[PATCH] Misc fixes for configure.in (was Re: stop the autoconf
insanity)
Tim Potter
tpot at samba.org
Fri Jun 27 02:46:30 GMT 2003
Here are two patches to configure.in for people to look at. One fixes bug
#125 where we foolishly discard the value of LIBS when determining LDAP
libraries. I've instead used the OTHER-LIBRARIES argument to AC_CHECK_LIB
to link additional libraries for the test.
The second patch displays the libaries detected during the configure
process at the end of the script. I think this is more useful than displaying
them in the Makefile (but only when you build particular targets).
Tim.
-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /data/cvs/samba/source/configure.in,v
retrieving revision 1.300.2.112
diff -c -u -r1.300.2.112 configure.in
cvs server: conflicting specifications of output style
--- configure.in 26 Jun 2003 17:33:58 -0000 1.300.2.112
+++ configure.in 27 Jun 2003 02:23:43 -0000
@@ -2386,26 +2386,24 @@
SMBLDAP=""
if test x"$with_ldap_support" = x"yes"; then
- ac_save_LIBS="$LIBS"
- LIBS=""
##################################################################
# we might need the lber lib on some systems. To avoid link errors
# this test must be before the libldap test
- AC_CHECK_LIB(lber, ber_scanf)
+ AC_CHECK_LIB(lber, ber_scanf, [LDAP_LIBS="$LDAP_LIBS -llber"], [], [$LDAP_LIBS])
########################################################
# now see if we can find the ldap libs in standard paths
if test x$have_ldap != xyes; then
- AC_CHECK_LIB(ldap, ldap_init, [
- LIBS="$LIBS -lldap";
- AC_CHECK_LIB(ldap, ldap_domain2hostlist, [
+ AC_CHECK_LIB(ldap, ldap_init,
+ [LDAP_LIBS="$LDAP_LIBS -lldap";
+ AC_CHECK_LIB(ldap, ldap_domain2hostlist, [
AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])
AC_CHECK_HEADERS([ldap.h lber.h],
[default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
SMBLDAP="lib/smbldap.o"])
- ])
- ])
+ ], [], [$LDAP_LIBS])
+ ], [], [$LDAP_LIBS])
########################################################
# If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
@@ -2420,8 +2418,6 @@
fi
AC_SUBST(SMBLDAP)
- LDAP_LIBS="$LIBS";
- LIBS="$ac_save_LIBS";
else
# Can't have ADS support without LDAP
if test x"$with_ads_support" = x"yes"; then
-------------- next part --------------
*** configure.in.~1.300.2.103.~ Mon Jun 23 09:50:28 2003
--- configure.in Fri Jun 27 12:37:31 2003
***************
*** 3842,3850 ****
AC_OUTPUT(include/stamp-h Makefile script/findsmb)
#################################################
! # Print very concise instructions on building/use
if test "x$enable_dmalloc" = xyes
then
AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])
fi
--- 3842,3862 ----
AC_OUTPUT(include/stamp-h Makefile script/findsmb)
#################################################
! # dmalloc stuff
if test "x$enable_dmalloc" = xyes
then
AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use])
AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.])
fi
+
+ #################################################
+ # Display summary of libraries detected
+
+ AC_MSG_RESULT([Using libraries:])
+ AC_MSG_RESULT([ LIBS = $LIBS])
+ if test x"$with_ads_support" = x"yes"; then
+ AC_MSG_RESULT([ KRB5_LIBS = $KRB5_LIBS])
+ fi
+ if test x"$with_ldap_support" = x"yes"; then
+ AC_MSG_RESULT([ LDAP_LIBS = $LDAP_LIBS])
+ fi
More information about the samba-technical
mailing list