|
|
昨天我打算在现有的系统上加装 gcc-4.1.1,gcc 可下载的源码包有下几个
gcc-4.1.1.tar.bz2 37.36 MB-May 25 2006 11:52:03 AM
gcc-ada-4.1.1.tar.bz2 4.38 MB-May 25 2006 11:52:15 AM
gcc-core-4.1.1.tar.bz2 16.3 MB-May 25 2006 11:53:51 AM
gcc-fortran-4.1.1.tar.bz2 747.27 KB-May 25 2006 11:52:35 AM
gcc-g++-4.1.1.tar.bz2 3.63 MB-May 25 2006 11:52:31 AM
gcc-java-4.1.1.tar.bz2 8.71 MB-May 25 2006 11:53:03 AM
gcc-objc-4.1.1.tar.bz2 188.05 KB-May 25 2006 11:53:04 AM
gcc-testsuite-4.1.1.tar.bz2 3.35 MB-May 25 2006 11:53:18 AM
LFS 的 mirror 提供的 tarball 通常是第一个综合的包,已包括下面所有可支援的 languages 及 testsuite 等
因此按常理我也是用第一个包来进行,解包後參考 BLFS 的方法去编译,前面的几个 sed 不写了,我是这样 configure 的
../gcc-4.1.1/configure --prefix=/opt/gcc-4.1.1 \
--enable-shared \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-languages=c,c++ &&
make -j3 bootstrap
完成编译後,发现 /opt/gcc-4.1.1/bin 内不单有 gcc 及 g++,还有 gcj!
怪了,为什麽会有 gcj?
在 http://gcc.gnu.org/install/configure.html 有这一段
--enable-languages=lang1,lang2,...
Specify that only a particular subset of compilers and their runtime libraries should be built. For a list of valid values for langN you can issue the following command in the gcc directory of your GCC source tree:
grep language= */config-lang.in
Currently, you can use any of the following: all, ada, c, c++, fortran, java, objc, obj-c++, treelang. Building the Ada compiler has special requirements, see below. If you do not pass this flag, or specify the option all, then all default languages available in the gcc sub-tree will be configured. Ada, Objective-C++, and treelang are not default languages; the rest are. Re-defining LANGUAGES when calling `make' does not work anymore, as those language sub-directories might not have been configured!
很清楚的说明不用 --enable-languages 或者 --enable-languages=all 就代表所有可编译的 language 都要了,这个可以理解,但最不明白的就是为何 --enable-languages=c,c++ 竟然会去编译 gcj 出来,跟本没有选 java 呀!
莫非 c++ 就要自动带 gcj?
若然我不用综合的 tarball,只装 gcc-core 及 gcc-g++,这肯定是可以的,从前我就是这样做
真不合逻辑,不解 :ask |
|