@@ -20,6 +20,9 @@ dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
2020dnl Copyright (c) 2013-2015 Intel, Inc. All rights reserved
2121dnl Copyright (c) 2015 Research Organization for Information Science
2222dnl and Technology (RIST). All rights reserved.
23+ dnl Copyright (c) 2016 Mellanox Technologies, Inc.
24+ dnl All rights reserved.
25+ dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
2326dnl
2427dnl $COPYRIGHT $
2528dnl
@@ -82,6 +85,34 @@ AC_DEFUN([PMIX_SETUP_CORE],[
8285 AC_SUBST(PMIX_RELEASE_DATE)
8386 AC_MSG_RESULT([$PMIX_VERSION ])
8487
88+ # Save the breakdown the version information
89+ AC_MSG_CHECKING([for pmix major version])
90+ PMIX_MAJOR_VERSION= " ` $PMIX_top_srcdir /config/pmix_get_version.sh $PMIX_top_srcdir /VERSION --major` "
91+ if test " $? " ! = " 0" ; then
92+ AC_MSG_ERROR([Cannot continue])
93+ fi
94+ AC_SUBST(PMIX_MAJOR_VERSION)
95+ AC_DEFINE_UNQUOTED([PMIX_MAJOR_VERSION], [" $PMIX_MAJOR_VERSION " ],
96+ [The library major version is always available, contrary to VERSION])
97+
98+ AC_MSG_CHECKING([for pmix minor version])
99+ PMIX_MINOR_VERSION= " ` $PMIX_top_srcdir /config/pmix_get_version.sh $PMIX_top_srcdir /VERSION --minor` "
100+ if test " $? " ! = " 0" ; then
101+ AC_MSG_ERROR([Cannot continue])
102+ fi
103+ AC_SUBST(PMIX_MINOR_VERSION)
104+ AC_DEFINE_UNQUOTED([PMIX_MINOR_VERSION], [" $PMIX_MINOR_VERSION " ],
105+ [The library minor version is always available, contrary to VERSION])
106+
107+ AC_MSG_CHECKING([for pmix release version])
108+ PMIX_RELEASE_VERSION= " ` $PMIX_top_srcdir /config/pmix_get_version.sh $PMIX_top_srcdir /VERSION --release` "
109+ if test " $? " ! = " 0" ; then
110+ AC_MSG_ERROR([Cannot continue])
111+ fi
112+ AC_SUBST(PMIX_RELEASE_VERSION)
113+ AC_DEFINE_UNQUOTED([PMIX_RELEASE_VERSION], [" $PMIX_RELEASE_VERSION " ],
114+ [The library release version is always available, contrary to VERSION])
115+
85116 # Debug mode?
86117 AC_MSG_CHECKING([if want pmix maintainer support])
87118 pmix_debug=
@@ -99,11 +130,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
99130 AC_MSG_CHECKING([for pmix directory prefix])
100131 AC_MSG_RESULT(m4_ifval([$1 ], pmix_config_prefix, [(none)]))
101132
102- # Note that private/config.h *MUST* be listed first so that it
103- # becomes the "main" config header file. Any AC-CONFIG-HEADERS
104- # after that (pmix/config.h) will only have selective #defines
105- # replaced, not the entire file.
106- AC_CONFIG_HEADERS(pmix_config_prefix[include/private/autogen/config.h])
107133 AC_CONFIG_HEADERS(pmix_config_prefix[include/pmix/autogen/config.h])
108134
109135 # What prefix are we using?
@@ -430,7 +456,11 @@ AC_DEFUN([PMIX_SETUP_CORE],[
430456 # endif
431457 ])
432458
433- #
459+ AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid],
460+ [], [],
461+ [# include <sys/types.h>
462+ # include <sys/socket.h> ])
463+
434464 # Check for ptrdiff type. Yes, there are platforms where
435465 # sizeof(void*) != sizeof(long) (64 bit Windows, apparently).
436466 #
@@ -465,7 +495,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
465495 # Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
466496 PMIX_SEARCH_LIBS_CORE([ceil], [m])
467497
468- AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep])
498+ AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep getpeereid ])
469499
470500 # On some hosts, htonl is a define, so the AC_CHECK_FUNC will get
471501 # confused. On others, it's in the standard library, but stubbed with
@@ -580,7 +610,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
580610 # rather than have successive assignments to these shell
581611 # variables, lest the $(foo) names try to get evaluated here.
582612 # Yuck!
583- CPPFLAGS=' -I$(PMIX_top_srcdir ) -I$(PMIX_top_builddir ) -I$(PMIX_top_srcdir)/src -I$(PMIX_top_srcdir )/include -I$(PMIX_top_builddir )/include' " $CPPFLAGS "
613+ CPPFLAGS=' -I$(PMIX_top_builddir ) -I$(PMIX_top_srcdir ) -I$(PMIX_top_srcdir)/src -I$(PMIX_top_builddir )/include -I$(PMIX_top_srcdir )/include' " $CPPFLAGS "
584614 else
585615 CPPFLAGS=' -I$(PMIX_top_srcdir) -I$(PMIX_top_srcdir)/src -I$(PMIX_top_srcdir)/include' " $CPPFLAGS "
586616 fi
@@ -608,12 +638,15 @@ AC_DEFUN([PMIX_SETUP_CORE],[
608638
609639AC_DEFUN([PMIX_DEFINE_ARGS],[
610640 # Embedded mode, or standalone?
641+ AC_MSG_CHECKING([if embedded mode is enabled])
611642 AC_ARG_ENABLE([embedded-mode],
612643 [AC_HELP_STRING([--enable-embedded-mode],
613644 [Using --enable-embedded-mode causes PMIx to skip a few configure checks and install nothing. It should only be used when building PMIx within the scope of a larger package.])])
614645 AS_IF([test ! -z " $enable_embedded_mode " && test " $enable_embedded_mode " = " yes" ],
615- [pmix_mode= embedded],
616- [pmix_mode= standalone])
646+ [pmix_mode= embedded
647+ AC_MSG_RESULT([yes])],
648+ [pmix_mode= standalone
649+ AC_MSG_RESULT([no])])
617650
618651 # Change the symbol prefix?
619652 AC_ARG_WITH([pmix-symbol-prefix],
@@ -685,6 +718,22 @@ AC_ARG_ENABLE(debug-symbols,
685718 AC_HELP_STRING([--disable-debug-symbols],
686719 [Disable adding compiler flags to enable debugging symbols if --enable-debug is specified. For non-debugging builds, this flag has no effect.]))
687720
721+ #
722+ # Do we want to install the internal devel headers?
723+ #
724+ AC_MSG_CHECKING([if want to install project-internal header files])
725+ AC_ARG_WITH(devel-headers,
726+ AC_HELP_STRING([--with-devel-headers],
727+ [normal PMIx users/applications do not need this (pmix.h and friends are ALWAYS installed). Developer headers are only necessary for authors doing deeper integration (default: disabled).]))
728+ if test " $with_devel_headers " = " yes" ; then
729+ AC_MSG_RESULT([yes])
730+ WANT_INSTALL_HEADERS=1
731+ else
732+ AC_MSG_RESULT([no])
733+ WANT_INSTALL_HEADERS=0
734+ fi
735+ AM_CONDITIONAL(WANT_INSTALL_HEADERS, test " $WANT_INSTALL_HEADERS " = 1)
736+
688737#
689738# Do we want the pretty-print stack trace feature?
690739#
0 commit comments