Skip to content
Snippets Groups Projects
Commit cc9c436e authored by Claus-Justus Heine's avatar Claus-Justus Heine
Browse files

Optional packages can be disabled with one switch.

parent ee104194
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,37 @@ dnl $5: header name
dnl $6: include path (-I$6)
dnl $7 \in \{optional, required\}, bail out if required, warning otherwise
dnl
AC_DEFUN([ALBERT_CHECK_PKG_OPT],
[AC_ARG_WITH($1,
AC_HELP_STRING([--without-$1], [disable use of package $1
(default: autodetect)]),
[case "$withval" in
yes)
;;
no)
DISABLE=yes
;;
*)
AC_MSG_ERROR(["$withval" should have been either "yes" or "no"])
;;
esac],
[DISABLE=no])
])
AC_DEFUN(ALBERT_CHECK_PACKAGE,
[AC_REQUIRE([AC_SET_PREFIX])
#
# foobar
#
m4_if($7, optional,[ALBERT_CHECK_PKG_OPT([$1])])
m4_ifval([$7], [optional], echo barfoo)
dnl if test "$7" = "optional"; then
dnl ALBERT_CHECK_PKG_OPT([$1])
dnl fi
if test "$DISABLE" = yes; then
:
else
if test -z "$3"; then
DEFAULT_LIBDIR=`eval eval echo ${libdir}`
else
......@@ -93,6 +122,9 @@ else
1, Define to 1 if you have lib$2)
fi
fi
fi dnl disable fi
AC_SUBST(m4_bpatsubst([$1],-,_)_INCLUDE_PATH)
AC_SUBST(m4_bpatsubst([$1],-,_)_LIB_PATH)
AC_SUBST(m4_bpatsubst([$1],-,_)_LIB)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment