From 1e0095c2900099f2d03babbb8a5422d84c26654c Mon Sep 17 00:00:00 2001 From: jay Date: Sun, 21 Nov 2004 16:28:23 +0000 Subject: [PATCH] Try to avoid requesting -lsun if we don't seem to need it (e.g. on UNICOS where it is not present and trying to link against it produces a warning). --- configure.in | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 2a17160..b19a789 100644 --- a/configure.in +++ b/configure.in @@ -45,14 +45,16 @@ gl_INIT dnl Try to get a POSIX.1 environment. -dnl Checks for libraries. -AC_CHECK_LIB(sun, getpwnam) +dnl Checks for libraries. If getpwnam() isn't present in the +dnl C library, try -lsun. +AC_CHECK_FUNC(getpwnam, [], +[AC_CHECK_LIB(sun, getpwnam)]) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h string.h limits.h unistd.h errno.h stdlib.h stddef.h) AC_CHECK_HEADERS(unistd.h inttypes.h fcntl.h locale.h stdint.h) -AC_CHECK_HEADERS(sys/param.h) +AC_CHECK_HEADERS(sys/param.h mntent.h) AC_HEADER_MAJOR AC_HEADER_DIRENT AC_HEADER_STAT @@ -103,9 +105,14 @@ AC_REPLACE_FUNCS(memcmp memset stpcpy strdup strstr strtol strtoul) AC_CHECK_FUNCS(fchdir getcwd strerror endgrent endpwent) AC_FUNC_VPRINTF AC_FUNC_ALLOCA -AC_FUNC_GETMNTENT AC_FUNC_CLOSEDIR_VOID +dnl We don't just use AC_FUNC_GETMNTENT directly because it +dnl will try to use -lsun on platforms which have getmntent() in the +dnl C library, for example UNICOS. +AC_CHECK_FUNC(getmntent, [], [AC_FUNC_GETMNTENT]) +AC_CHECK_FUNCS(getmntent) + dnl Checks for library functions that are provided by findlib. FINDLIB_REPLACE_FUNCS(waitpid strspn) FINDLIB_REPLACE_FUNCS(forcefindlib) -- 2.11.4.GIT