X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=16db6ced5edfe830b08052c3d885fda865f8875d;hb=ee0e16d4703f59f5c2f7301de9cd5140427a8ff1;hp=81d1104ef543f200e8b4deca5d903c2f1b762e16;hpb=d8017aecfc2fd57c9a8759b45c4bc655c4479afb;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 81d1104..16db6ce 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -134,43 +134,6 @@ m4_popdef([fp_Cache])[]dnl ])# FP_CHECK_ALIGNMENT -# FP_CHECK_CONST(EXPRESSION, [INCLUDES = DEFAULT-INCLUDES], [VALUE-IF-FAIL = -1]) -# ------------------------------------------------------------------------------- -# Defines CONST_EXPRESSION to the value of the compile-time EXPRESSION, using -# INCLUDES. If the value cannot be determined, use VALUE-IF-FAIL. -AC_DEFUN([FP_CHECK_CONST], -[AS_VAR_PUSHDEF([fp_Cache], [fp_cv_const_$1])[]dnl -AC_CACHE_CHECK([value of $1], fp_Cache, -[FP_COMPUTE_INT([$1], fp_check_const_result, [AC_INCLUDES_DEFAULT([$2])], - [fp_check_const_result=m4_default([$3], ['-1'])]) -AS_VAR_SET(fp_Cache, [$fp_check_const_result])])[]dnl -AC_DEFINE_UNQUOTED(AS_TR_CPP([CONST_$1]), AS_VAR_GET(fp_Cache), [The value of $1.])[]dnl -AS_VAR_POPDEF([fp_Cache])[]dnl -])# FP_CHECK_CONST - - -# FP_CHECK_CONSTS_TEMPLATE(EXPRESSION...) -# --------------------------------------- -# autoheader helper for FP_CHECK_CONSTS -m4_define([FP_CHECK_CONSTS_TEMPLATE], -[AC_FOREACH([fp_Const], [$1], - [AH_TEMPLATE(AS_TR_CPP(CONST_[]fp_Const), - [The value of ]fp_Const[.])])[]dnl -])# FP_CHECK_CONSTS_TEMPLATE - - -# FP_CHECK_CONSTS(EXPRESSION..., [INCLUDES = DEFAULT-INCLUDES], [VALUE-IF-FAIL = -1]) -# ----------------------------------------------------------------------------------- -# List version of FP_CHECK_CONST -AC_DEFUN(FP_CHECK_CONSTS, -[FP_CHECK_CONSTS_TEMPLATE([$1])dnl -for fp_const_name in $1 -do -FP_CHECK_CONST([$fp_const_name], [$2], [$3]) -done -])# FP_CHECK_CONSTS - - # FP_LEADING_UNDERSCORE # --------------------- # Test for determining whether symbol names have a leading underscore. We assume @@ -199,14 +162,15 @@ case $HostPlatform in alpha-dec-osf*) fptools_cv_leading_underscore=no;; *cygwin32) fptools_cv_leading_underscore=yes;; *mingw32) fptools_cv_leading_underscore=yes;; -*darwin) fptools_cv_leading_underscore=yes;; -*) AC_TRY_RUN([#ifdef HAVE_NLIST_H +*) AC_RUN_IFELSE([AC_LANG_SOURCE([[#ifdef HAVE_NLIST_H #include struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}}; struct nlist xYzzY2[] = {{"_xYzzY2", 0},{0}}; #endif -int main() +int main(argc, argv) +int argc; +char **argv; { #ifdef HAVE_NLIST_H if(nlist(argv[0], xYzzY1) == 0 && xYzzY1[0].n_value != 0) @@ -215,7 +179,7 @@ int main() exit(0); #endif exit(1); -}], [fptools_cv_leading_underscore=yes], [fptools_cv_leading_underscore=no], [fptools_cv_leading_underscore=no]) +}]])],[fptools_cv_leading_underscore=yes],[fptools_cv_leading_underscore=no],[fptools_cv_leading_underscore=no]) ;; esac]); AC_SUBST([LeadingUnderscore], [`echo $fptools_cv_leading_underscore | sed 'y/yesno/YESNO/'`]) @@ -526,52 +490,26 @@ fi rm -f conftest ])]) -dnl -dnl Extra testing of the result AC_PROG_CC, testing the gcc version no. -dnl *Must* be called after AC_PROG_CC -dnl -AC_DEFUN(FPTOOLS_HAVE_GCC, -[AC_CACHE_CHECK([whether you have an ok gcc], fptools_cv_have_gcc, + +# FP_HAVE_GCC +# ----------- +# Extra testing of the result AC_PROG_CC, testing the gcc version no. Sets the +# output variables HaveGcc and GccVersion. +AC_DEFUN([FP_HAVE_GCC], +[AC_REQUIRE([AC_PROG_CC]) +AC_CACHE_CHECK([whether your gcc is OK], [fp_cv_have_gcc], [if test -z "$GCC"; then - echo '' - echo "You would be better off with gcc" - echo "Perhaps it is already installed, but not in your PATH?" - fptools_cv_have_gcc='no' + fp_cv_have_gcc='no' + AC_MSG_WARN([You would be better off with gcc, perhaps it is already installed, but not in your PATH?]) else -changequote(, )dnl - gcc_version_str="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1\.\2/g' `" -changequote([, ])dnl - fptools_cv_have_gcc='yes' - FP_COMPARE_VERSIONS([$gcc_version_str], [-lt], [2.0], - [fptools_cv_have_gcc='no' - echo "" - echo "your gcc version appears to be ..." - $CC --version - echo "gcc prior to 2.0 and have never worked with ghc." - echo "we recommend 2.95.3, although versions back to 2.7.2 should be ok." - AC_MSG_ERROR([gcc 1.X has never been supported])]) -fi -]) -HaveGcc=`echo $fptools_cv_have_gcc | sed 'y/yesno/YESNO/'` -AC_SUBST(HaveGcc) -GccVersion=`gcc --version | grep mingw | cut -f 3 -d ' '` -AC_SUBST(GccVersion) -]) - -dnl -dnl Some OSs (Mandrake Linux, in particular) configure GCC with -dnl -momit-leaf-frame-pointer on by default. If this is the case, we -dnl need to turn it off for mangling to work. The test is currently a bit -dnl crude, using only the version number of gcc. -dnl -AC_DEFUN([FPTOOLS_GCC_NEEDS_NO_OMIT_LFPTR], -[AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], [fptools_cv_gcc_needs_no_omit_lfptr], -[FP_COMPARE_VERSIONS([$gcc_version_str], [-ge], [3.2], - [fptools_cv_gcc_needs_no_omit_lfptr=yes], - [fptools_cv_gcc_needs_no_omit_lfptr=no])]) -if test "$fptools_cv_gcc_needs_no_omit_lfptr" = "yes"; then - AC_DEFINE([HAVE_GCC_MNO_OMIT_LFPTR], [1], [Define to 1 if gcc supports -mno-omit-leaf-frame-pointer.]) -fi])# FPTOOLS_GCC_NEEDS_NO_OMIT_LFPTR + fp_cv_have_gcc='yes' + gcc_version_str="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\.\2/g' `" + FP_COMPARE_VERSIONS([$gcc_version_str], [-lt], [2.0], + [AC_MSG_ERROR([Need at least gcc version 2.0 (2.95.3 recommend)])]) +fi]) +AC_SUBST([HaveGcc], [`echo $fp_cv_have_gcc | sed 'y/yesno/YESNO/'`]) +AC_SUBST([GccVersion], [`gcc --version | grep mingw | cut -f 3 -d ' '`]) +])# FP_HAVE_GCC dnl Small feature test for perl version. Assumes PerlCmd @@ -654,7 +592,7 @@ dnl AC_DEFUN(FPTOOLS_GHC_VERSION, [FPTOOLS_NOCACHE_CHECK([version of ghc], [fptools_version_of_ghc], ["${WithGhc-ghc}" --version > conftestghc 2>&1 - cat conftestghc >&AC_FD_CC + cat conftestghc >&AS_MESSAGE_LOG_FD #Useless Use Of cat award... fptools_version_of_ghc=`cat conftestghc | sed -n -e 's/, patchlevel *\([[0-9]]\)/.\1/;s/.* version \([[0-9]][[0-9.]]*\).*/\1/p'` rm -fr conftest* @@ -710,7 +648,7 @@ AC_CACHE_VAL(AC_CV_NAME, [AC_CV_NAME_supported=yes fp_check_htype_save_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" -AC_TRY_RUN([#include +AC_RUN_IFELSE([AC_LANG_SOURCE([[#include #include #if HAVE_SYS_TYPES_H @@ -781,9 +719,9 @@ main() { } fclose(f); exit(0); -}],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 +}]])],[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) @@ -911,14 +849,66 @@ fi ])# FP_CHECK_DOCBOOK_DTD +# FP_GEN_FO +# ------------------ +# Generates a formatting objects document in conftest.fo. +AC_DEFUN([FP_GEN_FO], +[rm -f conftest.fo +cat > conftest.fo << EOF + + + + + + + + + + + Test! + + + + +EOF +]) # FP_GEN_FO + + +# FP_PROG_FOP +# ----------- +# Set the output variable 'FopCmd' to the first working 'fop' in the current +# 'PATH'. Note that /usr/bin/fop is broken in SuSE 9.1 (unpatched), so try +# /usr/share/fop/fop.sh in that case (or no 'fop'), too. +AC_DEFUN([FP_PROG_FOP], +[AC_PATH_PROGS([FopCmd1], [fop]) +if test -n "$FopCmd1"; then + AC_CACHE_CHECK([for $FopCmd1 usability], [fp_cv_fop_usability], + [FP_GEN_FO + if "$FopCmd1" -fo conftest.fo -ps conftest.ps > /dev/null 2>&1; then + fp_cv_fop_usability=yes + else + fp_cv_fop_usability=no + fi + rm -rf conftest*]) + if test x"$fp_cv_fop_usability" = xyes; then + FopCmd=$FopCmd1 + fi +fi +if test -z "$FopCmd"; then + AC_PATH_PROGS([FopCmd2], [fop.sh], , [/usr/share/fop]) + FopCmd=$FopCmd2 +fi +AC_SUBST([FopCmd]) +])# FP_PROG_FOP + + # FP_PROG_FO_PROCESSOR # -------------------- # Try to find an FO processor. PassiveTeX output is sometimes a bit strange, so -# try FOP first. Furthermore, /usr/bin/fop is broken in SuSE 9.1, so try the -# "real" fop.sh first. Sets the output variables FopCmd, XmltexCmd, DvipsCmd, -# and PdfxmltexCmd. +# try FOP first. Sets the output variables FopCmd, XmltexCmd, DvipsCmd, and +# PdfxmltexCmd. AC_DEFUN([FP_PROG_FO_PROCESSOR], -[AC_PATH_PROGS([FopCmd], [fop.sh fop], [], [$PATH:/usr/share/fop]) +[AC_REQUIRE([FP_PROG_FOP]) AC_PATH_PROG([XmltexCmd], [xmltex]) AC_PATH_PROG([DvipsCmd], [dvips]) if test -z "$FopCmd"; then @@ -958,220 +948,4 @@ else GhcPkgCmd=$fp_cv_matching_ghc_pkg fi])# FP_PROG_GHC_PKG - -# FP_CHECK_WIN32 -# -------------- -# If Windows is the target platform (e.g. MinGW/MSYS or Cygwin with -# -mno-cygwin), the variable "is_win32" is set to "yes", otherwise (e.g. *nix -# systems or plain Cygwin) it is set to "no". -AC_DEFUN([FP_CHECK_WIN32], -[AC_CACHE_CHECK([for Windows environment], [fp_cv_is_win32], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ -#if !_WIN32 - syntax error; -#endif -])], [fp_cv_is_win32=yes], [fp_cv_is_win32=no])]) -is_win32="$fp_cv_is_win32"[]dnl -])# FP_CHECK_WIN32 - - -# FP_PATH_X -# --------- -# Same as AC_PATH_X, but works even for broken Cygwins which try to include the -# non-existant header when -mno-cygwin is used. -AC_DEFUN([FP_PATH_X], -[AC_REQUIRE([FP_CHECK_WIN32]) -if test x"$is_win32" = xyes; then - no_x=yes -else - AC_PATH_X -fi -])# FP_PATH_X - - -# FP_PATH_XTRA -# ------------ -# Same as AC_PATH_XTRA, but works even for broken Cygwins which try to include -# the non-existant header when -mno-cygwin is used. -AC_DEFUN([FP_PATH_XTRA], -[AC_REQUIRE([FP_CHECK_WIN32]) -if test x"$is_win32" = xyes; then - no_x=yes -else - AC_PATH_XTRA -fi -])# FP_PATH_XTRA - - -# FP_CHECK_GL_HELPER(LIBNAME, LIBS, INCLUDES, FUNCTION-BODY) -# ---------------------------------------------------------- -# Try each library in LIBS to successfully link INCLUDES plus FUNCTION-BODY, -# setting LIBNAME_CFLAGS and LIBNAME_LIBS to the corresponding values. Sets -# no_LIBNAME to "yes" if no suitable library was found. (LIBNAME_CFLAGS0 -# contains the value of LIBNAME_CFLAGS without CPPFLAGS, and LIBNAME_LIBS0 -# contains the value of LIBNAME_LIBS without LDFLAGS, but these are only -# used internally.) -AC_DEFUN([FP_CHECK_GL_HELPER], -[AC_CACHE_CHECK([for $1 library], [fp_cv_check_$1_lib], - [fp_cv_check_$1_lib="no" - fp_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS ${$1_CFLAGS}" - fp_save_LIBS="$LIBS" - for fp_try_lib in $2; do - # transform "-lfoo" to "foo.lib" when using cl - if test x"$CC" = xcl; then - fp_try_lib=`echo $fp_try_lib | sed -e 's/^-l//' -e 's/$/.lib/'` - fi - LIBS="$fp_try_lib ${$1_LIBS} $fp_save_LIBS" - AC_TRY_LINK([$3], [$4], [fp_cv_check_$1_lib="$fp_try_lib ${$1_LIBS}"; break]) - done - LIBS="$fp_save_LIBS" - CPPFLAGS="$fp_save_CPPFLAGS"]) - - if test x"$fp_cv_check_$1_lib" = xno; then - no_$1=yes - $1_CFLAGS= - $1_LIBS= - else - $1_CFLAGS0="${$1_CFLAGS}" - $1_CFLAGS="$CPPFLAGS ${$1_CFLAGS0}" - $1_LIBS0="$fp_cv_check_$1_lib" - $1_LIBS="$LDFLAGS ${$1_LIBS0}" - fi -])# FP_CHECK_GL_HELPER - - -# FP_CHECK_GL -# ----------- -AC_DEFUN([FP_CHECK_GL], -[AC_REQUIRE([FP_PATH_X]) -AC_REQUIRE([AC_CANONICAL_SYSTEM]) - -AC_ARG_ENABLE([hopengl], - [AC_HELP_STRING([--enable-hopengl], - [build a Haskell binding for OpenGL (GL/GLU). On Mac OS X, use - --enable-hopengl=x11 to use X11 instead of the "native" libraries. - (default=no)])], - [enable_opengl=$enableval], [enable_opengl=no]) - -if test x"$enable_opengl" = xno; then - no_GL=yes -else - use_quartz_opengl=no - case $target_os in - darwin*) - if test x"$enable_opengl" != xx11; then - AC_DEFINE([USE_QUARTZ_OPENGL], [1], - [Define to 1 if native OpenGL should be used on Mac OS X]) - use_quartz_opengl=yes - fi - ;; - esac - - if test x"$use_quartz_opengl" != xyes; then - AC_CHECK_LIB([m], [atan], [GL_LIBS="-lm $GL_LIBS"]) - - if test x"$no_x" != xyes; then - test -n "$x_includes" && GL_CFLAGS="-I$x_includes $GL_CFLAGS" - test -n "$x_libraries" && GL_LIBS="-L$x_libraries -lX11 $GL_LIBS" - fi - - FP_CHECK_GL_HELPER([GL], [-lGL -lopengl32], [@%:@include ], [glEnd()]) - - if test x"$no_GL" != xyes; then - # Ugly: To get wglGetProcAddress on Windows, we have to link with - # opengl32.dll, too, even when we are using Cygwin with X11. - case "$GL_LIBS" in - *-lopengl32*|*opengl32.lib*) ;; - *) fp_save_LIBS="$LIBS" - LIBS="$LIBS -lopengl32" - AC_TRY_LINK([@%:@include ], [glEnd()], - [GL_LIBS="$GL_LIBS -lopengl32"; GL_LIBS0="$GL_LIBS0 -lopengl32"]) - LIBS="$fp_save_LIBS" - ;; - esac - fi - fi -fi - -AC_SUBST([GL_CFLAGS]) -AC_SUBST([GL_LIBS]) -])# FP_CHECK_GL - - -# FP_CHECK_GLU -# ------------ -AC_DEFUN([FP_CHECK_GLU], -[AC_REQUIRE([FP_CHECK_GL])dnl -GLU_CFLAGS="$GL_CFLAGS0" -GLU_LIBS="$GL_LIBS0" - -if test x"$enable_opengl" = xno; then - no_GLU=yes -elif test x"$use_quartz_opengl" != xyes; then - FP_CHECK_GL_HELPER([GLU], [-lglu32 -lGLU], [@%:@include ], [gluNewQuadric()]) -fi - -AC_SUBST([GLU_CFLAGS]) -AC_SUBST([GLU_LIBS]) -])# FP_CHECK_GLU - - -# FP_CHECK_GLUT -# ------------- -AC_DEFUN([FP_CHECK_GLUT], -[AC_REQUIRE([FP_CHECK_GLU]) -FP_PATH_XTRA - -if test x"$enable_opengl" = xno; then - no_GLUT=yes -elif test x"$use_quartz_opengl" != xyes; then - GLUT_CFLAGS="$GLU_CFLAGS0" - GLUT_LIBS="$GLU_LIBS0" - - if test x"$no_x" != xyes; then - GLUT_LIBS="$X_PRE_LIBS -lXmu -lXi $X_EXTRA_LIBS $GLUT_LIBS" - fi - - AC_CHECK_HEADERS([windows.h GL/glut.h]) - # Note 1: On Cygwin with X11, GL/GLU functions use the "normal" calling - # convention, but GLUT functions use stdcall. To get this right, it is - # necessary to include first. - # Note 2: MinGW/MSYS comes without a GLUT header, so we use Cygwin's one in - # that case. - FP_CHECK_GL_HELPER([GLUT], [-lglut32 -lglut], [ -#if HAVE_WINDOWS_H -#include -#endif -#if HAVE_GL_GLUT_H -#include -#else -#include "glut_local.h" -#endif - ], [glutMainLoop()]) -fi - -AC_SUBST([GLUT_CFLAGS]) -AC_SUBST([GLUT_LIBS]) -])# FP_CHECK_GLUT - - -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