...ing logging 4.0

はてなブログに移行しました。D言語の話とかいろいろ。

GCC-4.3.0のインストールに再挑戦

checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... tail +16c $$f1 > tmp-foo1; tail
+16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... yes
*** 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... m4
checking for flex... flex
checking for flex... flex
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... dlltool
checking for ld... (cached) /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-p
c-cygwin/bin/ld.exe
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... windres
checking for windmc... no
checking for objcopy... objcopy
checking for objdump... objdump
checking for cc... cc
checking for c++... c++
checking for gcc... gcc
checking for gcj... no
checking for gfortran... no
checking for ar... no
checking for ar... ar
checking for as... no
checking for as... as
checking for dlltool... no
checking for dlltool... dlltool
checking for ld... no
checking for ld... ld
checking for lipo... no
checking for lipo... no
checking for nm... no
checking for nm... nm
checking for objdump... no
checking for objdump... objdump
checking for ranlib... no
checking for ranlib... ranlib
checking for strip... no
checking for strip... strip
checking for windres... no
checking for windres... windres
checking for windmc... no
checking for windmc... 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 where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether -fkeep-inline-functions is supported... yes
configure: creating ./config.status
config.status: creating Makefile
sed: -e expression #1, char 1538: unknown option to `s'

今度は ./configure に失敗する・・・.
sed のエラーはどうして出るのだろうか.

追記

2008-03-06 - かそくそうち を参考にして,ビルド用のディレクトリを作ってその中で

mkdir build-gcc-4.3.0
cd build-gcc-4.3.0
../gcc-4.3.0/configure ...

とするのではなく,

$ cd gcc-4.3.0

$ ../gcc-4.3.0/configure --prefix=/home/<UserName>/gcc-4.3.0 --with-gmp=/home/<UserName>/gcc-4.3.0 --with-mpfr=/home/<UserName>/gcc-4.3.0 --enable-languages=c,c++ --enable-nls --without-included-gettext --enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debug

のように解凍した gcc-4.3.0 自体をカレントディレクトリにしてから ./configure したら成功したようだ.
これから make && make install に挑戦.

追記

本来はリンク先のようにビルド用のディレクトリを作るべきらしいので注意のこと.

追記

できたああああああああああ!(現在 03:45 orz)

bash-3.2$ c++ main.cpp -std=c++0x
bash-3.2$ ./a
hello world
bash-3.2$ ls
a.exe*  main.cpp  main.cpp~
bash-3.2$ cat main.cpp
#include <iostream>
#include <string>
using namespace std;

string h()
{
  string ret("hello world");
  return ret;
}

int main()
{
  string&& m = h();
  cout << m << endl;
  return 0;
}

ただし,GCC 4.3.0インストール完了 - Faith and Brave - C++で遊ぼう のように

Cygwinbashから、
PATH=/home/gcc-4.3.0/bin:${PATH}
としてみてください。
CygwinがPATHの先頭に/binとかを追加するので、Windows環境変数を変えても/binの方が先に見つかります。

とする必要あり.

gcc -V 4.3.0

ではダメなのだろうか?