autoconf-patches
[Top][All Lists]
Advanced

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

Re: autoconf 2.50: Libdnet may be linked in unnecessarily with libX11


From: Pavel Roskin
Subject: Re: autoconf 2.50: Libdnet may be linked in unnecessarily with libX11
Date: Mon, 11 Jun 2001 12:24:35 -0400 (EDT)

Hi, Maciej!

> > I personally believe that autoconf should primarily cater to developers.
> > Package builders can (and should) build in the controlled environment.
> > Besides, they know better what the system it's going to be, so they should
> > tell it to configure instead of expecting configure to guess it.
>
>  I know no way to tell the macro not to use libdnet even if it thinks it
> has to.  It's simple the other way (just set LIBS before invoking
> configure) and the developer knows if he needs libdnet for static linking
> or not, anyway.

I see. Now the _idea_ of the patch is fine with me. Let's check the
implementation.

There is still on detail that I don't like. I tried your patch and I'm
getting a warning in config.log:

configure:10028: warning: implicit declaration of function `XOpenDisplay'

Maybe it's better to use AC_CHECK_LIB or AC_TRY_LINK_FUNC instead of
AC_TRY_LINK? Or add the headers? I did it and now I'm getting "too few
arguments to function `XOpenDisplay'". Not good!

For some reason AC_CHECK_LIB allows us to ommit the trailing semicolon,
but we shouldn't be so sloppy in the Autoconf code.

With all the changes we get the following patch (ChangeLog is the same):

__________________________________
--- acspecific.m4
+++ acspecific.m4
@@ -810,11 +810,14 @@
     # 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(address@hidden:@include <X11/Intrinsic.h>], 
[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"

     # address@hidden says -lnsl (and -lsocket) are needed for his 386/AT,
     # to get the SysV transport functions.
__________________________________

Regards,
Pavel Roskin




reply via email to

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