X-Git-Url: https://rtime.felk.cvut.cz/gitweb/orte.git/blobdiff_plain/0cfc6d11deafc73ef88c078276d95566336ad38d..refs/heads/master:/configure.ac diff --git a/configure.ac b/configure.ac index 7aeede7..a6b9b7f 100644 --- a/configure.ac +++ b/configure.ac @@ -4,9 +4,9 @@ # autoconf requirement -AC_PREREQ([2.56]) +AC_PREREQ([2.69]) -AC_INIT([orte],[0.3.3],[orte@rtime.felk.cvut.cz], [], [http://orte.sf.net]) +AC_INIT([orte],[0.3.4],[orte@rtime.felk.cvut.cz],[],[http://orte.sf.net]) AC_CONFIG_AUX_DIR(admin) ############################### @@ -14,22 +14,17 @@ AC_CONFIG_AUX_DIR(admin) ORTE_MAJOR_VERSION=0 ORTE_MINOR_VERSION=3 ORTE_MICRO_VERSION=3 -ORTE_INTERFACE_AGE=0 -ORTE_BINARY_AGE=0 ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION AC_SUBST(ORTE_MAJOR_VERSION) AC_SUBST(ORTE_MINOR_VERSION) AC_SUBST(ORTE_MICRO_VERSION) AC_SUBST(ORTE_VERSION) -AC_SUBST(ORTE_INTERFACE_AGE) -AC_SUBST(ORTE_BINARY_AGE) -#Libtool versioning -ORTE_MICRO_VERSION_NUM=`echo $ORTE_MICRO_VERSION | sed 's/[[a-zA-Z]]//g'` -LT_RELEASE=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION -LT_CURRENT=`expr $ORTE_MICRO_VERSION_NUM - $ORTE_INTERFACE_AGE` -LT_REVISION=$ORTE_INTERFACE_AGE -LT_AGE=`expr $ORTE_BINARY_AGE - $ORTE_INTERFACE_AGE` -AC_SUBST(LT_RELEASE) + +# Libtool versioning (see libtool manual) + +LT_CURRENT=1 # This will be part of SONAME +LT_REVISION=0 +LT_AGE=0 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) @@ -47,6 +42,7 @@ AC_CANONICAL_TARGET AC_CONFIG_HEADER(orte/include/orte/orte_config.h) AM_INIT_AUTOMAKE(no-define) +AC_CONFIG_MACRO_DIR([admin]) # Activate maintainer mode AM_MAINTAINER_MODE @@ -77,7 +73,7 @@ case "$target" in ;; *) # Assume a Unix. - if test -z ${CONFIG_ORTE_RT} -a ${CONFIG_ORTE_KERNEL} ; then + if test -z "${CONFIG_ORTE_RT}" -a "${CONFIG_ORTE_KERNEL}" ; then UNIX='yes' AC_DEFINE([CONFIG_ORTE_UNIX],[1],[Define if is target a unix system]) fi @@ -106,7 +102,7 @@ else if test ${USE_RTAI} == 'yes' ; then CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS" else - if test -n ${CONFIG_ORTE_KERNEL} ; then + if test -n "${CONFIG_ORTE_KERNEL}" ; then CFLAGS="$CFLAGS $LINUX_CFLAGS" fi fi @@ -117,7 +113,8 @@ fi # Initialize libtool AC_PROG_CC AM_PROG_CC_C_O -AC_PROG_LIBTOOL +LT_INIT([win32-dll]) +PKG_PROG_PKG_CONFIG() ############################### # Checks for ability to compile ORTE_IDL @@ -129,7 +126,7 @@ AM_JORTE ############################### # Checks for libraries and init libtools -if test -z ${CONFIG_ORTE_RT} ; then +if test -z "${CONFIG_ORTE_RT}" ; then AC_CHECK_LIB([ws2_32], [main]) AC_CHECK_LIB([socket], [main]) AC_CHECK_LIB([nsl], [main]) @@ -137,7 +134,7 @@ if test -z ${CONFIG_ORTE_RT} ; then AC_CHECK_LIB(pthread, pthread_create, , AC_CHECK_LIB(c_r, pthread_create, , if test ${MINGW} == 'yes' ; then - LIBS=$LIBS' -L$(top_srcdir)/orte/contrib/win_pthread/ -lpthread' + INTERNAL_PTHREAD_LIBS=' -L$(top_srcdir)/orte/contrib/win_pthread/ -lpthread' AC_MSG_NOTICE([Using internal version of pthreads!!!]) else AC_MSG_ERROR([Can't compile without pthreads!!!]) @@ -146,6 +143,10 @@ if test -z ${CONFIG_ORTE_RT} ; then ) fi +AC_CHECK_FUNCS([pthread_condattr_setclock]) +AC_CHECK_LIB([rt], [clock_gettime]) +AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include ]]) + ############################### # enable GNU source AH_VERBATIM([_GNU_SOURCE],[ @@ -184,9 +185,10 @@ fi if test ${WIN} == 'yes' ; then AC_CHECK_HEADERS([\ winsock2.h ws2tcpip.h windows.h w32api/windows.h],,,[[]]) + AC_CHECK_FUNCS([gettimeofday]) fi # kernel -if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then +if test "${CONFIG_ORTE_KERNEL}" == 'yes' ; then AC_CHECK_HEADERS([\ asm/byteorder.h linux/ctype.h linux/string.h \ linux/module.h linux/if.h linux/socket.h \ @@ -235,15 +237,92 @@ AC_SUBST(INCLUDES) ############################### # Checks for typedefs, structures, and compiler characteristics. -AC_C_BIGENDIAN + +AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[#ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_WINSOCK2_H + #include + #endif]) + + +AC_CHECK_HEADERS([ifaddrs.h],,,[#ifdef HAVE_SYS_TYPES_H + #include + #endif]) + +############################### +# Endianness support attempts to allow build with same configure +# for both cases on recent systems + +need_endian_test=yes +AC_CHECK_HEADERS([endian.h sys/param.h], [], [],[]) + +if test "$ac_cv_header_sys_param_h" == 'yes' ; then + AC_MSG_CHECKING([whether BYTE_ORDER defined in sys/param.h]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [ + unsigned int a=BYTE_ORDER; + unsigned int b=BIG_ENDIAN; + unsigned int c=LITTLE_ENDIAN;])], + [AC_MSG_RESULT([yes]) + need_endian_test=no],[AC_MSG_RESULT([no])]) + + if test "$need_endian_test" == 'yes' ; then + AC_MSG_CHECKING([whether __BYTE_ORDER defined in sys/param.h]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [ + unsigned int a=__BYTE_ORDER; + unsigned int b=__BIG_ENDIAN; + unsigned int c=__LITTLE_ENDIAN;])], + [AC_MSG_RESULT([yes]) + need_endian_test=no],[AC_MSG_RESULT([no])]) + fi +fi +if test "$ac_cv_header_endian_h" == 'yes' ; then + if test "$need_endian_test" == 'yes' ; then + AC_MSG_CHECKING([whether endian can be determined from endian.h]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [ + unsigned int a=__BYTE_ORDER; + unsigned int b=__BIG_ENDIAN; + unsigned int c=__LITTLE_ENDIAN;])], + [AC_MSG_RESULT([yes]) + need_endian_test=no],[AC_MSG_RESULT([no])]) + fi +fi + +if test "$need_endian_test" == 'yes' ; then + AC_C_BIGENDIAN +fi + +AH_BOTTOM([ +#if defined(HAVE_ENDIAN_H) || defined(HAVE_SYS_PARAM_H) + #ifdef HAVE_SYS_PARAM_H + #include + #endif + #if defined(HAVE_ENDIAN_H) && !defined(BYTE_ORDER) && !defined(__BYTE_ORDER) + #include + #endif + #if defined(__BYTE_ORDER) + #if __BYTE_ORDER == __BIG_ENDIAN + #define WORDS_BIGENDIAN 1 + #endif + #elif defined(BYTE_ORDER) + #if BYTE_ORDER == BIG_ENDIAN + #define WORDS_BIGENDIAN 1 + #endif + #endif +#endif +]) + AC_C_CONST AC_C_INLINE ############################### # Checks for library functions. AC_PROG_GCC_TRADITIONAL -if test -z ${CONFIG_ORTE_RT} ; then -AC_CHECK_FUNCS([gethostbyname getopt_long]) +if test -z "${CONFIG_ORTE_RT}" ; then +AC_CHECK_FUNCS([gethostbyname getopt_long sigwaitinfo]) fi AC_CONFIG_FILES([Makefile @@ -262,17 +341,19 @@ AC_CONFIG_FILES([Makefile orte/libjorte/Makefile orte/manager/Makefile]) +LIBS="$LIBS$INTERNAL_PTHREAD_LIBS" -AC_OUTPUT([ +AC_CONFIG_FILES([ modtool ]) +AC_OUTPUT chmod +x modtool # ====================================================================== # generate orte/include/orte/orte_config.h # ====================================================================== -AC_MSG_NOTICE([creating orte/include/orte/orte_config.h]) +AC_MSG_NOTICE([fixing orte/include/orte/orte_config.h]) sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \ orte/include/orte/orte_config.h >orte/include/orte/orte_config.h.new if cmp -s orte/include/orte/orte_config.h.new orte/include/orte/orte_config.h; then