LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-14-2007, 08:15 PM   #1
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
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
 
Old 12-14-2007, 08:38 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,712
Blog Entries: 1

Rep: Reputation: 221Reputation: 221Reputation: 221
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.

Last edited by weibullguy; 12-14-2007 at 08:39 PM.
 
Old 12-15-2007, 02:35 PM   #3
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Original Poster
Rep: Reputation: 61
Thanks for the help.

Brian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
32bit(i386) or 64bit(amd64) on an amd 64bit cpu (amd 6000+)? d-_-b Debian 7 10-28-2007 07:48 PM
can 64bit processor run both 64bit and 32bit computers? DJOtaku Linux - General 4 09-08-2005 08:14 PM
32bit on 64bit paralysis Linux From Scratch 2 06-02-2005 03:19 PM
how i compile a source code? nazib Linux - General 5 02-27-2005 09:13 AM
How to compile source code... Grim Reaper Linux - Newbie 3 04-26-2002 11:28 AM


All times are GMT -5. The time now is 06:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration