1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([xmlsec1],[1.2.14],[http://www.aleksey.com/xmlsec])
7 XMLSEC_VERSION_SUBMINOR=14
8 XMLSEC_VERSION="$XMLSEC_VERSION_MAJOR.$XMLSEC_VERSION_MINOR.$XMLSEC_VERSION_SUBMINOR"
9 XMLSEC_VERSION_INFO=`echo $XMLSEC_VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
10 XMLSEC_VERSION_SAFE=`echo $XMLSEC_VERSION | sed 's/\./_/g'`
15 AC_SUBST(XMLSEC_VERSION)
16 AC_SUBST(XMLSEC_PACKAGE)
17 AC_SUBST(XMLSEC_VERSION_SAFE)
18 AC_SUBST(XMLSEC_VERSION_MAJOR)
19 AC_SUBST(XMLSEC_VERSION_MINOR)
20 AC_SUBST(XMLSEC_VERSION_SUBMINOR)
21 AC_SUBST(XMLSEC_VERSION_INFO)
23 AC_CONFIG_MACRO_DIR(m4)
24 AM_INIT_AUTOMAKE([1.7 tar-ustar])
25 AC_CONFIG_HEADERS([config.h])
29 dnl Check the environment
40 if test "z$RM" == "z" ; then
41 AC_PATH_PROG(RM, rm, /bin/rm)
43 AC_PATH_PROG(CP, cp, /bin/cp)
44 AC_PATH_PROG(MV, mv, /bin/mv)
45 AC_PATH_PROG(TAR, tar, /bin/tar)
46 AC_PATH_PROG(HELP2MAN, help2man)
47 AC_PATH_PROG(MAN2HTML, man2html)
49 dnl Make sure we have an ANSI compiler
51 test "z$U" != "z" && AC_MSG_ERROR(Compiler not ANSI compliant)
53 dnl Checks for header files.
56 AC_CHECK_HEADERS([stdio.h])
57 AC_CHECK_HEADERS([stdlib.h])
58 AC_CHECK_HEADERS([string.h])
59 AC_CHECK_HEADERS([ctype.h])
60 AC_CHECK_HEADERS([errno.h])
61 AC_CHECK_HEADERS([ansidecl.h])
62 AC_CHECK_HEADERS([time.h])
63 AC_CHECK_FUNCS(strchr strrchr printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf timegm)
67 dnl ==========================================================================
68 dnl Specific setup for Aleksey's development environment:
70 dnl - with pedantic compiler flags
71 dnl - with static binaries
72 dnl - without dynamic xmlsec-crypto loading
73 dnl ==========================================================================
74 AC_MSG_CHECKING(for development environment)
75 AC_ARG_ENABLE(development, [ --enable-development enable development environment (no)])
76 if test "z$enable_development" = "zyes" ; then
79 enable_static_linking="yes"
87 dnl ==========================================================================
88 dnl Perform host specific configuration
89 dnl ==========================================================================
91 XMLSEC_CRYPTO_EXTRA_LDFLAGS=
92 dnl should separate extra LDFLAGS for xmlsec and crypto libs ?
93 dnl should --enable-runtime-pseudo-reloc for mingw and cygwin ?
95 xmlsec_sharedlib_hack="no"
96 if test -n "$shrext"; then
97 XMLSEC_SHLIBSFX="$shrext"
99 dnl changed in libtool (between 1.5.2 and 1.5.14)
100 XMLSEC_SHLIBSFX="$shrext_cmds"
104 CFLAGS="${CFLAGS} -D_ALL_SOURCE"
107 dnl use libtool flags "-avoid-version" to create shared
108 dnl libraries without version suffix, i.e. libxmlsec1.dll
109 dnl instead libxmlsec1-NN.dll, where NN is a number.
110 XMLSEC_EXTRA_LDFLAGS="-no-undefined -avoid-version"
111 XMLSEC_CRYPTO_EXTRA_LDFLAGS="-no-undefined -avoid-version"
112 XMLSEC_SHLIBSFX=".dll.a"
113 xmlsec_sharedlib_hack="yes"
116 XMLSEC_EXTRA_LDFLAGS="-no-undefined"
117 XMLSEC_CRYPTO_EXTRA_LDFLAGS="-no-undefined"
121 # To avoid problem with loading of a shared library (dlopen or equivalent)
122 # at run time on some platforms we need to link crypto modules with extra
123 # source. It's work without hack on 9x and under emulation.
124 # On nt 5.x (w2k,xp) the error is 998("Invalid access to memory location").
125 AM_CONDITIONAL(SHAREDLIB_HACK, [test "z$xmlsec_sharedlib_hack" = "zyes"])
127 dnl ==========================================================================
128 dnl Hack for autoconf version mismatch
129 dnl ==========================================================================
130 if test "z$shrext" == "z" ; then
134 dnl ==========================================================================
135 dnl Check for __FUNCTION__ or __FUNCTION__
136 dnl ==========================================================================
137 AC_MSG_CHECKING(for __FUNCTION__ or __func__)
138 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
139 [[char *foo = __FUNCTION__;]])],
140 [ac_function_exists=yes],
141 [ac_function_exists=no])
142 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
143 [[char *foo = __func__;]])],
144 [ac_func_exists=yes],
146 if test "z$ac_function_exists" = "zyes" ; then
147 AC_MSG_RESULT(__FUNCTION__)
148 XMLSEC_DEFINES="$XMLSEC_DEFINES -D__XMLSEC_FUNCTION__=__FUNCTION__"
149 elif test "z$ac_func_exists" = "zyes" ; then
150 AC_MSG_RESULT(__func__)
151 XMLSEC_DEFINES="$XMLSEC_DEFINES -D__XMLSEC_FUNCTION__=__func__"
156 dnl ==========================================================================
157 dnl check do we have size_t and its size,
158 dnl TODO: will need to replace this and the xmlSecSize define with
159 dnl typedef on next ABI refresh
160 dnl ==========================================================================
161 AC_CHECK_SIZEOF(size_t)
162 if test "$ac_cv_sizeof_size_t" -ne "4" ; then
163 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SIZE_T"
167 dnl autoconf 2.59 fail
168 dnl configure.in:137: error: possibly undefined macro: PKG_CONFIG_ENABLED
169 dnl If this token and others are legitimate, please use m4_pattern_allow.
170 dnl See the Autoconf documentation.
171 dnl Also note that pkg.m4 (pkgconfig>=0.16 ?)
172 dnl allow [^PKG_CONFIG(_PATH)?$] !
173 m4_pattern_allow([PKG_CONFIG_ENABLED])
175 dnl ==========================================================================
176 dnl Check if pkg-config enabled and installed
177 dnl ==========================================================================
178 AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig enable pkgconfig for configuration (yes)])
179 if test "z$enable_pkgconfig" = "zno" ; then
180 PKG_CONFIG_ENABLED=no
182 AC_CHECK_PROG(PKG_CONFIG_ENABLED, pkg-config, yes, no)
183 if test "z$PKG_CONFIG_ENABLED" = "zyes" ; then
184 if ! pkg-config --atleast-pkgconfig-version 0.9 ; then
185 PKG_CONFIG_ENABLED=no
190 dnl ==========================================================================
192 dnl ==========================================================================
193 LIBXML_MIN_VERSION="2.7.4"
194 LIBXML_CONFIG="xml2-config"
199 [ --with-libxml=[PFX] libxml2 location]
201 AC_ARG_WITH(libxml-src,
202 [ --with-libxml-src=[PFX] not installed yet libxml2 location]
205 if test "z$with_libxml" = "zno" -o "z$with_libxml_src" = "zno"; then
206 AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION)
207 AC_MSG_ERROR(libxml2 >= $LIBXML_MIN_VERSION is required for $XMLSEC_PACKAGE)
208 elif test "z$with_libxml_src" != "z" ; then
209 AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_MIN_VERSION)
211 if cd "$with_libxml_src" ; then
213 LIBXML_CONFIG=${SRC_DIR}/xml2-config
214 LIBXML_LIBS="-L${SRC_DIR}/.libs -lxml2"
215 LIBXML_CFLAGS="-I${SRC_DIR}/include"
218 AC_MSG_RESULT([yes (source)])
220 AC_MSG_ERROR([libxml source dir not found (${with_libxml_src}), typo?])
222 elif test "z$with_libxml" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then
223 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_MIN_VERSION,
227 if test "z$LIBXML_FOUND" = "zno" ; then
228 if test "z$with_libxml" != "zyes" ; then
229 AC_PATH_PROG([LIBXML_CONFIG], [$LIBXML_CONFIG], [],
230 [$with_libxml/bin:$PATH])
232 AC_MSG_CHECKING([libxml2 $LIBXML_CONFIG ])
233 if ! LIBXML_VERSION=`$LIBXML_CONFIG --version 2>/dev/null`; then
234 AC_MSG_ERROR(Could not find libxml2 anywhere.)
236 vers=`echo $LIBXML_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
237 minvers=`echo $LIBXML_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
238 if test "$vers" -ge "$minvers" ; then
239 LIBXML_LIBS="`$LIBXML_CONFIG --libs`"
240 LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`"
242 AC_MSG_RESULT([yes ('$LIBXML_VERSION')])
244 AC_MSG_ERROR(You need at least libxml2 $LIBXML_MIN_VERSION for this version of $XMLSEC_PACKAGE)
248 AC_SUBST(LIBXML_CFLAGS)
249 AC_SUBST(LIBXML_LIBS)
250 AC_SUBST(LIBXML_CONFIG)
251 AC_SUBST(LIBXML_MIN_VERSION)
253 dnl ==========================================================================
255 dnl ==========================================================================
256 XMLSEC_NO_LIBXSLT="1"
257 LIBXSLT_MIN_VERSION=1.0.20
258 LIBXSLT_CONFIG="xslt-config"
263 [ --with-libxslt=[PFX] libxslt location]
265 AC_ARG_WITH(libxslt-src,
266 [ --with-libxslt-src=[PFX] not installed yet libxslt location]
268 if test "z$with_libxslt" = "zno" -o "z$with_libxslt_src" = "zno" ; then
269 AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION)
271 LIBXSLT_FOUND="without"
272 elif test "z$with_libxslt_src" != "z" ; then
273 AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION)
275 if cd "$with_libxslt_src" ; then
277 LIBXSLT_CONFIG=${SRC_DIR}/xslt-config
278 LIBXSLT_LIBS="-L${SRC_DIR}/libxslt/.libs -lxslt"
279 LIBXSLT_CFLAGS="-I${SRC_DIR}"
282 AC_MSG_RESULT([yes (source)])
284 AC_MSG_ERROR([libxslt source dir not found (${with_libxslt_src}), typo?])
286 elif test "z$with_libxslt" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then
287 PKG_CHECK_MODULES(LIBXSLT, libxslt >= $LIBXSLT_MIN_VERSION,
292 if test "z$LIBXSLT_FOUND" = "zno" ; then
293 if test "z$with_libxslt" != "zyes" ; then
294 AC_PATH_PROG([LIBXSLT_CONFIG], [$LIBXSLT_CONFIG], [],
295 [$with_libxslt/bin:$PATH])
297 AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION)
298 if ! LIBXSLT_VERSION=`$LIBXSLT_CONFIG --version 2>/dev/null`; then
299 if test "z$with_libxslt" != "zyes" ; then
300 AC_MSG_ERROR(Unable to find libxslt at '$with_libxslt')
305 vers=`echo $LIBXSLT_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
306 minvers=`echo $LIBXSLT_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
307 if test "$vers" -ge "$minvers" ; then
308 LIBXSLT_LIBS="`$LIBXSLT_CONFIG --libs`"
309 LIBXSLT_CFLAGS="`$LIBXSLT_CONFIG --cflags`"
311 AC_MSG_RESULT([yes ('$LIBXSLT_VERSION')])
313 AC_MSG_ERROR(You need at least libxslt $LIBXSLT_MIN_VERSION for this version of $XMLSEC_PACKAGE)
318 if test "z$LIBXSLT_FOUND" = "zyes" ; then
319 XMLSEC_NO_LIBXSLT="0"
321 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XSLT=1"
324 AC_SUBST(XMLSEC_NO_LIBXSLT)
325 AC_SUBST(LIBXSLT_CFLAGS)
326 AC_SUBST(LIBXSLT_LIBS)
327 AC_SUBST(LIBXSLT_CONFIG)
328 AC_SUBST(LIBXSLT_MIN_VERSION)
330 dnl ==========================================================================
331 dnl See if we can find a crypto library
332 dnl ==========================================================================
334 XMLSEC_CRYPTO_LIST=""
335 XMLSEC_CRYPTO_DISABLED_LIST=""
337 XMLSEC_CRYPTO_CFLAGS=""
338 XMLSEC_CRYPTO_CFLAGS_APP=""
339 XMLSEC_CRYPTO_LIBS=""
341 dnl ==========================================================================
343 dnl ==========================================================================
344 ac_openssl_lib_dir="/usr/local/lib /usr/lib /usr/lib64 /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg"
345 ac_openssl_inc_dir="/usr/local/include /usr/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include"
347 XMLSEC_NO_OPENSSL="1"
348 OPENSSL_MIN_VERSION="0.9.6"
352 OPENSSL_CRYPTO_LIB="$XMLSEC_PACKAGE-openssl"
354 AC_ARG_WITH(openssl, [ --with-openssl=[PFX] openssl location])
355 if test "z$with_openssl" = "zno" ; then
356 OPENSSL_FOUND=without
357 AC_MSG_CHECKING(for openssl libraries >= $OPENSSL_MIN_VERSION)
359 elif test "z$with_openssl" != "z" ; then
361 *-*-mingw*) openssl_exlibs=;;
362 *-*-osf5*) openssl_exlibs=;;
363 *-*-openbsd*) openssl_exlibs=;;
364 *-*-netbsd*) openssl_exlibs=;;
365 #FIXME: check if lib "dl" is required
366 *) openssl_exlibs=-ldl;;
368 OPENSSL_CFLAGS="$OPENSSL_CFLAGS -I$with_openssl/include"
369 if test -f "$with_openssl/lib/libcrypto${XMLSEC_SHLIBSFX}" ; then
370 OPENSSL_LIBS="-L$with_openssl/lib -lcrypto $openssl_exlibs"
372 OPENSSL_LIBS="$with_openssl/lib/libcrypto.a $openssl_exlibs"
375 elif test "z$PKG_CONFIG_ENABLED" = "zyes" ; then
376 if test "z$OPENSSL_VERSION" = "z" ; then
377 PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.8,
378 [OPENSSL_VERSION="0.9.8"],
379 [OPENSSL_VERSION=""])
382 if test "z$OPENSSL_VERSION" = "z" ; then
383 PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7,
384 [OPENSSL_VERSION="0.9.7"],
385 [OPENSSL_VERSION=""])
388 if test "z$OPENSSL_VERSION" = "z" ; then
389 PKG_CHECK_MODULES(OPENSSL, openssl >= $OPENSSL_MIN_VERSION,
390 [OPENSSL_VERSION="$OPENSSL_MIN_VERSION"],
391 [OPENSSL_VERSION=""])
394 if test "z$OPENSSL_VERSION" != "z" ; then
399 if test "z$OPENSSL_FOUND" = "zno" ; then
400 OPENSSL_INCLUDES_FOUND="no"
401 OPENSSL_LIBS_FOUND="no"
403 for dir in $ac_openssl_inc_dir ; do
404 if test -f $dir/openssl/ssl.h ; then
405 dnl do not add -I/usr/include because compiler does it anyway
406 if test "z$dir" = "z/usr/include" ; then
407 OPENSSL_CFLAGS="$OPENSSL_CFLAGS "
409 OPENSSL_CFLAGS="$OPENSSL_CFLAGS -I$dir"
411 OPENSSL_INCLUDES_FOUND="yes"
416 for dir in $ac_openssl_lib_dir ; do
417 if test -f $dir/libcrypto.a ; then
418 dnl do not add -L/usr/lib because compiler does it anyway
419 if test "z$dir" = "z/usr/lib" ; then
420 OPENSSL_LIBS="-lcrypto -ldl"
422 OPENSSL_LIBS="-L$dir -lcrypto -ldl"
424 OPENSSL_LIBS_FOUND="yes"
425 ac_found_openssl_lib_dir=$dir
430 if test "z$OPENSSL_INCLUDES_FOUND" = "zyes" -a "z$OPENSSL_LIBS_FOUND" = "zyes" ; then
435 if test "z$OPENSSL_FOUND" = "zyes" -a "z$OPENSSL_VERSION" = "z" ; then
436 AC_MSG_CHECKING(for openssl libraries >= $OPENSSL_MIN_VERSION)
438 dnl Check the OpenSSL version
439 OLD_CPPFLAGS=$CPPFLAGS
440 CPPFLAGS="$OPENSSL_CFLAGS"
442 if test "z$OPENSSL_VERSION" = "z" ; then
444 #include <openssl/opensslv.h>
445 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
449 OPENSSL_VERSION="1.0.0"
455 if test "z$OPENSSL_VERSION" = "z" ; then
457 #include <openssl/opensslv.h>
458 #if OPENSSL_VERSION_NUMBER >= 0x00908000L
462 OPENSSL_VERSION="0.9.8"
468 if test "z$OPENSSL_VERSION" = "z" ; then
470 #include <openssl/opensslv.h>
471 #if OPENSSL_VERSION_NUMBER >= 0x00907000L
475 OPENSSL_VERSION="0.9.7"
481 if test "z$OPENSSL_VERSION" = "z" ; then
483 #include <openssl/opensslv.h>
484 #if OPENSSL_VERSION_NUMBER >= 0x00906000L
488 OPENSSL_VERSION="0.9.6"
493 if test "z$OPENSSL_VERSION" = "z" ; then
496 AC_MSG_RESULT([yes ('$OPENSSL_VERSION')])
499 CPPFLAGS=$OLD_CPPFLAGS
502 if test "z$OPENSSL_FOUND" = "zyes" ; then
503 XMLSEC_NO_OPENSSL="0"
504 if test "z$OPENSSL_VERSION" = "z0.9.6" ; then
505 OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_OPENSSL_096=1"
507 if test "z$OPENSSL_VERSION" = "z0.9.7" ; then
508 OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_OPENSSL_097=1"
510 if test "z$OPENSSL_VERSION" = "z0.9.8" ; then
511 OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_OPENSSL_098=1"
513 if test "z$OPENSSL_VERSION" = "z1.0.0" ; then
514 OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_OPENSSL_100=1"
516 OPENSSL_CFLAGS="$OPENSSL_CFLAGS -DXMLSEC_CRYPTO_OPENSSL=1"
518 dnl first crypto library is default one
519 if test "z$XMLSEC_CRYPTO" = "z" ; then
520 XMLSEC_CRYPTO="openssl"
521 XMLSEC_CRYPTO_LIB="$OPENSSL_CRYPTO_LIB"
522 XMLSEC_CRYPTO_CFLAGS="$OPENSSL_CFLAGS"
523 XMLSEC_CRYPTO_LIBS="$OPENSSL_LIBS"
525 XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST openssl"
527 XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST openssl"
530 AM_CONDITIONAL(XMLSEC_NO_OPENSSL, test "z$XMLSEC_NO_OPENSSL" == "z1")
531 AC_SUBST(XMLSEC_NO_OPENSSL)
532 AC_SUBST(OPENSSL_CFLAGS)
533 AC_SUBST(OPENSSL_LIBS)
534 AC_SUBST(OPENSSL_CRYPTO_LIB)
535 AC_SUBST(OPENSSL_MIN_VERSION)
537 dnl ==========================================================================
538 dnl See if we can find NSS and NSPR
539 dnl Allow the use of:
540 dnl 1. Mozilla style distribution where all mozilla components (NSS, NSPR
541 dnl are just 2 of over 100 components) are under one directory.
542 dnl options: [--with-mozilla-ver=<VERSION>]
544 dnl Using the version number, various directories are searched
549 dnl 2. separate NSS & NSPR distributions
550 dnl options: [--with-nss=<PFX>] [--with-nspr=<PFX>]
554 dnl ==========================================================================
557 MOZILLA_MIN_VERSION="1.4"
558 NSS_MIN_VERSION="3.2"
559 NSPR_MIN_VERSION="4.0"
562 NSS_LIBS_LIST="-lnss3 -lsmime3"
563 NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4"
564 NSS_CRYPTO_LIB="$XMLSEC_PACKAGE-nss"
566 NSPR_PACKAGE=mozilla-nspr
567 NSS_PACKAGE=mozilla-nss
570 dnl if nss is disabled, bail out early
571 AC_ARG_WITH(nss, [ --with-nss=[PFX] nss location])
572 AC_ARG_WITH(nspr, [ --with-nspr=[PFX] nspr location (needed for NSS)])
573 AC_ARG_WITH(seamonkey_ver, [ --with-seamonkey-ver=[VER] mozilla version (alt to --with-nss, --with-nspr)])
574 AC_ARG_WITH(mozilla_ver, [ --with-mozilla-ver=[VER] mozilla version (alt to --with-nss, --with-nspr)])
575 if test "z$with_nss" = "zno" -o "z$with_nspr" = "zno" ; then
576 AC_MSG_CHECKING(for NSS libraries)
579 elif test "z$with_nss" = "z" -a "z$with_nspr" = "z" -a "z$with_mozilla_ver" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then
581 dnl Mozilla's NSS/NSPR are distributed under different names
582 dnl in different distribution:
583 dnl mozilla-nspr and mozilla-nss
584 dnl xulrunner-nspr and xulrunner-nss
586 dnl We are going to try all options
588 if test "z$NSS_FOUND" = "zno" ; then
589 PKG_CHECK_MODULES(NSS, mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION,
590 [NSS_FOUND=yes NSPR_PACKAGE=mozilla-nspr NSS_PACKAGE=mozilla-nss],
593 if test "z$NSS_FOUND" = "zno" ; then
594 PKG_CHECK_MODULES(NSS, xulrunner-nspr >= $MOZILLA_MIN_VERSION xulrunner-nss >= $MOZILLA_MIN_VERSION,
595 [NSS_FOUND=yes NSPR_PACKAGE=xulrunner-nspr NSS_PACKAGE=xulrunner-nss],
598 if test "z$NSS_FOUND" = "zno" ; then
599 PKG_CHECK_MODULES(NSS, nspr >= $MOZILLA_MIN_VERSION nss >= $MOZILLA_MIN_VERSION,
600 [NSS_FOUND=yes NSPR_PACKAGE=nspr NSS_PACKAGE=nss],
605 if test "z$NSS_FOUND" = "zno" ; then
606 dnl process the mozilla options if any
607 if test "z$with_seamonkey_ver" != "z" ; then
608 ac_mozilla_name=seamonkey-$with_seamonkey_ver
609 elif test "z$with_mozilla_ver" != "z" ; then
610 ac_mozilla_name=mozilla-$with_mozilla_ver
612 ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION
615 ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name"
616 ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name"
618 AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION)
619 NSPR_INCLUDES_FOUND="no"
624 if test "z$with_nspr" != "z" ; then
625 NSPR_PREFIX="$with_nspr"
626 NSPR_CFLAGS="-I$with_nspr/include -I$with_nspr/include/nspr"
627 if test "z$with_gnu_ld" = "zyes" ; then
628 NSPR_LIBS="-Wl,-rpath-link -Wl,$with_nspr/lib -L$with_nspr/lib $NSPR_LIBS_LIST"
630 NSPR_LIBS="-L$with_nspr/lib $NSPR_LIBS_LIST"
632 NSPR_INCLUDES_FOUND="yes"
633 NSPR_LIBS_FOUND="yes"
634 NSPR_PRINIT_H="$with_nspr/include/prinit.h"
636 for dir in $ac_nss_inc_dir ; do
637 if test -f $dir/nspr/prinit.h ; then
638 dnl do not add -I/usr/include because compiler does it anyway
639 if test "z$dir" = "z/usr/include" ; then
642 NSPR_CFLAGS="-I$dir/nspr"
644 NSPR_INCLUDES_FOUND="yes"
645 NSPR_PRINIT_H="$dir/nspr/prinit.h"
650 for dir in $ac_nss_lib_dir ; do
651 if test -f $dir/libnspr4$shrext ; then
652 dnl do not add -L/usr/lib because compiler does it anyway
653 if test "z$dir" = "z/usr/lib" ; then
654 NSPR_LIBS="$NSPR_LIBS_LIST"
656 if test "z$with_gnu_ld" = "zyes" ; then
657 NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST"
659 NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
662 NSPR_LIBS_FOUND="yes"
668 if test "z$NSPR_INCLUDES_FOUND" = "zyes" -a "z$NSPR_LIBS_FOUND" = "zyes" ; then
669 OLD_CPPFLAGS=$CPPFLAGS
670 CPPFLAGS="$NSPR_CFLAGS"
681 CPPFLAGS="$OLD_CPPFLAGS"
684 if test "z$NSPR_FOUND" = "zyes" ; then
691 AC_MSG_CHECKING(for nss libraries >= $NSS_MIN_VERSION)
692 NSS_INCLUDES_FOUND="no"
696 if test "z$with_nss" != "z" ; then
697 NSS_CFLAGS="$NSS_CFLAGS -I$with_nss/include -I$with_nss/include/nss"
698 if test "z$with_gnu_ld" = "zyes" ; then
699 NSS_LIBS="$NSS_LIBS -Wl,-rpath-link -Wl,$with_nss/lib -L$with_nss/lib $NSS_LIBS_LIST"
701 NSS_LIBS="$NSS_LIBS -L$with_nss/lib $NSS_LIBS_LIST"
703 NSS_INCLUDES_FOUND="yes"
705 NSS_NSS_H="$with_nss/include/nss.h"
707 for dir in $ac_nss_inc_dir ; do
708 if test -f $dir/nss/nss.h ; then
709 dnl do not add -I/usr/include because compiler does it anyway
710 if test "z$dir" = "z/usr/include" ; then
711 NSS_CFLAGS="$NSS_CFLAGS"
713 NSS_CFLAGS="$NSS_CFLAGS -I$dir/nss"
715 NSS_INCLUDES_FOUND="yes"
716 NSS_NSS_H="$dir/nss/nss.h"
721 for dir in $ac_nss_lib_dir ; do
722 if test -f $dir/libnss3$shrext ; then
723 dnl do not add -L/usr/lib because compiler does it anyway
724 if test "z$dir" = "z/usr/lib" ; then
725 NSS_LIBS="$NSS_LIBS_LIST"
727 if test "z$with_gnu_ld" = "zyes" ; then
728 NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST"
730 NSS_LIBS="-L$dir $NSS_LIBS_LIST"
739 if test "z$NSS_INCLUDES_FOUND" = "zyes" -a "z$NSS_LIBS_FOUND" = "zyes" ; then
740 OLD_CPPFLAGS=$CPPFLAGS
741 CPPFLAGS="$NSS_CFLAGS"
744 #if NSS_VMAJOR >= 3 && NSS_VMINOR >= 2
752 CPPFLAGS="$OLD_CPPFLAGS"
755 if test "z$NSS_FOUND" = "zyes" ; then
761 dnl check that we have found both NSS and NSPR
762 if test "z$NSPR_FOUND" = "zyes" -a "z$NSS_FOUND" = "zyes" ; then
763 NSS_CFLAGS="$NSS_CFLAGS $NSPR_CFLAGS"
764 NSS_LIBS="$NSS_LIBS $NSPR_LIBS"
765 elif test "z$NSPR_FOUND" != "zyes" -a "z$NSS_FOUND" = "zyes" ; then
767 AC_MSG_RESULT(NSPR library is required for NSS, ignoring NSS library we have found)
771 if test "z$NSS_FOUND" = "zyes" ; then
773 NSS_CFLAGS="$NSS_CFLAGS -DXMLSEC_CRYPTO_NSS=1"
775 dnl first crypto library is default one
776 if test "z$XMLSEC_CRYPTO" = "z" ; then
778 XMLSEC_CRYPTO_LIB="$NSS_CRYPTO_LIB"
779 XMLSEC_CRYPTO_CFLAGS="$NSS_CFLAGS"
780 XMLSEC_CRYPTO_LIBS="$NSS_LIBS"
782 XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST nss"
784 XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST nss"
787 AM_CONDITIONAL(XMLSEC_NO_NSS, test "z$XMLSEC_NO_NSS" = "z1")
788 AC_SUBST(XMLSEC_NO_NSS)
789 AC_SUBST(NSPR_PACKAGE)
790 AC_SUBST(NSS_PACKAGE)
793 AC_SUBST(NSS_CRYPTO_LIB)
794 AC_SUBST(NSS_MIN_VERSION)
795 AC_SUBST(NSPR_MIN_VERSION)
796 AC_SUBST(MOZILLA_MIN_VERSION)
798 dnl ==========================================================================
799 dnl See if we can find GnuTLS
800 dnl ==========================================================================
801 GNUTLS_CONFIG="libgnutls-config"
803 GNUTLS_MIN_VERSION="0.8.1"
804 GNUTLS_NEW_MIN_VERSION="1.0.0"
808 GNUTLS_CRYPTO_LIB="$XMLSEC_PACKAGE-gnutls"
810 AC_ARG_WITH(gnutls, [ --with-gnutls=[PFX] gnutls location])
811 if test "z$with_gnutls" = "zno" ; then
812 AC_MSG_CHECKING(for gnutls libraries >= $GNUTLS_MIN_VERSION)
814 GNUTLS_FOUND="without"
815 elif test "z$with_gnutls" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then
816 PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_NEW_MIN_VERSION,
819 if test "z$GNUTLS_FOUND" = "zno" ; then
820 PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION,
825 if test "z$GNUTLS_FOUND" = "zno" ; then
826 PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION,
829 if test "z$GNUTLS_FOUND" = "zyes" ; then
830 GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_GNUTLS_OLD=1"
835 if test "z$GNUTLS_FOUND" = "zno" ; then
836 AC_MSG_CHECKING(for gnutls libraries >= $GNUTLS_MIN_VERSION)
837 if test "z$with_gnutls" != "z" ; then
838 GNUTLS_CONFIG=$with_gnutls/bin/$GNUTLS_CONFIG
840 if ! $GNUTLS_CONFIG --version > /dev/null 2>&1 ; then
841 if test "z$with_gnutls" != "z" ; then
842 AC_MSG_ERROR(Unable to find gnutls at '$with_gnutls')
847 vers=`$GNUTLS_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
848 minvers=`echo $GNUTLS_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
849 if test "$vers" -ge "$minvers" ; then
850 GNUTLS_CFLAGS="$GNUTLS_CFLAGS `$GNUTLS_CONFIG --cflags`"
851 GNUTLS_LIBS="$GNUTLS_LIBS `$GNUTLS_CONFIG --libs`"
854 new_minvers=`echo $GNUTLS_NEW_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
855 if test "$vers" -lt "$new_minvers" ; then
856 GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_GNUTLS_OLD=1"
860 AC_MSG_ERROR(You need at least gnutls $GNUTLS_MIN_VERSION for this version of $XMLSEC_PACKAGE)
865 if test "z$GNUTLS_FOUND" = "zyes" ; then
867 GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_CRYPTO_GNUTLS=1"
869 dnl first crypto library is default one
870 if test "z$XMLSEC_CRYPTO" = "z" ; then
871 XMLSEC_CRYPTO="gnutls"
872 XMLSEC_CRYPTO_LIB="$GNUTLS_CRYPTO_LIB"
873 XMLSEC_CRYPTO_CFLAGS="$GNUTLS_CFLAGS"
874 XMLSEC_CRYPTO_LIBS="$GNUTLS_LIBS"
876 XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST gnutls"
878 XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST gnutls"
881 AM_CONDITIONAL(XMLSEC_NO_GNUTLS, test "z$XMLSEC_NO_GNUTLS" = "z1")
882 AC_SUBST(XMLSEC_NO_GNUTLS)
883 AC_SUBST(GNUTLS_CFLAGS)
884 AC_SUBST(GNUTLS_LIBS)
885 AC_SUBST(GNUTLS_CRYPTO_LIB)
886 AC_SUBST(GNUTLS_MIN_VERSION)
888 dnl ==========================================================================
889 dnl See if we can find MSCrypto
890 dnl ==========================================================================
891 XMLSEC_NO_MSCRYPTO="1"
894 MSCRYPTO_CRYPTO_LIB="$XMLSEC_PACKAGE-mscrypto"
895 MSCRYPTO_ENABLE='none'
896 AC_ARG_ENABLE(mscrypto,
897 [ --enable-mscrypto enable mscrypto (no)],
898 [MSCRYPTO_ENABLE=$enableval])
899 if test "z$MSCRYPTO_ENABLE" != "zyes" ; then
900 AC_MSG_CHECKING(for mscrypto libraries)
901 AC_MSG_RESULT([$MSCRYPTO_ENABLE])
903 dnl cannot detect __stdcall functions
904 dnl AC_CHECK_LIB(crypt32, CertOpenStore, ....
906 LIBS="$LIBS -lcrypt32"
907 AC_MSG_CHECKING(for mscrypto libraries)
910 #include <wincrypt.h>
911 int main () { CertOpenStore(0,0,0,0,0);; return(0); }
914 [MSCRYPTO_ENABLE="no"])
915 AC_MSG_RESULT([$MSCRYPTO_ENABLE])
919 if test "z$MSCRYPTO_ENABLE" = "zyes" ; then
920 XMLSEC_NO_MSCRYPTO="0"
922 MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1"
925 dnl since mingw crypt32 library is limited
926 dnl we use own def-file
927 MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';;
929 MSCRYPTO_LIBS="-lcrypt32";;
932 dnl first crypto library is default one
933 if test "z$XMLSEC_CRYPTO" = "z" ; then
934 XMLSEC_CRYPTO="mscrypto"
935 XMLSEC_CRYPTO_LIB="$MSCRYPTO_CRYPTO_LIB"
936 XMLSEC_CRYPTO_CFLAGS="$MSCRYPTO_CFLAGS"
937 XMLSEC_CRYPTO_LIBS="$MSCRYPTO_LIBS"
939 XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST mscrypto"
941 XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST mscrypto"
944 AM_CONDITIONAL(XMLSEC_NO_MSCRYPTO, [test "z$XMLSEC_NO_MSCRYPTO" = "z1"])
945 AC_SUBST(XMLSEC_NO_MSCRYPTO)
946 AC_SUBST(MSCRYPTO_CFLAGS)
947 AC_SUBST(MSCRYPTO_LIBS)
948 AC_SUBST(MSCRYPTO_CRYPTO_LIB)
950 dnl ==========================================================================
951 dnl Do we have a crypto library?
952 dnl ==========================================================================
953 AC_MSG_CHECKING(for crypto library)
954 if test "z$XMLSEC_CRYPTO" = "z" ; then
955 AC_MSG_ERROR(At least one crypto library should exist for $XMLSEC_PACKAGE)
957 AC_MSG_RESULT(yes ('$XMLSEC_CRYPTO'))
960 dnl ==========================================================================
961 dnl See do we need MD5 suport
962 dnl ==========================================================================
963 AC_MSG_CHECKING(for MD5 support)
964 AC_ARG_ENABLE(md5, [ --enable-md5 enable MD5 support (yes)])
965 if test "z$enable_md5" = "zno" ; then
966 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_MD5=1"
973 AM_CONDITIONAL(XMLSEC_NO_MD5, test "z$XMLSEC_NO_MD5" = "z1")
974 AC_SUBST(XMLSEC_NO_MD5)
976 dnl ==========================================================================
977 dnl See do we need RIPEMD-160 suport
978 dnl ==========================================================================
979 AC_MSG_CHECKING(for RIPEMD-160 support)
980 AC_ARG_ENABLE(ripemd160, [ --enable-ripemd160 enable RIPEMD-160 support (yes)])
981 if test "z$enable_ripemd160" = "zno" ; then
982 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_RIPEMD160=1"
983 XMLSEC_NO_RIPEMD160="1"
986 XMLSEC_NO_RIPEMD160="0"
989 AM_CONDITIONAL(XMLSEC_NO_RIPEMD160, test "z$XMLSEC_NO_RIPEMD160" = "z1")
990 AC_SUBST(XMLSEC_NO_RIPEMD160)
992 dnl ==========================================================================
993 dnl See do we need SHA1 suport
994 dnl ==========================================================================
995 AC_MSG_CHECKING(for SHA1 support)
996 AC_ARG_ENABLE(sha1, [ --enable-sha1 enable SHA1 support (yes)])
997 if test "z$enable_sha1" = "zno" ; then
998 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA1=1"
1005 AM_CONDITIONAL(XMLSEC_NO_SHA1, test "z$XMLSEC_NO_SHA1" = "z1")
1006 AC_SUBST(XMLSEC_NO_SHA1)
1008 dnl ==========================================================================
1009 dnl See do we need SHA224 suport
1010 dnl ==========================================================================
1011 AC_MSG_CHECKING(for SHA224 support)
1012 AC_ARG_ENABLE(sha224, [ --enable-sha224 enable SHA224 support (yes)])
1013 if test "z$enable_sha224" = "zno" ; then
1014 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA224=1"
1015 XMLSEC_NO_SHA224="1"
1018 XMLSEC_NO_SHA224="0"
1021 AM_CONDITIONAL(XMLSEC_NO_SHA224, test "z$XMLSEC_NO_SHA224" = "z1")
1022 AC_SUBST(XMLSEC_NO_SHA224)
1024 dnl ==========================================================================
1025 dnl See do we need SHA256 suport
1026 dnl ==========================================================================
1027 AC_MSG_CHECKING(for SHA256 support)
1028 AC_ARG_ENABLE(sha256, [ --enable-sha256 enable SHA256 support (yes)])
1029 if test "z$enable_sha256" = "zno" ; then
1030 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA256=1"
1031 XMLSEC_NO_SHA256="1"
1034 XMLSEC_NO_SHA256="0"
1037 AM_CONDITIONAL(XMLSEC_NO_SHA256, test "z$XMLSEC_NO_SHA256" = "z1")
1038 AC_SUBST(XMLSEC_NO_SHA256)
1040 dnl ==========================================================================
1041 dnl See do we need SHA384 suport
1042 dnl ==========================================================================
1043 AC_MSG_CHECKING(for SHA384 support)
1044 AC_ARG_ENABLE(sha384, [ --enable-sha384 enable SHA384 support (yes)])
1045 if test "z$enable_sha384" = "zno" ; then
1046 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA384=1"
1047 XMLSEC_NO_SHA384="1"
1050 XMLSEC_NO_SHA384="0"
1053 AM_CONDITIONAL(XMLSEC_NO_SHA384, test "z$XMLSEC_NO_SHA384" = "z1")
1054 AC_SUBST(XMLSEC_NO_SHA384)
1056 dnl ==========================================================================
1057 dnl See do we need SHA512 suport
1058 dnl ==========================================================================
1059 AC_MSG_CHECKING(for SHA512 support)
1060 AC_ARG_ENABLE(sha512, [ --enable-sha512 enable SHA512 support (yes)])
1061 if test "z$enable_sha512" = "zno" ; then
1062 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SHA512=1"
1063 XMLSEC_NO_SHA512="1"
1066 XMLSEC_NO_SHA512="0"
1069 AM_CONDITIONAL(XMLSEC_NO_SHA512, test "z$XMLSEC_NO_SHA512" = "z1")
1070 AC_SUBST(XMLSEC_NO_SHA512)
1073 dnl ==========================================================================
1074 dnl See do we need HMAC suport
1075 dnl ==========================================================================
1076 AC_MSG_CHECKING(for HMAC support)
1077 AC_ARG_ENABLE(hmac, [ --enable-hmac enable HMAC support (yes)])
1078 if test "z$enable_hmac" = "zno" ; then
1079 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_HMAC=1"
1086 AM_CONDITIONAL(XMLSEC_NO_HMAC, test "z$XMLSEC_NO_HMAC" = "z1")
1087 AC_SUBST(XMLSEC_NO_HMAC)
1089 dnl ==========================================================================
1090 dnl See do we need DSA suport
1091 dnl ==========================================================================
1092 AC_MSG_CHECKING(for DSA support)
1093 AC_ARG_ENABLE(dsa, [ --enable-dsa enable DSA support (yes)])
1094 if test "z$enable_dsa" = "zno" ; then
1095 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_DSA=1"
1102 AM_CONDITIONAL(XMLSEC_NO_DSA, test "z$XMLSEC_NO_DSA" = "z1")
1103 AC_SUBST(XMLSEC_NO_DSA)
1105 dnl ==========================================================================
1106 dnl See do we need RSA suport
1107 dnl ==========================================================================
1108 AC_MSG_CHECKING(for RSA support)
1109 AC_ARG_ENABLE(rsa, [ --enable-rsa enable RSA support (yes)])
1110 if test "z$enable_rsa" = "zno" ; then
1111 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_RSA=1"
1118 AM_CONDITIONAL(XMLSEC_NO_RSA, test "z$XMLSEC_NO_RSA" = "z1")
1119 AC_SUBST(XMLSEC_NO_RSA)
1121 dnl ==========================================================================
1122 dnl See do we need x509 suport
1123 dnl ==========================================================================
1124 AC_MSG_CHECKING(for x509 support)
1125 AC_ARG_ENABLE(x509, [ --enable-x509 enable x509 support (yes)])
1126 if test "z$enable_x509" = "zno" ; then
1127 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_X509=1"
1134 AM_CONDITIONAL(XMLSEC_NO_X509, test "z$XMLSEC_NO_X509" = "z1")
1135 AC_SUBST(XMLSEC_NO_X509)
1137 dnl ==========================================================================
1138 dnl See do we need DES suport
1139 dnl ==========================================================================
1140 AC_MSG_CHECKING(for DES support)
1141 AC_ARG_ENABLE(des, [ --enable-des enable DES support (yes)])
1142 if test "z$enable_des" = "zno" ; then
1143 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_DES=1"
1150 AM_CONDITIONAL(XMLSEC_NO_DES, test "z$XMLSEC_NO_DES" = "z1")
1151 AC_SUBST(XMLSEC_NO_DES)
1153 dnl ==========================================================================
1154 dnl See do we need AES suport
1155 dnl ==========================================================================
1156 AC_MSG_CHECKING(for AES support)
1157 AC_ARG_ENABLE(aes, [ --enable-aes enable AES support (OpenSSL >= 0.9.7 is required)])
1158 if test "z$enable_aes" = "zno" ; then
1159 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_AES=1"
1166 AM_CONDITIONAL(XMLSEC_NO_AES, test "z$XMLSEC_NO_AES" = "z1")
1167 AC_SUBST(XMLSEC_NO_AES)
1169 dnl ==========================================================================
1170 dnl See do we need GOST suport
1171 dnl ==========================================================================
1172 AC_MSG_CHECKING(for GOST support)
1173 AC_ARG_ENABLE(gost, [ --enable-gost enable GOST support (no)])
1174 if test "z$enable_gost" != "zyes" ; then
1175 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_GOST=1"
1182 AM_CONDITIONAL(XMLSEC_NO_GOST, test "z$XMLSEC_NO_GOST" = "z1")
1183 AC_SUBST(XMLSEC_NO_GOST)
1185 dnl ==========================================================================
1186 dnl See do we need XMLDSig suport
1187 dnl ==========================================================================
1188 AC_MSG_CHECKING(for XMLDSig support)
1189 AC_ARG_ENABLE(xmldsig, [ --enable-xmldsig enable XMLDSig support (yes)])
1190 if test "z$enable_xmldsig" = "zno" ; then
1191 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XMLDSIG=1"
1192 XMLSEC_NO_XMLDSIG="1"
1195 XMLSEC_NO_XMLDSIG="0"
1198 AM_CONDITIONAL(XMLSEC_NO_XMLDSIG, test "z$XMLSEC_NO_XMLDSIG" = "z1")
1199 AC_SUBST(XMLSEC_NO_XMLDSIG)
1201 dnl ==========================================================================
1202 dnl See do we need XMLEnc suport
1203 dnl ==========================================================================
1204 AC_MSG_CHECKING(for XMLEnc support)
1205 AC_ARG_ENABLE(xmlenc, [ --enable-xmlenc enable XMLEnc support (yes)])
1206 if test "z$enable_xmlenc" = "zno" ; then
1207 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XMLENC=1"
1208 XMLSEC_NO_XMLENC="1"
1211 XMLSEC_NO_XMLENC="0"
1214 AM_CONDITIONAL(XMLSEC_NO_XMLENC, test "z$XMLSEC_NO_XMLENC" = "z1")
1215 AC_SUBST(XMLSEC_NO_XMLENC)
1217 dnl ==========================================================================
1218 dnl See do we need XKMS suport
1219 dnl ==========================================================================
1220 AC_MSG_CHECKING(for XMKMS support - under development, not stable yet)
1221 AC_ARG_ENABLE(xkms, [ --enable-xkms enable XKMS support - under development (no)])
1222 if test "z$enable_xkms" = "zyes" ; then
1226 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XKMS=1"
1230 AM_CONDITIONAL(XMLSEC_NO_XKMS, test "z$XMLSEC_NO_XKMS" = "z1")
1231 AC_SUBST(XMLSEC_NO_XKMS)
1233 dnl ==========================================================================
1234 dnl check if we need dynamic loading support
1235 dnl ==========================================================================
1236 XMLSEC_DL_INCLUDES=""
1238 AC_MSG_CHECKING(for xmlsec-crypto dynamic loading support)
1239 AC_ARG_ENABLE(crypto_dl, [ --enable-crypto-dl enable dynamic loading support for xmlsec-crypto libraries (yes)])
1240 if test "z$enable_crypto_dl" = "zno" ; then
1241 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1"
1242 XMLSEC_NO_CRYPTO_DYNAMIC_LOADING="1"
1245 AC_CHECK_HEADER([ltdl.h],
1247 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_DL_LIBLTDL=1",
1257 if test "z$LIBLTDL" != "z" ; then
1258 XMLSEC_DL_INCLUDES="$INCLTDL"
1259 XMLSEC_DL_LIBS="$LIBLTDL"
1260 XMLSEC_NO_CRYPTO_DYNAMIC_LOADING="0"
1263 AC_MSG_ERROR([libltdl is required for xmlsec-crypto dynamic loading])
1266 AM_CONDITIONAL(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING, test "z$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING" = "z1")
1267 AC_SUBST(XMLSEC_NO_CRYPTO_DYNAMIC_LOADING)
1268 AC_SUBST(XMLSEC_DL_INCLUDES)
1269 AC_SUBST(XMLSEC_DL_LIBS)
1271 dnl ==========================================================================
1272 dnl check if we need dynamic loading in the xmlsec apps
1273 dnl ==========================================================================
1274 AC_MSG_CHECKING(for xmlsec-crypto dynamic loading support in command line tool)
1275 AC_ARG_ENABLE(apps_crypto_dl, [ --enable-apps-crypto-dl enable dynamic loading support for xmlsec-crypto libraries in xmlsec command line tool (yes)])
1276 if test "z$enable_apps_crypto_dl" = "z" ; then
1277 enable_apps_crypto_dl="$enable_crypto_dl"
1279 if test "z$enable_apps_crypto_dl" = "zno" ; then
1280 XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING="1"
1282 elif test "z$enable_crypto_dl" = "zno" ; then
1284 AC_MSG_ERROR(xmlsec-crypto libraries dynamic loading support in xmlsec command line tool is requested but no dynamic loading in xmlsec itself is disabled)
1286 XMLSEC_APP_DEFINES="$XMLSEC_APP_DEFINES -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1"
1287 XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING="0"
1290 AM_CONDITIONAL(XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING,
1291 test "z$XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING" = "z1")
1292 AC_SUBST(XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING)
1294 dnl ==========================================================================
1295 dnl Where do we want to install docs
1296 dnl ==========================================================================
1297 AC_MSG_CHECKING(for docs folder)
1298 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
1299 if test "z$with_html_dir" != "z" ; then
1300 XMLSEC_DOCDIR=$with_html_dir
1302 XMLSEC_DOCDIR='$(datadir)/doc/xmlsec1'
1305 AC_MSG_RESULT($XMLSEC_DOCDIR)
1306 AC_SUBST(XMLSEC_DOCDIR)
1308 dnl ==========================================================================
1309 dnl See do we need Simple Keys Manager
1310 dnl ==========================================================================
1311 AC_MSG_CHECKING(for Simple Keys Manager testing)
1312 AC_ARG_ENABLE(skm, [ --enable-skm enable Simple Keys Manager testing (yes)])
1313 if test "z$enable_skm" = "zno" ; then
1314 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_SKM_TEST=1"
1320 dnl ==========================================================================
1321 dnl See do we need templates tests
1322 dnl ==========================================================================
1323 AC_MSG_CHECKING(for templates testing)
1324 AC_ARG_ENABLE(tmpl_tests, [ --enable-tmpl-tests enable templates testing in xmlsec utility (yes)])
1325 if test "z$enable_tmpl_tests" = "zyes" ; then
1326 XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_TMPL_TEST=1"
1332 dnl ==========================================================================
1334 dnl ==========================================================================
1335 AC_MSG_CHECKING(for debuging)
1336 AC_ARG_ENABLE(debuging, [ --enable-debuging enable debuging compilation flags (no)])
1337 if test "z$enable_debuging" = "zyes" ; then
1344 dnl ==========================================================================
1346 dnl ==========================================================================
1347 AC_MSG_CHECKING(for profiling)
1348 AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling compilation flags (no)])
1349 if test "z$enable_profiling" = "zyes" ; then
1350 CFLAGS="$CFLAGS -pg"
1356 dnl ==========================================================================
1357 dnl Pedantic compilation
1358 dnl ==========================================================================
1359 AC_MSG_CHECKING(for pedantic)
1360 AC_ARG_ENABLE(pedantic, [ --enable-pedantic enable pedantic compilation flags (no)])
1361 if test "z$enable_pedantic" = "zyes" ; then
1362 dnl CFLAGS="$CFLAGS -pedantic -Wall -ansi -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 -Wredundant-decls"
1363 CFLAGS="$CFLAGS -O -pedantic -Wall -ansi -fno-inline -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
1369 dnl ==========================================================================
1371 dnl ==========================================================================
1372 XMLSEC_STATIC_BINARIES=""
1373 AC_MSG_CHECKING(for static linking)
1374 AC_ARG_ENABLE(static_linking, [ --enable-static-linking enable static linking (no)])
1375 if test "z$enable_static_linking" = "zyes" ; then
1376 XMLSEC_STATIC_BINARIES="-static"
1381 AC_SUBST(XMLSEC_STATIC_BINARIES)
1383 dnl ==========================================================================
1384 dnl Final steps: xmlsec config
1385 dnl ==========================================================================
1386 XMLSEC_CORE_CFLAGS="$XMLSEC_DEFINES -I${includedir}/xmlsec1 $XMLSEC_DL_INCLUDES"
1387 XMLSEC_CORE_LIBS="-lxmlsec1 $XMLSEC_DL_LIBS "
1388 AC_SUBST(XMLSEC_CORE_CFLAGS)
1389 AC_SUBST(XMLSEC_CORE_LIBS)
1391 dnl used in xmlsecConf.sh*
1392 XMLSEC_LIBDIR="${libdir}"
1393 AC_SUBST(XMLSEC_LIBDIR)
1395 XMLSEC_OPENSSL_CFLAGS="$XMLSEC_CORE_CFLAGS $OPENSSL_CFLAGS"
1396 XMLSEC_OPENSSL_LIBS="-L${libdir} -l$OPENSSL_CRYPTO_LIB $XMLSEC_CORE_LIBS $OPENSSL_LIBS"
1397 AC_SUBST(XMLSEC_OPENSSL_CFLAGS)
1398 AC_SUBST(XMLSEC_OPENSSL_LIBS)
1400 XMLSEC_GNUTLS_CFLAGS="$XMLSEC_CORE_CFLAGS $GNUTLS_CFLAGS"
1401 XMLSEC_GNUTLS_LIBS="-L${libdir} -l$GNUTLS_CRYPTO_LIB $XMLSEC_CORE_LIBS $GNUTLS_LIBS"
1402 AC_SUBST(XMLSEC_GNUTLS_CFLAGS)
1403 AC_SUBST(XMLSEC_GNUTLS_LIBS)
1405 XMLSEC_NSS_CFLAGS="$XMLSEC_CORE_CFLAGS $NSS_CFLAGS"
1406 XMLSEC_NSS_LIBS="-L${libdir} -l$NSS_CRYPTO_LIB $XMLSEC_CORE_LIBS $NSS_LIBS"
1407 AC_SUBST(XMLSEC_NSS_CFLAGS)
1408 AC_SUBST(XMLSEC_NSS_LIBS)
1410 dnl No we will not generate pkg-config file for mscrypto !
1411 dnl XMLSEC_MSCRYPTO_CFLAGS="$XMLSEC_CORE_CFLAGS $MSCRYPTO_CFLAGS"
1412 dnl XMLSEC_MSCRYPTO_LIBS="-L${libdir} -l$MSCRYPTO_CRYPTO_LIB $XMLSEC_CORE_LIBS $MSCRYPTO_LIBS";;
1413 dnl AC_SUBST(XMLSEC_MSCRYPTO_CFLAGS)
1414 dnl AC_SUBST(XMLSEC_MSCRYPTO_LIBS)
1416 XMLSEC_CFLAGS="$XMLSEC_CORE_CFLAGS $LIBXML_CFLAGS $LIBXSLT_CFLAGS $XMLSEC_CRYPTO_CFLAGS"
1417 XMLSEC_LIBS="-L${libdir} -l$XMLSEC_CRYPTO_LIB $XMLSEC_CORE_LIBS $LIBXML_LIBS $LIBXSLT_LIBS $XMLSEC_CRYPTO_LIBS"
1418 AC_SUBST(XMLSEC_CFLAGS)
1419 AC_SUBST(XMLSEC_LIBS)
1421 AC_SUBST(XMLSEC_DEFINES)
1422 AC_SUBST(XMLSEC_APP_DEFINES)
1426 AC_SUBST(XMLSEC_EXTRA_LDFLAGS)
1427 AC_SUBST(XMLSEC_CRYPTO_EXTRA_LDFLAGS)
1429 AC_SUBST(XMLSEC_CRYPTO)
1430 AC_SUBST(XMLSEC_CRYPTO_LIST)
1431 AC_SUBST(XMLSEC_CRYPTO_DISABLED_LIST)
1432 AC_SUBST(XMLSEC_CRYPTO_LIB)
1433 AC_SUBST(XMLSEC_CRYPTO_CFLAGS)
1434 AC_SUBST(XMLSEC_CRYPTO_LIBS)
1436 XMLSEC_CRYPTO_PC_FILES_LIST=""
1437 for i in $XMLSEC_CRYPTO_LIST ; do
1438 dnl skip pkg-config file for mscrypto
1439 test x$i = xmscrypto && continue
1440 XMLSEC_CRYPTO_PC_FILES_LIST="$XMLSEC_CRYPTO_PC_FILES_LIST $XMLSEC_PACKAGE-$i.pc"
1442 AC_SUBST(XMLSEC_CRYPTO_PC_FILES_LIST)
1444 dnl ==========================================================================
1445 dnl Writing result files
1446 dnl ==========================================================================
1447 if test "z$XMLSEC_NO_OPENSSL" != "z1" ; then
1448 AC_CONFIG_FILES([include/xmlsec/openssl/Makefile src/openssl/Makefile])
1451 if test "z$XMLSEC_NO_GNUTLS" != "z1" ; then
1452 AC_CONFIG_FILES([include/xmlsec/gnutls/Makefile src/gnutls/Makefile])
1455 if test "z$XMLSEC_NO_NSS" != "z1" ; then
1456 AC_CONFIG_FILES([include/xmlsec/nss/Makefile src/nss/Makefile])
1459 if test "z$XMLSEC_NO_MSCRYPTO" != "z1" ; then
1460 AC_CONFIG_FILES([include/xmlsec/mscrypto/Makefile src/mscrypto/Makefile])
1463 if test "z$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING" = "z1" ; then
1464 (rm -f xmlsec1.pc && $LN_S xmlsec1-$XMLSEC_CRYPTO.pc xmlsec1.pc)
1466 AC_CONFIG_FILES([xmlsec1.pc:xmlsec.pc.in])
1470 include/xmlsec/version.h
1473 include/xmlsec/Makefile
1474 include/xmlsec/private/Makefile
1481 xmlsec1Conf.sh:xmlsecConf.sh.in
1482 xmlsec1-config:xmlsec-config.in
1483 xmlsec1-openssl.pc:xmlsec-openssl.pc.in
1484 xmlsec1-gnutls.pc:xmlsec-gnutls.pc.in
1485 xmlsec1-nss.pc:xmlsec-nss.pc.in
1486 xmlsec1.spec:xmlsec.spec.in
1491 dnl COPYING should be in "srcdir" not in "builddir"
1492 (cd $srcdir && rm -f COPYING.LIB COPYING && $LN_S Copyright COPYING)