LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to compile source code as 32bit under 64bit OS. (https://www.linuxquestions.org/questions/linux-software-2/how-to-compile-source-code-as-32bit-under-64bit-os-606875/)

Brian1 12-14-2007 08:15 PM

How to compile source code as 32bit under 64bit OS.
 
Been searching a bit and can't really find what I am looking for. Can one compile source code as 32bit on a 64bit OS? Meaning a source file that is requires ./configure, make , make install routine. At the moment I have a small virtual 32bit OS installed and use this to build if needed. Just would like to know if it can be right in the 64bit OS and end up with a 32bit version. All 32bit libriares for the app is installed but can't figure out how to tell the ./configure to use the 32bit versions to build.

Thanks for your time and help.
Brian

weibullguy 12-14-2007 08:38 PM

If your toolchain is built with multilib support, then you can do something like this when you configure the package. You need to have pkg-config installed.
Code:

CC="gcc -m32" CXX="g++ -m32" \
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/lib/pkgconfig" \
./configure

Take a look at the multilib build instructions at CBLFS to get a better idea.

Brian1 12-15-2007 02:35 PM

Thanks for the help.

Brian


All times are GMT -5. The time now is 01:33 AM.