How to force /usr/bin/gcc -> /usr/bin/gcc -m32?
I have bad Makefile(s) of a large bundled software distribution. In some point compiler always "forgets" that I want to compile in 32 bit program. This causes that part of the programs have 64 bit libraries and others have 32 bit libraries.
How can I force -m32 option every time that I run gcc?
br,
JuhaP.S. My environment is mixed 32/64 bit (macbook5.1, snow leopard). Alternatively: How can I make my system purely 32 or 64 bits?
edit: Emphasis on the bad Makefiles that override the global variables. Thats why I chosed the h开发者_如何学运维ack that works.
Set your CFLAGS
environment variable to have the -m32
flag.
export CFLAGS="-m32"
If you want a crappy hack, you could replace /usr/bin/gcc with this shell script:
#!/bin/bash
/usr/bin/gcc-4.whatever -m32 "$@"
精彩评论