[project @ 2003-12-02 19:16:41 by panne]
[ghc-hetmet.git] / configure.ac
index 49d7a07..7bc993f 100644 (file)
@@ -619,7 +619,7 @@ AC_ARG_ENABLE(objectio,
 )
 AC_SUBST(GhcLibsWithObjectIO)
 
-dnl ** Enable the building of the OpenGL/GLUT binding in hslibs?
+dnl ** Enable the building of the OpenGL/GLUT binding?
 dnl --------------------------------------------------------------
 AC_ARG_ENABLE(hopengl,
 [  --enable-hopengl
@@ -627,8 +627,8 @@ AC_ARG_ENABLE(hopengl,
         On Mac OS X, use --enable-hopengl=x11 to use X11 instead
         of the "native" libraries.
 ],
-[GhcLibsWithHOpenGL=YES],
-[GhcLibsWithHOpenGL=NO]
+[GhcLibsWithOpenGL=YES; GhcLibsWithGLUT=YES],
+[GhcLibsWithOpenGL=NO;  GhcLibsWithGLUT=NO]
 )
 UseQuartzOpenGL=NO
 if test x"$TargetOS_CPP" = x"darwin"; then
@@ -639,7 +639,21 @@ if test x"$TargetOS_CPP" = x"darwin"; then
   fi
 fi
 
-AC_SUBST(GhcLibsWithHOpenGL)
+AC_SUBST([GhcLibsWithOpenGL])
+AC_SUBST([GhcLibsWithGLUT])
+
+dnl ** Enable the building of the OpenAL binding?
+dnl --------------------------------------------------------------
+AC_ARG_ENABLE([openal],
+  AC_HELP_STRING([--enable-openal],
+                 [Build OpenAL binding [[default=autodetect]]]),
+  [GhcLibsWithOpenAL=$enableval],
+  [GhcLibsWithOpenAL=yes])
+
+# This is silly! Alas, "YES" and "NO" are currently our standard...
+GhcLibsWithOpenAL=`echo $GhcLibsWithOpenGL | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+
+AC_SUBST([GhcLibsWithOpenAL])
 
 dnl ** .NET interop support?
 dnl --------------------------------------------------------------
@@ -661,6 +675,16 @@ dnl --------------------------------------------------------------
 dnl * General configuration checks
 dnl --------------------------------------------------------------
 
+dnl ** Can the unix package be built?
+dnl --------------------------------------------------------------
+
+if test x"$TargetPlatform" = x"i386-unknown-mingw32"; then
+   GhcLibsWithUnix=NO
+else
+   GhcLibsWithUnix=YES
+fi
+AC_SUBST([GhcLibsWithUnix])
+
 dnl ** does #! work?
 AC_SYS_INTERPRETER()
 
@@ -989,7 +1013,7 @@ FPTOOLS_CHECK_HTYPE(rlim_t)
 FPTOOLS_CHECK_HTYPE(wint_t)
 
 dnl ** Map OpenGL data types to Haskell types
-if test $GhcLibsWithHOpenGL = YES ; then
+if test $GhcLibsWithOpenGL = YES ; then
 FPTOOLS_CHECK_HTYPE(GLboolean)
 FPTOOLS_CHECK_HTYPE(GLbyte)
 FPTOOLS_CHECK_HTYPE(GLubyte)
@@ -1186,7 +1210,7 @@ dnl ** check for X Window System
 AC_PATH_XTRA()
 
 dnl ** check for OpenGL/GLUT/GLX include paths and libraries
-if test $GhcLibsWithHOpenGL = YES ; then
+if test $GhcLibsWithOpenGL = YES ; then
   if test $UseQuartzOpenGL = YES ; then
     dnl Take a shortcut for Mac OS X native OpenGL:
     dnl It's in a non-standard location, but it's always there
@@ -1353,25 +1377,15 @@ dnl --------------------------------------------------
 dnl * test for GTK+
 dnl --------------------------------------------------
 
-AC_PATH_PROGS(GTK_CONFIG, gtk-config gtk12-config)
-if test "$GTK_CONFIG" != ""; then
-   AC_CACHE_CHECK([for version of GTK+], fptools_cv_gtk_version, [
-       fptools_cv_gtk_version=`$GTK_CONFIG --version`
-    ])
-    GTK_VERSION=$fptools_cv_gtk_version
-else
-    GTK_VERSION=
+AC_PATH_PROGS([GTK_CONFIG], [gtk-config gtk12-config])
+if test -n "$GTK_CONFIG"; then
+  AC_CACHE_CHECK([for version of GTK+], [fp_cv_gtk_version],
+    [fp_cv_gtk_version=`$GTK_CONFIG --version`])
+  FP_COMPARE_VERSIONS([$fp_cv_gtk_version], [-lt], [1.2],
+    [AC_MSG_WARN([GTK+ not usable, need at least version 1.2])
+     GTK_CONFIG=])
 fi
-
-case $fptools_cv_gtk_version in
-  1.[[23]].*) ;;
-  *) AC_MSG_WARN([GTK+ not usable; need at least version 1.2])
-     GTK_CONFIG=
-     ;;
-esac
-
-AC_SUBST(GTK_CONFIG)
-AC_SUBST(GTK_VERSION)
+AC_SUBST([GTK_CONFIG])
 
 dnl --------------------------------------------------
 dnl * Miscellaneous feature tests