Changeset 1106


Ignore:
Timestamp:
Jun 23, 2010, 3:59:14 AM (10 years ago)
Author:
Peter Johansson
Message:

update pkg.m4 to version 0.24 (pkg-config)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/pkg.m4

    r877 r1106  
    11# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
     2# serial 1 (pkg-config-0.24)
    23#
    34# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
     
    2728[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
    2829m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
    29 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
     30AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
     31AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
     32AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
     33
    3034if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
    3135  AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
     
    4044    PKG_CONFIG=""
    4145  fi
    42    
    4346fi[]dnl
    4447])# PKG_PROG_PKG_CONFIG
     
    4952# to PKG_CHECK_MODULES(), but does not set variables or print errors.
    5053#
    51 #
    52 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
    53 # this or PKG_CHECK_MODULES is called, or make sure to call
    54 # PKG_CHECK_EXISTS manually
     54# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
     55# only at the first occurence in configure.ac, so if the first place
     56# it's called might be skipped (such as if it is within an "if", you
     57# have to call PKG_CHECK_EXISTS manually
    5558# --------------------------------------------------------------
    5659AC_DEFUN([PKG_CHECK_EXISTS],
     
    5861if test -n "$PKG_CONFIG" && \
    5962    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
    60   m4_ifval([$2], [$2], [:])
     63  m4_default([$2], [:])
    6164m4_ifvaln([$3], [else
    6265  $3])dnl
    6366fi])
    64 
    6567
    6668# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
     
    116118
    117119if test $pkg_failed = yes; then
     120    AC_MSG_RESULT([no])
    118121        _PKG_SHORT_ERRORS_SUPPORTED
    119122        if test $_pkg_short_errors_supported = yes; then
     
    125128  echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
    126129
    127   ifelse([$4], , [AC_MSG_ERROR(dnl
     130  m4_default([$4], [AC_MSG_ERROR(
    128131[Package requirements ($2) were not met:
    129132
     
    133136installed software in a non-standard prefix.
    134137
    135 _PKG_TEXT
    136 ])],
    137     [AC_MSG_RESULT([no])
    138                 $4])
     138_PKG_TEXT])dnl
     139        ])
    139140elif test $pkg_failed = untried; then
    140   ifelse([$4], , [AC_MSG_FAILURE(dnl
     141      AC_MSG_RESULT([no])
     142  m4_default([$4], [AC_MSG_FAILURE(
    141143[The pkg-config script could not be found or is too old.  Make sure it
    142144is in your PATH or set the PKG_CONFIG environment variable to the full
     
    145147_PKG_TEXT
    146148
    147 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
    148     [$4])
     149To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
     150        ])
    149151else
    150152  $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
    151153  $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
    152154        AC_MSG_RESULT([yes])
    153   ifelse([$3], , :, [$3])
     155  $3
    154156fi[]dnl
    155157])# PKG_CHECK_MODULES
Note: See TracChangeset for help on using the changeset viewer.