contrib: Fix a bug in the old gmp configure script
authorMartin Storsjö <martin@martin.st>
Mon, 1 Apr 2013 19:55:11 +0000 (22:55 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 1 Apr 2013 20:23:05 +0000 (23:23 +0300)
The brackets in the config test aren't properly escaped, and thus
don't end up in the final configure script as intended.

When building on a system where the system default compiler is clang,
clang can fail due to the main signature
"int main(int argc, char *argv)" being invalid,
which makes configure believe that the system compiler isn't
ANSI compliant, and it tries to invoke (broken) ANSI2KNR code.

Signed-off-by: Martin Storsjö <martin@martin.st>
contrib/src/gmp/ansitest.diff [new file with mode: 0644]
contrib/src/gmp/rules.mak

diff --git a/contrib/src/gmp/ansitest.diff b/contrib/src/gmp/ansitest.diff
new file mode 100644 (file)
index 0000000..e729208
--- /dev/null
@@ -0,0 +1,11 @@
+--- gmp-4.2.1/acinclude.m4.orig        2013-04-01 22:50:05.000000000 +0300
++++ gmp-4.2.1/acinclude.m4     2013-04-01 22:49:52.000000000 +0300
+@@ -3765,7 +3765,7 @@
+                gmp_cv_c_for_build_ansi,
+ [cat >conftest.c <<EOF
+ int
+-main (int argc, char *argv[])
++main (int argc, char **argv)
+ {
+   exit(0);
+ }
index b82faaa..ad05ab5 100644 (file)
@@ -14,10 +14,11 @@ $(TARBALLS)/gmp-$(GMP_VERSION).tar.bz2:
 gmp: gmp-$(GMP_VERSION).tar.bz2 .sum-gmp
        $(UNPACK)
        $(APPLY) $(SRC)/gmp/inline.diff
-       $(UPDATE_AUTOCONFIG)
+       $(APPLY) $(SRC)/gmp/ansitest.diff
        $(MOVE)
 
 .gmp: gmp
+       $(RECONF)
        cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
        cd $< && $(MAKE) install
        touch $@