libports: MPC

This patch adds the 'MPC' library to the 'libports' repository.

Fixes #263.
This commit is contained in:
Christian Prochaska 2012-06-28 17:57:06 +02:00 committed by Norman Feske
parent cdb1c6f203
commit b8ee4bda81
4 changed files with 51 additions and 0 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -0,0 +1,3 @@
MPC = mpc-0.9
REP_INC_DIR += include/mpc

15
libports/lib/mk/mpc.mk Normal file
View File

@ -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

32
libports/ports/mpc.mk Normal file
View File

@ -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)