From fd2b826b17ee85ade1e15e671b99fa0f432fe73a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Oct 2006 16:32:13 +0000 Subject: [PATCH] * Add -B$gcc/lib64 when appropriate. This is so that configure (calling gcc -print-search-dirs) builds a libtool that searches in lib64 for libstdc++.so. svn path=/nixpkgs/trunk/; revision=6850 --- pkgs/build-support/gcc-wrapper/add-flags | 4 ++-- pkgs/build-support/gcc-wrapper/builder.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/gcc-wrapper/add-flags b/pkgs/build-support/gcc-wrapper/add-flags index 63a483460015..ace0a789628c 100644 --- a/pkgs/build-support/gcc-wrapper/add-flags +++ b/pkgs/build-support/gcc-wrapper/add-flags @@ -9,8 +9,8 @@ if test -e @out@/nix-support/libc-ldflags; then export NIX_LDFLAGS="$(cat @out@/nix-support/libc-ldflags) $NIX_LDFLAGS" fi -if test -e @out@/nix-support/gcc-ldflags; then - export NIX_LDFLAGS="$(cat @out@/nix-support/gcc-ldflags) $NIX_LDFLAGS" +if test -e @out@/nix-support/gcc-cflags; then + export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE" fi if test -e @out@/nix-support/gcc-ldflags; then diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index c0b124fec0c6..20e15405526f 100644 --- a/pkgs/build-support/gcc-wrapper/builder.sh +++ b/pkgs/build-support/gcc-wrapper/builder.sh @@ -34,6 +34,16 @@ else fi gccLDFlags="$gccLDFlags -L$gcc/lib" echo "$gccLDFlags" > $out/nix-support/gcc-ldflags + + # GCC shows $gcc/lib in `gcc -print-search-dirs', but not + # $gcc/lib64 (even though it does actually search there...).. + # This confuses libtool. So add it to the compiler tool search + # path explicitly. + if test -e "$gcc/lib64"; then + gccCFlags="$gccCFlags -B$gcc/lib64" + fi + echo "$gccCFlags" > $out/nix-support/gcc-cflags + gccPath="$gcc/bin" ldPath="$binutils/bin" fi