Skip to content

Commit

Permalink
contrib: Fix a bug in the old gmp configure script
Browse files Browse the repository at this point in the history
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ö <[email protected]>
  • Loading branch information
mstorsjo committed Apr 1, 2013
1 parent ebef81b commit 7fa5b04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions contrib/src/gmp/ansitest.diff
Original file line number Diff line number Diff line change
@@ -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);
}
3 changes: 2 additions & 1 deletion contrib/src/gmp/rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@

0 comments on commit 7fa5b04

Please sign in to comment.