Changeset 1106 for trunk/m4/pkg.m4
- Timestamp:
- Jun 23, 2010, 3:59:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/m4/pkg.m4
r877 r1106 1 1 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 2 # serial 1 (pkg-config-0.24) 2 3 # 3 4 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. … … 27 28 [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 28 29 m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 29 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 30 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 31 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 32 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 33 30 34 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 31 35 AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) … … 40 44 PKG_CONFIG="" 41 45 fi 42 43 46 fi[]dnl 44 47 ])# PKG_PROG_PKG_CONFIG … … 49 52 # to PKG_CHECK_MODULES(), but does not set variables or print errors. 50 53 # 51 # 52 # Similar to PKG_CHECK_MODULES, make sure that the first instance of53 # this or PKG_CHECK_MODULES is called, or make sure to call54 # PKG_CHECK_EXISTS manually54 # 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 55 58 # -------------------------------------------------------------- 56 59 AC_DEFUN([PKG_CHECK_EXISTS], … … 58 61 if test -n "$PKG_CONFIG" && \ 59 62 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 60 m4_ ifval([$2],[$2], [:])63 m4_default([$2], [:]) 61 64 m4_ifvaln([$3], [else 62 65 $3])dnl 63 66 fi]) 64 65 67 66 68 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) … … 116 118 117 119 if test $pkg_failed = yes; then 120 AC_MSG_RESULT([no]) 118 121 _PKG_SHORT_ERRORS_SUPPORTED 119 122 if test $_pkg_short_errors_supported = yes; then … … 125 128 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 126 129 127 ifelse([$4], , [AC_MSG_ERROR(dnl130 m4_default([$4], [AC_MSG_ERROR( 128 131 [Package requirements ($2) were not met: 129 132 … … 133 136 installed software in a non-standard prefix. 134 137 135 _PKG_TEXT 136 ])], 137 [AC_MSG_RESULT([no]) 138 $4]) 138 _PKG_TEXT])dnl 139 ]) 139 140 elif test $pkg_failed = untried; then 140 ifelse([$4], , [AC_MSG_FAILURE(dnl 141 AC_MSG_RESULT([no]) 142 m4_default([$4], [AC_MSG_FAILURE( 141 143 [The pkg-config script could not be found or is too old. Make sure it 142 144 is in your PATH or set the PKG_CONFIG environment variable to the full … … 145 147 _PKG_TEXT 146 148 147 To get pkg-config, see <http://pkg-config.freedesktop.org/>.]) ],148 [$4])149 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl 150 ]) 149 151 else 150 152 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 151 153 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 152 154 AC_MSG_RESULT([yes]) 153 ifelse([$3], , :, [$3])155 $3 154 156 fi[]dnl 155 157 ])# PKG_CHECK_MODULES
Note: See TracChangeset
for help on using the changeset viewer.