bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with 'configure' on AIX-4.3.3.0 (tar, fileutils)


From: Paul Eggert
Subject: Re: problem with 'configure' on AIX-4.3.3.0 (tar, fileutils)
Date: Sat, 15 Sep 2001 21:23:22 -0700 (PDT)

> From: Paul Townsend <address@hidden>
> Date: Sat, 15 Sep 2001 04:19:00 -0500 (EST)
> 
> If you set "CFLAGS=-O[45]", the check for the existence of "-lcposix"
> succeeds even though the library doesn't exist.  Apparently, the linker
> used when "-O[45]" is set is different from the linker when "-O3" or
> lower is set and it has a relaxed view of fatal errors.  In this case,
> "strerror" exists in "-lc" also.  Since the linkage is satisfied, the
> alternate linker allows the non-existence of "cposix".

That test is generated by the following autoconf code in
m4/isc-posix.m4, which I got from fileutils:

   1998-05-12  Jim Meyering  <address@hidden>

           * configure.in: Use my replacement AC_ISC_POSIX rather than
           open-coding it.


Here's how it works:

   AC_DEFUN([AC_ISC_POSIX],
     [
       dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
       AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
     ]
   )

I'm not sure why this test was substituted for the autoconf
AC_ISC_POSIX.  However, it appears to me that your bug would be
avoided if we replaced the AC_CHECK_LIB call with
AC_SEARCH_LIBS(strerror, cposix).

(By the way, <http://www.sun.com/software/solaris/Interactive/> says
that ISC, more formally known as INTERACTIVE UNIX, is no longer being
sold but will be supported until 2006-07-23.)


> A similar problem happened with the "-ldir" check.

Here's a proposed patch to autoconf to fix both problems, in the
light of the above discussion.

Perhaps AC_CHECK_LIB should be removed entirely from the autoconf
source, except for backward-compatibility support?  I don't see why
anybody would prefer its semantics to those of AC_SEARCH_LIBS.


2001-09-15  Paul Eggert  <address@hidden>

        Fix bug reported by Paul Townsend on AIX 4.3.3.0 with
        CFLAGS=-O4 or CFLAGS=-O5.  In that case, the linker has a
        relaxed view of fatal errors, and AC_CHECK_LIB causes it to
        include libraries even when they don't exist.

        * acheaders.m4 (AC_HEADER_DIRENT): Use AC_SEARCH_LIBS, not
        AC_CHECK_LIB, so that we don't use -ldir or -lx if we don't
        need it.

        * acspecific.m4 (AC_ISC_POSIX): Replace the old, crufty
        version with the version used by fileutils 4.1, except use
        AC_SEARCH_LIBS, not AC_CHECK_LIB, so that we don't use
        -lcposix if we don't need it.

===================================================================
RCS file: acheaders.m4,v
retrieving revision 2.52
retrieving revision 2.52.0.1
diff -pu -r2.52 -r2.52.0.1
--- acheaders.m4        2001/07/03 14:19:09     2.52
+++ acheaders.m4        2001/09/16 02:53:51     2.52.0.1
@@ -158,9 +158,9 @@ ac_header_dirent=$ac_hdr; break])
 done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
-  AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
+  AC_SEARCH_LIBS(opendir, dir)
 else
-  AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
+  AC_SEARCH_LIBS(opendir, x)
 fi
 ])# AC_HEADER_DIRENT
 
===================================================================
RCS file: acspecific.m4,v
retrieving revision 2.52
retrieving revision 2.52.0.1
diff -pu -r2.52 -r2.52.0.1
--- acspecific.m4       2001/06/15 17:46:01     2.52
+++ acspecific.m4       2001/09/16 02:53:51     2.52.0.1
@@ -993,28 +993,7 @@ fi
 # AC_ISC_POSIX
 # ------------
 AC_DEFUN([AC_ISC_POSIX],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
-AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-AC_MSG_CHECKING([for POSIXized ISC])
-if test -d /etc/conf/kconfig.d &&
-   grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
-then
-  AC_MSG_RESULT([yes])
-  ISC=yes # If later tests want to check for ISC.
-  AC_DEFINE(_POSIX_SOURCE, 1,
-            [Define if you need to in order for stat and other things to
-             work.])
-  if test "$GCC" = yes; then
-    CC="$CC -posix"
-  else
-    CC="$CC -Xp"
-  fi
-else
-  AC_MSG_RESULT([no])
-  ISC=
-fi
-])# AC_ISC_POSIX
+[AC_SEARCH_LIBS(strerror, cposix)])
 
 
 # AC_XENIX_DIR



reply via email to

[Prev in Thread] Current Thread [Next in Thread]