Commit bbb57a6b authored by PHO's avatar PHO Committed by Austin Seipp

Make top-level "configure" accept and propagate --with-curses-{includes,libraries} to libraries

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
parent 0fa20726
......@@ -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
# --------------------------------------------------------------
......
......@@ -357,6 +357,7 @@ fi
FP_ICONV
FP_GMP
FP_CURSES
XCODE_VERSION()
......
......@@ -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@
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment