如何强制的/ usr / bin中/ GCC - >在/ usr /斌/ gcc的-m32?GCC、bin、usr、gcc

2023-09-07 22:35:14 作者:你的褐瞳里有深邃的意境つ

我有一个大的捆绑软件分发的不良生成文件(S)。在某些时候编译器总是忘记我要在32位程序进行编译。这将导致该计划的一部分,有64位库等都有32位的库。

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.

我怎么能强迫-m32选项每次我运行gcc的时候?

How can I force -m32 option every time that I run gcc?

BR, 尤哈

br, Juha

P.S。我的环境是混合32/64位(macbook5.1,雪豹)。或者:我怎样才能让我的系统纯粹是32位还是64位

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?

编辑:的坏的Makefile强调是覆盖全局变量。这就是为什么我chosed,工程破解。

edit: Emphasis on the bad Makefiles that override the global variables. Thats why I chosed the hack that works.

推荐答案

如果你想有一个糟糕的黑客,你可以替换了/ usr / bin中/ gcc的这个shell脚本:

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

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