]> code.ossystems Code Review - openembedded-core.git/commitdiff
gmp: add GPLv2 version (4.2.1)
authorKevin Tian <kevin.tian@intel.com>
Fri, 13 Aug 2010 09:34:24 +0000 (17:34 +0800)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 13 Aug 2010 22:38:16 +0000 (23:38 +0100)
The latest GPLv2 version of gmp is 4.2.1, which was released in 2006/05.

This GPLv2 recipe is written in clean house approach, w/o looking at
either v3 source code and recipe.

One patch (disable-stdc.patch) is added, which is also written from
scratch and licensed under GPLv2

test with 'calc' which is shipped by gmp package

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
meta/packages/gmp/gmp-4.2.1/disable-stdc.patch [new file with mode: 0644]
meta/packages/gmp/gmp_4.2.1.bb [new file with mode: 0644]

diff --git a/meta/packages/gmp/gmp-4.2.1/disable-stdc.patch b/meta/packages/gmp/gmp-4.2.1/disable-stdc.patch
new file mode 100644 (file)
index 0000000..83c9eae
--- /dev/null
@@ -0,0 +1,31 @@
+# "extern inline" in traditional gcc means that the function should be 
+# inlined wherever it's seen, while in C99, "extern inline" means that i
+# the function should only be inlined where the inline definition is 
+# seen while in other places it's not inlined:
+# http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html
+#
+# gmp checks "--std=gnu99" to use C99 convention however it internally 
+# defines some "extern inline" functions in gmp.h, which is included
+# by mainly .c files and finally lead a flood of redefinition function
+# errors when linking objects together.
+#
+# So disable C99/ANSI detection to stick to tranditional gcc behavior
+#
+# by Kevin Tian <kevin.tian@intel.com>, 2010-08-13
+#
+# (this patch is licensed under GPLv2+)
+
+diff --git a/configure.in b/configure.in
+index 450cc92..aab0b59 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1869,9 +1869,7 @@ AC_SUBST(DEFN_LONG_LONG_LIMB)
+ # The C compiler and preprocessor, put into ANSI mode if possible.
+ AC_PROG_CC
+-AC_PROG_CC_STDC
+ AC_PROG_CPP
+-GMP_H_ANSI
+ # The C compiler on the build system, and associated tests.
diff --git a/meta/packages/gmp/gmp_4.2.1.bb b/meta/packages/gmp/gmp_4.2.1.bb
new file mode 100644 (file)
index 0000000..d70dcf2
--- /dev/null
@@ -0,0 +1,14 @@
+DESCRIPTION = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers"
+HOMEPAGE = "http://gmplib.org/"
+BUGTRACKER = "http://gmplib.org/mailman/listinfo/gmp-bugs"
+# demo is licensed under GPLv2+, which however we don't package at all
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
+                    file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
+                    file://gmp-h.in;startline=6;endline=21;md5=5e25ffd16996faba8c1cd27b04b16099"
+PR = "r0"
+
+SRC_URI = "ftp://ftp.gnu.org/gnu/gmp/${BP}.tar.bz2 \
+           file://disable-stdc.patch"
+
+inherit autotools