From 4a0b6d6cba4c6d053c928ecc111ff0a300443f4b Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 24 Mar 2010 17:14:08 +0000 Subject: [PATCH] Pass the location of gcc in the ghc wrapper script; partially fixes #3863 This means we don't rely on baking a path to gcc into the executable --- distrib/configure.ac.in | 7 ++++++- ghc/ghc.wrapper | 2 +- rules/shell-wrapper.mk | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index 44a5517..27109a2 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -62,8 +62,13 @@ dnl ** Find the path to sed ** AC_PATH_PROG(SedCmd,sed) # -dnl ** How to invoke cpp directly ** +dnl ** How to invoke gcc/cpp ** # +FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc]) +export CC +WhatGccIsCalled="$CC" +AC_SUBST(WhatGccIsCalled) + FP_HAVE_GCC AC_PROG_CPP diff --git a/ghc/ghc.wrapper b/ghc/ghc.wrapper index 083a66d..db3ebb0 100644 --- a/ghc/ghc.wrapper +++ b/ghc/ghc.wrapper @@ -1 +1 @@ -exec "$executablename" -B"$topdir" ${1+"$@"} +exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" ${1+"$@"} diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk index c3358df..d2ff84d 100644 --- a/rules/shell-wrapper.mk +++ b/rules/shell-wrapper.mk @@ -40,6 +40,7 @@ $$(INPLACE_BIN)/$$($1_$2_PROG): $$($1_$2_INPLACE) echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"' >> $$@ echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"' >> $$@ echo 'topdir="$$(TOP)/$$(INPLACE_TOPDIR)"' >> $$@ + echo 'pgmgcc="$$(WhatGccIsCalled)"' >> $$@ $$($1_$2_SHELL_WRAPPER_EXTRA) $$($1_$2_INPLACE_SHELL_WRAPPER_EXTRA) cat $$($1_$2_SHELL_WRAPPER_NAME) >> $$@ @@ -71,6 +72,7 @@ install_$1_$2_wrapper: echo 'datadir="$$(datadir)"' >> "$$(WRAPPER)" echo 'bindir="$$(bindir)"' >> "$$(WRAPPER)" echo 'topdir="$$(topdir)"' >> "$$(WRAPPER)" + echo 'pgmgcc="$$(WhatGccIsCalled)"' >> "$$(WRAPPER)" $$($1_$2_SHELL_WRAPPER_EXTRA) $$($1_$2_INSTALL_SHELL_WRAPPER_EXTRA) cat $$($1_$2_SHELL_WRAPPER_NAME) >> "$$(WRAPPER)" -- 1.7.10.4