Cleanup logic of mpfr build, and patch using recommended switches
authorUlf Samuelsson <ulf.samuelsson@atmel.com>
Wed, 31 Oct 2007 06:52:26 +0000 (06:52 -0000)
committerUlf Samuelsson <ulf.samuelsson@atmel.com>
Wed, 31 Oct 2007 06:52:26 +0000 (06:52 -0000)
package/mpfr/mpfr.mk

index 94d6ef49915184f09c88a81bb2d7bef880886e4b..e156a7db368f822aa1c9adfe9636a04dc069e248 100644 (file)
@@ -14,35 +14,25 @@ MPFR_TARGET_DIR:=$(BUILD_DIR)/mpfr-$(MPFR_VERSION)
 MPFR_BINARY:=libmpfr$(LIBTGTEXT)
 MPFR_HOST_BINARY:=libmpfr$(HOST_SHREXT)
 MPFR_LIBVERSION:=1.0.1
+#MPFR_SVN_CMD:=svn co svn://scm.gforge.inria.fr/svn/mpfr/branches/2.3 mpfr-2.3
 
-# No patch
-ifeq ($(MPFR_PATCH),)
-$(DL_DIR)/$(MPFR_SOURCE):
-        $(WGET) -P $(DL_DIR) $(MPFR_SITE)/$(MPFR_SOURCE)
-
-libmpfr-source: $(DL_DIR)/$(MPFR_SOURCE)
-endif
 # need patch
 ifneq ($(MPFR_PATCH),)
-$(DL_DIR)/$(MPFR_SOURCE):
-        $(WGET) -P $(DL_DIR) $(MPFR_SITE)/$(MPFR_SOURCE)
+MPFR_PATCH_SOURCE:=$(DL_DIR)/$(MPFR_PATCH_FILE)
 
-$(DL_DIR)/$(MPFR_PATCH_FILE):
+$(MPFR_PATCH_SOURCE):
        $(WGET) -O $@ $(MPFR_SITE)/$(MPFR_PATCH)
-
-libmpfr-source: $(DL_DIR)/$(MPFR_SOURCE) $(DL_DIR)/$(MPFR_PATCH_FILE)
 endif
 
-ifeq ($(MPFR_PATCH),)
-$(MPFR_DIR)/.unpacked: $(DL_DIR)/$(MPFR_SOURCE)
-else
-$(MPFR_DIR)/.unpacked: $(DL_DIR)/$(MPFR_SOURCE) $(DL_DIR)/$(MPFR_PATCH_FILE)
-endif
+$(DL_DIR)/$(MPFR_SOURCE):
+        $(WGET) -P $(DL_DIR) $(MPFR_SITE)/$(MPFR_SOURCE)
+
+$(MPFR_DIR)/.unpacked: $(DL_DIR)/$(MPFR_SOURCE) $(MPFR_PATCH_SOURCE)
        $(MPFR_CAT) $(DL_DIR)/$(MPFR_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
        toolchain/patch-kernel.sh $(MPFR_DIR) package/mpfr/ \*.patch
        $(CONFIG_UPDATE) $(MPFR_DIR)
 ifneq ($(MPFR_PATCH),)
-       ( cd $(MPFR_DIR); patch -p1 < $(DL_DIR)/$(MPFR_PATCH_FILE); )
+       ( cd $(MPFR_DIR); patch -p1 -N -Z < $(MPFR_PATCH_SOURCE); )
 endif
        touch $@
 
@@ -77,6 +67,10 @@ ifeq ($(BR2_PACKAGE_LIBMPFR_HEADERS),y)
                $(TARGET_DIR)/usr/include/
 endif
 
+.PHONY: libmpfr-source
+
+libmpfr-source: $(DL_DIR)/$(MPFR_SOURCE) $(MPFR_PATCH_SOURCE)
+
 libmpfr: uclibc $(TARGET_DIR)/usr/lib/libmpfr$(LIBTGTEXT)
 stage-libmpfr: uclibc $(STAGING_DIR)/usr/lib/$(MPFR_BINARY)