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)
67 if test -f `dirname $configure`/bfd/elf64-x86-64.c -a '(' -d CVS -o -d .git ')';then
68 targets="--enable-targets=all"
72 if test -f `dirname $configure`/gcc/reload.c;then
73 werror="--disable-werror"
75 customss="--disable-static --enable-shared"
80 test -z "$CC" && CC=gcc
83 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
84 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \
87 if [ -z "$flags" ];then
89 echo >&2 "flags error"
92 "$CC" $flags -c errs1.c -o /dev/null && break
94 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
95 flags="$customm $flags"
98 export CFLAGS="$flags"
99 export CXXFLAGS="$flags"
100 export GCJFLAGS="$flags"
101 export CFLAGS_FOR_TARGET="$flags"
102 export CXXFLAGS_FOR_TARGET="$flags"
103 export LDFLAGS="$ldflags"
105 time nice "$configure" $target $targets $customss --enable-debug $maintainer $werror "$@"