X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=2a418c16174ce27370c85dff4b8c28b51925e154;hb=6b4abadb6b860d53ed20d795cd2274bd7fc275f8;hp=d07f3652254f79893e7be4ee2f3542fa886b294d;hpb=9c75067ef972c8003dede073a68e953ed15c61ad;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index d07f365..2a418c1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -4,11 +4,35 @@ # ensure we don't clash with any pre-supplied autoconf ones. -# FP_ALTZONE +# FP_PROG_CONTEXT_DIFF +# -------------------- +# Figure out how to do context diffs. Sets the output variable ContextDiffCmd. +# NB: NeXTStep thinks diff'ing a file against itself is "trouble". +# Used by ghc, glafp-utils/ltx, and glafp-utils/runstdtest +AC_DEFUN([FP_PROG_CONTEXT_DIFF], +[AC_CACHE_CHECK([for a working context diff], [fp_cv_context_diff], +[echo foo > conftest1 +echo foo > conftest2 +fp_cv_context_diff=no +for fp_var in '-C 1' '-c1' +do + if diff $fp_var conftest1 conftest2 > /dev/null 2>&1; then + fp_cv_context_diff="diff $fp_var" + break + fi +done]) +if test x"$fp_cv_context_diff" = xno; then + AC_MSG_ERROR([cannot figure out how to do context diffs]) +fi +AC_SUBST(ContextDiffCmd, [$fp_cv_context_diff]) +])# FP_PROG_CONTEXT_DIFF + + +# FP_DECL_ALTZONE # ------------------- # Defines HAVE_DECL_ALTZONE to 1 if declared, 0 otherwise. # Used by base package. -AC_DEFUN([FP_ALTZONE], +AC_DEFUN([FP_DECL_ALTZONE], [AC_REQUIRE([AC_HEADER_TIME])dnl AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_DECLS([altzone], [], [],[#if TIME_WITH_SYS_TIME @@ -21,7 +45,7 @@ AC_CHECK_DECLS([altzone], [], [],[#if TIME_WITH_SYS_TIME # include # endif #endif]) -])# FP_ALTZONE +])# FP_DECL_ALTZONE # FP_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS) @@ -49,7 +73,8 @@ AC_CACHE_CHECK([alignment of $1], AS_TR_SH([fp_cv_alignment_$1]), FP_COMPUTE_INT([(long) (&((struct { char c; $1 ty; } *)0)->ty)], [AS_TR_SH([fp_cv_alignment_$1])], [AC_INCLUDES_DEFAULT([$3])], - [AC_MSG_FAILURE([cannot compute alignment ($1), 77])]) + [AC_MSG_ERROR([cannot compute alignment ($1) +See `config.log' for more details.], [77])]) else AS_TR_SH([fp_cv_alignment_$1])=0 fi])dnl @@ -121,7 +146,7 @@ esac); LeadingUnderscore=`echo $fptools_cv_lead_uscore | sed 'y/yesno/YESNO/'` AC_SUBST(LeadingUnderscore) case $LeadingUnderscore in -YES) AC_DEFINE(LEADING_UNDERSCORE);; +YES) AC_DEFINE([LEADING_UNDERSCORE], [1], [Define to 1 if C symbols have a leading underscore added by the compiler.]);; esac ]) @@ -270,31 +295,6 @@ AlexVersion=$fptools_cv_alex_version; AC_SUBST(AlexVersion) ]) -dnl -dnl What's the best way of doing context diffs? -dnl -dnl (NB: NeXTStep thinks diff'ing a file against itself is "trouble") -dnl -AC_DEFUN(FPTOOLS_PROG_DIFF, -[AC_CACHE_CHECK([for ok way to do context diffs], fptools_cv_context_diffs, -[echo foo > conftest1 -echo foo > conftest2 -if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then - fptools_cv_context_diffs='diff -C 1' -else - if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then - fptools_cv_context_diffs='diff -c1' - else - echo "Can't figure out how to do context diffs." - echo "Neither \`diff -C 1' nor \`diff -c1' works." - exit 1 - fi -fi -rm -f conftest1 conftest2 -]) -ContextDiffCmd=$fptools_cv_context_diffs -AC_SUBST(ContextDiffCmd) -]) dnl dnl Check whether ld supports -x @@ -450,7 +450,7 @@ AC_DEFUN(FPTOOLS_GCC_NEEDS_NO_OMIT_LFPTR, fptools_cv_gcc_needs_no_omit_lfptr='yes') ]) if test "$fptools_cv_gcc_needs_no_omit_lfptr" = "yes"; then - AC_DEFINE(HAVE_GCC_MNO_OMIT_LFPTR) + AC_DEFINE([HAVE_GCC_MNO_OMIT_LFPTR], [1], [Define to 1 if gcc supports -mno-omit-leaf-frame-pointer.]) fi ]) @@ -649,7 +649,7 @@ main() { ifelse([$2], , AC_CV_NAME=NotReallyAType, AC_CV_NAME=$2), ifelse([$3], , AC_CV_NAME=NotReallyATypeCross, AC_CV_NAME=$3))]) dnl AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [Define to Haskell type for $1]) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) @@ -679,15 +679,26 @@ eval "$cv_name=-1", eval "$cv_name=-1")])dnl eval "fptools_check_cconst_result=`echo '$'{$cv_name}`" AC_MSG_RESULT($fptools_check_cconst_result) -AC_DEFINE_UNQUOTED(CCONST_$1, $fptools_check_cconst_result) +AC_DEFINE_UNQUOTED(CCONST_$1, $fptools_check_cconst_result, [The value of $1.]) unset fptools_check_cconst_result ]) + +# FP_CHECK_CCONSTS_TEMPLATE(CONST...) +# ----------------------------------- +m4_define([FP_CHECK_CCONSTS_TEMPLATE], +[AC_FOREACH([FP_Const], [$1], + [AH_TEMPLATE(AS_TR_CPP(CCONST_[]FP_Const), + [The value of ]FP_Const[.])])[]dnl +])# FP_CHECK_CCONSTS_TEMPLATE + + dnl ** Invoke AC_CHECK_CCONST on each argument (which have to separate with dnl spaces) dnl AC_DEFUN(FPTOOLS_CHECK_CCONSTS, -[for ac_const_name in $1 +[FP_CHECK_CCONSTS_TEMPLATE([$1])dnl +for ac_const_name in $1 do FPTOOLS_CHECK_CCONST($ac_const_name)dnl done @@ -715,7 +726,7 @@ AC_LANG_RESTORE ]) AC_MSG_RESULT($fptools_cv_have_o_binary) if test "$fptools_cv_have_o_binary" = yes; then -AC_DEFINE(HAVE_O_BINARY) + AC_DEFINE([HAVE_O_BINARY], [1], [Define to 1 if fcntl.h defines O_BINARY.]) fi ]) @@ -1103,7 +1114,7 @@ AC_DEFUN(FPTOOLS_MSGHDR_MSG_CONTROL, #include ], [struct msghdr m; m.msg_control;], fptools_cv_struct_msghdr_msg_control=yes, fptools_cv_struct_msghdr_msg_control=no)]) if test $fptools_cv_struct_msghdr_msg_control = yes; then - AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL) + AC_DEFINE([HAVE_MSGHDR_MSG_CONTROL], [1], [Define if struct msghdr contains msg_control field.]) fi AC_SUBST(HAVE_MSGHDR_MSG_CONTROL)dnl ]) @@ -1118,7 +1129,7 @@ AC_DEFUN(FPTOOLS_MSGHDR_MSG_ACCRIGHTS, #include ], [struct msghdr m; m.msg_accrights;], fptools_cv_struct_msghdr_msg_accrights=yes, fptools_cv_struct_msghdr_msg_accrights=no)]) if test $fptools_cv_struct_msghdr_msg_accrights = yes; then - AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS) + AC_DEFINE([HAVE_MSGHDR_MSG_ACCRIGHTS], [1], [Define to 1 if struct msghdr contains msg_accrights field.]) fi AC_SUBST(HAVE_MSGHDR_MSG_ACCRIGHTS)dnl ])