[EMAIL PROTECTED] wrote:
Author: jerenkrantz
Date: Wed Aug 30 22:04:40 2006
New Revision: 438795

URL: http://svn.apache.org/viewvc?rev=438795&view=rev
Log:
* build/apu-conf.m4
  (APU_TEST_EXPAT): Support Solaris /usr/sfw installs of Expat.

Modified:
    apr/apr-util/trunk/build/apu-conf.m4

Modified: apr/apr-util/trunk/build/apu-conf.m4
URL: 
http://svn.apache.org/viewvc/apr/apr-util/trunk/build/apu-conf.m4?rev=438795&r1=438794&r2=438795&view=diff
==============================================================================
--- apr/apr-util/trunk/build/apu-conf.m4 (original)
+++ apr/apr-util/trunk/build/apu-conf.m4 Wed Aug 30 22:04:40 2006
@@ -79,8 +79,15 @@
     expat_libtool="$1/lib64/libexpat.la"
   elif test -r "$1/include/expat.h" -a \
     -r "$1/lib/libexpat.a"; then
-    dnl Expat 1.95.* installation (without libtool)
+    dnl Expat 1.95.* static installation (without libtool)
     dnl FreeBSD textproc/expat2
+    expat_include_dir="$1/include"
+    expat_ldflags="-L$1/lib"
+    expat_libs="-lexpat"
+  elif test -r "$1/include/expat.h" -a \
+    -r "$1/lib/libexpat.so"; then
+    dnl Expat 1.95.* shared installation (without libtool)
+    dnl Solaris 10 /usr/sfw
     expat_include_dir="$1/include"
     expat_ldflags="-L$1/lib"
     expat_libs="-lexpat"




This is another hardcode case, is there a possibility to consider a patch I submitted[1] which use AC_CHECK_LIB to cover all cases with $1/include/expat.h available?

An updated patch is attached.

[1] http://mail-archives.apache.org/mod_mbox/apr-dev/200608.mbox/[EMAIL PROTECTED]

Cheers,
Henry

Index: build/apu-conf.m4
===================================================================
--- build/apu-conf.m4	(revision 442408)
+++ build/apu-conf.m4	(working copy)
@@ -63,34 +63,24 @@
     expat_ldflags="-L$1/lib"
     expat_libs="-lexpat"
     expat_libtool="$1/lib/libexpat.la"
-  elif test -r "$1/include/expat.h" -a \
-    -r "$1/lib/libexpat.la"; then
-    dnl Expat 1.95.* installation (with libtool)
-    expat_include_dir="$1/include"
-    expat_ldflags="-L$1/lib"
-    expat_libs="-lexpat"
-    expat_libtool="$1/lib/libexpat.la"
-  elif test -r "$1/include/expat.h" -a \
-    -r "$1/lib64/libexpat.la"; then
-    dnl Expat 1.95.* installation on certain 64-bit platforms (with libtool)
-    expat_include_dir="$1/include"
-    expat_ldflags="-L$1/lib64"
-    expat_libs="-lexpat"
-    expat_libtool="$1/lib64/libexpat.la"
-  elif test -r "$1/include/expat.h" -a \
-    -r "$1/lib/libexpat.a"; then
-    dnl Expat 1.95.* static installation (without libtool)
-    dnl FreeBSD textproc/expat2
-    expat_include_dir="$1/include"
-    expat_ldflags="-L$1/lib"
-    expat_libs="-lexpat"
-  elif test -r "$1/include/expat.h" -a \
-    -r "$1/lib/libexpat.so"; then
-    dnl Expat 1.95.* shared installation (without libtool)
-    dnl Solaris 10 /usr/sfw
-    expat_include_dir="$1/include"
-    expat_ldflags="-L$1/lib"
-    expat_libs="-lexpat"
+  elif test -r "$1/include/expat.h"; then
+    old_ldflags="$LDFLAGS"
+    old_cflags="$CFLAGS"
+    for d in $1/lib $1/libdir ; do
+      CFLAGS="$old_cflags -I$1/include"
+      LDFLAGS="$old_ldflags -L$d"
+      AC_CHECK_LIB(expat, XML_ParserCreate, [
+        expat_include_dir="$1/include"
+        expat_libs="-lexpat"
+        expat_ldflags="-L$d"
+        if test -r "$d/libexpat.la"; then
+          expat_libtool="$d/libexpat.la"
+        fi
+        break
+      ], [])
+    done
+    CFLAGS=$old_cflags
+    LDFLAGS=$old_ldflags
   elif test -r "$1/xmlparse.h"; then
     dnl maybe an expat-lite. use this dir for both includes and libs
     expat_include_dir="$1"

Reply via email to