2013-03-18 131 views
1

我想從AIX 6.5機器上的源代碼生成python 2.6.8,但幾個模塊不能建立成功。在構建過程中,有一個XLC手冊頁跳出並進行查找。我必須按q才能結束手冊頁,並且過程將繼續。所以我想是否是因爲構建調用默認XLC編譯器,我試圖更改默認的編譯器G ++:更改編譯C編譯器

make clean 
CC=/bin/gcc CXX=/bin/g++ ./configure 
make 

但似乎並沒有工作,XLC手冊頁仍然彈出並且模塊無法建立。

我如何確保它使用g ++而不是XLC?謝謝。

更新

這是日誌後CC=/bin/gcc CXX=/bin/g++ ./configure

-bash-3.2$ CC=/bin/gcc CXX=/bin/g++ ./configure 
checking for --enable-universalsdk... no 
checking for --with-universal-archs... 32-bit 
checking MACHDEP... aix6 
checking EXTRAPLATDIR... 
checking machine type as reported by uname -m... 00F63F144C00 
checking for --without-gcc... 
checking for gcc... cc_r 
checking whether the C compiler works... yes 
checking for C compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... no 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... no 
checking whether cc_r accepts -g... yes 
checking for cc_r option to accept ISO C89... -qlanglvl=extc89 
checking for --with-cxx-main=<compiler>... no 
checking how to run the C preprocessor... cc_r -qlanglvl=extc89 -E 
checking for grep that handles long lines and -e... /opt/freeware/bin/grep 
checking for egrep... /opt/freeware/bin/grep -E 

在我看行checking whether we are using the GNU C compiler... no,這是否意味着它不是用gcc?

而且還日誌中做出

checking for __attribute__((visibility("hidden")))... no 
cc_r: 1501-210 (W) command option t contains an incorrect subargument 

右上面的日誌後,XLC的男人頁面彈出。

+0

看看日誌,你確定xlc還在使用嗎?一般來說,'CC'應該是'gcc','CXX'應該是'g ++'。你的機器真的在'/ bin'中安裝了'g ++'嗎? – 2013-03-18 16:32:56

+0

@ n.m。謝謝。我不確定xlc在使用中。是的,它有g ++。在日誌中,我看到諸如'for gcc ... cc_r','C編譯器是否工作......是','我們是否使用GNU C編譯器...否'等行,是否意味着它不會使用GCC? – xslittlegrass 2013-03-18 17:53:47

+0

該腳本認爲'gcc'被稱爲'cc_r'。也許真正的gcc沒有找到。使用'./configure CC = gcc',看[這裏](http://www.gnu.org/prep/standards/html_node/Configuration.html)。 – 2013-03-18 19:10:41

回答

0

cc_r編譯器是IBM編譯器。 IBM C編譯器(和C++編譯器)有多種調用方式。 xlc是一個,_r變體(這意味着它們鏈接到重入/線程安全庫)是另一個。還有cc和c99的。爲什麼你問這麼多?那麼,每個都是作爲常用選項的簡寫提供的,在這種情況下,每個選項都適用於不同的語言標準。例如,c99支持C99標準。所以僅僅因爲編譯器沒有'xl'前綴並不意味着它不是IBM編譯器。

請注意,您顯示手冊頁的原因是您在某處調用編譯器時沒有任何參數或不正確的參數。這是消息

cc_r: 1501-210 (W) command option t contains an incorrect subargument 

-t flag可以讓你換出你的編譯器的部分原因,它是罕見的,你會真正想要做到這一點。它需要一個子論據,例如

cc_r -tI ... 

表示您將換出IPA優化器的編譯階段(通常使用-B指定新組件的位置)。

你的makefile文件中的某處指定了-t,並且大大地困惑了可憐的編譯器。

順便說一句,如果你想在make中重寫編譯器,你可以直接在makefile中用CC,CXX和CCC變量指定它。您可以在編輯makefile之前在命令行上指定它來進行試驗。請注意,如果再次運行./configure,這些更改將會丟失。

make CC=/bin/gcc CCC=/bin/g++ CXX=/bin/g++