X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=7472ce38eed83be90b766dd0221d8cde7c94f7c4;hb=b9267a7e597428ad9c8ce3a06e452dcfe7226300;hp=ed95f780d4b54a6d79c31f2da1451c63d771fcc6;hpb=f5d11ad4c5cd0c1e4f5fc95c43ba68da4e399bbe;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index ed95f78..7472ce3 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -669,7 +669,9 @@ define(<>, translit(fptools_cv_htype_sup_$1, [ *], [_p]))d changequote([, ])dnl AC_MSG_CHECKING(Haskell type for $1) AC_CACHE_VAL(AC_CV_NAME, -[AC_CV_NAME_supported=yes; +[AC_CV_NAME_supported=yes +fp_check_htype_save_cppflags="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $X_CFLAGS" AC_TRY_RUN([#include #include @@ -744,6 +746,7 @@ main() { }],AC_CV_NAME=`cat conftestval`, ifelse([$2], , [AC_CV_NAME=NotReallyAType; AC_CV_NAME_supported=no], AC_CV_NAME=$2), ifelse([$3], , [AC_CV_NAME=NotReallyATypeCross; AC_CV_NAME_supported=no], AC_CV_NAME=$3))]) dnl +CPPFLAGS="$fp_check_htype_save_cppflags" if test "$AC_CV_NAME_supported" = yes; then AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [Define to Haskell type for $1]) @@ -1106,4 +1109,22 @@ dnl and we don't want to be global namespace polluters. AC_LANG_RESTORE ]) + +dnl @synopsis FP_EMPTY_STRUCTS +dnl +dnl Check whether empty structs is accepted by CC. +dnl +AC_DEFUN(FP_EMPTY_STRUCTS, +[AC_CACHE_CHECK(empty struct support, fptools_cv_empty_structs, +[AC_TRY_COMPILE([ +typedef struct { /*empty*/ } StgFoo; +], +[int i;], +fptools_cv_empty_structs=yes, +fptools_cv_empty_structs=no)]) +if test "$fptools_cv_empty_structs" = yes; then +AC_DEFINE([SUPPORTS_EMPTY_STRUCTS], [1], [Define to 1 if C compiler supports declaration of empty structure types.]) +fi +]) + # LocalWords: fi