Perlized.
[nethome.git] / bin / errs1
1 #! /bin/sh
2 # $Id$
3
4 configure="./configure"
5 if [ "${1#*/configure}" != "$1" ];then
6         configure="$1"
7         shift
8 fi
9 customss="--enable-static --disable-shared"
10 if [ "$1" = "--origss" ];then
11         customss=
12         shift
13 fi
14 (
15         set -ex
16         rm -f config.cache
17         : >errs1.c
18         for flags in                                                                                                    \
19                 "-ggdb2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4"   \
20                 "-ggdb2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions"                                               \
21                 ""                                                                                                      \
22                 ;do
23                 if [ -z "$flags" ];then
24                         rm -f errs1.c
25                         echo >&2 "flags error"
26                         exit 1
27                 fi
28                 gcc $flags -c errs1.c -o /dev/null && break
29         done
30         if gcc -m64 -c errs1.c -o /dev/null;then
31                 flags="-m64 $flags"
32         fi
33         rm -f errs1.c
34         export CFLAGS="$flags"
35         export CXXFLAGS="$flags"
36         export GCJFLAGS="$flags"
37         time nice "$configure" $customss --enable-debug "$@"
38         ) 2>&1|tee errs1