4 customss="--enable-static --disable-shared"
8 configure="./configure"
13 if [ "$1" = "--origss" ];then
18 if [ "$1" = "-shared" ];then
19 customss="--disable-static --enable-shared"
24 if [ "$1" = "-m" ];then
29 if [ "$1" = "-m32" ];then
31 target=i386-unknown-linux-gnu
36 if [ "${1#*/configure}" != "$1" ];then
42 if [ "$1" = "-s" ];then
43 # -O0 is important to override GCC -O2.
54 find -name config.cache|xargs rm -f
57 if test -f `dirname $configure`/bfd/elf64-x86-64.c \
58 -o -f `dirname $configure`/gcc/reload.c;then
61 maintainer="--enable-maintainer-mode"
63 if test -f `dirname $configure`/bfd/elf64-x86-64.c;then
64 test -f g77 || (test -f /usr/bin/gfortran && ln -s /usr/bin/gfortran g77)
65 targets="--enable-targets=all"
68 if test -f `dirname $configure`/gcc/reload.c;then
69 werror="--disable-werror"
71 customss="--disable-static --enable-shared"
76 test -z "$CC" && CC=gcc
79 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
80 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \
83 if [ -z "$flags" ];then
85 echo >&2 "flags error"
88 "$CC" $flags -c errs1.c -o /dev/null && break
90 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
91 flags="$customm $flags"
94 export CFLAGS="$flags"
95 export CXXFLAGS="$flags"
96 export GCJFLAGS="$flags"
97 export CFLAGS_FOR_TARGET="$flags"
98 export CXXFLAGS_FOR_TARGET="$flags"
100 time nice "$configure" $target $targets $customss --enable-debug $maintainer $werror "$@"