[xmlsec] build fixes for 1.2.10

Roumen Petrov xmlsec at roumenpetrov.info
Sat Jun 16 15:32:26 PDT 2007


Please find attached file "xmlsec1-1.2.10.patch".

The patch solve folowing problems:
- autoconf 2.59 fail to create configure;
- messages for detecting libxml2 if configure without pkg-config enabled 
and print version found;
- messages for detecting libxslt if configure without pkg-config enabled 
and print version found;
- use rpath to link with openssl when path is psecified (may be this 
shouldn't go mainstream);
- print openssl version found;
- add support for nss from seamonkey;
- don't create many times output files .


Roumen
-------------- next part --------------
--- ./configure.in.ORIG	2006-06-12 23:10:21.000000000 +0300
+++ ./configure.in	2007-06-13 23:23:41.000000000 +0300
@@ -129,6 +129,14 @@
 fi
 
 
+dnl autoconf 2.59 fail
+dnl configure.in:137: error: possibly undefined macro: PKG_CONFIG_ENABLED
+dnl       If this token and others are legitimate, please use m4_pattern_allow.
+dnl       See the Autoconf documentation.
+dnl Also note that pkg.m4 (pkgconfig>=0.16 ?)
+dnl allow [^PKG_CONFIG(_PATH)?$] !
+m4_pattern_allow([PKG_CONFIG_ENABLED])
+
 dnl ==========================================================================
 dnl Check if pkg-config enabled and installed
 dnl ==========================================================================
@@ -161,23 +169,22 @@
 	[LIBXML_FOUND=yes],
 	[LIBXML_FOUND=no])
 fi
-AC_MSG_CHECKING(libxml2 $with_libxml  $LIBXML_FOUND  )
 if test "z$LIBXML_FOUND" = "zno" ; then
-    AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION) 
-    if test "z$with_libxml" != "z" ; then 
-	LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG
-    fi
-    AC_MSG_CHECKING(libxml2 $with_libxml  $LIBXML_CONFIG  )
-    if ! $LIBXML_CONFIG --version > /dev/null 2>&1 ; then
-	AC_MSG_ERROR(Could not find libxml2 anywhere (see config.log for details).)
+    if test "z$with_libxml" != "zyes" ; then
+	AC_PATH_PROG([LIBXML_CONFIG], [$LIBXML_CONFIG], [],
+		     [$with_libxml/bin:$PATH])
+    fi
+    AC_MSG_CHECKING([libxml2 $LIBXML_CONFIG ])
+    if ! LIBXML_VERSION=`$LIBXML_CONFIG --version 2>/dev/null`; then
+	AC_MSG_ERROR(Could not find libxml2 anywhere.)
     fi
-    vers=`$LIBXML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+    vers=`echo $LIBXML_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
     minvers=`echo $LIBXML_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
     if test "$vers" -ge "$minvers" ; then
         LIBXML_LIBS="`$LIBXML_CONFIG --libs`"
         LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`"
 	LIBXML_FOUND="yes"
-        AC_MSG_RESULT(yes ('$LIBXML_VERSION'))
+        AC_MSG_RESULT([yes ('$LIBXML_VERSION')])
     else
         AC_MSG_ERROR(You need at least libxml2 $LIBXML_MIN_VERSION for this version of $XMLSEC_PACKAGE)
     fi
@@ -209,24 +216,25 @@
 fi
 
 if test "z$LIBXSLT_FOUND" = "zno" ; then
-    AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) 
-    if test "z$LIBXSLT_CONFIG" != "z" ; then 
-	LIBXSLT_CONFIG=$with_libxslt/bin/$LIBXSLT_CONFIG
+    if test "z$with_libxslt" != "zyes" ; then
+	AC_PATH_PROG([LIBXSLT_CONFIG], [$LIBXSLT_CONFIG], [],
+		     [$with_libxslt/bin:$PATH])
     fi
-    if ! $LIBXSLT_CONFIG --version > /dev/null 2>&1 ; then
-	if test "z$with_libxslt" != "z" ; then
+    AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) 
+    if ! LIBXSLT_VERSION=`$LIBXSLT_CONFIG --version 2>/dev/null`; then
+	if test "z$with_libxslt" != "zyes" ; then
 	    AC_MSG_ERROR(Unable to find libxslt at '$with_libxslt')
 	else 
 	    AC_MSG_RESULT(no)
 	fi
     else
-        vers=`$LIBXSLT_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+        vers=`echo $LIBXSLT_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
 	minvers=`echo $LIBXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
 	if test "$vers" -ge "$minvers" ; then
     	    LIBXSLT_LIBS="`$LIBXSLT_CONFIG --libs`"
 	    LIBXSLT_CFLAGS="`$LIBXSLT_CONFIG --cflags`"
 	    LIBXSLT_FOUND="yes"
-    	    AC_MSG_RESULT("yes ('$LIBXSLT_VERSION')")
+    	    AC_MSG_RESULT([yes ('$LIBXSLT_VERSION')])
 	else
     	    AC_MSG_ERROR(You need at least libxslt $LIBXSLT_MIN_VERSION for this version of $XMLSEC_PACKAGE)
 	fi	
@@ -277,7 +285,11 @@
 elif test "z$with_openssl" != "z" ; then
     OPENSSL_CFLAGS="$OPENSSL_CFLAGS -I$with_openssl/include"
     if test -f "$with_openssl/lib/libcrypto$shrext" ; then
-	OPENSSL_LIBS="-L$with_openssl/lib -lcrypto -ldl"
+	if test "z$with_gnu_ld" = "zyes" ; then
+	    OPENSSL_LIBS="-Wl,-rpath,$with_openssl/lib -L$with_openssl/lib -lcrypto -ldl"
+	else
+	    OPENSSL_LIBS="-L$with_openssl/lib -lcrypto -ldl"
+	fi
     else
 	OPENSSL_LIBS="$with_openssl/lib/libcrypto.a -ldl"
     fi
@@ -384,9 +396,14 @@
 	],[
 	    OPENSSL_VERSION="0.9.6"
 	],[
-	    AC_MSG_RESULT(no)
+	    OPENSSL_VERSION=""
 	]) 
     fi
+    if test "z$OPENSSL_VERSION" = "z" ; then
+        AC_MSG_RESULT(no)
+    else
+        AC_MSG_RESULT([yes ('$OPENSSL_VERSION')])
+    fi
     
     CPPFLAGS=$OLD_CPPFLAGS
 fi    
@@ -459,6 +476,7 @@
 dnl if nss is disabled, bail out early
 AC_ARG_WITH(nss,     [  --with-nss=[PFX]          nss location])
 AC_ARG_WITH(nspr,    [  --with-nspr=[PFX]         nspr location (needed for NSS)])
+AC_ARG_WITH(seamonkey_ver, [  --with-seamonkey-ver=[VER]  mozilla version (alt to --with-nss, --with-nspr)])
 AC_ARG_WITH(mozilla_ver, [  --with-mozilla-ver=[VER]  mozilla version (alt to --with-nss, --with-nspr)])
 if test "z$with_nss" = "zno" -o "z$with_nspr" = "zno" ; then
     AC_MSG_CHECKING(for NSS libraries) 
@@ -492,7 +510,9 @@
 
 if test "z$NSS_FOUND" = "zno" ; then 
     dnl process the mozilla options if any
-    if test "z$with_mozilla_ver" != "z" ; then
+    if test "z$with_seamonkey_ver" != "z" ; then
+        ac_mozilla_name=seamonkey-$with_seamonkey_ver
+    elif test "z$with_mozilla_ver" != "z" ; then
         ac_mozilla_name=mozilla-$with_mozilla_ver
     else
         ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION
@@ -1237,6 +1257,24 @@
 dnl ==========================================================================
 dnl Writing result files
 dnl ==========================================================================
+if test "z$XMLSEC_NO_OPENSSL" != "z1" ; then
+AC_CONFIG_FILES([include/xmlsec/openssl/Makefile src/openssl/Makefile])
+fi
+
+if test "z$XMLSEC_NO_GNUTLS" != "z1" ; then
+AC_CONFIG_FILES([include/xmlsec/gnutls/Makefile src/gnutls/Makefile])
+fi
+
+if test "z$XMLSEC_NO_NSS" != "z1" ; then
+AC_CONFIG_FILES([include/xmlsec/nss/Makefile src/nss/Makefile])
+fi
+
+if test "z$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING" = "z1" ; then
+(rm -f xmlsec1.pc && $LN_S xmlsec1-$XMLSEC_CRYPTO.pc xmlsec1.pc)
+else
+AC_CONFIG_FILES([xmlsec1.pc:xmlsec.pc.in])
+fi
+
 AC_OUTPUT([
 include/xmlsec/version.h
 Makefile
@@ -1260,21 +1298,3 @@
 
 dnl COPYING should be in "srcdir" not in "builddir"
 (cd $srcdir && rm -f COPYING.LIB COPYING && $LN_S Copyright COPYING)
-
-if test "z$XMLSEC_NO_OPENSSL" != "z1" ; then
-AC_OUTPUT([include/xmlsec/openssl/Makefile src/openssl/Makefile])
-fi
-
-if test "z$XMLSEC_NO_GNUTLS" != "z1" ; then
-AC_OUTPUT([include/xmlsec/gnutls/Makefile src/gnutls/Makefile])
-fi
-
-if test "z$XMLSEC_NO_NSS" != "z1" ; then
-AC_OUTPUT([include/xmlsec/nss/Makefile src/nss/Makefile])
-fi
-
-if test "z$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING" = "z1" ; then
-(rm -f xmlsec1.pc && $LN_S xmlsec1-$XMLSEC_CRYPTO.pc xmlsec1.pc)
-else
-AC_OUTPUT([xmlsec1.pc:xmlsec.pc.in])
-fi


More information about the xmlsec mailing list