From 704829cbd56acbf22e7c6510af24f7e1a8cc65b0 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Tue, 7 Jun 2016 01:57:00 -0700 Subject: [PATCH] Make Iconv optional, controlled by --enable-iconv; set package url & bugreport fields; detect OSX crypto lib (for hashes) but don't actually use it yet. --- config.h.in | 3 +++ configure | 65 +++++++++++++++++++++++++++++++++++++++++----------- configure.ac | 28 ++++++++++++++-------- 3 files changed, 74 insertions(+), 22 deletions(-) diff --git a/config.h.in b/config.h.in index eb24d0e..5647ef6 100644 --- a/config.h.in +++ b/config.h.in @@ -12,6 +12,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_BITS_SIGNUM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_COMMONCRYPTO_COMMONDIGEST_H + /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H diff --git a/configure b/configure index 287699a..121ac29 100755 --- a/configure +++ b/configure @@ -2,6 +2,8 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for tripwire 2.4.3.2. # +# Report bugs to . +# # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # @@ -264,10 +266,12 @@ fi $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: https://github.com/Tripwire/tripwire-open-source/issues +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." fi exit 1 fi @@ -579,8 +583,8 @@ PACKAGE_NAME='tripwire' PACKAGE_TARNAME='tripwire' PACKAGE_VERSION='2.4.3.2' PACKAGE_STRING='tripwire 2.4.3.2' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' +PACKAGE_BUGREPORT='https://github.com/Tripwire/tripwire-open-source/issues' +PACKAGE_URL='https://github.com/Tripwire/tripwire-open-source' ac_unique_file="src/tw/tw.cpp" # Factoring default headers for most tests. @@ -742,6 +746,7 @@ enable_silent_rules enable_static enable_debug enable_dependency_tracking +enable_iconv enable_openssl with_ssl_dir ' @@ -1387,6 +1392,7 @@ Optional Features: do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build + --enable-iconv Use iconv for locale-independent report and db files --disable-openssl don't link against OpenSSL libraries Optional Packages: @@ -1416,7 +1422,8 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to the package provider. +Report bugs to . +tripwire home page: . _ACEOF ac_status=$? fi @@ -1718,6 +1725,10 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------------------------------------------- ## +## Report this to https://github.com/Tripwire/tripwire-open-source/issues ## +## ---------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 @@ -2223,6 +2234,10 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------------------------------------------- ## +## Report this to https://github.com/Tripwire/tripwire-open-source/issues ## +## ---------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 @@ -6160,6 +6175,19 @@ fi done +for ac_header in CommonCrypto/CommonDigest.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "CommonCrypto/CommonDigest.h" "ac_cv_header_CommonCrypto_CommonDigest_h" "$ac_includes_default" +if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_COMMONCRYPTO_COMMONDIGEST_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lc" >&5 $as_echo_n "checking for socket in -lc... " >&6; } @@ -6376,7 +6404,16 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -lc" >&5 + +# Check whether --enable-iconv was given. +if test "${enable_iconv+set}" = set; then : + enableval=$enable_iconv; +fi + + +if test "x${enable_iconv}" = xyes +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -lc" >&5 $as_echo_n "checking for iconv in -lc... " >&6; } if ${ac_cv_lib_c_iconv+:} false; then : $as_echo_n "(cached) " >&6 @@ -6414,7 +6451,7 @@ fi $as_echo "$ac_cv_lib_c_iconv" >&6; } if test "x$ac_cv_lib_c_iconv" = xyes; then : - for ac_header in iconv.h + for ac_header in iconv.h do : ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" if test "x$ac_cv_header_iconv_h" = xyes; then : @@ -6429,7 +6466,7 @@ done else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 $as_echo_n "checking for iconv in -liconv... " >&6; } if ${ac_cv_lib_iconv_iconv+:} false; then : $as_echo_n "(cached) " >&6 @@ -6467,8 +6504,8 @@ fi $as_echo "$ac_cv_lib_iconv_iconv" >&6; } if test "x$ac_cv_lib_iconv_iconv" = xyes; then : - LIBS="-liconv $LIBS" - for ac_header in iconv.h + LIBS="-liconv $LIBS" + for ac_header in iconv.h do : ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" if test "x$ac_cv_header_iconv_h" = xyes; then : @@ -6487,6 +6524,7 @@ fi fi +fi ac_ext=cpp @@ -7686,7 +7724,8 @@ $config_headers Configuration commands: $config_commands -Report bugs to the package provider." +Report bugs to . +tripwire home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 diff --git a/configure.ac b/configure.ac index 7ea5001..685da27 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl dnl -AC_INIT([tripwire], [2.4.3.2]) +AC_INIT([tripwire], [2.4.3.2], [https://github.com/Tripwire/tripwire-open-source/issues], [tripwire], [https://github.com/Tripwire/tripwire-open-source]) AC_CONFIG_SRCDIR([src/tw/tw.cpp]) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE @@ -109,6 +109,9 @@ AC_CHECK_FUNCS(mkstemp mktemp, break) dnl check for posix_fadvise AC_CHECK_HEADERS(fcntl.h, [AC_CHECK_FUNCS(posix_fadvise)]) +dnl check for OSX builtin hash algorithms +AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h) + dnl ############################################## dnl Checks for various platform specific libraries dnl ############################################## @@ -127,14 +130,21 @@ AC_CHECK_LIB(c, gethostbyname, [:], [ AC_CHECK_LIB(network, gethostbyname, [LIBS="-lnetwork $LIBS"] [:]) ]) ]) -dnl iconv? check the usual locations -AC_CHECK_LIB(c, iconv, [ - AC_CHECK_HEADERS(iconv.h) - ], [ - AC_CHECK_LIB(iconv, iconv, [ - LIBS="-liconv $LIBS" - AC_CHECK_HEADERS(iconv.h) - ], [:]) ]) + +AC_ARG_ENABLE(iconv, + [ --enable-iconv Use iconv for locale-independent report and db files]) + +if test "x${enable_iconv}" = xyes +then + dnl iconv? check the usual locations + AC_CHECK_LIB(c, iconv, [ + AC_CHECK_HEADERS(iconv.h) + ], [ + AC_CHECK_LIB(iconv, iconv, [ + LIBS="-liconv $LIBS" + AC_CHECK_HEADERS(iconv.h) + ], [:]) ]) +fi dnl check for stl library AC_LANG_SAVE