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.
79 find -name config.cache|xargs rm -f
82 if test -f `dirname $configure`/bfd/elf64-x86-64.c \
83 -o -f `dirname $configure`/gcc/reload.c;then
87 # maintainer="--enable-maintainer-mode"
89 if test -f `dirname $configure`/bfd/elf64-x86-64.c;then
90 test -f g77 || (test -f /usr/bin/gfortran && ln -s /usr/bin/gfortran g77)
93 targets="$targets --enable-64-bit-bfd"
95 if ! $fast && test -f `dirname $configure`/bfd/elf64-x86-64.c -a '(' -d CVS -o -d .git ')';then
96 targets="$targets --enable-targets=all"
99 if test -f `dirname $configure`/gcc/reload.c;then
100 werror="--disable-werror"
102 # --disable-static would fail on finding built libstdc++ due to -static-libstdc++.
103 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49829
105 customss="--disable-static --enable-shared"
110 if test -d readline/doc && ! test -e readline/readline.c;then
111 # Fedora gdb.spec prep.
112 readline="--with-system-readline"
115 test -z "$CC" && CC=gcc
118 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \
119 "$debug -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \
122 if [ -z "$flags" ];then
124 echo >&2 "flags error"
128 # cc1: warnings being treated as errors
129 # archive.c:1: error: -fstack-protector not supported for this target
130 "$CC" $flags -Werror -c errs1.c -o /dev/null && break
132 if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then
133 flags="$customm $flags"
136 export CFLAGS="$flags"
137 export CXXFLAGS="$flags"
138 export GCJFLAGS="$flags"
139 export CFLAGS_FOR_TARGET="$flags"
140 export CXXFLAGS_FOR_TARGET="$flags"
141 export LDFLAGS="$ldflags"
143 time nice "$configure" $target $targets $customss $readline --enable-debug --disable-sim --enable-gold --enable-plugins $maintainer $werror --with-separate-debug-dir=/usr/lib/debug "$@"
145 (ctags; test -d gdb && (cd gdb; ctags; cd testsuite; ctags; cd ../gdbserver; ctags)) &