|
From: <tro...@ju...> - 2003-03-17 23:24:24
|
There is a newer version of 'check_ssl' macro available that handles
CXXFLAGS too (at least it was submitted about a month or so ago) -
essentially exactly as you mention...
As for HAVE_SSL vs. HAVE_SSL_H - welp yer on yer own!!
Mark
On Mon, 17 Mar 2003, And...@wi... wrote:
> > .. but it's usually faster to check the configure.in, aclocal.m4
> > and acinclude.m4 files for the appropriate sections.
>
> A little easier ;-> But, somebody smarter will still have to the correct
> decisions for me, er htdig. acinclude.m4 (which is a shorter version of
> aclocal.m4?? at least the SSL section is the same) works on HAVE_SSL but
> it appears that's not used in the code, HAVE_SSL_H is. As importantly
> htnet/SSL*.cc is where the ssl work is needed and that uses C++ and so
> CXXFLAGS. Finally, the #includes in the htnet/SSL*.cc code are all:
> #ifdef HAVE_SSL_H
> #include <openssl/crypto.h>
> #include <openssl/x509.h>
> #include <openssl/pem.h>
> #include <openssl/ssl.h>
> #include <openssl/err.h>
>
> which means they're assuming openssl and want an include path of
> /usr/local/ssl. The m4 routine:
> AC_DEFUN([CHECK_SSL],
> [AC_MSG_CHECKING(if ssl is wanted)
> AC_ARG_WITH(ssl,
> [ --with-ssl enable ssl [will check /usr/local/ssl
> /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr
> ]
> ],
> [ AC_MSG_RESULT(yes)
> for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg
> /usr/local
> /usr; do
> ssldir="$dir"
> if test -f "$dir/include/openssl/ssl.h"; then
> found_ssl="yes";
> CFLAGS="$CFLAGS -I$ssldir/include/openssl -DHAVE_SSL";
> break;
> fi
> if test -f "$dir/include/ssl.h"; then
> found_ssl="yes";
> CFLAGS="$CFLAGS -I$ssldir/include/ -DHAVE_SSL";
> break
> fi
> done
> if test x_$found_ssl != x_yes; then
> AC_MSG_ERROR(Cannot find ssl libraries)
> else
> printf "OpenSSL found in $ssldir\n";
> LIBS="$LIBS -lssl -lcrypto";
> LDFLAGS="$LDFLAGS -L$ssldir/lib";
> HAVE_SSL=yes
> fi
> AC_SUBST(HAVE_SSL)
> ],
> [
> AC_MSG_RESULT(no)
> ])
> ])
>
>
> so change HAVE_SSL to HAVE_SSL_H and change:
> CFLAGS="$CFLAGS -I$ssldir/include/ -DHAVE_SSL";
> to:
> CXXFLAGS="$CXXFLAGS -I$ssldir/include/ -DHAVE_SSL_H";
>
> though its probably better to change the htnet/SSL*cc stuff to use:
> #include <ssl.h>
>
> if you want to keep the -I$ssldir/include/ vs -I$ssldir/include/openssl
>
> or is that a six/half dozen thing?
>
>
> > make distclean
>
> This would be an automake bug. What do the top of the Makefile.in files
> say? (I want to be sure it's the original CVS version and not regenerated
> on your system.)
>
> # Makefile.in generated by automake 1.6.3 from Makefile.am.
> # @configure_input@
>
> here's the chunk from Makefile.in
> #
> # If --enable-tests is not specified, should remove
> # the test/Makefile anyway
> #
> distclean-local:
> if "X$(TESTDIR)" = "Xtest" ; \
> then \
> rm -f test/Makefile test/test_functions ; \
> fi
>
> It seems to be missing the 'test' sh cmd (and 'X' is an executable prog):
> #
> # If --enable-tests is not specified, should remove
> # the test/Makefile anyway
> #
> distclean-local:
> if test "X$(TESTDIR)" = "Xtest" ; \
> then \
> rm -f test/Makefile test/test_functions ; \
> fi
>
>
>
|