[Clfs-support] Help with cross-compiling glibc toolchain
Daniel Jabbour
daniel at laptouchinc.com
Sat Apr 4 14:16:24 PDT 2009
Hi,
I am trying to build a cross-compiled glibc toolchain on a non-linux
platform. My only issue involves a problem with the include path for
glibc. I have patched glibc with the cross_hacks patch from your CLFS
project. This basically makes glibc compile a native localedef-native
binary so localedata/insatll-locales will work in the cross-compiler.
The issue is that it cannot find libintl.h during compilation. This is
part of the GNU gettext utilities package. So basically, I know I need
to figure out some way to get the make script to properly include the
path to my headers for gettext. On my system, gettext is installed in /
usr/local/include/.
I have tried two methods to pass the include directory, neither worked.
First, I tried to pass it to the configure script for glibc by way of
CPPFLAGS. In this case my configure command looked like:
BUILD_CC="gcc" CC="mipsel-linux-gcc" CPPFLAGS="-I/opt/local/include"
AR="mipsel-linux-ar" RANLIB="mipsel-linux-ranlib" ../glibc-2.6.1/
configure --prefix=/usr --libexecdir=/usr/lib/glibc --host=mipsel-
linux --disable-profile --enable-add-ons --with-tls --enable-
kernel=2.6.0 --with-__thread --with-binutils=/opt/mipsel-liunx-
toolchain/bin --with-headers=../linux-2.6.24.3-lt-headers --cache-
file=config.cache
When I did a make, however, it still didn't find libintl.h, and I
noticed no -I/opt/local/include in the gcc commands that it called.
Next, i tried passing the CPPFLAGS variable to make such as:
make CPPFLAGS="-I/opt/local/include"
This time, I noticed the -I flag was being passed to gcc, but that the
native -I flags there used to be there were not. This meant that it
could no longer find the various other files it needed to include, and
died on something else.
My conclusion is that CPPFLAGS during `make` overrides all other
compiler flags, and CPPFLAGS during `configure` is ignored. So how do
I pass this information to the build process for glibc so I can
compile it on my system? Thank you kindly,
Daniel
--
Daniel Jabbour
Software Engineer
Laptouch, Inc.
More information about the Clfs-support
mailing list