diff options
Diffstat (limited to 'lib/make/aclocal.m4')
-rw-r--r-- | lib/make/aclocal.m4 | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/lib/make/aclocal.m4 b/lib/make/aclocal.m4 new file mode 100644 index 00000000..83f5e99b --- /dev/null +++ b/lib/make/aclocal.m4 @@ -0,0 +1,72 @@ +dnl /*@@ +dnl @file aclocal.m4 +dnl @date Thu Oct 21 00:05:58 1999 +dnl @author Tom Goodale +dnl @desc +dnl Local Cactus macros +dnl @enddesc +dnl @version $Header$ +dnl @@*/ + + +dnl These are copies of the standard autoconf macros, except they +dnl use AC_TRY_COMPILE rather than AC_TRY_CPP to check for headers. +dnl This gets round the problem on cygwin where the gnu cpp finds +dnl the gcc headers and not the ones for the actual compiler. + +dnl CCTK_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(CCTK_CHECK_HEADER, +[dnl Do the transliteration at runtime so arg 1 can be a shell variable. +cctk_safe=`echo "$1" | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(cctk_cv_header_$cctk_safe, +[AC_TRY_COMPILE([#include <$1>], [return 0;], eval "cctk_cv_header_$cctk_safe=yes", + eval "cctk_cv_header_$cctk_safe=no")])dnl +if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) +ifelse([$3], , , [$3 +])dnl +fi +]) + +dnl CCTK_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +AC_DEFUN(CCTK_CHECK_HEADERS, +[for cctk_hdr in $1 +do +CCTK_CHECK_HEADER($cctk_hdr, +[changequote(, )dnl + cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($cctk_tr_hdr) $2], $3)dnl +done +]) + + +dnl CCTK_FIND_NULLDEVICE +dnl Have to do it in this rather bizarre way +dnl as cygwin emulates /dev/null +AC_DEFUN(CCTK_FIND_NULLDEVICE, +[AC_MSG_CHECKING([for the null device]) +AC_CACHE_VAL(cctk_cv_nulldevice, +[ +if test -d /dev ; then + eval "cctk_cv_nulldevice=/dev/null" +else + cat > NUL <<EOF +test +EOF + if `cat NUL > /dev/null 2>/dev/null` ; then + eval "cctk_cv_nulldevice=NUL" + fi +fi +]) +if eval "test -n \"$cctk_cv_nulldevice\"" ; then + AC_MSG_RESULT($NULL_DEVICE) + AC_DEFINE_UNQUOTED(NULL_DEVICE, "$cctk_cv_nulldevice") +else + AC_MSG_RESULT("not found") +fi +]) |