- 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 <gl/mesa_wgl.h> 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_LINK_IFELSE([AC_LANG_PROGRAM([$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_TARGET])
-
-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"])
+ 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])