]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acspecific.m4 (AC_PATH_XTRA): Check if linking against libX11
authorPavel Roskin <proski@gnu.org>
Tue, 12 Jun 2001 16:45:17 +0000 (16:45 +0000)
committerPavel Roskin <proski@gnu.org>
Tue, 12 Jun 2001 16:45:17 +0000 (16:45 +0000)
succeeds and only try adding libdnet upon a failure.

ChangeLog
acspecific.m4
lib/autoconf/specific.m4

index aa9b6622216a8ce9c44bf8c954b83f099873cd9e..afc1f929b74f4b6255210fb32ee851224421622e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-12  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
+
+       * acspecific.m4 (AC_PATH_XTRA): Check if linking against libX11
+       succeeds and only try adding libdnet upon a failure.
+
 2001-06-12  Akim Demaille  <akim@epita.fr>
 
        * autoscan.in (&output_kind): Output the comment only if it exists.
index 184ce298ea255d441e1b8f0616d3acc4a26017ad..1c62362af94e8678cbb2865c57885be4a0f46bb6 100644 (file)
@@ -810,11 +810,14 @@ dnl FIXME: banish uname from this macro!
     # Martyn Johnson says this is needed for Ultrix, if the X
     # libraries were built with DECnet support.  And Karl Berry says
     # the Alpha needs dnet_stub (dnet does not exist).
-    AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    AC_TRY_LINK_FUNC(XOpenDisplay, ,
+    [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"])
-    fi
+    fi])
+    LIBS="$ac_xsave_LIBS"
 
     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
     # to get the SysV transport functions.
index 184ce298ea255d441e1b8f0616d3acc4a26017ad..1c62362af94e8678cbb2865c57885be4a0f46bb6 100644 (file)
@@ -810,11 +810,14 @@ dnl FIXME: banish uname from this macro!
     # Martyn Johnson says this is needed for Ultrix, if the X
     # libraries were built with DECnet support.  And Karl Berry says
     # the Alpha needs dnet_stub (dnet does not exist).
-    AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    AC_TRY_LINK_FUNC(XOpenDisplay, ,
+    [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"])
-    fi
+    fi])
+    LIBS="$ac_xsave_LIBS"
 
     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
     # to get the SysV transport functions.