4 customss="--enable-static --disable-shared"
8 configure="./configure"
14 if [ "$1" = "--origss" ];then
19 if [ "$1" = "-shared" ];then
20 customss="--disable-static --enable-shared"
25 if [ "$1" = "-m" ];then
30 if [ "$1" = "-m32" ];then
32 target=i386-unknown-linux-gnu
37 if [ "${1#*/configure}" != "$1" ];then
43 if [ "$1" = "-s" ];then
44 # -O0 is important to override GCC -O2.
55 find -name config.cache|xargs rm -f
58 if test -f `dirname $configure`/bfd/elf64-x86-64.c \
59 -o -f `dirname $configure`/gcc/reload.c;then
62 maintainer="--enable-maintainer-mode"
64 if test -f `dirname $configure`/bfd/elf64-x86-64.c;then
65 test -f g77 || (test -f /usr/bin/gfortran && ln -s /usr/bin/gfortran g77)
66 targets="--enable-targets=all"
70 if test -f `dirname $configure`/gcc/reload.c;then
71 werror="--disable-werror"
73 customss="--disable-static --enable-shared"
78 test -z "$CC" && CC=gcc
81 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
82 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \
85 if [ -z "$flags" ];then
87 echo >&2 "flags error"
90 "$CC" $flags -c errs1.c -o /dev/null && break
92 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
93 flags="$customm $flags"
96 export CFLAGS="$flags"
97 export CXXFLAGS="$flags"
98 export GCJFLAGS="$flags"
99 export CFLAGS_FOR_TARGET="$flags"
100 export CXXFLAGS_FOR_TARGET="$flags"
101 export LDFLAGS="$ldflags"
103 time nice "$configure" $target $targets $customss --enable-debug $maintainer $werror "$@"