From: wolfgang Date: Wed, 30 Jul 2003 09:20:42 +0000 (+0000) Subject: [project @ 2003-07-30 09:20:41 by wolfgang] X-Git-Tag: Approx_11550_changesets_converted~612 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=5ca28d195c55751280886c194b9541af97cb77cc [project @ 2003-07-30 09:20:41 by wolfgang] OpenGL support for Mac OS X: "./configure --enable-hopengl" on Mac OS X now uses the OpenGL libs that come with Apple's "Quartz" display system. "./configure --enable-hopengl=x11" looks for an X11 implementation of OpenGL (which is an optional install on Mac OS X). Added a corresponding "USE_QUARTZ_OPENGL" flag to config.h --- diff --git a/configure.in b/configure.in index e19c938..b2bb123 100644 --- a/configure.in +++ b/configure.in @@ -534,10 +534,20 @@ dnl -------------------------------------------------------------- AC_ARG_ENABLE(hopengl, [ --enable-hopengl Build HOpenGL, a Haskell binding for OpenGL/GLUT. + On Mac OS X, use --enable-hopengl=x11 to use X11 instead + of the "native" libraries. ], [GhcLibsWithHOpenGL=YES], [GhcLibsWithHOpenGL=NO] ) +UseQuartzOpenGL=NO +if test x"$TargetOS_CPP" = x"darwin"; then + if test x"$enable_hopengl" != x"x11"; then + AC_DEFINE(USE_QUARTZ_OPENGL) + UseQuartzOpenGL=YES + fi +fi + AC_SUBST(GhcLibsWithHOpenGL) dnl ** .NET interop support? @@ -771,7 +781,11 @@ dnl ** check for Windows include files AC_CHECK_HEADERS(windows.h) dnl ** check for OpenGL include files -AC_CHECK_HEADERS(GL/gl.h) +if test $UseQuartzOpenGL = YES ; then + AC_CHECK_HEADERS(OpenGL/gl.h) +else + AC_CHECK_HEADERS(GL/gl.h) +fi dnl ** check if it is safe to include both and AC_HEADER_TIME @@ -1081,7 +1095,18 @@ AC_PATH_XTRA() dnl ** check for OpenGL/GLUT/GLX include paths and libraries if test $GhcLibsWithHOpenGL = YES ; then -FPTOOLS_HAVE_OPENGL + 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 + GL_CFLAGS= + GL_LIBS= + GLUT_LIBS= + AC_SUBST(GL_CFLAGS) + AC_SUBST(GL_LIBS) + AC_SUBST(GLUT_LIBS) + else + FPTOOLS_HAVE_OPENGL + fi fi dnl ################################################################ diff --git a/mk/config.h.in b/mk/config.h.in index 91e5374..8a4bab4 100644 --- a/mk/config.h.in +++ b/mk/config.h.in @@ -1110,3 +1110,6 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const + +/* Define if we want to use Apple's OpenGL for the Quartz Display System on Mac OS X (instead of X11) */ +#undef USE_QUARTZ_OPENGL