views:

46

answers:

2

Hi,

I'm compiling my program with architecture set to

-mtune=i386

However, I'm also linking statically against several libs (libpng, zlib, jpeglib, vorbisfile, libogg). I've built these libs on my own using configure and make, so I guess these libs were built with architecture being set to my system's architecture which would be i686. But I don't want that! I want my program to run on i386, too, so I need to make sure that all these libs that I'm statically linking against are built for i386, too.

So my question: Is there a convenient way to build libpng/zlib/jpeglib/vorbisfile/libogg etc. for i386 or do I have to modify all of their makefiles manually and make sure that -mtune is set to i386?

Thanks for help!

Andy

+2  A: 

--mtune only tunes the instruction output (ordering, scheduling, etc), but doesn't guarantee the output is i386 only, thats what --mcpu or --march or TARGET is for (i386-...)

Yann Ramin
+2  A: 

I think

CFLAGS="-march=i386 -O3" make ...

Might work if they use autotools to generate the Makefile. You could also extract the files from an RPM if they have the .a and headers for the version you want. Or go for an SRPM and modify the spec/scripts to build for the arch:

RPM_ARCH="i386"

But it really isn't that much trouble to rebuild the libraries properly, to ensure you don't miss anything. it isn't like you are compiling a whole distro.

Aiden Bell
I object! :-) It is a lot of trouble because the configure script generated a 50 KB makefile beast which contains a lot of references to "i686". These references also do not vanish when doing a./configure --target=i386It's really not so easy to analyze what's going on there... it probably would be easier to create my own makefile than messing with the auto generated one...
Andy