X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=37a731e30c6dd8de6c7b927a530225048c5eaaa9;hb=247e8ad162edd7fb57396193aacfc5d7c56a2727;hp=cc7cdab33269a85b3a74e68ac8d104128e63227b;hpb=eb1309d235adf5a65f90803d6291096c93cb7f02;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index cc7cdab..37a731e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.117 2003/05/23 16:36:58 panne Exp $ +dnl $Id: aclocal.m4,v 1.124 2003/08/14 15:43:22 simonmar Exp $ dnl dnl Extra autoconf macros for the Glasgow fptools dnl @@ -192,19 +192,19 @@ dnl Check for Greencard and version. dnl AC_DEFUN(FPTOOLS_GREENCARD, [ -AC_PATH_PROG(GreencardCmd,green-card) -AC_CACHE_CHECK([for version of green-card], fptools_cv_greencard_version, +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 | - grep 'version' | sed -e 's/green-card. version \([^ ]*\).*/\1/g'`" + grep 'version' | sed -e 's/greencard. version \([^ ]*\).*/\1/g'`" else fptools_cv_greencard_version="" fi changequote([, ])dnl ]) FPTOOLS_PROG_CHECK_VERSION([$fptools_cv_greencard_version],-lt,$1, - [AC_MSG_ERROR([green-card version $1 or later is required (found '$fptools_cv_greencard_version')])])dnl + [AC_MSG_ERROR([greencard version $1 or later is required (found '$fptools_cv_greencard_version')])])dnl GreencardVersion=$fptools_cv_greencard_version AC_SUBST(GreencardVersion) ]) @@ -265,6 +265,41 @@ dnl do without it for now. ]) dnl +dnl Check for Alex and version. If we're building GHC, then we need +dnl at least Alex version 2.0. If there's no installed Alex, we look +dnl for a alex source tree and point the build system at that instead. +dnl +AC_DEFUN(FPTOOLS_ALEX, +[ +if test -d $srcdir/alex; then + SrcTreeAlexCmd=$hardtop/alex/src/alex-inplace +fi +if test x"$UseSrcTreeAlex" = xYES; then + AlexCmd=$SrcTreeAlexCmd +else + AC_PATH_PROG(AlexCmd,alex,$SrcTreeAlexCmd) +fi +AC_CACHE_CHECK([for version of alex], fptools_cv_alex_version, +changequote(, )dnl +[if test x"$AlexCmd" = x"$SrcTreeAlexCmd"; then + fptools_cv_alex_version=`grep '^ProjectVersion[ ]*=' $srcdir/alex/mk/version.mk | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`; +elif test x"$AlexCmd" != x; then + fptools_cv_alex_version="`$AlexCmd -v | + grep 'Alex [Vv]ersion' | sed -e 's/Alex [Vv]ersion \([0-9\.]*\).*/\1/g'`" ; +else + fptools_cv_alex_version=""; +fi; +changequote([, ])dnl +]) +dnl if test -d $srcdir/ghc -a ! -f $srcdir/ghc/compiler/parser/Lexer.hs; then +dnl FPTOOLS_PROG_CHECK_VERSION([$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 +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") @@ -691,6 +726,10 @@ AC_CACHE_VAL(AC_CV_NAME, # include #endif +#ifdef HAVE_OPENGL_GL_H +# include +#endif + #ifdef HAVE_SYS_RESOURCE_H # include #endif @@ -795,11 +834,11 @@ AC_CACHE_VAL(fptools_cv_have_o_binary, [ AC_LANG_SAVE AC_LANG_C -AC_TRY_COMPILE(, +AC_TRY_COMPILE( [#ifdef HAVE_FCNTL_H #include -#endif -int x = O_BINARY;], +#endif], +[int x = O_BINARY;], fptools_cv_have_o_binary=yes, fptools_cv_have_o_binary=no) AC_LANG_RESTORE @@ -1133,9 +1172,10 @@ dnl Check for Mesa first if we were asked to. dnl If we are running under X11 then add in the appropriate libraries. if test x"$no_x" != xyes; then dnl Add everything we need to compile and link X programs to GL_CFLAGS -dnl and GL_X_LIBS. +dnl and GL_X_LIBS/GLUT_X_LIBS. GL_CFLAGS="$CPPFLAGS $X_CFLAGS" - GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS $LIBM" + GL_X_LIBS="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBM" + GLUT_X_LIBS="$X_LIBS $X_PRE_LIBS -lXmu -lXt -lXi -lXext -lX11 $X_EXTRA_LIBS $LIBM" fi GL_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$GL_CFLAGS" @@ -1143,13 +1183,9 @@ dnl and GL_X_LIBS. GL_save_LIBS="$LIBS" LIBS="$GL_X_LIBS" - dnl Including instead of plain avoids problems on - dnl platforms like WinDoze where special headers like or - dnl some macro trickery would be needed - FPTOOLS_SEARCH_LIBS([#include ], glEnd, $GL_search_list, have_GL=yes, have_GL=no) - FPTOOLS_SEARCH_LIBS([#include ], gluNewQuadric, $GLU_search_list, have_GLU=yes, have_GLU=no) + FPTOOLS_SEARCH_LIBS([#include ], glEnd, $GL_search_list, have_GL=yes, have_GL=no) + FPTOOLS_SEARCH_LIBS([#include ], gluNewQuadric, $GLU_search_list, have_GLU=yes, have_GLU=no) FPTOOLS_SEARCH_LIBS([#include ], glXWaitX, $GLX_search_list, have_GLX=yes, have_GLX=no) - FPTOOLS_SEARCH_LIBS([#include ], glutMainLoop, glut32 glut, have_glut=yes, have_glut=no) if test -n "$LIBS"; then GL_LIBS="$LDFLAGS $LIBS" @@ -1158,16 +1194,28 @@ dnl and GL_X_LIBS. GL_CFLAGS= fi + LIBS="$GLUT_X_LIBS" + + FPTOOLS_SEARCH_LIBS([#include ], glutMainLoop, glut32 glut, have_glut=yes, have_glut=no) + + if test -n "$LIBS"; then + GLUT_LIBS="$LDFLAGS $LIBS" + fi + AC_CACHE_CHECK([OpenGL flags], mdl_cv_gl_cflags, [mdl_cv_gl_cflags="$GL_CFLAGS"]) GL_CFLAGS="$mdl_cv_gl_cflags" AC_SUBST(GL_CFLAGS) AC_CACHE_CHECK([OpenGL libs], mdl_cv_gl_libs, [mdl_cv_gl_libs="$GL_LIBS"]) GL_LIBS="$mdl_cv_gl_libs" AC_SUBST(GL_LIBS) + AC_CACHE_CHECK([GLUT libs], mdl_cv_glut_libs, [mdl_cv_glut_libs="$GLUT_LIBS"]) + GLUT_LIBS="$mdl_cv_glut_libs" + AC_SUBST(GLUT_LIBS) -dnl Reset GL_X_LIBS regardless, since it was just a temporary variable +dnl Reset GL_X_LIBS/GLUT_X_LIBS regardless, since they were just temporary variables dnl and we don't want to be global namespace polluters. GL_X_LIBS= + GLUT_X_LIBS= LIBS="$GL_save_LIBS" CPPFLAGS="$GL_save_CPPFLAGS"