Generate a configure error if a dependency explicitly enabled with --with cannot be found
Originally committed to SVN as r6105.
This commit is contained in:
parent
f2c62dad3d
commit
ac498f75d5
1 changed files with 9 additions and 2 deletions
|
@ -33,10 +33,17 @@ AC_DEFUN([AC_AGI_LINK],[
|
||||||
AC_DEFUN([AGI_OPT_PKG], [
|
AC_DEFUN([AGI_OPT_PKG], [
|
||||||
m4_define([varname], m4_bpatsubst([$1], [-.*], []))dnl
|
m4_define([varname], m4_bpatsubst([$1], [-.*], []))dnl
|
||||||
m4_define([upper], m4_translit(varname, [a-z], [A-Z]))dnl
|
m4_define([upper], m4_translit(varname, [a-z], [A-Z]))dnl
|
||||||
|
|
||||||
AC_ARG_WITH(varname, AS_HELP_STRING([--without-][varname], [$2]))
|
AC_ARG_WITH(varname, AS_HELP_STRING([--without-][varname], [$2]))
|
||||||
AS_IF([test x$with_]varname[ = xno],
|
AS_IF([test x$with_]varname[ = xno],
|
||||||
varname[_disabled="(disabled)"],
|
varname[_disabled="(disabled)"],
|
||||||
[PKG_CHECK_MODULES(upper, $1 >= varname[]_required_version, [with_]varname[="yes"], [with_]varname[="no"])])
|
[PKG_CHECK_MODULES(upper, $1 >= varname[]_required_version, [
|
||||||
AS_IF([test x$with_]varname[ = xyes], AC_DEFINE([WITH_]upper, 1, $3))
|
AC_DEFINE([WITH_]upper, 1, $3)
|
||||||
|
with_[]varname="yes"
|
||||||
|
], [
|
||||||
|
AS_IF([test x$with_]varname[ = xyes],
|
||||||
|
[AC_MSG_FAILURE([--with-]varname[ was specified, but ]varname[ could not be found])])
|
||||||
|
with_[]varname="no"
|
||||||
|
])])
|
||||||
AC_SUBST([with_]varname)
|
AC_SUBST([with_]varname)
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in a new issue