@@ -67,7 +67,7 @@ AS_VAR_POPDEF([CACHEVAR])dnl
67
67
] ) dnl AX_CHECK_COMPILE_FLAGS
68
68
69
69
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
70
- # serial 12 (pkg-config-0.29.2 )
70
+ # serial 11 (pkg-config-0.29.1 )
71
71
72
72
dnl Copyright © 2004 Scott James Remnant <[email protected] >.
73
73
dnl Copyright © 2012-2015 Dan Nicholson <[email protected] >
109
109
dnl See the "Since" comment for each macro you use to see what version
110
110
dnl of the macros you require.
111
111
m4_defun([ PKG_PREREQ] ,
112
- [ m4_define ( [ PKG_MACROS_VERSION] , [ 0.29.2 ] )
112
+ [ m4_define ( [ PKG_MACROS_VERSION] , [ 0.29.1 ] )
113
113
m4_if ( m4_version_compare ( PKG_MACROS_VERSION , [ $1 ] ) , - 1 ,
114
114
[ m4_fatal ( [ pkg.m4 version $1 or higher is required but ] PKG_MACROS_VERSION [ found] ) ] )
115
115
] )dnl PKG_PREREQ
@@ -210,7 +210,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
210
210
AC_ARG_VAR ( [ $1 ] [ _LIBS] , [ linker flags for $1 , overriding pkg-config] ) dnl
211
211
212
212
pkg_failed=no
213
- AC_MSG_CHECKING ( [ for $2 ] )
213
+ AC_MSG_CHECKING ( [ for $1 ] )
214
214
215
215
_PKG_CONFIG([ $1 ] [ _CFLAGS] , [ cflags] , [ $2 ] )
216
216
_PKG_CONFIG([ $1 ] [ _LIBS] , [ libs] , [ $2 ] )
@@ -220,11 +220,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
220
220
See the pkg-config man page for more details.] )
221
221
222
222
if test $pkg_failed = yes; then
223
- AC_MSG_RESULT ( [ no] )
223
+ AC_MSG_RESULT ( [ no] )
224
224
_PKG_SHORT_ERRORS_SUPPORTED
225
225
if test $_pkg_short_errors_supported = yes; then
226
226
$1 [ ] _PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2 " 2>&1`
227
- else
227
+ else
228
228
$1 [ ] _PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2 " 2>&1`
229
229
fi
230
230
# Put the nasty error message in config.log where it belongs
@@ -241,7 +241,7 @@ installed software in a non-standard prefix.
241
241
_PKG_TEXT] ) [ ] dnl
242
242
] )
243
243
elif test $pkg_failed = untried; then
244
- AC_MSG_RESULT ( [ no] )
244
+ AC_MSG_RESULT ( [ no] )
245
245
m4_default ( [ $4 ] , [ AC_MSG_FAILURE (
246
246
[ The pkg-config script could not be found or is too old. Make sure it
247
247
is in your PATH or set the PKG_CONFIG environment variable to the full
@@ -342,5 +342,73 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
342
342
AS_VAR_IF ( [ $1 ] , [ ""] , [ $5 ] , [ $4 ] ) dnl
343
343
] ) dnl PKG_CHECK_VAR
344
344
345
+ dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
346
+ dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
347
+ dnl [DESCRIPTION], [DEFAULT])
348
+ dnl ------------------------------------------
349
+ dnl
350
+ dnl Prepare a "--with-" configure option using the lowercase
351
+ dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
352
+ dnl PKG_CHECK_MODULES in a single macro.
353
+ AC_DEFUN ( [ PKG_WITH_MODULES] ,
354
+ [
355
+ m4_pushdef ( [ with_arg] , m4_tolower ( [ $1 ] ) )
356
+
357
+ m4_pushdef ( [ description] ,
358
+ [ m4_default ( [ $5 ] , [ build with ] with_arg [ support] ) ] )
359
+
360
+ m4_pushdef ( [ def_arg] , [ m4_default ( [ $6 ] , [ auto] ) ] )
361
+ m4_pushdef ( [ def_action_if_found] , [ AS_TR_SH ( [ with_] with_arg ) =yes] )
362
+ m4_pushdef ( [ def_action_if_not_found] , [ AS_TR_SH ( [ with_] with_arg ) =no] )
363
+
364
+ m4_case ( def_arg ,
365
+ [ yes] ,[ m4_pushdef ( [ with_without] , [ --without-] with_arg ) ] ,
366
+ [ m4_pushdef ( [ with_without] ,[ --with-] with_arg ) ] )
367
+
368
+ AC_ARG_WITH ( with_arg ,
369
+ AS_HELP_STRING ( with_without , description [ @<:@ default=] def_arg [ @:>@ ] ) ,,
370
+ [ AS_TR_SH ( [ with_] with_arg ) =def_arg] )
371
+
372
+ AS_CASE ( [ $AS_TR_SH ( [ with_] with_arg ) ] ,
373
+ [ yes] ,[ PKG_CHECK_MODULES([ $1 ] ,[ $2 ] ,$3 ,$4 )] ,
374
+ [ auto] ,[ PKG_CHECK_MODULES([ $1 ] ,[ $2 ] ,
375
+ [ m4_n ( [ def_action_if_found] ) $3 ] ,
376
+ [ m4_n ( [ def_action_if_not_found] ) $4 ] )] )
377
+
378
+ m4_popdef ( [ with_arg] )
379
+ m4_popdef ( [ description] )
380
+ m4_popdef ( [ def_arg] )
381
+
382
+ ] ) dnl PKG_WITH_MODULES
383
+
384
+ dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
385
+ dnl [DESCRIPTION], [DEFAULT])
386
+ dnl -----------------------------------------------
387
+ dnl
388
+ dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
389
+ dnl check._[VARIABLE-PREFIX] is exported as make variable.
390
+ AC_DEFUN ( [ PKG_HAVE_WITH_MODULES] ,
391
+ [
392
+ PKG_WITH_MODULES([ $1 ] ,[ $2 ] ,,,[ $3 ] ,[ $4 ] )
393
+
394
+ AM_CONDITIONAL([ HAVE_] [ $1 ] ,
395
+ [ test "$AS_TR_SH ( [ with_] m4_tolower ( [ $1 ] ) ) " = "yes"] )
396
+ ] ) dnl PKG_HAVE_WITH_MODULES
397
+
398
+ dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
399
+ dnl [DESCRIPTION], [DEFAULT])
400
+ dnl ------------------------------------------------------
401
+ dnl
402
+ dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
403
+ dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
404
+ dnl and preprocessor variable.
405
+ AC_DEFUN ( [ PKG_HAVE_DEFINE_WITH_MODULES] ,
406
+ [
407
+ PKG_HAVE_WITH_MODULES([ $1 ] ,[ $2 ] ,[ $3 ] ,[ $4 ] )
408
+
409
+ AS_IF ( [ test "$AS_TR_SH ( [ with_] m4_tolower ( [ $1 ] ) ) " = "yes"] ,
410
+ [ AC_DEFINE ( [ HAVE_] [ $1 ] , 1 , [ Enable ] m4_tolower ( [ $1 ] ) [ support] ) ] )
411
+ ] ) dnl PKG_HAVE_DEFINE_WITH_MODULES
412
+
345
413
m4_include ( [ m4/ax_c_float_words_bigendian.m4] )
346
414
m4_include ( [ m4/ax_check_openssl.m4] )
0 commit comments