[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix for AC_CHECK_LIB
From: |
Pavel Roskin |
Subject: |
Fix for AC_CHECK_LIB |
Date: |
Sat, 23 Sep 2000 19:21:03 -0400 (EDT) |
Hello!
For some reason autoheader puts HAVE_LIBlibrary to config.h.in even if the
ACTION-IF-TRUE is given to AC_CHECK_LIB, so that HAVE_LIBlibrary is not
defined by autoconf. This results in such horrifying constructs in
config.h as:
/* Define if you have the `m' library (-lm). */
/* #define HAVE_LIBM 1 */
config.h is supposed to be user-readable (that's what the comments are
for), so my first impression was that something is seriously wrong with
Autoconf.
My patch replaces a two-line FIXME with a one-line fix :-)
ChangeLog:
* acgeneral.m4 (AC_CHECK_LIB): only call AH_CHECK_LIB if
ACTION-IF-TRUE is not given.
(AH_CHECK_LIB): related comment changes.
Regards,
Pavel Roskin
_________________________
Index: acgeneral.m4
--- acgeneral.m4 Thu Sep 21 22:02:24 2000
+++ acgeneral.m4 Sat Sep 23 18:21:58 2000
@@ -3237,7 +3237,7 @@
# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
# freedom.
AC_DEFUN([AC_CHECK_LIB],
-[AH_CHECK_LIB([$1])dnl
+[ifval([$3], , [AH_CHECK_LIB([$1])])dnl
AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
AC_ARG_VAR([LDFLAGS], [linker flags, e.g. -L<lib dir> if you have libraries in
a nonstandard directory <lib dir>])
AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
@@ -3259,8 +3259,6 @@
# AH_CHECK_LIB(LIBNAME)
# ---------------------
-# FIXME: To be rigorous, this should not be systematic: depending
-# upon the arguments of AC_CHECK_LIB, we might not AC_DEFINE.
define([AH_CHECK_LIB],
[AH_TEMPLATE(AC_TR_CPP(HAVE_LIB$1),
[Define if you have the `]$1[' library (-l]$1[).])])
_________________________
- Fix for AC_CHECK_LIB,
Pavel Roskin <=