- 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 <GL/gl.h>], [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 <GL/gl.h>], [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 <GL/glu.h>], [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 <windows.h> 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 <windows.h>
-#endif
-#if HAVE_GL_GLUT_H
-#include <GL/glut.h>
-#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
-])
+ fp_cv_ghc_has_readline=no
+ fi])
+AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`])
+])# FP_GHC_HAS_READLINE
+
+
+# FP_GCC_NEEDS_NO_OMIT_LFPTR
+# --------------------------
+# Some OSs (Mandrake Linux, in particular) configure GCC with
+# -momit-leaf-frame-pointer on by default. If this is the case, we need to turn
+# it off for mangling to work. The test is currently a bit crude, using only the
+# version number of gcc. Defines HAVE_GCC_MNO_OMIT_LFPTR.
+AC_DEFUN([FP_GCC_NEEDS_NO_OMIT_LFPTR],
+[AC_REQUIRE([FP_HAVE_GCC])
+AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], [fp_cv_gcc_needs_no_omit_lfptr],
+[FP_COMPARE_VERSIONS([$fp_gcc_version], [-ge], [3.2],
+ [fp_cv_gcc_needs_no_omit_lfptr=yes],
+ [fp_cv_gcc_needs_no_omit_lfptr=no])])
+if test "$fp_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])# FP_GCC_NEEDS_NO_OMIT_LFPTR
+
+# FP_GCC_HAS_NO_UNIT_AT_A_TIME
+# --------------------------
+AC_DEFUN([FP_GCC_HAS_NO_UNIT_AT_A_TIME],
+[AC_REQUIRE([FP_HAVE_GCC])
+AC_CACHE_CHECK([whether gcc has -fno-unit-at-a-time], [fp_cv_gcc_has_no_unit_at_a_time],
+[FP_COMPARE_VERSIONS([$fp_gcc_version], [-ge], [3.4],
+ [fp_cv_gcc_has_no_unit_at_a_time=yes],
+ [fp_cv_gcc_has_no_unit_at_a_time=no])])
+if test "$fp_cv_gcc_has_no_unit_at_a_time" = "yes"; then
+ AC_DEFINE([HAVE_GCC_HAS_NO_UNIT_AT_A_TIME], [1], [Define to 1 if gcc supports -fno-unit-at-a-time.])
+fi])