4 renice +19 -p $$; ionice -c3 -p $$
6 # Do not use for ctags - it would override $PATH:
8 function ctags {(unset ctags; PS1=x; . ~/.bashrc; ctags; );}
10 customss="--enable-static --disable-shared"
14 configure="./configure"
22 if [ "$1" = "--origss" ];then
27 if [ "$1" = "--fast" ];then
32 if [ "$1" = "--shared" ];then
33 customss="--disable-static --enable-shared"
38 if [ "$1" = "-m" ];then
43 if [ "$1" = "-m32" ];then
46 i?86|x86_64|ia64) target=i386-unknown-linux-gnu ;;
47 ppc*) target=powerpc64-unknown-linux-gnu ;;
48 s390*) target=s390-unknown-linux-gnu ;;
54 if [ "${1#*/configure}" != "$1" ];then
60 if [ "$1" = "-s" ];then
61 # -O0 is important to override GCC -O2.
74 find -name config.cache|xargs rm -f
77 if test -f `dirname $configure`/bfd/elf64-x86-64.c \
78 -o -f `dirname $configure`/gcc/reload.c;then
82 # maintainer="--enable-maintainer-mode"
84 if test -f `dirname $configure`/bfd/elf64-x86-64.c;then
85 test -f g77 || (test -f /usr/bin/gfortran && ln -s /usr/bin/gfortran g77)
88 targets="$targets --enable-64-bit-bfd"
90 if ! $fast && test -f `dirname $configure`/bfd/elf64-x86-64.c -a '(' -d CVS -o -d .git ')';then
91 targets="$targets --enable-targets=all"
94 if test -f `dirname $configure`/gcc/reload.c;then
95 werror="--disable-werror"
97 # --disable-static would fail on finding built libstdc++ due to -static-libstdc++.
98 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49829
100 customss="--disable-static --enable-shared"
105 if test -d readline/doc && ! test -e readline/readline.c;then
106 # Fedora gdb.spec prep.
107 readline="--with-system-readline"
110 test -z "$CC" && CC=gcc
113 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
114 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \
117 if [ -z "$flags" ];then
119 echo >&2 "flags error"
122 "$CC" $flags -c errs1.c -o /dev/null && break
124 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
125 flags="$customm $flags"
128 export CFLAGS="$flags"
129 export CXXFLAGS="$flags"
130 export GCJFLAGS="$flags"
131 export CFLAGS_FOR_TARGET="$flags"
132 export CXXFLAGS_FOR_TARGET="$flags"
133 export LDFLAGS="$ldflags"
135 time nice "$configure" $target $targets $customss $readline --enable-debug --disable-sim --enable-gold --enable-plugins $maintainer $werror --with-separate-debug-dir=/usr/lib/debug "$@"
137 (ctags; test -d gdb && (cd gdb; ctags; cd testsuite; ctags; cd ../gdbserver; ctags)) &