2006-09-28 19:38:06 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# gmp
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
GMP_VERSION:=4.2.1
|
|
|
|
GMP_SOURCE:=gmp-$(GMP_VERSION).tar.bz2
|
|
|
|
GMP_SITE:=http://ftp.sunet.se/pub/gnu/gmp/
|
2006-11-17 16:43:51 +01:00
|
|
|
GMP_CAT:=$(BZCAT)
|
2006-09-28 19:38:06 +02:00
|
|
|
GMP_DIR:=$(BUILD_DIR)/gmp-$(GMP_VERSION)
|
|
|
|
GMP_BINARY:=libgmp.a
|
|
|
|
GMP_LIBVERSION:=3.4.1
|
|
|
|
|
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
|
|
|
GMP_BE:=yes
|
|
|
|
else
|
|
|
|
GMP_BE:=no
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(DL_DIR)/$(GMP_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(GMP_SITE)/$(GMP_SOURCE)
|
|
|
|
|
2006-11-28 17:54:30 +01:00
|
|
|
libgmp-source: $(DL_DIR)/$(GMP_SOURCE)
|
2006-09-28 19:38:06 +02:00
|
|
|
|
|
|
|
$(GMP_DIR)/.unpacked: $(DL_DIR)/$(GMP_SOURCE)
|
|
|
|
$(GMP_CAT) $(DL_DIR)/$(GMP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
|
|
|
toolchain/patch-kernel.sh $(GMP_DIR) package/gmp/ \*.patch
|
|
|
|
$(CONFIG_UPDATE) $(GMP_DIR)
|
|
|
|
touch $(GMP_DIR)/.unpacked
|
|
|
|
|
|
|
|
$(GMP_DIR)/.configured: $(GMP_DIR)/.unpacked
|
|
|
|
(cd $(GMP_DIR); rm -rf config.cache; \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2006-12-02 19:32:33 +01:00
|
|
|
CC_FOR_BUILD="$(HOSTCC)" \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
2006-09-28 19:38:06 +02:00
|
|
|
ac_cv_c_bigendian=$(GMP_BE) \
|
|
|
|
./configure \
|
|
|
|
--host=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=$(STAGING_DIR) \
|
|
|
|
--exec_prefix=$(STAGING_DIR) \
|
|
|
|
--libdir=$(STAGING_DIR)/lib \
|
|
|
|
--includedir=$(STAGING_DIR)/include \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--enable-shared \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
);
|
|
|
|
touch $(GMP_DIR)/.configured
|
|
|
|
|
|
|
|
$(GMP_DIR)/.libs/$(GMP_BINARY): $(GMP_DIR)/.configured
|
|
|
|
$(MAKE) CC=$(TARGET_CC) -C $(GMP_DIR)
|
|
|
|
|
|
|
|
$(STAGING_DIR)/lib/$(GMP_BINARY): $(GMP_DIR)/.libs/$(GMP_BINARY)
|
|
|
|
$(MAKE) prefix=$(STAGING_DIR) \
|
|
|
|
exec_prefix=$(STAGING_DIR) \
|
|
|
|
bindir=$(STAGING_DIR)/bin \
|
|
|
|
sbindir=$(STAGING_DIR)/sbin \
|
|
|
|
libexecdir=$(STAGING_DIR)/libexec \
|
|
|
|
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 \
|
|
|
|
-C $(GMP_DIR) install;
|
|
|
|
|
|
|
|
$(TARGET_DIR)/lib/libgmp.so.$(GMP_LIBVERSION): $(STAGING_DIR)/lib/$(GMP_BINARY)
|
|
|
|
cp -a $(STAGING_DIR)/lib/libgmp.so* $(STAGING_DIR)/lib/libgmp.a \
|
|
|
|
$(TARGET_DIR)/lib/
|
2006-11-28 17:54:30 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBGMP_HEADERS),y)
|
2006-11-17 12:51:17 +01:00
|
|
|
test -d $(TARGET_DIR)/usr/include || mkdir -p $(TARGET_DIR)/usr/include
|
|
|
|
cp -a $(STAGING_DIR)/include/gmp.h $(TARGET_DIR)/usr/include/
|
2006-09-28 19:38:06 +02:00
|
|
|
endif
|
|
|
|
$(STRIP) --strip-unneeded $(TARGET_DIR)/lib/libgmp.so* \
|
|
|
|
$(TARGET_DIR)/lib/libgmp.a
|
|
|
|
|
2006-11-28 17:54:30 +01:00
|
|
|
libgmp: uclibc $(TARGET_DIR)/lib/libgmp.so.$(GMP_LIBVERSION)
|
2006-12-13 20:57:05 +01:00
|
|
|
libgmp-stage: uclibc $(STAGING_DIR)/lib/$(GMP_BINARY)
|
2006-09-28 19:38:06 +02:00
|
|
|
|
2006-11-28 17:54:30 +01:00
|
|
|
libgmp-clean:
|
2006-12-14 09:12:18 +01:00
|
|
|
rm -f $(TARGET_DIR)/lib/$(GMP_BINARY) $(TARGET_DIR)/lib/libgmp.so* \
|
|
|
|
$(TARGET_DIR)/usr/include/gmp.h
|
2006-09-28 19:38:06 +02:00
|
|
|
-$(MAKE) -C $(GMP_DIR) clean
|
|
|
|
|
2006-11-28 17:54:30 +01:00
|
|
|
libgmp-dirclean:
|
2006-09-28 19:38:06 +02:00
|
|
|
rm -rf $(GMP_DIR)
|
|
|
|
|
2006-12-14 09:12:18 +01:00
|
|
|
GMP_DIR2:=$(TOOL_BUILD_DIR)/gmp-$(GMP_VERSION)
|
|
|
|
$(GMP_DIR2)/.configured: $(GMP_DIR)/.unpacked
|
|
|
|
[ -d $(GMP_DIR2) ] || mkdir $(GMP_DIR2)
|
|
|
|
(cd $(GMP_DIR2); \
|
2006-12-13 20:57:05 +01:00
|
|
|
CC_FOR_BUILD="$(HOSTCC)" \
|
|
|
|
CC="$(HOSTCC)" \
|
|
|
|
CFLAGS="$(HOST_CFLAGS)" \
|
|
|
|
$(GMP_DIR)/configure \
|
|
|
|
--prefix=$(STAGING_DIR) \
|
|
|
|
--exec_prefix=$(STAGING_DIR) \
|
|
|
|
--libdir=$(STAGING_DIR)/lib \
|
|
|
|
--includedir=$(STAGING_DIR)/include \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--datadir=/usr/share \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
|
|
|
$(DISABLE_NLS) \
|
2006-12-14 09:12:18 +01:00
|
|
|
);
|
|
|
|
touch $(GMP_DIR2)/.configured
|
2006-12-13 20:57:05 +01:00
|
|
|
|
2006-12-14 09:12:18 +01:00
|
|
|
$(GMP_DIR2)/.libs/$(GMP_BINARY): $(GMP_DIR2)/.configured
|
|
|
|
$(MAKE) -C $(GMP_DIR2)
|
2006-12-13 20:57:05 +01:00
|
|
|
|
2006-12-14 09:12:18 +01:00
|
|
|
GMP_HOST_DIR:=$(TOOL_BUILD_DIR)/gmp
|
|
|
|
$(GMP_HOST_DIR)/lib/$(GMP_BINARY): $(GMP_DIR2)/.libs/$(GMP_BINARY)
|
|
|
|
mkdir -p $(GMP_HOST_DIR)/lib $(GMP_HOST_DIR)/include
|
|
|
|
cp -a $(GMP_DIR2)/.libs/libgmp.* $(GMP_HOST_DIR)/lib
|
|
|
|
cp -a $(GMP_DIR2)/gmp.h $(GMP_HOST_DIR)/include
|
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_LIBGMP)),y)
|
|
|
|
TARGETS+=libgmp
|
2006-09-28 19:38:06 +02:00
|
|
|
endif
|