2008-04-17 09:02:20 +00:00
|
|
|
# name, version, show-in-help?, optional?, help-text, [am-cond]
|
2008-02-20 04:12:28 +00:00
|
|
|
AC_DEFUN([AC_FLDIGI_PKG_CHECK], [
|
|
|
|
|
2008-04-17 09:02:20 +00:00
|
|
|
m4_define([PKG_NAME_UC], m4_translit([$1], [a-z], [A-Z]))
|
|
|
|
|
|
|
|
m4_if([$3], [yes],
|
|
|
|
[ AC_ARG_WITH($1, AC_HELP_STRING([--with-[]$1], [$5]),
|
2008-04-08 21:15:43 +00:00
|
|
|
[case "${withval}" in
|
|
|
|
yes|no) ac_cv_want_[]$1="${withval}" ;;
|
2008-04-17 09:02:20 +00:00
|
|
|
*) AC_MSG_ERROR([bad value "${withval}" for --with-[]$1]) ;;
|
2008-04-08 21:15:43 +00:00
|
|
|
esac],
|
|
|
|
[ac_cv_want_[]$1=check])
|
2008-04-17 09:02:20 +00:00
|
|
|
])
|
2008-05-11 02:10:30 +00:00
|
|
|
m4_if([$4], [no], [ac_cv_want_[]$1=yes])
|
2008-03-19 22:38:01 +00:00
|
|
|
|
2008-05-18 10:12:18 +00:00
|
|
|
case "x$ac_cv_want_[]$1" in
|
|
|
|
"xno")
|
|
|
|
ac_cv_[]$1=no
|
|
|
|
;;
|
|
|
|
"xcheck")
|
|
|
|
PKG_CHECK_MODULES(PKG_NAME_UC, [$2], [ac_cv_[]$1=yes], [ac_cv_[]$1=no])
|
|
|
|
;;
|
|
|
|
"xyes")
|
|
|
|
PKG_CHECK_MODULES(PKG_NAME_UC, [$2])
|
|
|
|
# if we get here the test has succeeded
|
|
|
|
ac_cv_[]$1=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test "x$ac_cv_[]$1" = "xyes"; then
|
|
|
|
AC_DEFINE([USE_]PKG_NAME_UC, 1, [Define to 1 if we are using $1])
|
2008-02-20 04:12:28 +00:00
|
|
|
else
|
2008-05-18 10:12:18 +00:00
|
|
|
AC_DEFINE([USE_]PKG_NAME_UC, 0, [Define to 1 if we are using $1])
|
2008-02-20 04:12:28 +00:00
|
|
|
fi
|
2008-05-18 10:12:18 +00:00
|
|
|
|
2008-04-17 09:02:20 +00:00
|
|
|
AC_SUBST(PKG_NAME_UC[_CFLAGS])
|
|
|
|
AC_SUBST(PKG_NAME_UC[_LIBS])
|
2008-02-20 04:12:28 +00:00
|
|
|
|
2008-04-17 09:02:20 +00:00
|
|
|
m4_ifval([$6], [ AM_CONDITIONAL([$6], [test "x$ac_cv_[]$1" = "xyes"]) ], [:])
|
2008-02-20 04:12:28 +00:00
|
|
|
])
|