How to force /usr/bin/gcc -> /usr/bin/gcc -m32?

余生颓废 提交于 2019-12-18 03:46:22

问题


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,
Juha

P.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 hack that works.


回答1:


If you want a crappy hack, you could replace /usr/bin/gcc with this shell script:

#!/bin/bash
/usr/bin/gcc-4.whatever -m32 "$@"



回答2:


Set your CFLAGS environment variable to have the -m32 flag.

export CFLAGS="-m32"



来源:https://stackoverflow.com/questions/4369765/how-to-force-usr-bin-gcc-usr-bin-gcc-m32

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!