[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
havelib's AC_LIB_HAVE_LINKFLAGS in conditionals
From: |
Micah Cowan |
Subject: |
havelib's AC_LIB_HAVE_LINKFLAGS in conditionals |
Date: |
Tue, 07 Aug 2007 11:07:03 -0700 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20070604) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hello,
I have recently become the maintainer for GNU Wget, which uses autoconf
and havelib, but currently not automake.
The use of ./configure --with-libssl-prefix=<some path> has stopped
working; I did some investigating, and it appears that the following
code is problematic:
====
if test x"$with_ssl" = xgnutls
then
dnl Now actually check for -lssl
AC_LIB_HAVE_LINKFLAGS([gnutls], [], [
#include <gnutls/gnutls.h>
], [gnutls_global_init()])
if test x"$LIBGNUTLS" != x
then
AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
SSL_OBJ='gnutls.o'
else
AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not
available.])
fi
elif test x"$with_ssl" != xno; then
dnl As of this writing (OpenSSL 0.9.6), the libcrypto shared library
dnl doesn't record its dependency on libdl, so we need to make sure
dnl -ldl ends up in LIBS on systems that have it. Most OSes use
dnl dlopen(), but HP-UX uses shl_load().
AC_CHECK_LIB(dl, dlopen, [], [
AC_CHECK_LIB(dl, shl_load)
])
dnl Now actually check for -lssl
AC_LIB_HAVE_LINKFLAGS([ssl], [crypto], [
#include <openssl/ssl.h>
#include <openssl/x509.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/des.h>
#include <openssl/md4.h>
#include <openssl/md5.h>
], [SSL_library_init ()])
if test x"$LIBSSL" != x
then
AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
SSL_OBJ='openssl.o'
elif test x"$with_ssl" != x
then
AC_MSG_ERROR([--with-ssl was given, but SSL is not available.])
fi
fi
===
If I remove the first invocation of AC_LIB_HAVE_LINKFLAGS (within
gnutls), the second one functions as it used to. If I leave it as you
see it above, apparently shlibext and other vars somehow get the null
value, and it searches for libraries such as "/opt/openssl/libssl." (no
"so"). This was determined via invocation as "bash -x ./configure ...".
I was thinking perhaps that it was that the AC_REQUIRE'd macros from
AC_LIB_HAVE_LINKFLAGS needed to be invoked outside of the shell
conditional, but adding invocations to AC_LIB_RPATH and
AC_PREPARE_PREFIX at the top level did not seem to improve matters.
I'm rather inexperienced with debugging m4, so I'm still tracking down
the root cause. Perhaps someone could enlighten me about anything I'm
doing wrong, or determine the root problem? Also: is there any
documentation on havelib?
I'm expecting that, for this specific case, as a workaround, I could
place the sole invocation of AC_LIB_HAVE_LINKFLAGS inside a single
conditional (test x"$with_ssl" != x), and then set shell variables
according to whether --with-ssl=gnutls (whose support is currently
experimental/unfinished) was specified.
For better context, the GNU Wget source, as it exists at the time of
this post, may be viewed at
http://addictivecode.org/svn/wget/trunk/?pathrev=2323
It can be checked out with subversion with something like:
svn co -r 2323 svn://addictivecode.org/wget/trunk wget
- --
Thanks for your help,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGuLTG7M8hyUobTrERCNDzAJ0SBXTNZ/hpCBQKDBb2NQ4K8zcSTACeIgvv
jcdNcaa+tWQQkbJ9tRYTYLM=
=2sEH
-----END PGP SIGNATURE-----
- havelib's AC_LIB_HAVE_LINKFLAGS in conditionals,
Micah Cowan <=