Fixed compatibility with old GCCs.
authorlace <>
Sat, 21 Apr 2007 06:37:41 +0000 (06:37 +0000)
committerlace <>
Sat, 21 Apr 2007 06:37:41 +0000 (06:37 +0000)
bin/errs1

index 1024d74..bace2b5 100755 (executable)
--- a/bin/errs1
+++ b/bin/errs1
@@ -14,7 +14,20 @@ fi
 (
        set -ex
        rm -f config.cache
-       flags="-ggdb2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4"
+       : >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
+       rm -f errs1.c
        export CFLAGS="$flags"
        export CXXFLAGS="$flags"
        export GCJFLAGS="$flags"