# Douglas Thrift's Search Engine Autoconf Script # # Douglas Thrift # # $Id: configure.ac,v 1.18 2003/11/18 00:11:07 douglas Exp $ AC_INIT() AC_CONFIG_SRCDIR(Search.cpp) AC_PREFIX_DEFAULT(/usr/local/dtse) AC_PROG_INSTALL CHECK_GNU_MAKE if test x$_cv_gnu_make_command = x; then AC_MSG_ERROR(You need GNU Make.) fi AC_PROG_CXX if ! test x$GXX = x; then AC_MSG_CHECKING(if g++ is version 3.1 or higher) dt_gxx_3_x=`$CXX --version 2>&1 | grep ^$CXX` if test "x$dt_gxx_3_x" = "x"; then AC_MSG_RESULT(no) AC_MSG_ERROR(You need g++ 3.1 or higher.) else AC_MSG_RESULT(yes) fi fi AC_PROG_PERL_VERSION(5.00503, , AC_MSG_ERROR(You need a Perl 5.6 or higher.)) AC_MSG_CHECKING(perl path) AC_SUBST(which_perl, `which $PERL`) AC_MSG_RESULT($which_perl) AC_PROG_PERL_MODULES(File::Temp, , AC_MSG_ERROR(You need File::Temp.)) mingw=`$CXX --version 2>&1 | grep mingw\ special` if test "x$mingw" = "x"; then ETR_SOCKET_NSL LIBS="$LIBS $ETR_SOCKET_LIBS" else LIBS="$LIBS -lws2_32" fi AC_MSG_CHECKING(if OpenSSL is wanted) AC_ARG_WITH(openssl, [[ --with-openssl[=DIR] enable OpenSSL [DIR=path]] ], [ AC_MSG_RESULT(yes) AC_MSG_CHECKING(for OpenSSL) for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg \ /usr/local /usr; do openssl_dir="$dir" if test -f "$dir/include/openssl/ssl.h"; then openssl="yes"; break; fi done if ! test x$openssl = x; then AC_MSG_RESULT($openssl_dir); CPPFLAGS="$CPPFLAGS -I$openssl_dir/include"; LDFLAGS="$LDFLAGS -L$openssl_dir/lib"; if test "x$mingw" = "x"; then LIBS="$LIBS -lssl -lcrypto"; else LIBS="$LIBS -lssl32 -leay32"; fi AC_SUBST(OpenSSL, -D_OpenSSL_) else AC_MSG_RESULT(not found); AC_MSG_ERROR(couldn't find OpenSSL) fi ], [ AC_MSG_RESULT(no) ]) if ! test x$openssl = x; then if test "x$mingw" = "x"; then AC_CHECK_FILE(/dev/urandom, AC_SUBST(urandomdev, -D_urandomdev_), AC_SUBST(urandomdev,)) fi fi AC_CONFIG_FILES([GNUmakefile search.cgi]) AC_OUTPUT