]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
fix AC_PATH_XTRA for solaris
authorDavid MacKenzie <djm@djmnet.org>
Thu, 14 Nov 1996 00:42:10 +0000 (00:42 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Thu, 14 Nov 1996 00:42:10 +0000 (00:42 +0000)
ChangeLog
NEWS
TODO
acspecific.m4
lib/autoconf/specific.m4

index 2cbd5044c68b9ddaf15f6e231f3104a29c106858..2556827e847c860743ce547ebe37be0f1030a9ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 Wed Nov 13 10:07:14 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
+       * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX): Check whether the
+       compiler works before checking whether it's a GNU compiler.
+       (AC_FUNC_VFORK): Call _exit after perror.
+       (AC_PATH_XTRA): Go back to using -R, as setting an env var as part
+       of CC doesn't get eval'd correctly to actually work.
+       Directly test whether a space is needed after -R.
+       Don't add "-L" to LDFLAGS if $x_libraries is empty.
+
        * Test release 2.10.3.
 
        * testsuite/Makefile.in (dejacheck): New target, suggested by Tom
diff --git a/NEWS b/NEWS
index 63a3b6e5e6503e69bbeccd249e77cd90452f40d0..0c74043c405ad09dc3f6ce67cec951ee41f025f6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,3 @@
-Issues to resolve before release:
-
-Test the new features: AC_PROG_CC_WORKS on Solaris, AC_CACHE_SAVE
-with spaces in var values on HP-UX, AC_FUNC_SETPGRP, AC_PATH_XTRA on
-Solaris, sed command splitting on HP-UX (many AC_SUBST's), AC_FUNC_FNMATCH.
-
 Major changes in release 2.11:
 
 * AC_PROG_CC and AC_PROG_CXX check whether the compiler works.
diff --git a/TODO b/TODO
index 16d4a0d3f4e9d9aad279cc32765624e69cb26ba7..aace42051265e59e276e63f0327259ff8eb94b93 100644 (file)
--- a/TODO
+++ b/TODO
@@ -359,13 +359,6 @@ From:    fjh@kryten.cs.mu.oz.au (Fergus Henderson)
 
 ------------------------------------------------------------------------------
 
-I think it would be useful to be able to have the variables expanded in
-AC_CONFIG_HEADER just like AC_OUTPUT allows.
-
-From:    Julian Onions <j.onions@nexor.co.uk>
-
-------------------------------------------------------------------------------
-
 It would be nice if the configure script would handle an option such as
 --x-libraries="/usr/openwin/lib /usr/dt/lib".
 
@@ -373,40 +366,6 @@ Rick Boykin <rboykin@cscsun3.larc.nasa.gov>
 
 ------------------------------------------------------------------------------
 
-This is fine, but painfully slow.
-
-Sun Jun 30 04:43:08 1996  Paul Eggert  <eggert@twinsun.com>
-
-       * acgeneral.m4 (AC_CACHE_SAVE):
-       Output each variable separately, so that values containing
-       special characters (e.g. ', \, newline) are handled correctly.
-
---- acgeneral.m4       1996/11/09 22:20:01     1.211
-+++ acgeneral.m4       1996/11/12 04:32:06
-@@ -1051,10 +1052,16 @@
- dnl Allow a site initialization script to override cache values.
- # Ultrix sh set writes to stderr and can't be redirected directly,
- # and sets the high bit in the cache file unless we assign to the vars.
--# HP-UX 10.01 sh prints single quotes around any value that contains spaces.
--(set) 2>&1 |
--sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)='*\([^']*\)'*/\1=\${\1='\2'}/p"\
--  >> confcache
-+ac_vars=`(set) 2>&1 | sed -n '/^[a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*=/s/=.*//p'`
-+# Output each variable separately so that values containing
-+# special characters (e.g. ', \, newline) are handled correctly.
-+for ac_var in $ac_vars; do
-+  eval ac_val=\$$ac_var
-+  sed -e "s/'/'\\\\''/g" -e "1s/^/$ac_var=\${$ac_var='&/" -e "\$s/\$/'}/" \
-+    >> confcache <<EOF
-+$ac_val
-+EOF
-+done
- changequote([, ])dnl
- if cmp -s $cache_file confcache; then
-   :
-
-------------------------------------------------------------------------------
-
 Timezone calculations checks.
 
 ------------------------------------------------------------------------------
index fb95e46db3daa8f50c34f459786dbe4ddf79c611..5e98312f22d4c278897db1853f53fc041a3aef82 100644 (file)
@@ -78,6 +78,7 @@ if test -z "$CC"; then
   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
 fi
 
+AC_PROG_CC_WORKS
 AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
 cat > conftest.c <<EOF
@@ -119,14 +120,13 @@ else
   GCC=
   test "${CFLAGS+set}" = set || CFLAGS="-g"
 fi
-
-AC_PROG_CC_WORKS
 ])
 
 AC_DEFUN(AC_PROG_CXX,
 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
 
+AC_PROG_CXX_WORKS
 AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
 cat > conftest.C <<EOF
@@ -168,8 +168,6 @@ else
   GXX=
   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
 fi
-
-AC_PROG_CXX_WORKS
 ])
 
 AC_DEFUN(AC_PROG_CC_WORKS,
@@ -1069,8 +1067,10 @@ sparc_address_test (arg) int arg;
   static pid_t child;
   if (!child) {
     child = vfork ();
-    if (child < 0)
+    if (child < 0) {
       perror ("vfork");
+      _exit(2);
+    }
     if (!child) {
       arg = getpid();
       write(-1, "", 0);
@@ -2008,11 +2008,27 @@ else
     X_LIBS="$X_LIBS -L$x_libraries"
 dnl FIXME banish uname from this macro!
     # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space, so we take a different approach.
-    if test "`(uname) 2>/dev/null`" = SunOS &&
-      uname -r | grep '^5' >/dev/null; then
-      CC="LD_RUN_PATH=$x_libraries $CC"
-    fi
+    # others require no space.  Words are not sufficient . . . .
+    case "`(uname -sr) 2>/dev/null`" in
+    "SunOS 5"*)
+      AC_MSG_CHECKING(whether -R must be followed by a space)
+      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+      AC_TRY_LINK(, , ac_R_nospace=yes, ac_R_nospace=no)
+      if test $ac_R_nospace = yes; then
+       AC_MSG_RESULT(no)
+       X_LIBS="$X_LIBS -R$x_libraries"
+      else
+       LIBS="$ac_xsave_LIBS -R $x_libraries"
+       AC_TRY_LINK(, , ac_R_space=yes, ac_R_space=no)
+       if test $ac_R_space = yes; then
+         AC_MSG_RESULT(yes)
+         X_LIBS="$X_LIBS -R $x_libraries"
+       else
+         AC_MSG_RESULT(neither works)
+       fi
+      fi
+      LIBS="$ac_xsave_LIBS"
+    esac
   fi
 
   # Check for system-dependent libraries X programs must link with.
@@ -2028,7 +2044,7 @@ dnl FIXME banish uname from this macro!
     AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       AC_CHECK_LIB(dnet_stub, dnet_ntoa,
-        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+       [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
     fi
 
     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
@@ -2070,7 +2086,7 @@ dnl FIXME banish uname from this macro!
 
   # Check for libraries that X11R6 Xt/Xaw programs need.
   ac_save_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS -L$x_libraries"
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
   # check for ICE first), but we must link in the order -lSM -lICE or
   # we get undefined symbols.  So assume we have SM if we have ICE.
index fb95e46db3daa8f50c34f459786dbe4ddf79c611..5e98312f22d4c278897db1853f53fc041a3aef82 100644 (file)
@@ -78,6 +78,7 @@ if test -z "$CC"; then
   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
 fi
 
+AC_PROG_CC_WORKS
 AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
 cat > conftest.c <<EOF
@@ -119,14 +120,13 @@ else
   GCC=
   test "${CFLAGS+set}" = set || CFLAGS="-g"
 fi
-
-AC_PROG_CC_WORKS
 ])
 
 AC_DEFUN(AC_PROG_CXX,
 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
 
+AC_PROG_CXX_WORKS
 AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
 cat > conftest.C <<EOF
@@ -168,8 +168,6 @@ else
   GXX=
   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
 fi
-
-AC_PROG_CXX_WORKS
 ])
 
 AC_DEFUN(AC_PROG_CC_WORKS,
@@ -1069,8 +1067,10 @@ sparc_address_test (arg) int arg;
   static pid_t child;
   if (!child) {
     child = vfork ();
-    if (child < 0)
+    if (child < 0) {
       perror ("vfork");
+      _exit(2);
+    }
     if (!child) {
       arg = getpid();
       write(-1, "", 0);
@@ -2008,11 +2008,27 @@ else
     X_LIBS="$X_LIBS -L$x_libraries"
 dnl FIXME banish uname from this macro!
     # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space, so we take a different approach.
-    if test "`(uname) 2>/dev/null`" = SunOS &&
-      uname -r | grep '^5' >/dev/null; then
-      CC="LD_RUN_PATH=$x_libraries $CC"
-    fi
+    # others require no space.  Words are not sufficient . . . .
+    case "`(uname -sr) 2>/dev/null`" in
+    "SunOS 5"*)
+      AC_MSG_CHECKING(whether -R must be followed by a space)
+      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+      AC_TRY_LINK(, , ac_R_nospace=yes, ac_R_nospace=no)
+      if test $ac_R_nospace = yes; then
+       AC_MSG_RESULT(no)
+       X_LIBS="$X_LIBS -R$x_libraries"
+      else
+       LIBS="$ac_xsave_LIBS -R $x_libraries"
+       AC_TRY_LINK(, , ac_R_space=yes, ac_R_space=no)
+       if test $ac_R_space = yes; then
+         AC_MSG_RESULT(yes)
+         X_LIBS="$X_LIBS -R $x_libraries"
+       else
+         AC_MSG_RESULT(neither works)
+       fi
+      fi
+      LIBS="$ac_xsave_LIBS"
+    esac
   fi
 
   # Check for system-dependent libraries X programs must link with.
@@ -2028,7 +2044,7 @@ dnl FIXME banish uname from this macro!
     AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       AC_CHECK_LIB(dnet_stub, dnet_ntoa,
-        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+       [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
     fi
 
     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
@@ -2070,7 +2086,7 @@ dnl FIXME banish uname from this macro!
 
   # Check for libraries that X11R6 Xt/Xaw programs need.
   ac_save_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS -L$x_libraries"
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
   # check for ICE first), but we must link in the order -lSM -lICE or
   # we get undefined symbols.  So assume we have SM if we have ICE.