dl-fldigi/m4/pkg-config.m4

44 wiersze
1.6 KiB
Plaintext
Czysty Zwykły widok Historia

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
])
m4_if([$4], [yes], [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-04-17 09:02:20 +00:00
AC_DEFINE([USE_]PKG_NAME_UC, 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-04-17 09:02:20 +00:00
PKG_CHECK_MODULES(PKG_NAME_UC, [$2], [:], [:])
2008-02-20 04:12:28 +00:00
if test "x$ac_cv_[]$1" = "xyes"; then
2008-04-17 09:02:20 +00:00
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-04-17 09:02:20 +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
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
2008-04-17 09:02:20 +00:00
AC_MSG_NOTICE([--with-[]$1 was given, but test for $1 failed])
2008-03-19 22:38:01 +00:00
fi
2008-02-20 04:12:28 +00:00
else
2008-04-17 09:02:20 +00:00
AC_DEFINE([USE_]PKG_NAME_UC, 1, [Define to 1 if we are using $1])
2008-02-20 04:12:28 +00:00
fi
2008-04-17 09:02:20 +00:00
PKG_CHECK_MODULES(PKG_NAME_UC, $2) # for the error message
2008-02-20 04:12:28 +00:00
fi
fi
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
])