Hi,

The attached patch file was reviewed, my last reply lead to no further discussion.

So here it is again, I removed the controversial -R flag in the result LDFLAGS for now, but wondering what should I do to convince you the -R is necessary for Solaris and cause no harm on others?

As I explained and quoted from the man page, -R is not needed if you are link against a libtool .la file, but in case you are link against a .so file, it is needed.

Cheers,
Henry
Index: build/apu-conf.m4
===================================================================
--- build/apu-conf.m4	(revision 408760)
+++ build/apu-conf.m4	(working copy)
@@ -63,27 +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.* 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"; 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 -R$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