Merge from vendor branch TNF:
[pkgsrcv2.git] / devel / libffi / Makefile
1 # $NetBSD: Makefile,v 1.15 2011/04/24 09:51:29 asau Exp $
2 #
3
4 DISTNAME=       libffi-3.0.9
5 PKGREVISION=    1
6 CATEGORIES=     devel
7 MASTER_SITES=   ftp://sourceware.org/pub/libffi/
8
9 MAINTAINER=     asau@inbox.ru
10 HOMEPAGE=       http://sources.redhat.com/libffi/
11 COMMENT=        Foreign function interface
12 LICENSE=        mit
13
14 PKG_DESTDIR_SUPPORT=    user-destdir
15
16 GNU_CONFIGURE=  yes
17 CONFIGURE_ARGS= --includedir=${PREFIX}/include
18 USE_LIBTOOL=    yes
19 USE_TOOLS+=     pkg-config
20 USE_LANGUAGES=  c c++
21 INFO_FILES=     yes
22
23 PKGCONFIG_OVERRIDE+=    libffi.pc.in
24
25 .include "../../mk/compiler.mk"
26 # The Compaq C frontend groks .s, but not .S. Assemble osf.S directly w/ as(1).
27 pre-build:
28 .if !empty(PKGSRC_COMPILER:Mccc)
29         cd ${WRKSRC} && ./libtool --mode=compile --tag=CC as -I. -Iinclude -o src/alpha/osf.lo -c src/alpha/osf.S
30 .endif
31
32 # Since we don't have "TEST_DEPENDS", we implement it as a hack:
33 .include "../../mk/bsd.prefs.mk"
34
35 .if !empty(PKGSRC_RUN_TEST:M[Yy][Ee][Ss])
36 TEST_TARGET=    check
37 BUILD_DEPENDS+= dejagnu-[0-9]*:../../devel/dejagnu
38 .endif
39
40 # patch-aj uses m68k_sync_icache(2)
41 .if !empty(MACHINE_PLATFORM:MNetBSD-*-m68k)
42 LIBS+=  -lm68k
43 .endif
44
45 # fix http://gnats.netbsd.org/42865
46 .if !empty(MACHINE_PLATFORM:MSunOS-*-i386) && !empty(CC_VERSION:Mgcc-[23]*)
47 CPPFLAGS += -D__PIC__
48 .endif
49
50 .include "../../mk/bsd.pkg.mk"