X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=3b8c7f27642b0177016cf424573a2454314acfae;hb=948e7f388748078a8d9a324b284da7c4029f7060;hp=ea73a21444ed9b6f0954683c638738c044b718ff;hpb=31667d5ee9808bc7e400de70397df317b6c1020c;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index ea73a21..3b8c7f2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -269,15 +269,15 @@ AS_IF([test "$fp_num1" $2 "$fp_num2"], [$4], [$5])[]dnl dnl -dnl Check for Greencard and version. +dnl Check for GreenCard and version. dnl AC_DEFUN(FPTOOLS_GREENCARD, [ -AC_PATH_PROG(GreencardCmd,greencard) +AC_PATH_PROG(GreenCardCmd,greencard) AC_CACHE_CHECK([for version of greencard], fptools_cv_greencard_version, changequote(, )dnl -[if test x"$GreencardCmd" != x; then - fptools_cv_greencard_version="`$GreencardCmd --version | +[if test x"$GreenCardCmd" != x; then + fptools_cv_greencard_version="`$GreenCardCmd --version | grep 'version' | sed -e 's/greencard. version \([^ ]*\).*/\1/g'`" else fptools_cv_greencard_version="" @@ -286,8 +286,8 @@ changequote([, ])dnl ]) FP_COMPARE_VERSIONS([$fptools_cv_greencard_version],[-lt],[$1], [AC_MSG_ERROR([greencard version $1 or later is required (found '$fptools_cv_greencard_version')])])[]dnl -GreencardVersion=$fptools_cv_greencard_version -AC_SUBST(GreencardVersion) +GreenCardVersion=$fptools_cv_greencard_version +AC_SUBST(GreenCardVersion) ]) dnl @@ -372,10 +372,10 @@ else fi; changequote([, ])dnl ]) -dnl if test -d $srcdir/ghc -a ! -f $srcdir/ghc/compiler/parser/Lexer.hs; then -dnl FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[2.0], -dnl [AC_MSG_ERROR([Alex version 2.0 or later is required to compile GHC.])])[]dnl -dnl fi +if test -d $srcdir/ghc -a ! -f $srcdir/ghc/compiler/parser/Lexer.hs; then + FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[2.0], + [AC_MSG_ERROR([Alex version 2.0 or later is required to compile GHC.])])[]dnl +fi AlexVersion=$fptools_cv_alex_version; AC_SUBST(AlexVersion) ]) @@ -657,10 +657,12 @@ dnl The name to #define. define(<>, translit(htype_$1, [a-z *], [A-Z_P]))dnl dnl The cache variable name. define(<>, translit(fptools_cv_htype_$1, [ *], [_p]))dnl +define(<>, translit(fptools_cv_htype_sup_$1, [ *], [_p]))dnl changequote([, ])dnl AC_MSG_CHECKING(Haskell type for $1) AC_CACHE_VAL(AC_CV_NAME, -[AC_TRY_RUN([#include +[AC_CV_NAME_supported=yes; +AC_TRY_RUN([#include #include #ifdef HAVE_SYS_TYPES_H @@ -727,16 +729,20 @@ main() { } fclose(f); exit(0); -}], AC_CV_NAME=`cat conftestval`, -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, [Define to Haskell type for $1]) +}],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 +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]) +else + AC_MSG_RESULT([not supported]) +fi undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl +undefine([AC_CV_NAME_supported])dnl ]) - dnl Based on AC_TRY_LINK - run iftrue if links cleanly with no warning dnl FPTOOLS_TRY_LINK_NOWARN(flags,main?,iftrue,iffalse) @@ -1057,7 +1063,9 @@ dnl and GL_X_LIBS/GLUT_X_LIBS. GL_CFLAGS= fi - LIBS="$GLUT_X_LIBS" + dnl Keep the GL/GLU/GLX libs, but expand the rest to what GLUT needs. + dnl (Some systems, like OpenBSD, need the GL/GLU libs.) + LIBS=`echo "$LIBS" | sed "s@$GL_X_LIBS@$GLUT_X_LIBS@"` FPTOOLS_SEARCH_LIBS([#include ], glutMainLoop, glut32 glut, have_glut=yes, have_glut=no)