From 7c651f3267e4d707ac587e84b5e672dab1594f69 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 29 Aug 2001 17:01:23 +0000 Subject: [PATCH] new macro for doing --with-foo, --with-foo-include, and --with-foo-lib in a sensible way git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10593 ec53bebd-3082-4978-b11e-865c3cabbd6b --- cf/with-all.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 cf/with-all.m4 diff --git a/cf/with-all.m4 b/cf/with-all.m4 new file mode 100644 index 000000000..6f4b4cef4 --- /dev/null +++ b/cf/with-all.m4 @@ -0,0 +1,42 @@ +dnl +dnl $Id$ +dnl + +dnl AC_WITH_ALL(name) + +AC_DEFUN([AC_WITH_ALL], [ +AC_ARG_WITH($1, + AC_HELP_STRING([--with-$1=dir], + [use $1 in dir])) + +AC_ARG_WITH($1-lib, + AC_HELP_STRING([--with-$1-lib=dir], + [use $1 libraries in dir]), +[if test "$withval" = "yes" -o "$withval" = "no"; then + AC_MSG_ERROR([No argument for --with-$1-lib]) +elif test "X$with_$1" = "X"; then + with_$1=yes +fi]) + +AC_ARG_WITH($1-include, + AC_HELP_STRING([--with-$1-include=dir], + [use $1 headers in dir]), +[if test "$withval" = "yes" -o "$withval" = "no"; then + AC_MSG_ERROR([No argument for --with-$1-include]) +elif test "X$with_$1" = "X"; then + with_$1=yes +fi]) + +case "$with_$1" in +yes) ;; +no) ;; +"") ;; +*) if test "$with_$1_include" = ""; then + with_$1_include="$with_$1/include" + fi + if test "$with_$1_lib" = ""; then + with_$1_lib="$with_$1/lib$abilibdirext" + fi + ;; +esac +]) \ No newline at end of file