From fa80f0150ad1803a2705c6a153cf5b64cc18a2d6 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 25 Aug 2011 16:37:33 -0400 Subject: autoconf: work around broken wbclient.h file Some versions of wbclient.h have function declarations with bool type args, but they don't include stdbool.h themselves. Make sure that we can deal with that by telling the autoconf test to include stdbool.h explicitly. In order to do that properly we need to move some of the standard header and type tests up in the file. Signed-off-by: Jeff Layton --- configure.ac | 59 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 27 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 2541f39..2607fb1 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,33 @@ AC_PROG_CC AC_PROG_SED AC_GNU_SOURCE +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_TYPE_UID_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_CHECK_TYPES([ptrdiff_t, ssize_t, uint32_t, uint8_t]) + +# Checks for library functions. +AC_FUNC_GETMNTENT +AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_FUNC_STRNLEN + +# check for required functions +AC_CHECK_FUNCS([alarm atexit endpwent getmntent getpass gettimeofday inet_ntop memset realpath setenv strchr strcmp strdup strerror strncasecmp strndup strpbrk strrchr strstr strtol strtoul tolower uname], , [AC_MSG_ERROR([necessary functions(s) not found])]) + +AC_CHECK_FUNCS(clock_gettime, [], [ + AC_CHECK_LIB(rt, clock_gettime, [ + AC_DEFINE(HAVE_CLOCK_GETTIME, 1) + AC_DEFINE(HAVE_CLOCK_GETTIME,1, + [Whether the clock_gettime func is there]) + LIBS="$LIBS -lrt" + ]) + ]) + # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h ctype.h fcntl.h inttypes.h limits.h mntent.h netdb.h stddef.h stdint.h stdbool.h stdlib.h stdio.h errno.h string.h strings.h sys/mount.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h], , [AC_MSG_ERROR([necessary header(s) not found])]) @@ -108,6 +135,11 @@ if test $enable_cifsacl != "no"; then AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling getcifsacl.]) enable_cifsacl="no" fi + ], + [AC_INCLUDES_DEFAULT] + [#ifdef HAVE_STDBOOL_H + #include + #endif ]) fi if test $enable_cifsupcall != "no"; then @@ -124,33 +156,6 @@ if test $enable_cifscreds = "yes"; then AC_CHECK_HEADERS([keyutils.h], , [AC_MSG_ERROR([keyutils.h not found, consider installing keyutils-libs-devel.])]) fi -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_TYPE_UID_T -AC_TYPE_OFF_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_CHECK_TYPES([ptrdiff_t, ssize_t, uint32_t, uint8_t]) - -# Checks for library functions. -AC_FUNC_GETMNTENT -AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK -AC_FUNC_MALLOC -AC_FUNC_REALLOC -AC_FUNC_STRNLEN - -# check for required functions -AC_CHECK_FUNCS([alarm atexit endpwent getmntent getpass gettimeofday inet_ntop memset realpath setenv strchr strcmp strdup strerror strncasecmp strndup strpbrk strrchr strstr strtol strtoul tolower uname], , [AC_MSG_ERROR([necessary functions(s) not found])]) - -AC_CHECK_FUNCS(clock_gettime, [], [ - AC_CHECK_LIB(rt, clock_gettime, [ - AC_DEFINE(HAVE_CLOCK_GETTIME, 1) - AC_DEFINE(HAVE_CLOCK_GETTIME,1, - [Whether the clock_gettime func is there]) - LIBS="$LIBS -lrt" - ]) - ]) - # ugly, but I'm not sure how to check for functions in a library that's not in $LIBS cu_saved_libs=$LIBS -- cgit v1.2.3