diff --git a/configure.ac b/configure.ac
index 9b420bb..b47c185 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,41 @@ 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(editline,
+[AC_HELP_STRING([--enable-editline],
+                [Enable building of the editline package. (default=enable)])],
+  [case "${enableval}" in
+     yes)
+       ENABLE_EDITLINE=YES
+       ;;
+     no)
+       ENABLE_EDITLINE=NO
+       ;;
+     *)
+       AC_MSG_ERROR([The --enable-editline value should be "yes" or "no"])
+       ;;
+   esac
+  ],
+  [ENABLE_EDITLINE=YES]
+)
 
 AC_ARG_ENABLE(unsupported-ghc-version,
 [AC_HELP_STRING([--enable-unsupported-ghc-version],
@@ -208,7 +243,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], [],
@@ -225,7 +260,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])
@@ -233,6 +267,8 @@ AC_SUBST([PERL])
 
 AC_SUBST([USER_INSTALL])
 AC_SUBST([ENABLE_PROFILING])
+AC_SUBST([ENABLE_OPENGL])
+AC_SUBST([ENABLE_EDITLINE])
 AC_SUBST([ALLOW_UNSUPPORTED_GHC])
 
 AC_OUTPUT
@@ -250,6 +286,22 @@ echo '*                                                 '
 echo '*   If you wish to change these settings then     '
 echo '*   use --prefix= and/or --enable-user-install    '
 echo '*                                                 '
+if test "${ENABLE_EDITLINE}" != "YES"; then
+echo '*   editline 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 "${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 534b7e0..398589f 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -16,6 +16,7 @@ die () {
   || die "Please run ./configure first"
 
 . scripts/config
+. scripts/common.sh
 
 # also check GHC, GHC_PKG
 [ -n "$prefix" ] \
@@ -43,22 +44,6 @@ PACKAGE_DB="packages/package.conf.inplace"
 [ -f "${PACKAGE_DB}" ] && rm "${PACKAGE_DB}"
 echo '[]' > "${PACKAGE_DB}"
 
-# Maybe use a small script instead ? Tested with bash and zsh.
-tell() {
-  # Save and shift the executable name
-  CMD=$1
-  shift
-  # Build the string of command-line parameters
-  PRINT="\"${CMD}\""
-  for arg in "$@"; do
-      PRINT="${PRINT} \"${arg}\""
-  done
-  # Echo the command
-  echo `echo $PRINT`
-  # Run the command
-  "$CMD" "$@"
-}
-
 build_pkg () {
   PKG=$1
 
@@ -102,20 +87,16 @@ build_pkg () {
   cd ..
 }
 
-# Is this exact version of the package already installed?
-is_pkg_installed () {
-  PKG_VER=$1
-  grep " ${PKG_VER} " installed.packages > /dev/null 2>&1
-}
-
 # Actually do something!
 
 cd packages
 for pkg in `cat platform.packages`; do
-  if is_pkg_installed "${pkg}"; then
+  if skip_pkg "${pkg}"; then
+    echo "Skipping ${pkg} due to configuration"
+  elif is_pkg_installed "${pkg}"; then
     echo "Platform package ${pkg} is already installed. Skipping..."
   else
-    echo "Building ${PKG}"
+    echo "Building ${pkg}"
     build_pkg "${pkg}"
   fi
 done
diff --git a/scripts/common.sh b/scripts/common.sh
new file mode 100755
index 0000000..8d3f7a2
--- /dev/null
+++ b/scripts/common.sh
@@ -0,0 +1,44 @@
+# Just a bunch of sh functions use in build.sh and install.sh
+
+# Maybe use a small script instead ? Tested with bash and zsh.
+tell() {
+  # Save and shift the executable name
+  CMD=$1
+  shift
+  # Build the string of command-line parameters
+  PRINT="\"${CMD}\""
+  for arg in "$@"; do
+      PRINT="${PRINT} \"${arg}\""
+  done
+  # Echo the command
+  echo `echo $PRINT`
+  # Run the command
+  "$CMD" "$@"
+}
+
+# Is this exact version of the package already installed?
+is_pkg_installed () {
+  PKG_VER=$1
+  grep " ${PKG_VER} " packages/installed.packages > /dev/null 2>&1
+}
+
+pkg_base () {
+  echo "$1" | sed 's/-[.0-9]\+$//'
+}
+
+skip_pkg() {
+  case `pkg_base "$1"` in
+    OpenGL|GLUT)
+      test "$ENABLE_OPENGL" == "NO"
+      ;;
+    editline)
+      test "$ENABLE_EDITLINE" == "NO"
+      ;;
+    haskell-platform)
+      test \( "$ENABLE_OPENGL" == "NO" \) -o \( "$ENABLE_EDITLINE" == "NO" \)
+      ;;
+    *)
+      false
+      ;;
+  esac
+}
diff --git a/scripts/config.in b/scripts/config.in
index 6eeb798..0876ab6 100644
--- a/scripts/config.in
+++ b/scripts/config.in
@@ -17,3 +17,5 @@ PERL=@PERL@
 ALLOW_UNSUPPORTED_GHC=@ALLOW_UNSUPPORTED_GHC@
 USER_INSTALL=@USER_INSTALL@
 ENABLE_PROFILING=@ENABLE_PROFILING@
+ENABLE_OPENGL=@ENABLE_OPENGL@
+ENABLE_EDITLINE=@ENABLE_EDITLINE@
diff --git a/scripts/install.sh b/scripts/install.sh
index 696befe..3bf1558 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -11,6 +11,7 @@ die () {
   || die "Please run ./configure first"
 
 . scripts/config
+. scripts/common.sh
 
 install_pkg () {
   PKG=$1
@@ -37,10 +38,16 @@ install_pkg () {
 # Actually do something!
 cd packages
 for pkg in `cat platform.packages`; do
-  cd "${pkg}" || die "The directory for the component ${PKG} is missing"
-  echo "Installing ${pkg}..."
-  install_pkg ${pkg}
-  cd ..
+  if skip_pkg "${pkg}"; then
+    echo "Skipping ${pkg} due to configuration"
+  elif is_pkg_installed "${pkg}"; then
+    echo "Platform package ${pkg} is already installed. Skipping..."
+  else
+    cd "${pkg}" || die "The directory for the component ${PKG} is missing"
+    echo "Installing ${pkg}..."
+    install_pkg ${pkg}
+    cd ..
+  fi
 done
 
 echo
