summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPHO <pho@cielonegro.org>2015-02-18 09:46:30 -0600
committerAustin Seipp <austin@well-typed.com>2015-02-18 09:46:30 -0600
commit9caf71a8d9293cfebdbb5b28e2d6a455ad126882 (patch)
tree492dbc5a4d5485ed2274612ac3984c15c71b7e22
parent91d9530525803403c3c012901115d54ff4fc3b5e (diff)
downloadhaskell-9caf71a8d9293cfebdbb5b28e2d6a455ad126882.tar.gz
Do not clobber CPPFLAGS nor LDFLAGS, fixes #10093
Summary: Append -I/-L flags to CPPFLAGS/LDFLAGS instead of clobbering. Test Plan: Install libiconv into /some/non-standard/path. Set CONF_GCC_LINKER_OPTS_STAGE{0,1,2} to -Wl,-rpath,/some/non-standard/path/lib. And then run ./configure with arguments --with-iconv-includes=/some/non-standard/path/include and --with-iconv-libraries=/some/non-standard/path/lib Reviewers: hvr, austin Reviewed By: austin Subscribers: thomie, PHO Differential Revision: https://phabricator.haskell.org/D663 GHC Trac Issues: #10093
-rw-r--r--libraries/base/configure.ac9
1 files changed, 6 insertions, 3 deletions
diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac
index 4835a2b925..85b2f2e860 100644
--- a/libraries/base/configure.ac
+++ b/libraries/base/configure.ac
@@ -92,13 +92,13 @@ dnl--------------------------------------------------------------------
AC_ARG_WITH([iconv-includes],
[AC_HELP_STRING([--with-iconv-includes],
[directory containing iconv.h])],
- [ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval"],
+ [ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval $CPPFLAGS"],
[ICONV_INCLUDE_DIRS=])
AC_ARG_WITH([iconv-libraries],
[AC_HELP_STRING([--with-iconv-libraries],
[directory containing iconv library])],
- [ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval"],
+ [ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval $LDFLAGS"],
[ICONV_LIB_DIRS=])
AC_SUBST(ICONV_INCLUDE_DIRS)
@@ -205,7 +205,10 @@ fi
# Hack - md5.h needs HsFFI.h. Is there a better way to do this?
CFLAGS="-I../../includes $CFLAGS"
-AC_CHECK_SIZEOF([struct MD5Context], ,[#include "include/md5.h"])
+dnl Calling AC_CHECK_TYPE(T) makes AC_CHECK_SIZEOF(T) abort on failure
+dnl instead of considering sizeof(T) as 0.
+AC_CHECK_TYPE([struct MD5Context], [], [], [#include "include/md5.h"])
+AC_CHECK_SIZEOF([struct MD5Context], [], [#include "include/md5.h"])
AC_SUBST(EXTRA_LIBS)
AC_CONFIG_FILES([base.buildinfo])