开发者

Is there a transparent way to force 64-bit gcc compilation on Solaris

Is there a way to force '-m64' not overriding CXXFLAGS/CFLAGS. I want automatic x64 build environment like in Linux/BSD amd64.

Why do I need this?

The problem is complexity of the project I need to be buit as x64 on Solaris. It contains several parts and each may use specific C/C++ compiler flags. So, I can't just run:

CXXFLAGS=-m64 O2 ...
CFLAGS=-m64 -O2 ...
./configure

because there are no common C/C++ flags.

All I need is the way to transpare开发者_如何学编程ntly append '-m64' to every gcc/g++ call.


You can write a wrapper (eg: ~/bin/gcc) that would add the required option(s) and put ~/bin first in your PATH. eg:

#!/bin/ksh
/usr/sfw/bin/gcc -m64 "$@"


CPPFLAGS is used for the c preprocessor. It should be picked up by both gcc and g++.

Reference: http://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜