gmp: make it a proper package and bump to version 5.0.1
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Mon, 6 Dec 2010 19:40:07 +0000 (16:40 -0300)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 27 Dec 2010 21:00:59 +0000 (22:00 +0100)
* Convert gmp to a proper autotargets package
* Bump to version 5.0.1
* Hook it up for binutils/gcc to use

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/gmp/Config.in
package/gmp/gmp.mk
toolchain/binutils/binutils.mk
toolchain/gcc/gcc-uclibc-4.x.mk

index 74596f86a1ddf6af158aea48dfcf2f7d62ce0193..226e0887d8b3708f18789621f9fe84813ae476e7 100644 (file)
@@ -1,14 +1,6 @@
-config BR2_PACKAGE_LIBGMP
+config BR2_PACKAGE_GMP
        bool "gmp"
        help
          GNU Multiple Precision Arithmetic Library.
 
-         http://www.swox.com/gmp/
-
-
-config BR2_PACKAGE_LIBGMP_HEADERS
-       bool "gmp headers for target"
-       depends on BR2_PACKAGE_LIBGMP
-       help
-         Install the gmp.h for the target.
-
+         http://gmplib.org/
index a3488b8369c18a5f7409df47f060df24b54547be..cdddca1ba1c5261e819b7e250c18e901b76b85ab 100644 (file)
 # gmp
 #
 #############################################################
-GMP_VERSION:=4.2.4
-GMP_SOURCE:=gmp-$(GMP_VERSION).tar.bz2
-GMP_SITE:=$(BR2_GNU_MIRROR)/gmp
-GMP_CAT:=$(BZCAT)
-GMP_DIR:=$(TOOLCHAIN_DIR)/gmp-$(GMP_VERSION)
-GMP_TARGET_DIR:=$(BUILD_DIR)/gmp-$(GMP_VERSION)
-GMP_BINARY:=libgmp$(LIBTGTEXT)
-GMP_HOST_BINARY:=libgmp$(HOST_LIBEXT)
-GMP_LIBVERSION:=3.4.4
 
-# this is a workaround for a bug in GMP, please see
-# http://gmplib.org/list-archives/gmp-devel/2006-April/000618.html
-ifeq ($(HOST_EXEEXT),.exe)
-GMP_CPP_FLAGS:=CPPFLAGS=-DDLL_EXPORT
-endif
+GMP_VERSION = 5.0.1
+GMP_SITE = $(BR2_GNU_MIRROR)/gmp
+GMP_SOURCE = gmp-$(GMP_VERSION).tar.bz2
+GMP_INSTALL_STAGING = YES
 
-$(DL_DIR)/$(GMP_SOURCE):
-        $(call DOWNLOAD,$(GMP_SITE),$(GMP_SOURCE))
-
-libgmp-source: $(DL_DIR)/$(GMP_SOURCE)
-
-$(GMP_DIR)/.unpacked: $(DL_DIR)/$(GMP_SOURCE)
-       $(GMP_CAT) $(DL_DIR)/$(GMP_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) -
-       toolchain/patch-kernel.sh $(GMP_DIR) package/gmp/ \*.patch
-       $(CONFIG_UPDATE) $(@D)
-       touch $@
-
-$(GMP_TARGET_DIR)/.configured: $(GMP_DIR)/.unpacked
-       mkdir -p $(GMP_TARGET_DIR)
-       (cd $(GMP_TARGET_DIR); rm -rf config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               $(TARGET_CONFIGURE_ARGS) \
-               $(GMP_CPP_FLAGS) \
-               $(GMP_DIR)/configure $(QUIET) \
-               --target=$(GNU_TARGET_NAME) \
-               --host=$(GNU_TARGET_NAME) \
-               --build=$(GNU_HOST_NAME) \
-               --prefix=/usr \
-               $(PREFERRED_LIB_FLAGS) \
-               $(DISABLE_NLS) \
-       )
-       touch $@
-
-$(GMP_TARGET_DIR)/.libs/$(GMP_BINARY): $(GMP_TARGET_DIR)/.configured
-       #$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(GMP_TARGET_DIR)
-       $(MAKE) -C $(GMP_TARGET_DIR)
-
-$(STAGING_DIR)/usr/lib/$(GMP_BINARY): $(GMP_TARGET_DIR)/.libs/$(GMP_BINARY)
-       $(MAKE) DESTDIR=$(STAGING_DIR) -C $(GMP_TARGET_DIR) install
-       $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(STAGING_DIR)/usr/lib/libgmp$(LIBTGTEXT)*
-
-$(TARGET_DIR)/usr/lib/libgmp.so $(TARGET_DIR)/usr/lib/libgmp.so.$(GMP_LIBVERSION) $(TARGET_DIR)/usr/lib/libgmp.a: $(STAGING_DIR)/usr/lib/$(GMP_BINARY)
-       cp -dpf $(STAGING_DIR)/usr/lib/libgmp$(LIBTGTEXT)* $(TARGET_DIR)/usr/lib/
-ifeq ($(BR2_PACKAGE_LIBGMP_HEADERS),y)
-       test -d $(TARGET_DIR)/usr/include || mkdir -p $(TARGET_DIR)/usr/include
-       cp -dpf $(STAGING_DIR)/usr/include/gmp.h $(TARGET_DIR)/usr/include/
-endif
-
-libgmp: $(TARGET_DIR)/usr/lib/libgmp$(LIBTGTEXT)
-stage-libgmp: $(STAGING_DIR)/usr/lib/$(GMP_BINARY)
-
-libgmp-clean:
-       rm -f $(TARGET_DIR)/usr/lib/libgmp.* $(TARGET_DIR)/usr/include/gmp.h \
-               $(STAGING_DIR)/usr/lib/libgmp* $(STAGING_DIR)/usr/include/gmp.h
-       -$(MAKE) -C $(GMP_TARGET_DIR) clean
-
-libgmp-dirclean:
-       rm -rf $(GMP_TARGET_DIR) $(GMP_DIR)
-
-GMP_DIR2:=$(TOOLCHAIN_DIR)/gmp-$(GMP_VERSION)-host
-GMP_HOST_DIR:=$(TOOLCHAIN_DIR)/gmp
-$(GMP_DIR2)/.configured: $(GMP_DIR)/.unpacked
-       mkdir -p $(GMP_DIR2)
-       (cd $(GMP_DIR2); rm -rf config.cache; \
-               $(HOST_CONFIGURE_OPTS) \
-               $(GMP_CPP_FLAGS) \
-               $(GMP_DIR)/configure $(QUIET) \
-               --prefix="$(GMP_HOST_DIR)" \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --disable-shared \
-               --enable-static \
-               $(DISABLE_NLS) \
-       )
-       touch $@
-
-$(GMP_HOST_DIR)/lib/libgmp$(HOST_LIBEXT): $(GMP_DIR2)/.configured
-       $(MAKE) -C $(GMP_DIR2) install
-
-host-libgmp: $(GMP_HOST_DIR)/lib/$(GMP_HOST_BINARY)
-host-libgmp-source: libgmp-source
-host-libgmp-clean:
-       rm -rf $(GMP_HOST_DIR)
-       -$(MAKE) -C $(GMP_DIR2) clean
-host-libgmp-dirclean:
-       rm -rf $(GMP_HOST_DIR) $(GMP_DIR2)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_LIBGMP),y)
-TARGETS+=libgmp
-endif
+$(eval $(call AUTOTARGETS,package,gmp))
+$(eval $(call AUTOTARGETS,package,gmp,host))
index ef9f64404838975b4802c8f2e612ac479742915a..327a0f65db7c4c06c86ff8197e2e74ec4cdc79d0 100644 (file)
@@ -16,17 +16,15 @@ endif
 BINUTILS_HOST_PREREQ:=
 BINUTILS_TARGET_PREREQ:=
 
-BINUTILS_HOST_PREREQ:=$(TOOLCHAIN_DIR)/gmp/lib/libgmp$(HOST_LIBEXT) \
-       $(TOOLCHAIN_DIR)/mpfr/lib/libmpfr$(HOST_LIBEXT)
-HOST_SOURCE += host-libgmp-source host-libmpfr-source
+BINUTILS_HOST_PREREQ:=host-gmp $(TOOLCHAIN_DIR)/mpfr/lib/libmpfr$(HOST_LIBEXT)
+HOST_SOURCE += host-gmp-source host-libmpfr-source
 
-BINUTILS_TARGET_PREREQ:=$(TARGET_DIR)/usr/lib/libgmp$(LIBTGTEXT) \
-       $(TARGET_DIR)/usr/lib/libmpfr$(LIBTGTEXT)
+BINUTILS_TARGET_PREREQ:=gmp $(TARGET_DIR)/usr/lib/libmpfr$(LIBTGTEXT)
 
-EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-gmp="$(GMP_HOST_DIR)"
+EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-gmp=$(HOST_DIR)/usr
 EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_HOST_DIR)"
 
-BINUTILS_TARGET_CONFIG_OPTIONS=--with-gmp="$(GMP_TARGET_DIR)"
+BINUTILS_TARGET_CONFIG_OPTIONS=--with-gmp=$(STAGING_DIR)/usr
 BINUTILS_TARGET_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_TARGET_DIR)"
 
 ifeq ($(BR2_PACKAGE_LIBMPC),y)
index cd63992fc2c0cbc7b472b04e0b6701b321f4be2d..13961bb7536ddc03b8423c884c319439b082f53c 100644 (file)
@@ -106,9 +106,9 @@ ifeq ($(BR2_INSTALL_OBJC),y)
 GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
 endif
 
-GCC_WITH_HOST_GMP=--with-gmp=$(GMP_HOST_DIR)
+GCC_WITH_HOST_GMP = --with-gmp=$(HOST_DIR)/usr
 GCC_WITH_HOST_MPFR=--with-mpfr=$(MPFR_HOST_DIR)
-HOST_SOURCE += host-libgmp-source host-libmpfr-source
+HOST_SOURCE += host-gmp-source host-libmpfr-source
 
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
 GCC_WITH_HOST_MPC=--with-mpc=$(MPC_HOST_DIR)
@@ -119,7 +119,7 @@ ifeq ($(BR2_INSTALL_FORTRAN),y)
 GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
 #GCC_TARGET_PREREQ+=$(TARGET_DIR)/usr/lib/libmpfr.so $(TARGET_DIR)/usr/lib/libgmp.so
 #GCC_STAGING_PREREQ+=$(TOOLCHAIN_DIR)/mpfr/lib/libmpfr.so
-GCC_WITH_TARGET_GMP=--with-gmp="$(GMP_TARGET_DIR)"
+GCC_WITH_TARGET_GMP = --with-gmp=$(STAGING_DIR)/usr
 GCC_WITH_TARGET_MPFR=--with-mpfr="$(MPFR_TARGET_DIR)"
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
 GCC_WITH_TARGET_MPC=--with-mpc="$(MPC_TARGET_DIR)"