I'm having some trouble building ghc against gmp installed in an
unusual place. (Actually, I install every package in its own
directory, but gmp seems to be the one causing trouble here.) First
attempt: adding the necessary -I, -L, and -Xlinker -R options to
CPPFLAGS/LDFLAGS when invoking ./configure, and I also created
mk/build.mk to add the -I flags to SRC_CC_OPTS and SRC_HSC2HS_OPTS,
and -optc-I, -optl-L, and -optl-Xlinker -optl-R flags to SRC_HC_OPTS.
This method worked for ghc 6.6.1, but 6.8.2 gives me:
/command/ghc -H16m -O -O2 -optc-I/nil -optc-I/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/gmp/include -optc-I/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/ncurses/include -optc-I/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/readline/include -optc-I/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/binutils/include -optc-pipe -optl-pipe -optc-Os -optl-Os '-optc-march=pentium3' '-optl-march=pentium3' '-optc-mfpmath=sse' '-optl-mfpmath=sse' -optc-msse -optl-msse -optc-mmmx -optl-mmmx -optl-L/nil -optl-L/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/gmp/library -optl-L/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/ncurses/library -optl-L/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/readline/library -optl-L/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/binutils/library -optl-Xlinker -optl-R -optl-Xlinker -optl/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/gmp/library -optl-Xlinker -optl-R -optl-Xlinker -optl/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/ncurses/library -optl-Xlinker -optl-R -optl-Xlinker -optl/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/readline/library -optl-Xlinker -optl-R -optl-Xlinker -optl/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/binutils/library -istage1/utils -istage1/basicTypes -istage1/types -istage1/hsSyn -istage1/prelude -istage1/rename -istage1/typecheck -istage1/deSugar -istage1/coreSyn -istage1/vectorise -istage1/specialise -istage1/simplCore -istage1/stranal -istage1/stgSyn -istage1/simplStg -istage1/codeGen -istage1/main -istage1/profiling -istage1/parser -istage1/cprAnalysis -istage1/ndpFlatten -istage1/iface -istage1/cmm -istage1/nativeGen -Wall -fno-warn-name-shadowing -fno-warn-orphans -Istage1 -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser -package unix -ignore-package lang -recomp -Rghc-timing -H16M '-#include "cutils.h"' -DUSING_COMPAT -i../compat -ignore-package Cabal -package directory -package pretty -package containers -c stranal/StrictAnal.lhs -o stage1/stranal/StrictAnal.o -ohi stage1/stranal/StrictAnal.hi
<