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 Following is the workaround for PACKAGE_* variables from ap_config_auto.h AC_DEFUN([RXV_SPIN_PACKAGE],[ AH_TEMPLATE([RXV_SPIN_PACKAGE_BUGREPORT],[Where to send bug reports]) AH_TEMPLATE([RXV_SPIN_PACKAGE_NAME],[Full name of the package]) AH_TEMPLATE([RXV_SPIN_PACKAGE_STRING],[Full name and version of the package]) AH_TEMPLATE([RXV_SPIN_PACKAGE_TARNAME],[Short name of the package]) AH_TEMPLATE([RXV_SPIN_PACKAGE_VERSION],[Version of the package]) AH_TEMPLATE([RXV_SPIN_HASPREPARE],[Has prepare entry function]) AC_DEFINE_UNQUOTED([RXV_SPIN_PACKAGE_BUGREPORT],["$PACKAGE_BUGREPORT"]) AC_DEFINE_UNQUOTED([RXV_SPIN_PACKAGE_NAME],["$PACKAGE_NAME"]) AC_DEFINE_UNQUOTED([RXV_SPIN_PACKAGE_STRING],["$PACKAGE_STRING"]) AC_DEFINE_UNQUOTED([RXV_SPIN_PACKAGE_TARNAME],["$PACKAGE_TARNAME"]) AC_DEFINE_UNQUOTED([RXV_SPIN_PACKAGE_VERSION],["$PACKAGE_VERSION"]) AC_DEFINE([RXV_SPIN_HASPREPARE]) ]) dnl Signature AC_DEFUN([RXV_SPIN_SIGNATURE],[ AH_TEMPLATE([RXV_SPIN_PACKAGE_SIGNATURE],[Signature of the package]) AC_DEFINE_UNQUOTED([RXV_SPIN_PACKAGE_SIGNATURE],["$PACKAGE/$VERSION"]) ]) dnl Configuration for mod_spin applications AC_DEFUN([RXV_SPIN_CONFIG],[ AC_ARG_WITH([spinconfig],AC_HELP_STRING([--with-spinconfig], [location of rxv_spin-config]), [AC_PATH_PROG([spinconfig],["`basename $withval`"],, ["`AS_DIRNAME($withval)`"])], [AC_PATH_PROG([spinconfig],[rxv_spin-config],, [$PATH])]) if test "x$spinconfig" = 'x'; then AC_MSG_ERROR([rxv_spin-config missing]) fi dnl Add rxv_spin stuff CPPFLAGS="$CPPFLAGS `$spinconfig --cflags`" LDFLAGS="`$spinconfig --libs` $LDFLAGS" SPINLIBS="`$spinconfig --libdir`/librxv_spin.la $SPINLIBS" AC_SUBST([SPINLIBS],[$SPINLIBS]) ]) dnl Define packager build AC_DEFUN([RXV_SPIN_PACKAGER],[ AC_ARG_ENABLE([packager],AC_HELP_STRING([--enable-packager], [use package tool for installation]), [packager="$enableval"],[packager="no"]) AM_CONDITIONAL(PACKAGERBUILD,test "$packager" = 'yes') ]) AC_DEFUN([RXV_SPIN_CLEANFLAGS],[ dnl Kill single quotes, they cause problems CPPFLAGS="`echo $CPPFLAGS | sed -e s,\',,g`" LDFLAGS="`echo $LDFLAGS | sed -e s,\',,g -e s@'-L\(/usr\)*/lib\(64\)*\($\| \)'@''@g`" AC_SUBST([xml2config],[$xml2config]) ]) dnl Checks for programs. AC_DEFUN([RXV_SPIN_STDPROGS],[ AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL AC_PROG_CC AC_PROG_LN_S AC_PROG_INSTALL AC_PROG_MAKE_SET ]) dnl Checks for rxv_spin header AC_DEFUN([RXV_SPIN_SPINHEADER],[ AC_CHECK_HEADERS([rxv_spin.h],,[AC_MSG_ERROR([rxv_spin.h header missing])]) ]) dnl Writes config.nice file AC_DEFUN([RXV_SPIN_CONFIG_NICE],[ echo "#! /bin/sh" > $1 for i in CC CFLAGS CPPFLAGS LDFLAGS LTFLAGS LIBS INCLUDES PKG_CONFIG_PATH; do config_nice_var="\$$i" config_nice_val=`eval echo "$config_nice_var"` if test -n "$config_nice_val"; then echo "$i=\"$config_nice_val\" \\" >> $1 fi done echo "[$]0 [$]ac_configure_args \"\$[@]\"" >> $1 chmod a+x $1 ])