[commit: ghc] master: Do not clobber CPPFLAGS nor LDFLAGS, fixes #10093 (9caf71a)

git at git.haskell.org git at git.haskell.org
Wed Feb 18 15:48:21 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9caf71a8d9293cfebdbb5b28e2d6a455ad126882/ghc

>---------------------------------------------------------------

commit 9caf71a8d9293cfebdbb5b28e2d6a455ad126882
Author: PHO <pho at cielonegro.org>
Date:   Wed Feb 18 09:46:30 2015 -0600

    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


>---------------------------------------------------------------

9caf71a8d9293cfebdbb5b28e2d6a455ad126882
 libraries/base/configure.ac | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac
index 4835a2b..85b2f2e 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])



More information about the ghc-commits mailing list