X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=bin%2Ferrs1;h=ab30d3b9592c4a471d68dd2cb4ec12c5a2e0bbbe;hb=597f181523ccf1d990a699aee3c20034e3a13ecf;hp=f533fd123217d0f08d8a737afbdc843bde717190;hpb=96a8159f71db595911c0b64309aa3ee6b57bc4e2;p=nethome.git diff --git a/bin/errs1 b/bin/errs1 index f533fd1..ab30d3b 100755 --- a/bin/errs1 +++ b/bin/errs1 @@ -1,10 +1,46 @@ #! /bin/sh # $Id$ +customss="--enable-static --disable-shared" +if [ "$1" = "--origss" ];then + customss= + shift +fi + +customm="-m64" +if [ "$1" = "--origm" ];then + customm= + shift +fi + +configure="./configure" +if [ "${1#*/configure}" != "$1" ];then + configure="$1" + shift +fi + ( set -ex rm -f config.cache - export CFLAGS="-ggdb3" - export CXXFLAGS="-ggdb3" - ./configure --enable-static --disable-shared --enable-debug "$@" + : >errs1.c + for flags in \ + "-ggdb2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4" \ + "-ggdb2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions" \ + "" \ + ;do + if [ -z "$flags" ];then + rm -f errs1.c + echo >&2 "flags error" + exit 1 + fi + gcc $flags -c errs1.c -o /dev/null && break + done + if test -n "$customm" && gcc $customm -c errs1.c -o /dev/null;then + flags="$customm $flags" + fi + rm -f errs1.c + export CFLAGS="$flags" + export CXXFLAGS="$flags" + export GCJFLAGS="$flags" + time nice "$configure" $customss --enable-debug "$@" ) 2>&1|tee errs1