如何强制/usr/bin/gcc ->/usr/bin/gcc -m32? [英] How to force /usr/bin/gcc -> /usr/bin/gcc -m32?

查看:42
本文介绍了如何强制/usr/bin/gcc ->/usr/bin/gcc -m32?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大型捆绑软件分发的错误 Makefile.在某些时候,编译器总是忘记"我想在 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.

如何在每次运行 gcc 时强制使用 -m32 选项?

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

br,
巨哈

附言我的环境是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.这就是为什么我选择了有效的 hack.

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

推荐答案

如果你想要一个蹩脚的 hack,你可以用这个 shell 脚本替换/usr/bin/gcc:

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

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

这篇关于如何强制/usr/bin/gcc ->/usr/bin/gcc -m32?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆