diff options
author | Simon Josefsson <simon@josefsson.org> | 2008-11-12 13:15:36 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2008-11-12 13:15:36 +0100 |
commit | 6e86a54e3f6ce7ba6e53e223f3794ae41a7451e1 (patch) | |
tree | 3d5d146710b0d90165239711cd159ec45936e20a | |
parent | b561b18899c430b792854f4cdc0bc3e55ca92e01 (diff) | |
download | gnutls-6e86a54e3f6ce7ba6e53e223f3794ae41a7451e1.tar.gz |
Use external m4 files for shared tests.
-rw-r--r-- | configure.ac | 125 | ||||
-rw-r--r-- | lib/configure.ac | 22 | ||||
-rw-r--r-- | lib/m4/hooks.m4 | 15 | ||||
-rw-r--r-- | lib/m4/linker-script.m4 | 29 | ||||
-rw-r--r-- | libextra/configure.ac | 8 | ||||
-rw-r--r-- | m4/valgrind.m4 | 30 |
6 files changed, 123 insertions, 106 deletions
diff --git a/configure.ac b/configure.ac index 0b48e9a5b3..b335c63434 100644 --- a/configure.ac +++ b/configure.ac @@ -54,11 +54,6 @@ if test "x$GAA" = "x"; then fi AM_CONDITIONAL(HAVE_GCC, test "x$GCC" = "xyes") - -AC_MSG_RESULT([*** -*** Detecting compiler options... -]) - gl_EARLY AC_C_INLINE @@ -110,10 +105,6 @@ fi AM_CONDITIONAL([HAVE_GCC_GNU89_INLINE_OPTION], [test "$_gcc_gnu89_inline" = "yes"]) -AC_MSG_RESULT([*** -*** Detecting C library capabilities... -]) - AC_HEADER_STDC AC_CHECK_FUNCS(fork,,) AC_DEFINE([HAVE_STRINGS_H], 1, [Hard-code for src/cfg/.]) @@ -126,37 +117,13 @@ AC_DEFINE([HAVE_ERRNO_H], 1, [Hard-code for src/cfg/.]) # No fork on MinGW, disable some self-tests until we fix them. AM_CONDITIONAL(HAVE_FORK, test "$ac_cv_func_fork" != "no") -AC_MSG_RESULT([*** -*** Detecting system's parameters... -]) - -# Run self-tests under valgrind? -if test "$cross_compiling" = no; then - AC_CHECK_PROGS(VALGRIND, valgrind) -fi -if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then - opt_valgrind_tests=yes -else - opt_valgrind_tests=no - VALGRIND= -fi -AC_MSG_CHECKING([whether self tests are run under valgrind]) -AC_ARG_ENABLE(valgrind-tests, - AS_HELP_STRING([--enable-valgrind-tests], - [run self tests under valgrind]), - opt_valgrind_tests=$enableval) -AC_MSG_RESULT($opt_valgrind_tests) +sj_VALGRIND AC_CHECK_TYPES(uint,,, [ # include <sys/types.h> ]) -AC_MSG_RESULT([*** -*** Checking for external libraries... -]) - # For Guile bindings. - opt_guile_bindings=yes AC_MSG_CHECKING([whether building Guile bindings]) AC_ARG_ENABLE(guile, @@ -242,55 +209,59 @@ LIBS=$SAVED_LIBS AC_MSG_CHECKING([whether to use the included libcfg]) AC_MSG_RESULT($libcfg_enabled) -AC_MSG_RESULT([*** -*** Setting up gnulib compatibility files... -]) -gl_INIT - -AC_MSG_RESULT([*** -*** Detecting options for shared libraries... -]) AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL +gl_INIT + AC_CONFIG_SUBDIRS([lib]) AC_CONFIG_SUBDIRS([libextra]) -AC_CONFIG_FILES([ \ - Makefile \ - doc/Makefile \ - doc/examples/Makefile \ - doc/cyclo/Makefile \ - doc/scripts/Makefile \ - doc/manpages/Makefile \ - doc/reference/Makefile \ - doc/doxygen/Doxyfile \ - doc/credentials/Makefile \ - doc/credentials/x509/Makefile \ - doc/credentials/srp/Makefile \ - doc/credentials/openpgp/Makefile \ - gl/Makefile \ - gl/tests/Makefile \ - tests/Makefile \ - tests/rsa-md5-collision/Makefile \ - tests/userid/Makefile \ - tests/pkcs1-padding/Makefile \ - tests/pkcs8-decode/Makefile \ - tests/pkcs12-decode/Makefile \ - tests/pathlen/Makefile \ - tests/key-id/Makefile \ - tests/sha2/Makefile \ - tests/openpgp-certs/Makefile \ - src/Makefile \ - src/cfg/Makefile \ - src/cfg/platon/Makefile \ - src/cfg/platon/str/Makefile \ - guile/Makefile \ - guile/modules/Makefile \ - guile/src/Makefile \ - guile/tests/Makefile \ +AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile]) +AC_CONFIG_FILES([ + Makefile + doc/Makefile + doc/credentials/Makefile + doc/credentials/openpgp/Makefile + doc/credentials/srp/Makefile + doc/credentials/x509/Makefile + doc/cyclo/Makefile + doc/doxygen/Doxyfile + doc/examples/Makefile + doc/manpages/Makefile + doc/reference/Makefile + doc/scripts/Makefile + gl/Makefile + gl/tests/Makefile + guile/Makefile + guile/modules/Makefile + guile/src/Makefile + guile/tests/Makefile + src/Makefile + src/cfg/Makefile + src/cfg/platon/Makefile + src/cfg/platon/str/Makefile + tests/Makefile + tests/key-id/Makefile + tests/openpgp-certs/Makefile + tests/pathlen/Makefile + tests/pkcs1-padding/Makefile + tests/pkcs12-decode/Makefile + tests/pkcs8-decode/Makefile + tests/rsa-md5-collision/Makefile + tests/sha2/Makefile + tests/userid/Makefile ]) +AC_OUTPUT -AC_CONFIG_FILES([guile/pre-inst-guile], [chmod +x guile/pre-inst-guile]) +AC_MSG_NOTICE([summary of build options: -AC_OUTPUT + version: ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE + Host type: ${host} + Install prefix: ${prefix} + Compiler: ${CC} + Compiler flags: ${CFLAGS} + Library types: Shared=${enable_shared}, Static=${enable_static} + Valgrind: ${VALGRIND} + Linker script: $have_ld_version_script +]) diff --git a/lib/configure.ac b/lib/configure.ac index 94bf98dfea..1c23e1181d 100644 --- a/lib/configure.ac +++ b/lib/configure.ac @@ -86,17 +86,17 @@ LIBGNUTLS_CFLAGS="-I${includedir}" AC_SUBST(LIBGNUTLS_LIBS) AC_SUBST(LIBGNUTLS_CFLAGS) -AC_CONFIG_FILES([ \ - Makefile \ +AC_CONFIG_FILES([ + Makefile + gnutls.pc + gl/Makefile + gl/tests/Makefile includes/Makefile - includes/gnutls/gnutls.h \ - minitasn1/Makefile \ - x509/Makefile \ - openpgp/Makefile \ - opencdk/Makefile \ - po/Makefile.in \ - gnutls.pc \ - gl/Makefile \ - gl/tests/Makefile \ + includes/gnutls/gnutls.h + minitasn1/Makefile + opencdk/Makefile + openpgp/Makefile + po/Makefile.in + x509/Makefile ]) AC_OUTPUT diff --git a/lib/m4/hooks.m4 b/lib/m4/hooks.m4 index a0053efdd9..4c43d69ca1 100644 --- a/lib/m4/hooks.m4 +++ b/lib/m4/hooks.m4 @@ -243,20 +243,7 @@ AC_DEFUN([LIBGNUTLS_HOOKS], fi AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes") - AC_ARG_ENABLE([ld-version-script], - AS_HELP_STRING([--enable-ld-version-script], - [enable/disable linker version script (default is enabled when possible)]), - [have_ld_version_script=$enableval], []) - if test -z "$have_ld_version_script"; then - AC_MSG_CHECKING([if -Wl,--version-script works]) - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/lib/libtasn1.vers" - AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), - [have_ld_version_script=yes], [have_ld_version_script=no]) - LDFLAGS="$save_LDFLAGS" - AC_MSG_RESULT($have_ld_version_script) - fi - AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") + sj_LINKER_SCRIPT # For storing integers in pointers without warnings # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc diff --git a/lib/m4/linker-script.m4 b/lib/m4/linker-script.m4 new file mode 100644 index 0000000000..edf04698ed --- /dev/null +++ b/lib/m4/linker-script.m4 @@ -0,0 +1,29 @@ +# linker-script.m4 serial 1 +dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# sj_LINKER_SCRIPT() +# ------------- +# Check if ld supports linker scripts, and define automake conditional +# HAVE_LD_VERSION_SCRIPT if so. +AC_DEFUN([sj_LINKER_SCRIPT], +[ + AC_ARG_ENABLE([ld-version-script], + AS_HELP_STRING([--enable-ld-version-script], + [enable/disable linker version script (default is enabled when possible)]), + [have_ld_version_script=$enableval], []) + if test -z "$have_ld_version_script"; then + AC_MSG_CHECKING([if -Wl,--version-script works]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/lib/libtasn1.vers" + AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), + [have_ld_version_script=yes], [have_ld_version_script=no]) + LDFLAGS="$save_LDFLAGS" + AC_MSG_RESULT($have_ld_version_script) + fi + AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") +]) diff --git a/libextra/configure.ac b/libextra/configure.ac index f051782068..f47cc914a9 100644 --- a/libextra/configure.ac +++ b/libextra/configure.ac @@ -45,10 +45,10 @@ LIBGNUTLS_EXTRA_CFLAGS="-I${includedir}" AC_SUBST(LIBGNUTLS_EXTRA_LIBS) AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) -AC_CONFIG_FILES([ \ - Makefile \ +AC_CONFIG_FILES([ + Makefile + gnutls-extra.pc + gl/Makefile includes/Makefile - gl/Makefile \ - gnutls-extra.pc \ ]) AC_OUTPUT diff --git a/m4/valgrind.m4 b/m4/valgrind.m4 new file mode 100644 index 0000000000..0cd106abeb --- /dev/null +++ b/m4/valgrind.m4 @@ -0,0 +1,30 @@ +# valgrind.m4 serial 1 +dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# sj_VALGRIND() +# ------------- +# Check if valgrind is available, and set VALGRIND to it if available. +AC_DEFUN([sj_VALGRIND], +[ + # Run self-tests under valgrind? + if test "$cross_compiling" = no; then + AC_CHECK_PROGS(VALGRIND, valgrind) + fi + if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then + opt_valgrind_tests=yes + else + opt_valgrind_tests=no + VALGRIND= + fi + AC_MSG_CHECKING([whether self tests are run under valgrind]) + AC_ARG_ENABLE(valgrind-tests, + AS_HELP_STRING([--enable-valgrind-tests], + [run self tests under valgrind]), + opt_valgrind_tests=$enableval) + AC_MSG_RESULT($opt_valgrind_tests) +]) |