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 Lesser General Public License as published by dnl the Free Software Foundation, either version 2.1 of the License, or (at dnl your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with this program. If not, see . 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 Remove standard directories from -L LDFLAGS="`echo $LDFLAGS | sed -e s@'-L\(/usr\)*/lib\(64\)*\($\| \)'@''@g`" dnl Add appropriate -R to linker flags LDFLAGS="`echo $LDFLAGS | sed -e s@'-Wl,-R *-Wl,[[^ ]]\+ *'@''@g`" rpath_LDFLAGS="" for opt in $LDFLAGS; do rpath_LDFLAGS="$rpath_LDFLAGS $opt" if test -n "`echo $opt | grep '^-L'`"; then rpath_LDFLAGS="$rpath_LDFLAGS `echo $opt | sed -e 's/^-L/-Wl,-R -Wl,/'`" fi done LDFLAGS="$rpath_LDFLAGS" ]) 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 ])