gcc4.2.1在ubuntu 7.04下的具体配置如何

为当前最终发行版之前的所有版本提供支持
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

gcc4.2.1在ubuntu 7.04下的具体配置如何

#1

帖子 znf19850924 » 2007-10-10 11:30

请高手帮忙,如果写/configure
自己写的不行 老出错
注:gcc第一次安装
gg2005
帖子: 145
注册时间: 2007-09-25 18:54
送出感谢: 0
接收感谢: 0

#2

帖子 gg2005 » 2007-10-10 11:41

gcc是干嘛的?
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#3

帖子 znf19850924 » 2007-10-10 11:42

晕,不知道阿,gnc 的 compiler
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#4

帖子 znf19850924 » 2007-10-10 11:47

sudo /opt/gcc-4.2.1/configure --prefix=/opt/gcc-4.2.1 --enable-threads=posix --disable-checking --enable-long-long --host=i --enable-languages=c,c++

就是 配置这个 我配置的不错 也 不全 你们谁帮忙阿
zhangsong023
帖子: 768
注册时间: 2006-09-20 19:56
送出感谢: 0
接收感谢: 1 次

#5

帖子 zhangsong023 » 2007-10-10 11:57

晕死,编译gcc本身也需要C编译器的。

代码: 全选

sudo apt-get install build-essential
装好之后,不用再自已编译gcc了,不喜欢没事儿乱折磨。

PS: 有错误发生一定要贴错误信息。
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#6

帖子 znf19850924 » 2007-10-10 12:08

sudo apt-get install build-essential 输过了 已经 但是 还不行阿 make完了后 出现错误 自己写了 个 测试程序 也 还是 错误
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#7

帖子 znf19850924 » 2007-10-10 12:09

znf2008@ubuntu:~$ sudo apt-get install build-essential
Password:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
读取状态信息... 完成
build-essential 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#8

帖子 znf19850924 » 2007-10-10 12:10

znf2008@ubuntu:~$ sudo /opt/gcc-4.2.1/configure --prefix=/opt/gcc-4.2.1 --enable-threads=posix --disable-checking --enable-long-long --host=i --enable-languages=c,c++
loading cache ./config.cache
checking host system type... Invalid configuration `i': machine `i' not recognized

checking target system type... Invalid configuration `i': machine `i' not recognized

checking build system type... Invalid configuration `i': machine `i' not recognized

checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether ln works... (cached) yes
checking whether ln -s works... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for i-gnatbind... no
checking for gnatbind... no
checking whether compiler driver understands Ada... (cached) no
checking how to compare bootstrapped objects... (cached) cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... no
*** This configuration is not supported in the following subdirectories:
target-libmudflap target-libgomp target-libada gnattools target-libgfortran target-libffi target-zlib target-libjava zlib target-libobjc target-boehm-gc
(Any other directories should still work fine.)
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for bison... no
checking for gm4... no
checking for gnum4... no
checking for m4... no
checking for flex... no
checking for lex... no
checking for flex... no
checking for makeinfo... no
checking for expect... no
checking for runtest... no
checking for i-ar... (cached) ar
checking for i-as... (cached) as
checking for i-dlltool... no
checking for dlltool... no
checking for i-ld... (cached) ld
checking for i-lipo... no
checking for lipo... no
checking for i-nm... (cached) nm
checking for i-ranlib... (cached) ranlib
checking for i-strip... (cached) strip
checking for i-windres... no
checking for windres... no
checking for i-objcopy... (cached) objcopy
checking for i-objdump... (cached) objdump
checking for i-gcj... no
checking for gcj... no
checking for i-gfortran... no
checking for gfortran... no
checking for ar... no
checking for as... no
checking for dlltool... no
checking for i-dlltool... no
checking for dlltool... no
checking for ld... no
checking for lipo... no
checking for i-lipo... no
checking for lipo... no
checking for nm... no
checking for objdump... no
checking for ranlib... no
checking for strip... no
checking for windres... no
checking for i-windres... no
checking for windres... no
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... host tool
checking where to find the target gcc... just compiled
checking where to find the target gcj... host tool
checking where to find the target gfortran... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objdump... host tool
checking where to find the target ranlib... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#9

帖子 znf19850924 » 2007-10-10 12:12

znf2008@ubuntu:~$ sudo /opt/gcc-4.2.1/configure --prefix=/opt/gcc-4.2.1 --enable-threads=posix --disable-checking --enable-long-long --host=i386-linux-gnu --enable-languages=c,c++
loading cache ./config.cache
checking host system type... i386-pc-linux-gnu
checking target system type... i386-pc-linux-gnu
checking build system type... i386-pc-linux-gnu
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether ln works... (cached) yes
checking whether ln -s works... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gnatbind... (cached) no
checking whether compiler driver understands Ada... (cached) no
checking how to compare bootstrapped objects... (cached) cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... no
*** This configuration is not supported in the following subdirectories:
target-libada gnattools target-libgfortran target-libffi target-zlib target-libjava zlib target-libobjc target-boehm-gc
(Any other directories should still work fine.)
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for bison... no
checking for gm4... no
checking for gnum4... no
checking for m4... no
checking for flex... no
checking for lex... no
checking for flex... no
checking for makeinfo... no
checking for expect... no
checking for runtest... no
checking for i386-linux-gnu-ar... (cached) ar
checking for i386-linux-gnu-as... (cached) as
checking for i386-linux-gnu-dlltool... no
checking for dlltool... no
checking for i386-linux-gnu-ld... (cached) ld
checking for i386-linux-gnu-lipo... no
checking for lipo... no
checking for i386-linux-gnu-nm... (cached) nm
checking for i386-linux-gnu-ranlib... (cached) ranlib
checking for i386-linux-gnu-strip... (cached) strip
checking for i386-linux-gnu-windres... no
checking for windres... no
checking for i386-linux-gnu-objcopy... (cached) objcopy
checking for i386-linux-gnu-objdump... (cached) objdump
checking for i386-linux-gnu-gcj... no
checking for gcj... no
checking for i386-linux-gnu-gfortran... no
checking for gfortran... no
checking for ar... no
checking for as... no
checking for dlltool... no
checking for i386-linux-gnu-dlltool... no
checking for dlltool... no
checking for ld... no
checking for lipo... no
checking for i386-linux-gnu-lipo... no
checking for lipo... no
checking for nm... no
checking for objdump... no
checking for ranlib... no
checking for strip... no
checking for windres... no
checking for i386-linux-gnu-windres... no
checking for windres... no
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... host tool
checking where to find the target gcc... just compiled
checking where to find the target gcj... host tool
checking where to find the target gfortran... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objdump... host tool
checking where to find the target ranlib... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#10

帖子 znf19850924 » 2007-10-10 12:15

checking for fread_unlocked... yes
checking for fwrite_unlocked... yes
checking for getchar_unlocked... yes
checking for getc_unlocked... yes
checking for putchar_unlocked... yes
checking for putc_unlocked... yes
checking whether abort is declared... yes
checking whether asprintf is declared... (cached) no
checking whether basename is declared... (cached) no
checking whether errno is declared... no
checking whether vasprintf is declared... (cached) no
checking whether clearerr_unlocked is declared... yes
checking whether feof_unlocked is declared... yes
checking whether ferror_unlocked is declared... yes
checking whether fflush_unlocked is declared... yes
checking whether fgetc_unlocked is declared... yes
checking whether fgets_unlocked is declared... no
checking whether fileno_unlocked is declared... yes
checking whether fprintf_unlocked is declared... no
checking whether fputc_unlocked is declared... yes
checking whether fputs_unlocked is declared... no
checking whether fread_unlocked is declared... yes
checking whether fwrite_unlocked is declared... yes
checking whether getchar_unlocked is declared... yes
checking whether getc_unlocked is declared... yes
checking whether putchar_unlocked is declared... yes
checking whether putc_unlocked is declared... yes
checking for an ANSI C-conforming const... (cached) yes
checking for sys/mman.h... (cached) yes
checking for mmap... yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking whether to enable maintainer-specific portions of Makefiles... no
updating cache ../config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mkheaders.almost
config.status: creating config.h
make[3]: Entering directory `/home/znf2008/build-i386-linux-gnu/fixincludes'
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/opt/gcc-4.2.1/fixincludes -I../include -I/opt/gcc-4.2.1/fixincludes/../include /opt/gcc-4.2.1/fixincludes/fixincl.c
In file included from /opt/gcc-4.2.1/fixincludes/fixincl.c:101:
/opt/gcc-4.2.1/fixincludes/fixincl.x:76: 警告: 字符串长 ‘4756’ 比 ‘509’ (ISO C89 被要求支持的最大长度) 还要长
/opt/gcc-4.2.1/fixincludes/fixincl.x:228: 警告: 字符串长 ‘552’ 比 ‘509’ (ISO C89 被要求支持的最大长度) 还要长
/opt/gcc-4.2.1/fixincludes/fixincl.x:273: 警告: 字符串长 ‘532’ 比 ‘509’ (ISO C89 被要求支持的最大长度) 还要长
/opt/gcc-4.2.1/fixincludes/fixincl.x:317: 警告: 字符串长 ‘808’ 比 ‘509’ (ISO C89 被要求支持的最大长度) 还要长
/opt/gcc-4.2.1/fixincludes/fixincl.x:403: 警告: 字符串长 ‘5139’ 比 ‘509’ (ISO C89 被要求支持的最大长度) 还要长
/opt/gcc-4.2.1/fixincludes/fixincl.x:2503: 警告: 字符串长 ‘729’ 比 ‘509’ (ISO C89 被要求支持的最大长度) 还要长
/opt/gcc-4.2.1/fixincludes/fixincl.x:7635: 警告: 字符串长 ‘575’ 比 ‘509’ (ISO C89 被要求支持的最大长度) 还要长
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/opt/gcc-4.2.1/fixincludes -I../include -I/opt/gcc-4.2.1/fixincludes/../include /opt/gcc-4.2.1/fixincludes/fixtests.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/opt/gcc-4.2.1/fixincludes -I../include -I/opt/gcc-4.2.1/fixincludes/../include /opt/gcc-4.2.1/fixincludes/fixfixes.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/opt/gcc-4.2.1/fixincludes -I../include -I/opt/gcc-4.2.1/fixincludes/../include /opt/gcc-4.2.1/fixincludes/server.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/opt/gcc-4.2.1/fixincludes -I../include -I/opt/gcc-4.2.1/fixincludes/../include /opt/gcc-4.2.1/fixincludes/procopen.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/opt/gcc-4.2.1/fixincludes -I../include -I/opt/gcc-4.2.1/fixincludes/../include /opt/gcc-4.2.1/fixincludes/fixlib.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/opt/gcc-4.2.1/fixincludes -I../include -I/opt/gcc-4.2.1/fixincludes/../include /opt/gcc-4.2.1/fixincludes/fixopts.c
gcc -g -O2 -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
echo timestamp > full-stamp
srcdir="/opt/gcc-4.2.1/fixincludes" /bin/sh /opt/gcc-4.2.1/fixincludes/mkfixinc.sh i386-pc-linux-gnu
sed -e 's/@gcc_version@/4.2.1/' < mkheaders.almost > mkheadersT
mv -f mkheadersT mkheaders
make[3]: Leaving directory `/home/znf2008/build-i386-linux-gnu/fixincludes'
make[3]: Entering directory `/home/znf2008/libcpp'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/znf2008/libcpp'
make[3]: Entering directory `/home/znf2008/libdecnumber'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/znf2008/libdecnumber'
make[3]: Entering directory `/home/znf2008/gcc'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/znf2008/gcc'
make[2]: Leaving directory `/home/znf2008'
make[2]: Entering directory `/home/znf2008'
make[3]: Entering directory `/home/znf2008'
rm -f stage_current
make[3]: Leaving directory `/home/znf2008'
make[2]: Leaving directory `/home/znf2008'
make[2]: Entering directory `/home/znf2008'
Configuring stage 2 in ./intl
configure: loading cache ./config.cache
configure: error: `CC' has changed since the previous run:
configure: former value: /home/znf2008/./prev-gcc/xgcc -B/home/znf2008/./prev-gcc/ -B/opt/gcc-4.2.1/i386-ubuntu-linux/bin/
configure: current value: /home/znf2008/./prev-gcc/xgcc -B/home/znf2008/./prev-gcc/ -B/opt/gcc-4.2.1/i386-linux-gnu/bin/
configure: error: `build_alias' has changed since the previous run:
configure: former value: i386-ubuntu-linux
configure: current value: i386-linux-gnu
configure: error: `host_alias' has changed since the previous run:
configure: former value: i386-ubuntu-linux
configure: current value: i386-linux-gnu
configure: error: `target_alias' has changed since the previous run:
configure: former value: i386-ubuntu-linux
configure: current value: i386-linux-gnu
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
make[2]: *** [configure-stage2-intl] 错误 1
make[2]: Leaving directory `/home/znf2008'
make[1]: *** [stage2-bubble] 错误 2
make[1]: Leaving directory `/home/znf2008'
make: *** [all] 错误 2
zhangsong023
帖子: 768
注册时间: 2006-09-20 19:56
送出感谢: 0
接收感谢: 1 次

#11

帖子 zhangsong023 » 2007-10-10 12:52

1、装了build-essential之后,就已经有gcc了,不用自己编译;
2、贴出你的测试程序;
3、如果build-essential依赖的gcc版本不是你想要的,那么源里还有你试图编译的4.2.1版。
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星
送出感谢: 1 次
接收感谢: 0

#12

帖子 xhy » 2007-10-10 13:00

gcc需要使用特定版本的gcc才能编译
目前负债150多万
zhangsong023
帖子: 768
注册时间: 2006-09-20 19:56
送出感谢: 0
接收感谢: 1 次

#13

帖子 zhangsong023 » 2007-10-10 13:00

host参数也明显错误,host参数指定系统平台,估计你原意是i386。
zhangsong023
帖子: 768
注册时间: 2006-09-20 19:56
送出感谢: 0
接收感谢: 1 次

#14

帖子 zhangsong023 » 2007-10-10 13:11

对了,7.10前段时间gcc升级了一次,解决了无法编译gcc4.2.x的一个bug,不知道7.04下的包有没有升级,我没有7.04。
去package.ubuntu上gutsy分支下载最新的gcc的deb包,configure时不用写host参数,再试试。
至于什么测试程序错误,100%是你自己程序的错。
znf19850924
帖子: 45
注册时间: 2007-10-10 11:24
送出感谢: 0
接收感谢: 0

#15

帖子 znf19850924 » 2007-10-10 13:28

谢谢 14楼的高手 :lol:
回复

回到 “老旧版本支持”