Make top-level "configure" accept and propagate --with-curses-{includes,libraries...
authorPHO <pho@cielonegro.org>
Mon, 23 Feb 2015 09:40:05 +0000 (03:40 -0600)
committerAustin Seipp <austin@well-typed.com>
Mon, 23 Feb 2015 09:40:05 +0000 (03:40 -0600)
Summary:
If curses is installed into some non-standard path, we currently have
to say something like the following in mk/build.mk:

  libraries/terminfo_CONFIGURE_OPTS += \
      --configure-option=--with-curses-includes=/somewhere/include \
      --configure-option=--with-curses-libraries=/somewhere/lib

This is because the top-level configure does not accept nor propagate
--with-curses-{includes,libraries} to libraries while it does so for
iconv, gmp and libffi. It would be nice if curses were handled in the
same manner.

Test Plan: Install curses into some non-standard path. Then run the top-level "configure" script with options "--with-curses-includes=/path/to/curses/include" and "--with-curses-libraries=/path/to/curses/lib".

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, PHO

Differential Revision: https://phabricator.haskell.org/D665

GHC Trac Issues: #10096

aclocal.m4
configure.ac
mk/config.mk.in
rules/build-package-data.mk

index cb4aa83..73b8890 100644 (file)
@@ -1826,6 +1826,28 @@ AC_DEFUN([FP_GMP],
   AC_SUBST(GMP_LIB_DIRS)
 ])# FP_GMP
 
+# FP_CURSES
+# -------------
+AC_DEFUN([FP_CURSES],
+[
+  dnl--------------------------------------------------------------------
+  dnl * Deal with arguments telling us curses is somewhere odd
+  dnl--------------------------------------------------------------------
+
+  AC_ARG_WITH([curses-includes],
+    [AC_HELP_STRING([--with-curses-includes],
+      [directory containing curses headers])],
+      [CURSES_INCLUDE_DIRS=$withval])
+
+  AC_ARG_WITH([curses-libraries],
+    [AC_HELP_STRING([--with-curses-libraries],
+      [directory containing curses libraries])],
+      [CURSES_LIB_DIRS=$withval])
+
+  AC_SUBST(CURSES_INCLUDE_DIRS)
+  AC_SUBST(CURSES_LIB_DIRS)
+])# FP_CURSES
+
 # --------------------------------------------------------------
 # Calculate absolute path to build tree
 # --------------------------------------------------------------
index 9740e15..f65d133 100644 (file)
@@ -357,6 +357,7 @@ fi
 
 FP_ICONV
 FP_GMP
+FP_CURSES
 
 XCODE_VERSION()
 
index dfe8c2b..b32f227 100644 (file)
@@ -805,3 +805,6 @@ ICONV_LIB_DIRS = @ICONV_LIB_DIRS@
 
 GMP_INCLUDE_DIRS = @GMP_INCLUDE_DIRS@
 GMP_LIB_DIRS = @GMP_LIB_DIRS@
+
+CURSES_INCLUDE_DIRS = @CURSES_INCLUDE_DIRS@
+CURSES_LIB_DIRS = @CURSES_LIB_DIRS@
index 2e61001..494b89a 100644 (file)
@@ -77,6 +77,14 @@ ifneq "$$(GMP_LIB_DIRS)" ""
 $1_$2_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="$$(GMP_LIB_DIRS)"
 endif
 
+ifneq "$$(CURSES_INCLUDE_DIRS)" ""
+$1_$2_CONFIGURE_OPTS += --configure-option=--with-curses-includes="$$(CURSES_INCLUDE_DIRS)"
+endif
+
+ifneq "$$(CURSES_LIB_DIRS)" ""
+$1_$2_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="$$(CURSES_LIB_DIRS)"
+endif
+
 ifeq "$$(CrossCompiling)" "YES"
 $1_$2_CONFIGURE_OPTS += --configure-option=--host=$(TargetPlatformFull)
 endif