bincimap

Log | Files | Refs | LICENSE

commit 6daa2941e618da66167a67e655bde68f4f98547f
parent b1bf97ef6f70b67fba8e401b4153fca44864b8bc
Author: andreaha <andreaha@b31fe1f4-c0d1-0310-8000-a34f4ae90293>
Date:   Mon,  2 Feb 2004 19:55:59 +0000

- Fixed bug where --enable-static or --disable-static
  both enabled static compiling.
- Fixed so that the SSL library check links instead of
  just compiling the source.


git-svn-id: file:///home/cwright/convert/bincimap/trunk@16 b31fe1f4-c0d1-0310-8000-a34f4ae90293

Diffstat:
Mconfigure.in | 63++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 52 insertions(+), 11 deletions(-)

diff --git a/configure.in b/configure.in @@ -59,8 +59,12 @@ AC_FUNC_UTIME_NULL AC_FUNC_ERROR_AT_LINE AC_CHECK_FUNCS([alarm dup2 getcwd gethostname gettimeofday memset mkdir putenv regcomp rmdir select setenv strchr strdup strerror strtol utime]) +dnl --------------------------------------------------------------------------- + AC_PREFIX_DEFAULT(/opt/bincimap) +dnl --------------------------------------------------------------------------- + dnl Add /usr/kerberos/include to include path if this path dnl exists. AC_MSG_CHECKING(wether to include /usr/kerberos/include) @@ -73,10 +77,9 @@ fi CXXFLAGS="$CXXFLAGS -Wall -fno-exceptions" -prefix=$(eval echo $(eval echo ${prefix})) -sysconfdir=$(eval echo $(eval echo ${sysconfdir})) -localstatedir=$(eval echo $(eval echo ${localstatedir})) +dnl --------------------------------------------------------------------------- +prefix=$(eval echo $(eval echo ${prefix})) AC_MSG_CHECKING(--prefix) if [[ "x$prefix" = "xNONE" ]]; then AC_MSG_RESULT([unset, defaulting to /opt/bincimap]) @@ -86,6 +89,9 @@ else AC_MSG_RESULT(using $prefix) fi +dnl --------------------------------------------------------------------------- + +sysconfdir=$(eval echo $(eval echo ${sysconfdir})) AC_MSG_CHECKING(--sysconfdir) if [[ "x$sysconfdir" = "xNONE/etc" ]]; then AC_MSG_RESULT([unset, defaulting to /etc/opt/bincimap]) @@ -95,20 +101,46 @@ else AC_MSG_RESULT(using $sysconfdir) fi +dnl --------------------------------------------------------------------------- + +localstatedir=$(eval echo $(eval echo ${localstatedir})) AC_MSG_CHECKING(--localstatedir) if [[ "x$localstatedir" = "xNONE/var" ]]; then - AC_MSG_RESULT([unset, defaulting to /var/opt]) - localstatedir=/var/opt + AC_MSG_RESULT([unset, defaulting to /var/opt/bincimap]) + localstatedir=/var/opt/bincimap AC_SUBST(localstatedir) else AC_MSG_RESULT(using $localstatedir) fi +dnl --------------------------------------------------------------------------- + +datadir=$(eval echo $(eval echo ${datadir})) +AC_MSG_CHECKING(--datadir) +if [[ "x$datadir" = "xNONE/share" ]]; then + AC_MSG_RESULT([unset, defaulting to /var/opt/bincimap]) + datadir=/var/opt/bincimap + AC_SUBST(datadir) +else + AC_MSG_RESULT(using $datadir) +fi + +dnl --------------------------------------------------------------------------- + AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [Enable static compile]), - [STATIC="-static --all-static"], [STATIC=]) + [ if [[ "x$enableval" != "xno" ]]; then STATIC="-static --all-static"; fi ], []) AC_SUBST(STATIC) +AC_MSG_CHECKING(wether to compile static or shared) +if [[ "x$STATIC" = "x" ]]; then + AC_MSG_RESULT(shared) +else + AC_MSG_RESULT(static) +fi + +dnl --------------------------------------------------------------------------- + AC_ARG_WITH(optimization, AC_HELP_STRING([--with-optimization], [Compile with -O2 (default)]) AC_HELP_STRING([--without-optimization], [Compile with -O0]), @@ -124,6 +156,8 @@ else CXXFLAGS="$CXXFLAGS -O0" fi +dnl --------------------------------------------------------------------------- + AC_ARG_WITH(openssl-lib, AC_HELP_STRING([--with-openssl-lib], [Set path to OpenSSL libraries]), [ if [[ "x$withval" != "xno" -a "x$withval" != "xyes" ]]; then LDFLAGS="$LDFLAGS -L$withval"; fi ],) @@ -134,18 +168,20 @@ AC_ARG_WITH(openssl-include, AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl], [Enable SSL support (default)]) - AC_HELP_STRING([--without-ssl], [Disable SSL support]), +AC_HELP_STRING([--without-ssl], [Disable SSL support]), [ if [[ "x$withval" != "xno" ]]; then WITH_SSL=1; fi ], WITH_SSL=1) AC_MSG_CHECKING(for OpenSSL libraries) if [[ "$WITH_SSL" = "1" ]]; then + AC_LANG_CPLUSPLUS + AC_DEFINE(WITH_SSL, 1, [Define to 1 if SSL support is included.]) export LDTMP=$LDFLAGS for k in found /usr/lib /usr/local/lib /usr/local/ssl/lib /usr/local/openssl/lib /opt/ssl/lib /opt/openssl/lib; do export LDFLAGS="-L$k $LDTMP -lssl -lcrypto" - AC_TRY_COMPILE([#include <openssl/ssl.h>], [SSL_write(0, 0, 0);], LIBSSL="-L$k -lssl -lcrypto"; AC_MSG_RESULT($k), []) + AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_write(0, 0, 0);], LIBSSL="-L$k -lssl -lcrypto"; AC_MSG_RESULT($k), []) if [[ "x$LIBSSL" != "x" ]]; then break; fi done @@ -154,18 +190,19 @@ if [[ "$WITH_SSL" = "1" ]]; then AC_MSG_ERROR([Unable to find the ssl library which is part of OpenSSL. You want want to look up the FAQ to learn more about this requirement and how to deal with it. Or run configure with --without-ssl.]) fi - AC_LANG_CPLUSPLUS - AC_MSG_CHECKING(wether OpenSSL headers are included properly) - AC_TRY_COMPILE([#include <openssl/ssl.h>], [], AC_MSG_RESULT([yes]), AC_MSG_ERROR([Unable to include header files for OpenSSL. Check config.log to see what exactly went wrong. With some platforms you need to explicitly add paths to certain header files in CXXFLAGS. For example ./configure CXXFLAGS="$CXXFLAGS -I /usr/kerberos/include".])) AC_LANG_C else AC_MSG_RESULT(no) fi +dnl --------------------------------------------------------------------------- + AC_CHECK_LIB(dl, dlopen, LIBDL=-ldl, LIBDL=) AC_SUBST(LIBDL) AC_SUBST(LIBSSL) +dnl --------------------------------------------------------------------------- + dnl Checks AC_LANG_CPLUSPLUS AC_MSG_CHECKING(whether to include <sstream> or <strstream>) @@ -182,12 +219,16 @@ int i = O_LARGEFILE;], [], AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_OLARGEFILE,, [su AC_LANG_C +dnl --------------------------------------------------------------------------- + AH_TOP(#ifndef config_h_included #define config_h_included ) AH_BOTTOM(#endif ) +dnl --------------------------------------------------------------------------- + AC_OUTPUT([ Makefile conf/Makefile