~ubuntu-branches/ubuntu/hardy/lighttpd/hardy

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jeremie Corbier
  • Date: 2006-09-22 19:16:08 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060922191608-i9jngvf1wtf3j5rd
Tags: 1.4.12~20060907-1ubuntu1
Merge from debian unstable:
-> Keep the additional dependency on libterm-readline-perl-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6171
6171
AC_MSG_RESULT([$SED])
6172
6172
])
6173
6173
 
6174
 
 
6175
 
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
6176
 
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
6177
 
dnl also defines GSTUFF_PKG_ERRORS on error
6178
 
AC_DEFUN([PKG_CHECK_MODULES], [
6179
 
  succeeded=no
6180
 
 
6181
 
  if test -z "$PKG_CONFIG"; then
6182
 
    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
6183
 
  fi
6184
 
 
6185
 
  if test "$PKG_CONFIG" = "no" ; then
6186
 
     echo "*** The pkg-config script could not be found. Make sure it is"
6187
 
     echo "*** in your path, or set the PKG_CONFIG environment variable"
6188
 
     echo "*** to the full path to pkg-config."
6189
 
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
6190
 
  else
6191
 
     PKG_CONFIG_MIN_VERSION=0.9.0
6192
 
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
6193
 
        AC_MSG_CHECKING(for $2)
6194
 
 
6195
 
        if $PKG_CONFIG --exists "$2" ; then
6196
 
            AC_MSG_RESULT(yes)
6197
 
            succeeded=yes
6198
 
 
6199
 
            AC_MSG_CHECKING($1_CFLAGS)
6200
 
            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
6201
 
            AC_MSG_RESULT($$1_CFLAGS)
6202
 
 
6203
 
            AC_MSG_CHECKING($1_LIBS)
6204
 
            $1_LIBS=`$PKG_CONFIG --libs "$2"`
6205
 
            AC_MSG_RESULT($$1_LIBS)
6206
 
        else
6207
 
            $1_CFLAGS=""
6208
 
            $1_LIBS=""
6209
 
            ## If we have a custom action on failure, don't print errors, but 
6210
 
            ## do set a variable so people can do so.
6211
 
            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
6212
 
            ifelse([$4], ,echo $$1_PKG_ERRORS,)
 
6174
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
6175
 
6176
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
6177
#
 
6178
# This program is free software; you can redistribute it and/or modify
 
6179
# it under the terms of the GNU General Public License as published by
 
6180
# the Free Software Foundation; either version 2 of the License, or
 
6181
# (at your option) any later version.
 
6182
#
 
6183
# This program is distributed in the hope that it will be useful, but
 
6184
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
6185
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
6186
# General Public License for more details.
 
6187
#
 
6188
# You should have received a copy of the GNU General Public License
 
6189
# along with this program; if not, write to the Free Software
 
6190
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
6191
#
 
6192
# As a special exception to the GNU General Public License, if you
 
6193
# distribute this file as part of a program that contains a
 
6194
# configuration script generated by Autoconf, you may include it under
 
6195
# the same distribution terms that you use for the rest of that program.
 
6196
 
 
6197
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
6198
# ----------------------------------
 
6199
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
6200
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
6201
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 
6202
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
 
6203
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
6204
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
6205
fi
 
6206
if test -n "$PKG_CONFIG"; then
 
6207
        _pkg_min_version=m4_default([$1], [0.9.0])
 
6208
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
6209
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
6210
                AC_MSG_RESULT([yes])
 
6211
        else
 
6212
                AC_MSG_RESULT([no])
 
6213
                PKG_CONFIG=""
 
6214
        fi
 
6215
                
 
6216
fi[]dnl
 
6217
])# PKG_PROG_PKG_CONFIG
 
6218
 
 
6219
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
6220
#
 
6221
# Check to see whether a particular set of modules exists.  Similar
 
6222
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
6223
#
 
6224
#
 
6225
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
 
6226
# this or PKG_CHECK_MODULES is called, or make sure to call
 
6227
# PKG_CHECK_EXISTS manually
 
6228
# --------------------------------------------------------------
 
6229
AC_DEFUN([PKG_CHECK_EXISTS],
 
6230
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
6231
if test -n "$PKG_CONFIG" && \
 
6232
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
6233
  m4_ifval([$2], [$2], [:])
 
6234
m4_ifvaln([$3], [else
 
6235
  $3])dnl
 
6236
fi])
 
6237
 
 
6238
 
 
6239
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
6240
# ---------------------------------------------
 
6241
m4_define([_PKG_CONFIG],
 
6242
[if test -n "$PKG_CONFIG"; then
 
6243
    if test -n "$$1"; then
 
6244
        pkg_cv_[]$1="$$1"
 
6245
    else
 
6246
        PKG_CHECK_EXISTS([$3],
 
6247
                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
6248
                         [pkg_failed=yes])
 
6249
    fi
 
6250
else
 
6251
        pkg_failed=untried
 
6252
fi[]dnl
 
6253
])# _PKG_CONFIG
 
6254
 
 
6255
# _PKG_SHORT_ERRORS_SUPPORTED
 
6256
# -----------------------------
 
6257
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
6258
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
6259
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
6260
        _pkg_short_errors_supported=yes
 
6261
else
 
6262
        _pkg_short_errors_supported=no
 
6263
fi[]dnl
 
6264
])# _PKG_SHORT_ERRORS_SUPPORTED
 
6265
 
 
6266
 
 
6267
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
6268
# [ACTION-IF-NOT-FOUND])
 
6269
#
 
6270
#
 
6271
# Note that if there is a possibility the first call to
 
6272
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
6273
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
6274
#
 
6275
#
 
6276
# --------------------------------------------------------------
 
6277
AC_DEFUN([PKG_CHECK_MODULES],
 
6278
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
6279
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
6280
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
6281
 
 
6282
pkg_failed=no
 
6283
AC_MSG_CHECKING([for $1])
 
6284
 
 
6285
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
6286
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
6287
 
 
6288
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
6289
and $1[]_LIBS to avoid the need to call pkg-config.
 
6290
See the pkg-config man page for more details.])
 
6291
 
 
6292
if test $pkg_failed = yes; then
 
6293
        _PKG_SHORT_ERRORS_SUPPORTED
 
6294
        if test $_pkg_short_errors_supported = yes; then
 
6295
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
 
6296
        else 
 
6297
                $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
6213
6298
        fi
6214
 
 
6215
 
        AC_SUBST($1_CFLAGS)
6216
 
        AC_SUBST($1_LIBS)
6217
 
     else
6218
 
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
6219
 
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
6220
 
     fi
6221
 
  fi
6222
 
 
6223
 
  if test $succeeded = yes; then
6224
 
     ifelse([$3], , :, [$3])
6225
 
  else
6226
 
     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
6227
 
  fi
6228
 
])
6229
 
 
6230
 
 
 
6299
        # Put the nasty error message in config.log where it belongs
 
6300
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
6301
 
 
6302
        ifelse([$4], , [AC_MSG_ERROR(dnl
 
6303
[Package requirements ($2) were not met:
 
6304
 
 
6305
$$1_PKG_ERRORS
 
6306
 
 
6307
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
6308
installed software in a non-standard prefix.
 
6309
 
 
6310
_PKG_TEXT
 
6311
])],
 
6312
                [$4])
 
6313
elif test $pkg_failed = untried; then
 
6314
        ifelse([$4], , [AC_MSG_FAILURE(dnl
 
6315
[The pkg-config script could not be found or is too old.  Make sure it
 
6316
is in your PATH or set the PKG_CONFIG environment variable to the full
 
6317
path to pkg-config.
 
6318
 
 
6319
_PKG_TEXT
 
6320
 
 
6321
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
 
6322
                [$4])
 
6323
else
 
6324
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
6325
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
6326
        AC_MSG_RESULT([yes])
 
6327
        ifelse([$3], , :, [$3])
 
6328
fi[]dnl
 
6329
])# PKG_CHECK_MODULES
6231
6330
 
6232
6331
# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
6233
6332
#