[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnulib] AC_FUNC_GETMNTENT problem on UNICOS
From: |
Mark D. Baushke |
Subject: |
[bug-gnulib] AC_FUNC_GETMNTENT problem on UNICOS |
Date: |
Mon, 06 Dec 2004 09:44:51 -0800 |
The autoconf AC_FUNC_GETMNTENT seems to assume that adding -lsun
is always desirable. This is NOT true on UNICOS where the getmntent
function resides in the C library and no -lsun library exists.
The findutils project has been jumping thru hoops to avoid using
AC_FUNC_GETMNTENT to try not to add LIBS=-lsun to the generated Makefile
files and most recently has run into problems with GNULIB using this
macro in their m4/ls-mntd-fs.m4 file.
I believe that a simple check to see if the function is available in the
default library set is reasonable.
I have attached a patch for autoconf-2.59 for this.
As it may be some time until AUTOCONF delivers a new release, I have
attached a patch to GNULIB's m4/ls-mntd-fs.m4 file as well that will
work around the problem until a new AUTOCONF is available.
-- Mark
Index: autoconf-2.59/lib/autoconf/functions.m4
--- autoconf-2.59/lib/autoconf/functions.m4~ 2003-10-27 03:13:42.000000000
-0800
+++ autoconf-2.59/lib/autoconf/functions.m4 2004-12-06 09:32:08.546246524
-0800
@@ -771,9 +771,11 @@ AU_ALIAS([AC_GETLOADAVG], [AC_FUNC_GETLO
AN_FUNCTION([getmntent], [AC_FUNC_GETMNTENT])
AC_DEFUN([AC_FUNC_GETMNTENT],
[# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware.
-AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS",
- [AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS",
- [AC_CHECK_LIB(gen, getmntent, LIBS="-lgen $LIBS")])])
+# -lsun does NOT exist on UNICOS 9 where the C library has the function.
+AC_CHECK_FUNC(getmntent, [],
+ [AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS",
+ [AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS",
+ [AC_CHECK_LIB(gen, getmntent, LIBS="-lgen $LIBS")])])])
AC_CHECK_FUNCS(getmntent)
])
Index: m4/ls-mntd-fs.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/ls-mntd-fs.m4,v
retrieving revision 1.28
diff -u -p -u -p -r1.28 ls-mntd-fs.m4
--- ls-mntd-fs.m4 7 Aug 2004 00:09:39 -0000 1.28
+++ ls-mntd-fs.m4 6 Dec 2004 17:44:45 -0000
@@ -64,7 +64,10 @@ ac_list_mounted_fs=
# If the getmntent function is available but not in the standard library,
# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
-AC_FUNC_GETMNTENT
+# However, AC_FUNC_GETMNTENT will introduce a -lsun even if getmntent is
+# in the C library, for example on UNICOS which does not have a -lsun
+# library.
+AC_CHECK_FUNC(getmntent, [], [AC_FUNC_GETMNTENT])
# This test must precede the ones for getmntent because Unicos-9 is
# reported to have the getmntent function, but its support is incompatible
- [bug-gnulib] AC_FUNC_GETMNTENT problem on UNICOS,
Mark D. Baushke <=