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"
15 # >=4.7 has small macros section.
16 if gcc --version|perl -ne 'exit(!(/(\d+)\.(\d+)/&&($1>4||($1==4&&$2>=7))));';then
27 if [ "$1" = "--origss" ];then
32 if [ "$1" = "--fast" ];then
37 if [ "$1" = "--shared" ];then
38 customss="--disable-static --enable-shared"
43 if [ "$1" = "-m" ];then
48 if [ "$1" = "-m32" ];then
51 i?86|x86_64|ia64) target=i386-unknown-linux-gnu ;;
52 ppc*) target=powerpc64-unknown-linux-gnu ;;
53 s390*) target=s390-unknown-linux-gnu ;;
59 if [ "${1#*/configure}" != "$1" ];then
65 if [ "$1" = "-s" ];then
66 # -O0 is important to override GCC -O2.
72 if [ "$1" = "--nomcheck" ];then
84 find -name config.cache|xargs rm -f
87 if test -f `dirname $configure`/bfd/elf64-x86-64.c \
88 -o -f `dirname $configure`/gcc/reload.c;then
92 # maintainer="--enable-maintainer-mode"
94 if test -f `dirname $configure`/bfd/elf64-x86-64.c;then
95 test -f g77 || (test -f /usr/bin/gfortran && ln -s /usr/bin/gfortran g77)
98 targets="$targets --enable-64-bit-bfd"
100 if ! $fast && test -f `dirname $configure`/bfd/elf64-x86-64.c -a '(' -d CVS -o -d .git ')';then
101 targets="$targets --enable-targets=all"
104 if test -f `dirname $configure`/gcc/reload.c;then
105 werror="--disable-werror"
107 # --disable-static would fail on finding built libstdc++ due to -static-libstdc++.
108 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49829
110 customss="--disable-static --enable-shared"
115 if test -d readline/doc && ! test -e readline/readline.c;then
116 # Fedora gdb.spec prep.
117 readline="--with-system-readline"
120 test -z "$CC" && CC=gcc
122 # -Wp,-D_FORTIFY_SOURCE=2: /usr/include/features.h:329:3: error: #warning _FORTIFY_SOURCE requested but disabled [-Werror=cpp]
124 "$debug -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -ftrack-macro-expansion=0 -fno-diagnostics-show-caret" \
125 "$debug -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
126 "$debug -pipe -Wall -fexceptions" \
129 if [ -z "$flags" ];then
131 echo >&2 "flags error"
135 # cc1: warnings being treated as errors
136 # archive.c:1: error: -fstack-protector not supported for this target
137 "$CC" $flags -Werror -c errs1.c -o /dev/null && break
139 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
140 flags="$customm $flags"
143 export CFLAGS="$flags"
144 export CXXFLAGS="$flags"
145 export GCJFLAGS="$flags"
146 export CFLAGS_FOR_TARGET="$flags"
147 export CXXFLAGS_FOR_TARGET="$flags"
148 export LDFLAGS="$mcheck"
150 time nice "$configure" $target $targets $customss $readline --enable-debug --disable-sim --enable-gold --enable-plugins $maintainer $werror --with-separate-debug-dir=/usr/lib/debug "$@"
152 (ctags; test -d gdb && (cd gdb; ctags; cd testsuite; ctags; cd ../gdbserver; ctags)) &