2006-09-28 19:38:06 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# mpfr
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-12-02 19:14:38 +01:00
|
|
|
MPFR_VERSION:=2.2.1
|
2007-03-19 15:16:10 +01:00
|
|
|
MPFR_PATCH:=patches
|
2007-03-22 14:21:05 +01:00
|
|
|
MPFR_PATCH_FILE:=mpfr-$(MPFR_VERSION).patch
|
2006-09-28 19:38:06 +02:00
|
|
|
MPFR_SOURCE:=mpfr-$(MPFR_VERSION).tar.bz2
|
2006-11-17 16:43:51 +01:00
|
|
|
MPFR_CAT:=$(BZCAT)
|
2006-09-28 19:38:06 +02:00
|
|
|
MPFR_SITE:=http://www.mpfr.org/mpfr-current/
|
2007-01-16 14:26:32 +01:00
|
|
|
MPFR_DIR:=$(TOOL_BUILD_DIR)/mpfr-$(MPFR_VERSION)
|
2007-01-16 20:48:46 +01:00
|
|
|
MPFR_TARGET_DIR:=$(BUILD_DIR)/mpfr-$(MPFR_VERSION)
|
2007-01-22 20:17:23 +01:00
|
|
|
MPFR_BINARY:=libmpfr.so
|
2006-12-21 18:20:42 +01:00
|
|
|
MPFR_LIBVERSION:=1.0.1
|
2006-09-28 19:38:06 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
|
|
|
MPFR_BE:=yes
|
|
|
|
else
|
|
|
|
MPFR_BE:=no
|
|
|
|
endif
|
|
|
|
|
2007-03-22 14:21:05 +01:00
|
|
|
# No patch
|
|
|
|
ifeq ($(MPFR_PATCH),)
|
2006-09-28 19:38:06 +02:00
|
|
|
$(DL_DIR)/$(MPFR_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(MPFR_SITE)/$(MPFR_SOURCE)
|
|
|
|
|
2006-11-28 17:54:30 +01:00
|
|
|
libmpfr-source: $(DL_DIR)/$(MPFR_SOURCE)
|
2007-03-22 14:21:05 +01:00
|
|
|
endif
|
|
|
|
# need patch
|
|
|
|
ifneq ($(MPFR_PATCH),)
|
|
|
|
$(DL_DIR)/$(MPFR_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(MPFR_SITE)/$(MPFR_SOURCE)
|
|
|
|
|
|
|
|
$(DL_DIR)/$(MPFR_PATCH_FILE):
|
|
|
|
$(WGET) -O $@ $(MPFR_SITE)/$(MPFR_PATCH)
|
|
|
|
|
|
|
|
libmpfr-source: $(DL_DIR)/$(MPFR_SOURCE) $(DL_DIR)/$(MPFR_PATCH_FILE)
|
|
|
|
endif
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2007-03-22 17:14:42 +01:00
|
|
|
ifeq ($(MPFR_PATCH),)
|
2006-09-28 19:38:06 +02:00
|
|
|
$(MPFR_DIR)/.unpacked: $(DL_DIR)/$(MPFR_SOURCE)
|
2007-03-22 17:14:42 +01:00
|
|
|
else
|
|
|
|
$(MPFR_DIR)/.unpacked: $(DL_DIR)/$(MPFR_SOURCE) $(DL_DIR)/$(MPFR_PATCH_FILE)
|
|
|
|
endif
|
2007-01-16 14:26:32 +01:00
|
|
|
$(MPFR_CAT) $(DL_DIR)/$(MPFR_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
2006-09-28 19:38:06 +02:00
|
|
|
toolchain/patch-kernel.sh $(MPFR_DIR) package/mpfr/ \*.patch
|
|
|
|
$(CONFIG_UPDATE) $(MPFR_DIR)
|
|
|
|
ifneq ($(MPFR_PATCH),)
|
2007-03-22 17:14:42 +01:00
|
|
|
( cd $(MPFR_DIR) ; patch -p1 < $(DL_DIR)/$(MPFR_PATCH_FILE) ; )
|
2006-09-28 19:38:06 +02:00
|
|
|
endif
|
2007-01-22 20:17:23 +01:00
|
|
|
touch $@
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2007-01-16 14:26:32 +01:00
|
|
|
$(MPFR_TARGET_DIR)/.configured: $(MPFR_DIR)/.unpacked $(STAGING_DIR)/lib/$(GMP_BINARY)
|
2007-01-16 22:00:54 +01:00
|
|
|
mkdir -p $(MPFR_TARGET_DIR)
|
2007-01-16 14:26:32 +01:00
|
|
|
(cd $(MPFR_TARGET_DIR); rm -rf config.cache; \
|
2006-09-28 19:38:06 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2006-12-02 19:14:38 +01:00
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
2007-03-13 23:59:59 +01:00
|
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
2006-09-28 19:38:06 +02:00
|
|
|
ac_cv_c_bigendian=$(MPFR_BE) \
|
2007-01-16 20:48:46 +01:00
|
|
|
$(MPFR_DIR)/configure \
|
2007-01-14 04:52:21 +01:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
2006-09-28 19:38:06 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
2007-01-14 04:52:21 +01:00
|
|
|
--prefix=/usr \
|
|
|
|
--exec-prefix=/usr \
|
2006-09-28 19:38:06 +02:00
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
2007-01-14 04:52:21 +01:00
|
|
|
--libdir=/lib \
|
2006-09-28 19:38:06 +02:00
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--localstatedir=/var \
|
2007-01-14 04:52:21 +01:00
|
|
|
--includedir=/include \
|
2006-09-28 19:38:06 +02:00
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--enable-shared \
|
2006-12-13 20:57:05 +01:00
|
|
|
--with-gmp=$(STAGING_DIR) \
|
2006-09-28 19:38:06 +02:00
|
|
|
$(DISABLE_NLS) \
|
|
|
|
);
|
2006-12-13 21:09:07 +01:00
|
|
|
touch $@
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2007-01-16 14:26:32 +01:00
|
|
|
$(MPFR_TARGET_DIR)/.libs/$(MPFR_BINARY): $(MPFR_TARGET_DIR)/.configured
|
|
|
|
$(MAKE) CC=$(TARGET_CC) -C $(MPFR_TARGET_DIR)
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2007-01-16 14:26:32 +01:00
|
|
|
$(STAGING_DIR)/lib/$(MPFR_BINARY): $(MPFR_TARGET_DIR)/.libs/$(MPFR_BINARY)
|
2006-09-28 19:38:06 +02:00
|
|
|
$(MAKE) prefix=$(STAGING_DIR) \
|
|
|
|
exec_prefix=$(STAGING_DIR) \
|
|
|
|
bindir=$(STAGING_DIR)/bin \
|
|
|
|
sbindir=$(STAGING_DIR)/sbin \
|
2007-01-14 04:52:21 +01:00
|
|
|
libexecdir=$(STAGING_DIR)/bin \
|
2006-09-28 19:38:06 +02:00
|
|
|
datadir=$(STAGING_DIR)/share \
|
|
|
|
sysconfdir=$(STAGING_DIR)/etc \
|
|
|
|
sharedstatedir=$(STAGING_DIR)/com \
|
|
|
|
localstatedir=$(STAGING_DIR)/var \
|
|
|
|
libdir=$(STAGING_DIR)/lib \
|
|
|
|
includedir=$(STAGING_DIR)/include \
|
|
|
|
oldincludedir=$(STAGING_DIR)/include \
|
|
|
|
infodir=$(STAGING_DIR)/info \
|
|
|
|
mandir=$(STAGING_DIR)/man \
|
2007-01-16 14:26:32 +01:00
|
|
|
-C $(MPFR_TARGET_DIR) install;
|
2007-01-24 16:56:11 +01:00
|
|
|
$(STRIP) --strip-unneeded $(STAGING_DIR)/lib/libmpfr.{so*,a}
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2007-01-22 20:17:23 +01:00
|
|
|
$(TARGET_DIR)/lib/libmpfr.so $(TARGET_DIR)/lib/libmpfr.so.$(MPFR_LIBVERSION) $(TARGET_DIR)/lib/libmpfr.a: $(STAGING_DIR)/lib/$(MPFR_BINARY)
|
|
|
|
cp -dpf $(STAGING_DIR)/lib/libmpfr.so* $(STAGING_DIR)/lib/libmpfr.a \
|
2006-09-28 19:38:06 +02:00
|
|
|
$(TARGET_DIR)/lib/
|
2006-11-28 17:54:30 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBMPFR_HEADERS),y)
|
2007-01-22 20:17:23 +01:00
|
|
|
cp -dpf $(STAGING_DIR)/include/mpfr.h $(STAGING_DIR)/include/mpf2mpfr.h \
|
2006-11-17 12:51:17 +01:00
|
|
|
$(TARGET_DIR)/usr/include/
|
2006-09-28 19:38:06 +02:00
|
|
|
endif
|
|
|
|
|
2007-01-22 20:17:23 +01:00
|
|
|
libmpfr: uclibc $(TARGET_DIR)/lib/libmpfr.so.$(MPFR_LIBVERSION)
|
|
|
|
stage-libmpfr: uclibc $(STAGING_DIR)/lib/$(MPFR_BINARY)
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2006-11-28 17:54:30 +01:00
|
|
|
libmpfr-clean:
|
2006-12-14 09:12:18 +01:00
|
|
|
rm -f $(TARGET_DIR)/lib/$(MPFR_BINARY) $(TARGET_DIR)/lib/libmpfr.so* \
|
|
|
|
$(TARGET_DIR)/usr/include/mpfr.h \
|
|
|
|
$(TARGET_DIR)/usr/include/mpf2mpfr.h
|
2007-01-16 14:26:32 +01:00
|
|
|
-$(MAKE) -C $(MPFR_TARGET_DIR) clean
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2006-11-28 17:54:30 +01:00
|
|
|
libmpfr-dirclean:
|
2007-01-16 14:26:32 +01:00
|
|
|
rm -rf $(MPFR_TARGET_DIR)
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2007-01-22 20:17:23 +01:00
|
|
|
MPFR_DIR2:=$(TOOL_BUILD_DIR)/mpfr-$(MPFR_VERSION)-host
|
2007-01-16 14:26:32 +01:00
|
|
|
MPFR_HOST_DIR:=$(TOOL_BUILD_DIR)/mpfr
|
2006-12-14 09:12:18 +01:00
|
|
|
$(MPFR_DIR2)/.configured: $(MPFR_DIR)/.unpacked $(GMP_HOST_DIR)/lib/$(GMP_BINARY)
|
2007-01-16 14:26:32 +01:00
|
|
|
mkdir -p $(MPFR_DIR2)
|
2006-12-14 09:12:18 +01:00
|
|
|
(cd $(MPFR_DIR2); \
|
2007-01-16 14:26:32 +01:00
|
|
|
CC="$(HOSTCC)" CC_FOR_BUILD="$(HOSTCC)" \
|
2006-12-13 20:57:05 +01:00
|
|
|
CXX="$(HOSTCXX)" \
|
|
|
|
$(MPFR_DIR)/configure \
|
2007-01-16 14:26:32 +01:00
|
|
|
--prefix="$(MPFR_HOST_DIR)" \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
2006-12-13 20:57:05 +01:00
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
2007-01-16 14:26:32 +01:00
|
|
|
--with-gmp=$(GMP_HOST_DIR) \
|
2006-12-13 20:57:05 +01:00
|
|
|
$(DISABLE_NLS) \
|
2006-12-14 09:12:18 +01:00
|
|
|
);
|
2006-12-13 21:09:07 +01:00
|
|
|
touch $@
|
2006-12-13 20:57:05 +01:00
|
|
|
|
2007-01-16 14:26:32 +01:00
|
|
|
$(MPFR_HOST_DIR)/lib/$(MPFR_BINARY): $(MPFR_DIR2)/.configured
|
|
|
|
$(MAKE) -C $(MPFR_DIR2) install
|
2006-12-13 20:57:05 +01:00
|
|
|
|
2007-01-16 14:26:32 +01:00
|
|
|
host-libmpfr: $(MPFR_HOST_DIR)/lib/$(MPFR_BINARY)
|
|
|
|
host-libmpfr-clean:
|
|
|
|
rm -rf $(MPFR_HOST_DIR)
|
|
|
|
-$(MAKE) -C $(MPFR_DIR2) clean
|
|
|
|
host-libmpfr-dirclean:
|
|
|
|
rm -rf $(MPFR_HOST_DIR) $(MPFR_DIR2)
|
2006-12-13 20:57:05 +01:00
|
|
|
|
2006-09-28 19:38:06 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-11-28 17:54:30 +01:00
|
|
|
ifeq ($(strip $(BR2_PACKAGE_LIBMPFR)),y)
|
|
|
|
TARGETS+=libmpfr
|
2006-09-28 19:38:06 +02:00
|
|
|
endif
|