bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross-compiling libintl


From: Bruno Haible
Subject: Re: Cross-compiling libintl
Date: Wed, 2 Jul 2008 02:56:41 +0200
User-agent: KMail/1.5.4

Hi,

Ryan Govostes wrote:
> I'm trying to build libintl for a PowerPC host (powerpc-apple-darwin8)  
> from an i386 machine with gcc 4.2.1 (i686-apple-darwin10-gcc-4.2.1)  
> under Mac OS X. When I run file on the resultant .dylib, I expect to  
> see that it is built for PowerPC, but in fact it is built for i386:
> 
> ===
> libintl.8.dylib: Mach-O dynamically linked shared library i386
> ===
> 
> So, it looks like the configuration settings don't take and it's  
> building for the native architecture instead.
> 
> ===
> CFLAGS=-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/ 
> MacOSX10.4u.sdk -arch ppc
> CXXFLAGS=$CFLAGS
> LDFLAGS=-mmacosx-version-min=10.4 -headerpad_max_install_names -Wl,- 
> syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc
> 
> configure --disable-static --enable-shared --host=powerpc-apple-darwin8
> make && make install
> ===
> 
> Is there a patch for the Makefile which will correctly build libintl  
> for the host architecture?

Cross-compiling is supported by GNU gettext. When libintl is built in the
wrong format, it points to a problem with either your CPPFLAGS/.../LDFLAGS
settings, or with libtool, or with gettext's Makefile.

First thing to try is to set CPPFLAGS (instead of CFLAGS and CXXFLAGS)
to include the -isysroot, -arch etc. settings. See [1] for details.

Next thing to try is to see in which format are the generated .o files.
If they are i386 object files, your problem already starts at the compilation
step - look at $CC, $CPPFLAGS, $CFLAGS, $LDFLAGS variables. Otherwise,
check whether the libtool configuration is ok (the first 400 lines of
gettext-runtime/libtool - not to be confused with /usr/bin/libtool).

Bruno


[1] 
http://www.gnu.org/software/autoconf/manual/html_node/Preset-Output-Variables.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]