--- aclocal.m4 2002/11/03 16:31:34 1.99
+++ aclocal.m4 2002/11/03 19:06:19 1.100
@@ -1245,10 +1245,10 @@
dnl ##
AC_DEFUN(AC_CHECK_EXTLIB,[dnl
-AC_ARG_WITH($2,[dnl
-[ --with-]m4_substr([$2[[=DIR]] ], 0, 19)[build against $1 library (default=no)]],[dnl
+AC_ARG_WITH($2, [dnl
+[ --with-]m4_substr([$2[[=DIR]] ], 0, 19)[build with external $1 library (default=no)]], [dnl
if test ".$with_$2" = .yes; then
- # via config script
+ # via config script in PATH
$2_version=`($2-config --version) 2>/dev/null`
if test ".$$2_version" != .; then
CPPFLAGS="$CPPFLAGS `$2-config --cflags`"
@@ -1271,7 +1271,7 @@
fi
fi
done
- # via standard paths
+ # in standard sub-areas
if test ".$found" = .0; then
for dir in $with_$2/include/$2 $with_$2/include $with_$2; do
if test -f "$dir/$4"; then
@@ -1286,43 +1286,51 @@
LDFLAGS="$LDFLAGS -L$dir -L$dir/.libs"
found=1
break
- elif test -f "$dir/lib$2.a" -o -f "$dir/lib$2.so"; then
+ elif test -f "$dir/lib$2.a" || test -f "$dir/lib$2.so"; then
LDFLAGS="$LDFLAGS -L$dir"
found=1
break
fi
done
fi
- # in any subarea
+ # in any sub-area
if test ".$found" = .0; then
changequote(, )dnl
for file in x `find $with_$2 -name "$4" -type f -print`; do
test .$file = .x && continue
- dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
+ dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
CPPFLAGS="$CPPFLAGS -I$dir"
CFLAGS="$CFLAGS -I$dir"
done
- for file in x `find $with_$2 -name "lib$2.[[aso]]" -type f -print`; do
+ for file in x `find $with_$2 -name "lib$2.[aso]" -type f -print`; do
test .$file = .x && continue
- dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
+ dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
LDFLAGS="$LDFLAGS -L$dir"
done
changequote([, ])dnl
fi
fi
fi
- AC_CHECK_HEADER($4)
+ AC_HAVE_HEADERS($4)
AC_CHECK_LIB($2, $3)
- AC_IFALLYES(header:$4 lib:$2_$3, with_$2=yes, with_$2=no)
+ with_$2=yes
+ ac_var="ac_cv_header_`echo $4 | sed 'y%./+-%__p_%'`"
+ eval "ac_val=\$$ac_var"
+ if test ".$ac_val" != .yes; then
+ with_$2=no
+ fi
+ if test ".$ac_cv_lib_$2_$3" != .yes; then
+ with_$2=no
+ fi
if test ".$with_$2" = .no; then
AC_ERROR([Unable to find $1 library])
fi
-,
+ ], [dnl
if test ".$with_$2" = .; then
with_$2=no
fi
-])dnl
-AC_MSG_CHECKING(whether to build against $1 library)
+ ])dnl
+AC_MSG_CHECKING(whether to build against external $1 library)
if test ".$with_$2" = .yes; then
ifelse([$5], , :, [$5])
else
|