From b8ee4bda8160f85d336cfe7ceffe61747f443255 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Thu, 28 Jun 2012 17:57:06 +0200 Subject: [PATCH] libports: MPC This patch adds the 'MPC' library to the 'libports' repository. Fixes #263. --- .gitignore | 1 + libports/lib/import/import-mpc.mk | 3 +++ libports/lib/mk/mpc.mk | 15 +++++++++++++++ libports/ports/mpc.mk | 32 +++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 libports/lib/import/import-mpc.mk create mode 100644 libports/lib/mk/mpc.mk create mode 100644 libports/ports/mpc.mk diff --git a/.gitignore b/.gitignore index ca919938c8..1ffde05a6d 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ /libports/include/zlib /libports/include/gmp/gmp-impl.h /libports/include/gmp/x86_32/gmp-mparam.h +/libports/include/mpc/ /libports/include/mpfr/ /libports/src/lib/gmp/mpn/asm-defs.m4 /libports/src/lib/ncurses/codes.c diff --git a/libports/lib/import/import-mpc.mk b/libports/lib/import/import-mpc.mk new file mode 100644 index 0000000000..49ae4e3a23 --- /dev/null +++ b/libports/lib/import/import-mpc.mk @@ -0,0 +1,3 @@ +MPC = mpc-0.9 + +REP_INC_DIR += include/mpc diff --git a/libports/lib/mk/mpc.mk b/libports/lib/mk/mpc.mk new file mode 100644 index 0000000000..e9f46da9db --- /dev/null +++ b/libports/lib/mk/mpc.mk @@ -0,0 +1,15 @@ +include $(REP_DIR)/lib/import/import-mpc.mk + +MPC_DIR = $(REP_DIR)/contrib/$(MPC) + +ifeq ($(wildcard $(MPC_DIR)),) +REQUIRES += prepare_mpc +endif + +LIBS = libc gmp mpfr + +SRC_C := $(notdir $(wildcard $(MPC_DIR)/src/*.c)) + +vpath %.c $(MPC_DIR)/src + +SHARED_LIB = 1 diff --git a/libports/ports/mpc.mk b/libports/ports/mpc.mk new file mode 100644 index 0000000000..a1e51d68e0 --- /dev/null +++ b/libports/ports/mpc.mk @@ -0,0 +1,32 @@ +include lib/import/import-mpc.mk + +MPC_TGZ = $(MPC).tar.gz +MPC_URL = http://www.multiprecision.org/mpc/download/$(MPC_TGZ) + +# +# Interface to top-level prepare Makefile +# +PORTS += $(MPC) + +MPC_INCLUDES = include/mpc/mpc.h + +prepare-mpc: $(CONTRIB_DIR)/$(MPC) $(MPC_INCLUDES) + +$(CONTRIB_DIR)/$(MPC): clean-mpc + +# +# Port-specific local rules +# +$(DOWNLOAD_DIR)/$(MPC_TGZ): + $(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(MPC_URL) && touch $@ + +$(CONTRIB_DIR)/$(MPC): $(DOWNLOAD_DIR)/$(MPC_TGZ) + $(VERBOSE)tar xfz $< -C $(CONTRIB_DIR) && touch $@ + +include/mpc/mpc.h: + $(VERBOSE)mkdir -p $(dir $@) + $(VERBOSE)ln -sf ../../$(CONTRIB_DIR)/$(MPC)/src/mpc.h $@ + +clean-mpc: + $(VERBOSE)rm -f $(MPC_INCLUDES) + $(VERBOSE)rm -rf $(CONTRIB_DIR)/$(MPC)