X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Ferrs12;h=4970709604f82f19d6349fc7fe1b00f106139b7c;hp=164309f60c4022d337ce49927efb0644749858b2;hb=257109ce5b17e8bf1e9990564d3eef7722746c0b;hpb=6d138c2428ecc2da3dd693272c0cb632b9311076 diff --git a/bin/errs12 b/bin/errs12 index 164309f..4970709 100755 --- a/bin/errs12 +++ b/bin/errs12 @@ -3,16 +3,21 @@ renice +19 -p $$; ionice -c3 -p $$ -# For ctags -PS1=x -. ~/.bashrc +# Do not use for ctags - it would override $PATH: +# PS1=x; . ~/.bashrc +function ctags {(unset ctags; PS1=x; . ~/.bashrc; ctags; );} customss="--enable-static --disable-shared" customm="-m64" target= targets= configure="./configure" -debug="-ggdb2" +# >=4.7 has small macros section. +if gcc --version|perl -ne 'exit(!(/(\d+)\.(\d+)/&&($1>4||($1==4&&$2>=7))));';then + debug="-g3" +else + debug="-g2" +fi ldflags="-lmcheck" fast=false readline="" @@ -95,7 +100,9 @@ rm -f errs1.ok werror="--disable-werror" customm="" # --disable-static would fail on finding built libstdc++ due to -static-libstdc++. - customss="" + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49829 + #customss="" + customss="--disable-static --enable-shared" else werror="" fi @@ -117,7 +124,10 @@ rm -f errs1.ok echo >&2 "flags error" exit 1 fi - "$CC" $flags -c errs1.c -o /dev/null && break + # Use -Werror: + # cc1: warnings being treated as errors + # archive.c:1: error: -fstack-protector not supported for this target + "$CC" $flags -Werror -c errs1.c -o /dev/null && break done if test -n "$customm" && "$CC" $customm -c errs1.c -o /dev/null;then flags="$customm $flags"