# =========================================================================== # URL # =========================================================================== # # SYNOPSIS # # AX_CHECK_CGIUTIL() # # DESCRIPTION # # # LICENSE # # Copyright (c) 2011 Boris Manojlovic # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 1 AU_ALIAS([CHECK_CGIUTIL], [AX_CHECK_CGIUTIL]) AC_DEFUN([AX_CHECK_CGIUTIL], # # Handle user hints # [AC_ARG_WITH(cgi-util, [ --with-cgi-util=DIR root directory path of cgi-util installation [defaults to /usr/local or /usr if not found in /usr/local] --without-cgi-util to disable cgi-util usage completely], [ if test "$withval" != "no"; then if test -d "$withval" ; then WANT_CGIUTIL="yes" cgi_util_places="$withval" else AC_MSG_WARN([Sorry, $withval does not exist]) fi fi ],[ dnl just provide default places where it most probably could be found cgi_util_places="/usr/local /usr /opt/local /sw" ]) # # Locate cgi-util # if test -n "$cgi_util_places" ; then # check the user supplied or any other more or less 'standard' place: # Most UNIX systems : /usr/local and /usr # MacPorts / Fink on OSX : /opt/local respectively /sw for CGIUTIL_HOME in ${cgi_util_places} ; do if test -f "${CGIUTIL_HOME}/include/cgi-util.h"; then break; fi CGIUTIL_HOME="" done # if cgi-util.h was nowhere to be found, give a notice and bail out if test ! -n "${CGIUTIL_HOME}"; then AC_MSG_ERROR(No cgi-util.h in any include directory of ${cgi_util_places}: either specify a valid cgi-util installation with --with-cgi-util=DIR or disable cgi-util usage with --without-cgi-util) fi AC_LANG_SAVE AC_LANG_C AC_CHECK_LIB(cgi-util, cgi_init, [cgi_util_cv_libcgi_util=yes], [cgi_util_cv_libcgi_util=no]) AC_CHECK_HEADER(cgi-util.h, [cgiutil_cv_cgiutil_h=yes], [cgi_util_cv_cgi_util_h=no]) AC_LANG_RESTORE CGIUTIL_LIBS="-lcgi-util" CGIUTIL_CFLAGS="-I${CGIUTIL_HOME}/include" if test "$cgi_util_cv_libcgi_util" != "yes" -a "$cgiutil_cv_cgiutil_h" != "yes" then # If either header or library was not found, revert and bomb AC_MSG_ERROR(either specify a valid cgi-util installation with --with-cgi-util=DIR or disable cgi-util usage with --without-cgi-util) fi fi AC_SUBST(CGIUTIL_LIBS) AC_SUBST(CGIUTIL_CFLAGS) AC_SUBST(CGIUTIL_LDFLAGS) dnl no really use for this library ])