diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-03-13 05:42:19 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-03-13 05:42:19 +0000 |
commit | 5762d5289451059d8db0371352a694dda9a2cdf1 (patch) | |
tree | f124a9cd5b886b29f677368d2eee538ed43daad5 /configure.in | |
parent | b318bd8989bf58d3d3cda55dbfc5004f968bd4e6 (diff) | |
download | tor-5762d5289451059d8db0371352a694dda9a2cdf1.tar.gz tor-5762d5289451059d8db0371352a694dda9a2cdf1.zip |
Another configure.in fix. We copied some idiocy from our example "look for openssl" code where we skipped checking for the presence of header files when deciding whether we needed a -L or -I option. This broke the case where openssl/libevent was in our default linker search path, but not our default cpp search path. Thanks go to cat-"pathological case"-xeger and her Solaris box.
svn:r6149
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/configure.in b/configure.in index 6f68091218..88ff163a33 100644 --- a/configure.in +++ b/configure.in @@ -109,6 +109,7 @@ dnl Where do you live, libevent? And how do we call you? AC_CACHE_CHECK([for libevent directory], ac_cv_libevent_dir, [ saved_LIBS="$LIBS" saved_LDFLAGS="$LDFLAGS" + saved_CPPFLAGS="$CPPFLAGS" le_found=no for ledir in $trylibeventdir "" $prefix /usr/local ; do LDFLAGS="$saved_LDFLAGS" @@ -124,9 +125,16 @@ AC_CACHE_CHECK([for libevent directory], ac_cv_libevent_dir, [ else LDFLAGS="-L$ledir $LDFLAGS" fi + if test -d "$ledir/include" ; then + CPPFLAGS="-I$ledir/include $CPPFLAGS" + else + CPPFLAGS="-I$ledir $CPPFLAGS" + fi fi - # Can I link it? - AC_TRY_LINK([], [ void *event_init(void); event_init(); ], + # Can I compile and link it? + AC_TRY_LINK([struct timeval { long tv_sec; long tv_usec; }; +typedef unsigned char u_char; typedef unsigned long size_t; +#include <event.h>], [ event_init(); ], [ libevent_linked=yes ], [ libevent_linked=no ]) if test $libevent_linked = yes; then if test ! -z "$ledir" ; then @@ -140,6 +148,7 @@ AC_CACHE_CHECK([for libevent directory], ac_cv_libevent_dir, [ done LIBS="$saved_LIBS" LDFLAGS="$saved_LDFLAGS" + CPPFLAGS="$saved_CPPFLAGS" if test $le_found = no ; then AC_MSG_ERROR([Could not find a linkable libevent. You can specify an explicit path using --with-libevent-dir]) fi @@ -156,7 +165,6 @@ if test $ac_cv_libevent_dir != "(system)"; then if test -d "$ac_cv_libevent_dir/include" ; then CPPFLAGS="-I$ac_cv_libevent_dir/include $CPPFLAGS" else - CPPFLAGS="-I$ac_cv_libevent_dir $CPPFLAGS" fi fi @@ -199,6 +207,7 @@ dnl Where do you live, openssl? And how do we call you? AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl_dir, [ saved_LIBS="$LIBS" saved_LDFLAGS="$LDFLAGS" + saved_CPPFLAGS="$CPPFLAGS" ssl_found=no for ssldir in $tryssldir "" $prefix /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/athena /usr/pkg /opt /opt/openssl ; do LDFLAGS="$saved_LDFLAGS" @@ -214,10 +223,15 @@ AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl_dir, [ else LDFLAGS="-L$ssldir $LDFLAGS" fi + if test -d "$ssldir/include" ; then + CPPFLAGS="-I$ssldir/include $CPPFLAGS" + else + CPPFLAGS="-I$ssldir $CPPFLAGS" + fi fi # Can I link it? - AC_TRY_LINK([], - [ void RAND_add(const void *, int, double); RAND_add((void*)0,0,0); ], + AC_TRY_LINK([#include <openssl/rand.h>], + [ RAND_add((void*)0,0,0); ], [ openssl_linked=yes ], [ openssl_linked=no ]) if test $openssl_linked = yes; then if test ! -z "$ssldir" ; then @@ -231,6 +245,7 @@ AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl_dir, [ done LIBS="$saved_LIBS" LDFLAGS="$saved_LDFLAGS" + CPPFLAGS="$saved_CPPFLAGS" if test $ssl_found = no ; then AC_MSG_ERROR([Could not find a linkable OpenSSL. You can specify an explicit path using --with-ssl-dir]) fi |