dnl dnl Copyright (C) 2003 - 2007 Bojan Smojver, Rexursive dnl dnl This program is free software; you can redistribute it and/or modify it dnl under the terms of the GNU General Public Licence as published by the Free dnl Software Foundation; either version 2 of the Licence, or (at your option) dnl any later version. dnl dnl This program is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for dnl more details. dnl dnl You should have received a copy of the GNU General Public Licence along dnl with this program; if not, write to the Free Software Foundation, Inc., 59 dnl Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl Find APXS AC_DEFUN([RXV_SPIN_APXS],[ AC_ARG_WITH([apxs],AC_HELP_STRING([--with-apxs], [location of APache eXtenSion tool (APXS)]), [AC_PATH_PROG([apxs],["`basename $withval`"],, ["`AS_DIRNAME($withval)`"])], [AC_PATH_PROG([apxs],[apxs],, [/usr/sbin:/usr/local/apache2/bin:$PATH])]) if test "x$apxs" = 'x'; then AC_MSG_ERROR([apxs missing]) fi CFLAGS="`$apxs -q CFLAGS` $CFLAGS" CPPFLAGS="$CPPFLAGS -I. -I`$apxs -q INCLUDEDIR`" LDFLAGS="-L`$apxs -q LIBDIR` $LDFLAGS" AC_SUBST([apxs],[$apxs]) ]) dnl APR and APU AC_DEFUN([RXV_SPIN_APRAPU],[ dnl Cater for different APR/APU versions apr_major="`$apxs -q APR_VERSION 2>/dev/null | cut -f 1 -d '.'`" if test "x$apr_major" = 'x'; then apr_major='0' apr_cfmjr='' else apr_cfmjr="${apr_major}-" fi dnl Try built in APXS support first aprconfig="`$apxs -q APR_CONFIG 2>/dev/null`" apuconfig="`$apxs -q APU_CONFIG 2>/dev/null`" dnl Have to have apr-config and apu-config if test "x$aprconfig" = 'x'; then AC_PATH_PROG([aprconfig],[apr-${apr_cfmjr}config],,["`$apxs -q BINDIR`:$PATH"]) fi if test "x$apuconfig" = 'x'; then AC_PATH_PROG([apuconfig],[apu-${apr_cfmjr}config],,["`$apxs -q BINDIR`:$PATH"]) fi if test "x$aprconfig" = 'x'; then AC_MSG_ERROR([apr-${apr_cfmjr}config missing]) fi if test "x$apuconfig" = 'x'; then AC_MSG_ERROR([apu-${apr_cfmjr}config missing]) fi dnl Add APR stuff CFLAGS="`$aprconfig --cflags` $CFLAGS" CPPFLAGS="$CPPFLAGS `$aprconfig --cppflags --includes`" SPINLIBS="`$aprconfig --link-libtool` $SPINLIBS" APRVMINOR=`$aprconfig --version | cut -f -2 -d '.'` dnl Add APR Util stuff CPPFLAGS="$CPPFLAGS `$apuconfig --includes`" SPINLIBS="`$apuconfig --link-libtool` $SPINLIBS" APUVMINOR=`$apuconfig --version | cut -f -2 -d '.'` AC_SUBST([SPINLIBS],[$SPINLIBS]) AC_SUBST([APRVMINOR],[$APRVMINOR]) AC_SUBST([APUVMINOR],[$APUVMINOR]) AC_SUBST([aprconfig],[$aprconfig]) AC_SUBST([apuconfig],[$apuconfig]) ]) dnl libapreq2 stuff AC_DEFUN([RXV_SPIN_LIBAPREQ2],[ AC_PATH_PROG([apreq2config],[apreq2-config],,["`$apxs -q BINDIR`:$PATH"]) if test "x$apreq2config" = 'x'; then AC_MSG_ERROR([apreq2-config missing]) fi CPPFLAGS="$CPPFLAGS `$apreq2config --includes` -I`$apxs -q INCLUDEDIR`/apreq2" SPINLIBS="`$apreq2config --link-libtool` $SPINLIBS" AC_SUBST([SPINLIBS],[$SPINLIBS]) dnl Where are the Doxygen tag files? if test "$packager" = 'yes'; then AC_SUBST(APREQ_TAG_FILES_LOCATION, "`$apreq2config --prefix`/share/doc/libapreq2-devel-`$apreq2config --package-version | cut -f 1 -d '-'`") AC_SUBST(APR_TAG_FILES_LOCATION, "`$aprconfig --prefix`/share/doc/apr-`$aprconfig --version`/api-docs") else AC_SUBST(APREQ_TAG_FILES_LOCATION,"`$apreq2config --prefix`/share/libapreq2/docs") AC_SUBST(APR_TAG_FILES_LOCATION,"$APREQ_TAG_FILES_LOCATION") fi AC_SUBST([apreq2config],[$apreq2config]) ]) dnl libxml2 stuff AC_DEFUN([RXV_SPIN_LIBXML2],[ AC_PATH_PROG([xml2config],[xml2-config]) if test "x$xml2config" = 'x'; then AC_MSG_ERROR([xml2-config missing]) fi CPPFLAGS="$CPPFLAGS `$xml2config --cflags`" for opt in `$xml2config --libs`; do if test "x`echo $opt | grep '^-L'`" != 'x'; then LDFLAGS="$opt $LDFLAGS" fi done ]) dnl Static Apache build AC_DEFUN([RXV_SPIN_APACHE],[ AC_ARG_WITH([apache],AC_HELP_STRING([--with-apache], [location of Apache source for static build]), [apache="$withval"],[apache="no"]) AM_CONDITIONAL(STATICBUILD,test "$apache" != 'no') ]) dnl Reentrant Flex AC_DEFUN([RXV_SPIN_FLEXRE],[ AC_ARG_WITH([flex-reentrant],AC_HELP_STRING([--with-flex-reentrant], [location of reentrant flex installation]), [flexre="$withval"],[flexre=""]) ]) dnl We really have to have bison AC_DEFUN([RXV_SPIN_FLEXBISON],[ AC_PROG_YACC if test "$YACC" != 'bison -y'; then AC_MSG_NOTICE([bison missing: existing parser will be used]) AM_CONDITIONAL(NOBISON,true) else AM_CONDITIONAL(NOBISON,false) fi dnl Verify that we have reentrant flex scanner if test "x${flexre}" != 'x'; then AC_PATH_PROG([LEX],[flex],,["${flexre}/bin:$PATH"]) else AC_PATH_PROG([LEX],[flex]) fi if test "x$LEX" = 'x'; then AC_MSG_NOTICE([flex missing: existing scanner will be used]) AM_CONDITIONAL(NOFLEX,true) AM_CONDITIONAL(NORLEX,true) else AM_CONDITIONAL(NOFLEX,false) $LEX -t -R >/dev/null 2>&1 <]]) AC_CHECK_HEADERS([apr_strings.h],,[AC_MSG_ERROR([apr_strings.h header missing])]) AC_CHECK_HEADERS([apr.h],,[AC_MSG_ERROR([apr.h header missing])]) AC_CHECK_HEADERS([apr_pools.h],,[AC_MSG_ERROR([apr_pools.h header missing])]) AC_CHECK_HEADERS([apr_buckets.h],,[AC_MSG_ERROR([apr_buckets.h header missing])]) AC_CHECK_HEADERS([apr_file_io.h],,[AC_MSG_ERROR([apr_file_io.h header missing])]) AC_CHECK_HEADERS([apr_hash.h],,[AC_MSG_ERROR([apr_hash.h header missing])]) AC_CHECK_HEADERS([apr_portable.h],,[AC_MSG_ERROR([apr_portable.h header missing])]) AC_CHECK_HEADERS([apr_time.h],,[AC_MSG_ERROR([apr_time.h header missing])]) AC_CHECK_HEADERS([apr_ring.h],,[AC_MSG_ERROR([apr_ring.h header missing])]) AC_CHECK_HEADERS([apr_dbd.h],,[AC_MSG_ERROR([apr_dbd.h header missing])], [[#include #include ]]) AC_CHECK_HEADERS([apr_md5.h],,[AC_MSG_ERROR([apr_md5.h header missing])]) AC_CHECK_HEADERS([apr_base64.h],,[AC_MSG_ERROR([apr_base64.h header missing])]) AC_CHECK_HEADERS([apr_thread_proc.h],,[AC_MSG_ERROR([apr_thread_proc.h header missing])]) AC_CHECK_HEADERS([apr_thread_mutex.h],,[AC_MSG_ERROR([apr_thread_mutex.h header missing])]) AC_CHECK_HEADERS([apreq_param.h],,[AC_MSG_ERROR([apreq_param.h header missing])]) AC_CHECK_HEADERS([apreq_cookie.h],,[AC_MSG_ERROR([apreq_cookie.h header missing])]) AC_CHECK_HEADERS([apreq_module_apache2.h],,[AC_MSG_ERROR([apreq_module_apache2.h header missing])]) AC_CHECK_HEADERS([httpd.h],,[AC_MSG_ERROR([httpd.h header missing])]) AC_CHECK_HEADERS([http_request.h],,[AC_MSG_ERROR([http_request.h header missing])]) AC_CHECK_HEADERS([pcreposix.h]) AC_CHECK_HEADERS([ap_regex.h],,,[[#include ]]) AC_CHECK_HEADERS([libxml/tree.h],,[AC_MSG_ERROR([tree.h header missing])]) AC_CHECK_HEADERS([libxml/parser.h],,[AC_MSG_ERROR([parser.h header missing])]) AC_CHECK_HEADERS([libxml/xmlsave.h],,[AC_MSG_ERROR([xmlsave.h header missing])]) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_TYPE_OFF_T dnl Checks for library functions. AC_CHECK_FUNCS([malloc strchr]) ]) dnl Check if APU DBD has getname() and pick up database libraries if not AC_DEFUN([RXV_SPIN_APUGETNAME],[ AC_CHECK_FUNCS(apr_dbd_get_name,,[ dnl Add PostgreSQL configuration AC_PATH_PROG([pgconfig],[pg_config]) if test "x$pgconfig" != 'x'; then CPPFLAGS="$CPPFLAGS -I`$pgconfig --includedir`" LDFLAGS="-L`$pgconfig --libdir` $LDFLAGS" fi dnl Add MySQL configuration AC_PATH_PROG([mysqlconfig],[mysql_config]) if test "x$mysqlconfig" != 'x'; then $mysqlconfig --include >/dev/null 2>&1 if test $? -eq 0; then CPPFLAGS="$CPPFLAGS `$mysqlconfig --include`" else CPPFLAGS="$CPPFLAGS `$mysqlconfig --cflags`" fi for opt in `$mysqlconfig --libs_r`; do if test "x`echo $opt | grep '^-L'`" != 'x'; then LDFLAGS="$opt $LDFLAGS" fi done fi dnl Check for database libraries AC_CHECK_LIB(pq,PQconnectdb) AC_CHECK_LIB(mysqlclient_r,mysql_init) AC_CHECK_LIB(sqlite,sqlite_open) AC_CHECK_LIB(sqlite3,sqlite3_open) dnl Check for database headers AC_CHECK_HEADERS([libpq-fe.h]) AC_CHECK_HEADERS([mysql.h]) AC_CHECK_HEADERS([sqlite.h]) AC_CHECK_HEADERS([sqlite3.h]) ]) ]) dnl mod_spin private headers AC_DEFUN([RXV_SPIN_PRIVHEADERS],[ AC_CHECK_HEADERS([http_config.h],,[AC_MSG_ERROR([http_config.h header missing])],[[#include ]]) AC_CHECK_HEADERS([http_connection.h],,[AC_MSG_ERROR([http_connection.h header missing])],[[#include ]]) AC_CHECK_HEADERS([http_protocol.h],,[AC_MSG_ERROR([http_core.h header missing])]) AC_CHECK_HEADERS([http_log.h],,[AC_MSG_ERROR([http_log.h header missing])],[[#include ]]) ])