darcs patch: Fix detection of libiconf.

Matthias Kilian kili at outback.escape.de
Wed Jun 24 12:03:27 EDT 2009

On Wed, Jun 24, 2009 at 04:43:02PM +0200, Matthias Kilian wrote:
> > $1_$2_CONFIGURE_OPTS += --gcc-options="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$($1_CC_OPTS) $$($1_$2_CC_OPTS)"
> > $1_$2_CONFIGURE_OPTS += --ld-options="$$(SRC_LD_OPTS) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)"
> > 
> > then does that fix the problem?
> The second added line doesn't work as expected.  I explicitely have
> to set CFLAGS="-I/usr/local/include -L/usr/local/lib".  It seems
> like cabal only uses --gcc-options when running gcc (and ignoring
> --ld-options). So for now, the addition of --gcc-options helps me
> to build ghc-head again.

Except that now ghc-stage1 fails to link ghc-stage2:

"inplace/bin/ghc-stage1" -o ghc/stage2/build/tmp/ghc-stage2  -H32m -O     -i -ighc/. -ighc/stage2/build -ighc/stage2/build/autogen -Ighc/stage2/build -Ighc/stage2/build/autogen       -O -fasm -DGHCI -threaded -package ghc-6.11.20090624 -package haskeline -XCPP -XPatternGuards -XForeignFunctionInterface -XUnboxedTuples -XFlexibleInstances -XMagicHash -no-user-package-conf    -odir ghc/stage2/build -hidir ghc/stage2/build -stubdir ghc/stage2/build -hisuf hi -osuf  o -hcsuf hc  ghc/stage2/build/Main.o ghc/stage2/build/GhciMonad.o ghc/stage2/build/GhciTags.o ghc/stage2/build/InteractiveUI.o   
/usr/bin/ld: cannot find -liconv

I could probably "fix" it by setting LD_OPTS, but I don't think
that's a proper fix. I didn't find where compiler/stage2/package-data.mk
gets its compiler_stage2_LD_OPTS variable set (i tried to set
$1_$2_LD_OPTS in rules/build-package-data.mk, but it didn't help).
And it's probably still the wrong place to fix it. The knowledge
that linking against base needs -L/usr/local/lib (for to find
libiconv) should be stored in the entry of base in the package.conf.
Or, to start with, it should be written to libraries/base/base.buildinfo
(together with the -I/usr/local/include for compiling libraries/base).

Or do I still have a completely wrong understanding of GHCs new
build system *and* of cabal?


More information about the Libraries mailing list