configure: fix print_config() with broke awks
authorMans Rullgard <mans@mansr.com>
Tue, 30 Oct 2012 11:57:30 +0000 (11:57 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Oct 2012 18:26:07 +0000 (19:26 +0100)
Some awk versions do not treat the result of unary + on a (numeric)
string as numeric, giving wrong results when used in a boolean context
Using unary - instead is logically equivalent works as expected.

Signed-off-by: Mans Rullgard <mans@mansr.com>
configure

index 4c9a299..115e8b1 100755 (executable)
--- a/configure
+++ b/configure
@@ -630,7 +630,7 @@ print_config(){
                 } else if (file ~ /\\.asm\$/) {
                     printf(\"%%define %s %d\\n\", c, v) >>file;
                 } else if (file ~ /\\.mak\$/) {
                 } else if (file ~ /\\.asm\$/) {
                     printf(\"%%define %s %d\\n\", c, v) >>file;
                 } else if (file ~ /\\.mak\$/) {
-                    n = +v ? \"\" : \"!\";
+                    n = -v ? \"\" : \"!\";
                     printf(\"%s%s=yes\\n\", n, c) >>file;
                 }
             }
                     printf(\"%s%s=yes\\n\", n, c) >>file;
                 }
             }