2008-03-19 22:38:01 +00:00
|
|
|
# name, version, optional?, opt-prefix, subst-var-prefix, help-text, [am-cond]
|
2008-02-20 04:12:28 +00:00
|
|
|
AC_DEFUN([AC_FLDIGI_PKG_CHECK], [
|
|
|
|
|
2008-04-08 21:15:43 +00:00
|
|
|
m4_ifval([$3],
|
|
|
|
[ AC_ARG_WITH($1, AC_HELP_STRING([--[]$4-[]$1], [$6]),
|
|
|
|
[case "${withval}" in
|
|
|
|
yes|no) ac_cv_want_[]$1="${withval}" ;;
|
|
|
|
*) AC_MSG_ERROR([bad value "${withval}" for --[]$4-[]$1]) ;;
|
|
|
|
esac],
|
|
|
|
[ac_cv_want_[]$1=check])
|
|
|
|
],
|
|
|
|
[ac_cv_want_[]$1=yes] )
|
2008-03-19 22:38:01 +00:00
|
|
|
|
2008-02-20 04:12:28 +00:00
|
|
|
if test "x$ac_cv_want_[]$1" = "xno"; then
|
2008-03-19 22:38:01 +00:00
|
|
|
AC_DEFINE([USE_][$5], 0)
|
2008-02-20 04:12:28 +00:00
|
|
|
ac_cv_[]$1=no
|
|
|
|
else
|
|
|
|
PKG_CHECK_EXISTS([$2], ac_cv_[]$1=yes, ac_cv_[]$1=no)
|
|
|
|
if test "x$ac_cv_want_[]$1" = "xcheck"; then
|
2008-03-19 22:38:01 +00:00
|
|
|
PKG_CHECK_MODULES([$5], [$2], [:], [:])
|
2008-02-20 04:12:28 +00:00
|
|
|
if test "x$ac_cv_[]$1" = "xyes"; then
|
2008-03-19 22:38:01 +00:00
|
|
|
AC_DEFINE([USE_][$5], 1, [Define to 1 if we are using [$1]])
|
2008-02-20 04:12:28 +00:00
|
|
|
else
|
2008-03-19 22:38:01 +00:00
|
|
|
AC_DEFINE([USE_][$5], 0, [Define to 1 if we are using [$1]])
|
2008-02-20 04:12:28 +00:00
|
|
|
fi
|
|
|
|
else # $ac_cv_want_[]$1 is yes
|
|
|
|
if test "x$ac_cv_[]$1" = "xno"; then
|
2008-03-19 22:38:01 +00:00
|
|
|
if test "x$3" = "xyes"; then
|
|
|
|
AC_MSG_NOTICE([--[]$4-[]$1 was given, but test for [$1] failed])
|
|
|
|
fi
|
2008-02-20 04:12:28 +00:00
|
|
|
else
|
2008-03-19 22:38:01 +00:00
|
|
|
AC_DEFINE([USE_][$5], 1, [Define to 1 if we are using [$1]])
|
2008-02-20 04:12:28 +00:00
|
|
|
fi
|
2008-03-19 22:38:01 +00:00
|
|
|
PKG_CHECK_MODULES([$5], [$2]) # for the error message
|
2008-02-20 04:12:28 +00:00
|
|
|
fi
|
|
|
|
fi
|
2008-03-19 22:38:01 +00:00
|
|
|
AC_SUBST([$5][_CFLAGS])
|
|
|
|
AC_SUBST([$5][_LIBS])
|
2008-02-20 04:12:28 +00:00
|
|
|
|
2008-03-19 22:38:01 +00:00
|
|
|
m4_ifval([$7], [ AM_CONDITIONAL([$7], [test "x$ac_cv_[]$1" = "xyes"]) ], [:])
|
2008-02-20 04:12:28 +00:00
|
|
|
])
|