From 091028da9d9aea8993626e15ce41e9e657a0ba8f Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Fri, 16 Jul 2004 10:17:29 +0000 Subject: [PATCH] apply patch from Rob Richards to add a normal --with-crypto configure * configure.in libexslt/crypto.c libexslt/exslt.[ch] libexslt/exsltconfig.h.in win32/configure.js: apply patch from Rob Richards to add a normal --with-crypto configure option. Daniel --- ChangeLog | 6 +++++ configure.in | 49 ++++++++++++++++++++++++--------------- libexslt/crypto.c | 4 ++++ libexslt/exslt.c | 2 ++ libexslt/exslt.h | 2 ++ libexslt/exsltconfig.h.in | 9 +++++++ win32/configure.js | 8 +++++++ 7 files changed, 61 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b8f60e1..0ab6fde0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jul 16 12:14:57 CEST 2004 Daniel Veillard + + * configure.in libexslt/crypto.c libexslt/exslt.[ch] + libexslt/exsltconfig.h.in win32/configure.js: apply patch from + Rob Richards to add a normal --with-crypto configure option. + Tue Jul 13 22:57:43 HKT 2004 William Brack * libxslt/functions.c: added some logic to xsltKeyFunction diff --git a/configure.in b/configure.in index a39c940b..933b7a56 100644 --- a/configure.in +++ b/configure.in @@ -215,31 +215,38 @@ fi AC_SUBST(pythondir) AC_SUBST(PYTHON_SUBDIR) -dnl -dnl check for gcrypt -dnl -AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) -if test "$LIBGCRYPT_CONFIG" != "no" ; then - LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version` - if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42") - then +AC_ARG_WITH(crypto, [ --with-crypto Add crypto support to exslt (on)]) +WITH_CRYPTO=0 +if test "$with_crypto" = "no" ; then + echo Disabling crypto support LIBGCRYPT_CFLAGS="" LIBGCRYPT_LIBS="" - AC_MSG_NOTICE([gcrypt library version < 1.1.42 - Crypto extensions will not be available.]) - else - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags` - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs` - AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.]) - AC_MSG_NOTICE([Crypto extensions will be available.]) - fi else - LIBGCRYPT_CFLAGS="" - LIBGCRYPT_LIBS="" - AC_MSG_NOTICE([Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.]) + AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) + if test "$LIBGCRYPT_CONFIG" != "no" ; then + LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version` + if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42") + then + LIBGCRYPT_CFLAGS="" + LIBGCRYPT_LIBS="" + echo gcrypt library version < 1.1.42 - Crypto extensions will not be available. + else + LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags` + LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs` + AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.]) + echo Crypto extensions will be available. + WITH_CRYPTO=1 + fi + else + LIBGCRYPT_CFLAGS="" + LIBGCRYPT_LIBS="" + echo Crypto extensions will not be available. Install libgcrypt and reconfigure to make available. + fi fi - +AC_SUBST(WITH_CRYPTO) AC_SUBST(LIBGCRYPT_CFLAGS) AC_SUBST(LIBGCRYPT_LIBS) + dnl dnl Debug for DV (-Wunreachable-code) dnl @@ -251,6 +258,10 @@ if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ]] || \ fi CFLAGS="-Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline " STATIC_BINARIES="-static" + if [ "${LOGNAME}" = "veillard" ] + then + LIBXML_SRC="/u/veillard/XML" + fi else STATIC_BINARIES= fi diff --git a/libexslt/crypto.c b/libexslt/crypto.c index 7a6fd825..2d5f357c 100644 --- a/libexslt/crypto.c +++ b/libexslt/crypto.c @@ -21,6 +21,8 @@ #include "exslt.h" +#ifdef EXSLT_CRYPTO_ENABLED + #define HASH_DIGEST_LENGTH 32 #define MD5_DIGEST_LENGTH 16 #define SHA1_DIGEST_LENGTH 20 @@ -731,3 +733,5 @@ exsltCryptoRegister (void) { } #endif /* defined(HAVE_CRYPTO) */ + +#endif /* EXSLT_CRYPTO_ENABLED */ diff --git a/libexslt/exslt.c b/libexslt/exslt.c index 9b6a6ac1..4db8f454 100644 --- a/libexslt/exslt.c +++ b/libexslt/exslt.c @@ -32,7 +32,9 @@ const int exsltLibxmlVersion = LIBXML_VERSION; void exsltRegisterAll (void) { exsltCommonRegister(); +#ifdef EXSLT_CRYPTO_ENABLED exsltCryptoRegister(); +#endif exsltMathRegister(); exsltSetsRegister(); exsltFuncRegister(); diff --git a/libexslt/exslt.h b/libexslt/exslt.h index 9cdaaa02..a50e95c3 100644 --- a/libexslt/exslt.h +++ b/libexslt/exslt.h @@ -72,7 +72,9 @@ EXSLTPUBVAR const int exsltLibxmlVersion; #define SAXON_NAMESPACE ((const xmlChar *) "http://icl.com/saxon") EXSLTPUBFUN void EXSLTCALL exsltCommonRegister (void); +#ifdef EXSLT_CRYPTO_ENABLED EXSLTPUBFUN void EXSLTCALL exsltCryptoRegister (void); +#endif EXSLTPUBFUN void EXSLTCALL exsltMathRegister (void); EXSLTPUBFUN void EXSLTCALL exsltSetsRegister (void); EXSLTPUBFUN void EXSLTCALL exsltFuncRegister (void); diff --git a/libexslt/exsltconfig.h.in b/libexslt/exsltconfig.h.in index 962425c9..b4a835bd 100644 --- a/libexslt/exsltconfig.h.in +++ b/libexslt/exsltconfig.h.in @@ -34,6 +34,15 @@ extern "C" { */ #define LIBEXSLT_VERSION_STRING "@LIBEXSLT_VERSION_NUMBER@" +/** + * WITH_CRYPTO: + * + * Whether crypto support is configured into exslt + */ +#if @WITH_CRYPTO@ +#define EXSLT_CRYPTO_ENABLED +#endif + /** * ATTRIBUTE_UNUSED: * diff --git a/win32/configure.js b/win32/configure.js index 58ac9430..6e512800 100644 --- a/win32/configure.js +++ b/win32/configure.js @@ -45,6 +45,7 @@ var withMemDebug = false; var withDebugger = true; var withIconv = true; var withZlib = false; +var withCrypto = true; /* Win32 build options. */ var dirSep = "\\"; var compiler = "msvc"; @@ -101,6 +102,7 @@ function usage() txt += " debugger: Enable external debugger support (" + (withDebugger? "yes" : "no") + ")\n"; txt += " iconv: Use iconv library (" + (withIconv? "yes" : "no") + ")\n"; txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n"; + txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n"; txt += "\nWin32 build options, default value given in parentheses:\n\n"; txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n"; txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n"; @@ -168,6 +170,7 @@ function discoverVersion() vf.WriteLine("WITH_DEBUGGER=" + (withDebugger? "1" : "0")); vf.WriteLine("WITH_ICONV=" + (withIconv? "1" : "0")); vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); + vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0")); vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); vf.WriteLine("PREFIX=" + buildPrefix); @@ -236,6 +239,8 @@ function configureExslt() } else if (s.search(/\@LIBEXSLT_VERSION_NUMBER\@/) != -1) { of.WriteLine(s.replace(/\@LIBEXSLT_VERSION_NUMBER\@/, verMajorExslt*10000 + verMinorExslt*100 + verMicroExslt*1)); + } else if (s.search(/\@WITH_CRYPTO\@/) != -1) { + of.WriteLine(s.replace(/\@WITH_CRYPTO\@/, withCrypto? "1" : "0")); } else of.WriteLine(ln); } @@ -304,6 +309,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { withIconv = strToBool(arg.substring(opt.length + 1, arg.length)); else if (opt == "zlib") withZlib = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "crypto") + withCrypto = strToBool(arg.substring(opt.length + 1, arg.length)); else if (opt == "compiler") compiler = arg.substring(opt.length + 1, arg.length); else if (opt == "cruntime") @@ -408,6 +415,7 @@ txtOut += " Memory debugging: " + boolToStr(withMemDebug) + "\n"; txtOut += " Debugger support: " + boolToStr(withDebugger) + "\n"; txtOut += " Use iconv: " + boolToStr(withIconv) + "\n"; txtOut += " With zlib: " + boolToStr(withZlib) + "\n"; +txtOut += " Crypto: " + boolToStr(withCrypto) + "\n"; txtOut += "\n"; txtOut += "Win32 build configuration\n"; txtOut += "-------------------------\n";