diff --git a/configure.ac b/configure.ac
index 3fba3c9..5573a4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,23 @@ AC_ARG_ENABLE(profiling,
   [ENABLE_PROFILING=YES]
 )
 
+AC_ARG_ENABLE(opengl,
+[AC_HELP_STRING([--enable-opengl],
+                [Enable building of OpenGL packages. (default=enable)])],
+  [case "${enableval}" in
+     yes)
+       ENABLE_OPENGL=YES
+       ;;
+     no)
+       ENABLE_OPENGL=NO
+       ;;
+     *)
+       AC_MSG_ERROR([The --enable-opengl value should be "yes" or "no"])
+       ;;
+   esac
+  ],
+  [ENABLE_OPENGL=YES]
+)
 
 AC_ARG_ENABLE(unsupported-ghc-version,
 [AC_HELP_STRING([--enable-unsupported-ghc-version],
@@ -214,7 +231,7 @@ fi
 
 
 # Check for OpenGL and GLUT
-if test "$OSX" != "yes"; then
+if test \( "$OSX" != "yes" \) -a \( "$ENABLE_OPENGL" == "YES" \); then
   AC_CHECK_HEADER([GL/gl.h], [],
     [AC_MSG_ERROR(The OpenGL C library is required)])
   AC_SEARCH_LIBS([glEnd], [GL opengl32], [],
@@ -231,7 +248,6 @@ if test "$OSX" != "yes"; then
     [AC_MSG_ERROR(The GLUT C library is required)])
 fi
 
-
 AC_SUBST([GHC])
 AC_SUBST([GHC_PKG])
 AC_SUBST([HSC2HS])
@@ -239,6 +255,7 @@ AC_SUBST([PERL])
 
 AC_SUBST([USER_INSTALL])
 AC_SUBST([ENABLE_PROFILING])
+AC_SUBST([ENABLE_OPENGL])
 AC_SUBST([ALLOW_UNSUPPORTED_GHC])
 
 AC_OUTPUT
@@ -260,6 +277,14 @@ else
 echo '*   use --prefix= and/or --enable-user-install    '
 fi
 echo '*                                                 '
+if test "${ENABLE_OPENGL}" != "YES"; then
+echo '*   OpenGL will NOT be built                      '
+echo '*                                                 '
+echo '*   You will not get a haskell-platform package   '
+echo '*   because some compliant codebases will not     '
+echo '*   build.                                        '
+echo '*                                                 '
+fi
 if test "${USER_INSTALL}" = "YES"; then
 echo '* Now do "make" followed by "make install"        '
 else
diff --git a/scripts/build.sh b/scripts/build.sh
index 9534af7..863fd1d 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -99,7 +99,9 @@ build_pkg () {
 
 # Actually do something!
 for pkg in `cat packages/platform.packages`; do
-  if is_pkg_installed "${pkg}"; then
+  if skip_pkg "${pkg}"; then
+    echo "Skipping ${pkg} because of configuration."
+  elif is_pkg_installed "${pkg}"; then
     echo "Platform package ${pkg} is already installed. Skipping..."
   else
     echo "Building ${PKG}"
diff --git a/scripts/common.sh b/scripts/common.sh
index 8e1f018..1b8f6a1 100755
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -21,3 +21,20 @@ is_pkg_installed () {
   PKG_VER=$1
   grep " ${PKG_VER} " packages/installed.packages > /dev/null 2>&1
 }
+
+skip_pkg() {
+  PKG=$1
+  test \( "$ENABLE_OPENGL" == "NO" \) && gl_pkg $PKG
+}
+
+gl_pkg() {
+  PKG=$1
+  case `echo $PKG | sed 's/-[.0-9]\+$//'` in
+    haskell-platform|OpenGL|GLUT)
+      true
+      ;;
+    *)
+      false
+      ;;
+  esac
+}
diff --git a/scripts/config.in b/scripts/config.in
index 6eeb798..e35ceb0 100644
--- a/scripts/config.in
+++ b/scripts/config.in
@@ -17,3 +17,4 @@ PERL=@PERL@
 ALLOW_UNSUPPORTED_GHC=@ALLOW_UNSUPPORTED_GHC@
 USER_INSTALL=@USER_INSTALL@
 ENABLE_PROFILING=@ENABLE_PROFILING@
+ENABLE_OPENGL=@ENABLE_OPENGL@
diff --git a/scripts/install.sh b/scripts/install.sh
index 6911879..0284dab 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -42,7 +42,9 @@ install_pkg () {
 
 # Actually do something!
 for pkg in `cat packages/platform.packages`; do
-  if is_pkg_installed "${pkg}"; then
+  if skip_pkg "${pkg}"; then
+    echo "Skipping ${pkg} because of configuration."
+  elif is_pkg_installed "${pkg}"; then
     echo "Platform package ${pkg} is already installed. Skipping..."
   else
     echo "Installing ${pkg}..."
