4 customss="--enable-static --disable-shared"
8 configure="./configure"
15 if [ "$1" = "--origss" ];then
20 if [ "$1" = "--fast" ];then
25 if [ "$1" = "--shared" ];then
26 customss="--disable-static --enable-shared"
31 if [ "$1" = "-m" ];then
36 if [ "$1" = "-m32" ];then
38 target=i386-unknown-linux-gnu
43 if [ "${1#*/configure}" != "$1" ];then
49 if [ "$1" = "-s" ];then
50 # -O0 is important to override GCC -O2.
61 find -name config.cache|xargs rm -f
64 if test -f `dirname $configure`/bfd/elf64-x86-64.c \
65 -o -f `dirname $configure`/gcc/reload.c;then
68 maintainer="--enable-maintainer-mode"
70 if test -f `dirname $configure`/bfd/elf64-x86-64.c;then
71 test -f g77 || (test -f /usr/bin/gfortran && ln -s /usr/bin/gfortran g77)
73 if ! $fast && test -f `dirname $configure`/bfd/elf64-x86-64.c -a '(' -d CVS -o -d .git ')';then
74 targets="--enable-targets=all"
78 if test -f `dirname $configure`/gcc/reload.c;then
79 werror="--disable-werror"
81 customss="--disable-static --enable-shared"
86 test -z "$CC" && CC=gcc
89 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
90 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \
93 if [ -z "$flags" ];then
95 echo >&2 "flags error"
98 "$CC" $flags -c errs1.c -o /dev/null && break
100 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
101 flags="$customm $flags"
104 export CFLAGS="$flags"
105 export CXXFLAGS="$flags"
106 export GCJFLAGS="$flags"
107 export CFLAGS_FOR_TARGET="$flags"
108 export CXXFLAGS_FOR_TARGET="$flags"
109 export LDFLAGS="$ldflags"
111 time nice "$configure" $target $targets $customss --enable-debug $maintainer $werror "$@"