I’ve migrated an Oracle database and Oracle HTTP server install from a 32-bit machine to a 64-bit machine – both machines running Linux. Oracle Database is 64-bit, but the (Apache) HTTP server is 32-bit.
I use some non-Oracle DSOs (mod_ntlm for one) but whenever I run the standard ‘make install’ type thing I end up with a 64-bit module.
Is there a standard way to compile 32-bit Apache modules on a 64-bit machine?
As an alternative to Andrew Medico’s answer, use ‘
-m32‘ for 32-bit compilations and ‘-m64‘ for 64-bit compilations on PPC or SPARC or Intel machines – since you don’t actually mention which chip architecture you are using and that notation works on all of these.I often use:
to ensure a 32-bit compilation (or, more frequently,
CC='gcc -m64'to ensure 64-bit compilation).Question: ‘Is CC an environment variable used by make?’
Answer: Yes, though in this case, it is also recognized by
configure, which is a shell script generated byautoconf. The notation I used – which is what I use at the command line – sets CC in the environment while theconfigurecommand is run. The other answer suggests using:I assume that works and achieves much the same effect; I’ve not tried it so I don’t know that it works.
If you run
./configure --help | less, you will see information (often just standard information) about how to use the script. And at the end, it will list (some of the) relevant environment variables, of which CC is one.The advantage of setting the C compiler to ‘gcc -m32’ is that the 32-bit flag is set every time the compiler is used – there is very little room for it to go wrong. If you set a flags variable (CFLAGS, etc), there is a chance that some command won’t use it, and then things can go awry.
Also, going back to the question,
makecertainly uses a variable (macro) called CC. And you can set that on the make command line:That overrides any setting in the makefile. By contrast, using an environment variable, the setting in the makefile overrides the value in the environment, so setting CC as an environment variable is less helpful. Although
make -egives the environment precedence over the makefile, it is usually a dangerous option to use – it can have unexpected side-effects.