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
39 i?86|x86_64|ia64) target=i386-unknown-linux-gnu ;;
40 ppc*) target=powerpc64-unknown-linux-gnu ;;
41 s390*) target=s390-unknown-linux-gnu ;;
47 if [ "${1#*/configure}" != "$1" ];then
53 if [ "$1" = "-s" ];then
54 # -O0 is important to override GCC -O2.
66 find -name config.cache|xargs rm -f
69 if test -f `dirname $configure`/bfd/elf64-x86-64.c \
70 -o -f `dirname $configure`/gcc/reload.c;then
74 # maintainer="--enable-maintainer-mode"
76 if test -f `dirname $configure`/bfd/elf64-x86-64.c;then
77 test -f g77 || (test -f /usr/bin/gfortran && ln -s /usr/bin/gfortran g77)
79 if ! $fast && test -f `dirname $configure`/bfd/elf64-x86-64.c -a '(' -d CVS -o -d .git ')';then
80 targets="--enable-targets=all --enable-64-bit-bfd"
83 if test -f `dirname $configure`/gcc/reload.c;then
84 werror="--disable-werror"
86 customss="--disable-static --enable-shared"
91 test -z "$CC" && CC=gcc
94 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
95 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \
98 if [ -z "$flags" ];then
100 echo >&2 "flags error"
103 "$CC" $flags -c errs1.c -o /dev/null && break
105 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
106 flags="$customm $flags"
109 export CFLAGS="$flags"
110 export CXXFLAGS="$flags"
111 export GCJFLAGS="$flags"
112 export CFLAGS_FOR_TARGET="$flags"
113 export CXXFLAGS_FOR_TARGET="$flags"
114 export LDFLAGS="$ldflags"
116 time nice "$configure" $target $targets $customss --enable-debug $maintainer $werror "$@"