X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=acinclude.m4;fp=acinclude.m4;h=714a850dbd5ca67ca9d15f06e83cd91f71fa3e74;hb=b2ab37962f7c709332c19418b421df0a0d974a26;hp=0000000000000000000000000000000000000000;hpb=08b74f8c85e9c6c4b1813c8ae8f86a235249641a;p=doldaconnect.git diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..714a850 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,59 @@ +AC_DEFUN([DOLDA_AC_GROUP], +[AC_MSG_NOTICE([ -- $1 -- ])]) + +m4_defun([_DOLDA_PKG_LOOP],[dnl +if test -z "$[]$1"; then + $2 +fi +ifelse(m4_eval([$# > 2]), 1, [_DOLDA_PKG_LOOP($1, m4_shift(m4_shift($@)))]) +]) + +# DOLDA_PKG(VARIABLE-NAME, COMMANDS...) +# +# Evaluate COMMANDS in sequence as long as ${VARIABLE-NAME} is empty + +AC_DEFUN([DOLDA_PKG],[dnl +$1="" +_DOLDA_PKG_LOOP($1, m4_shift($@)) +if test "$[]$1" != no; then $1=yes; fi +]) + +# DOLDA_CHECK_HEADER(FILE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND, +# [EXTRA-CFLAGS]) +# +# Augmented version of AC_CHECK_HEADER that overrides CPPFLAGS + +AC_DEFUN([DOLDA_CHECK_HEADER],[dnl +cpp_bak="$CPPFLAGS" +ifelse([$4], , , [CPPFLAGS="$CPPFLAGS $4"]) +AC_CHECK_HEADER($1, $2, $3) +CPPFLAGS="$cpp_bak" +]) + +# DOLDA_ENABLE(NAME, HELP, DEFAULT, DEPS) +# +# DEPS is a space-separated listing of required variables that must be +# `yes' + +AC_DEFUN([DOLDA_ENABLE],[dnl +AC_ARG_ENABLE([$1], [$2]) +if test "[$enable_][$1]" = yes; then + for var in [$4]; do + if test "${!var}" != yes; then + AC_MSG_ERROR([*** cannot enable $1 without $var]) + fi + done +else + ifelse([$3], yes, [dnl + [enable_][$1]=yes + for var in [$4]; do + if test "${!var}" != yes; then + [enable_][$1]=no + break + fi + done +], [dnl + [enable_][$1]=no +]) +fi +])