summaryrefslogtreecommitdiff
path: root/devel/ncurses/Makefile.common
blob: 711867f66fa92c4799092357b5d9aad08e880d9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# $NetBSD: Makefile.common,v 1.29 2015/08/17 17:10:31 wiz Exp $
#
# used by devel/ncurses/Makefile
# used by devel/ncursesw/Makefile

DISTNAME=	ncurses-${NC_VERS}
NC_VERS=	6.0
CATEGORIES=	devel
MASTER_SITES=	${MASTER_SITE_GNU:=ncurses/} \
		ftp://dickey.his.com/ncurses/ \
		ftp://dickey.his.com/ncurses/${NC_VERS}/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://invisible-island.net/ncurses/ncurses.html
LICENSE=	mit

USE_LANGUAGES=		c c++
USE_LIBTOOL=		yes
USE_TOOLS+=		gmake tbl
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--with-libtool
CONFIGURE_ARGS+=	--enable-bsdpad
CONFIGURE_ARGS+=	--enable-overwrite
CONFIGURE_ARGS+=	--with-cxx-binding
CONFIGURE_ARGS+=	--without-ada
CONFIGURE_ARGS+=	--without-gpm
CONFIGURE_ARGS+=	--with-manpage-format=normal
CONFIGURE_ARGS+=	--with-manpage-tbl
CONFIGURE_ARGS+=	--with-default-terminfo-dir=${PREFIX}/${TERMINFODIR}
CONFIGURE_ARGS+=	--with-terminfo-dirs=${PREFIX}/${TERMINFODIR}
CONFIGURE_ARGS+=	--includedir=${PREFIX}/include/ncurses

SUBST_CLASSES+=		rpath
SUBST_FILES.rpath+=	misc/ncurses-config
SUBST_STAGE.rpath=	post-configure
SUBST_SED.rpath+=	-e "s|-L\\(.libdir\\)|${COMPILER_RPATH_FLAG}\\1 -L\\1|"
SUBST_MESSAGE.rpath=	Fixing rpath in ncurses-config.

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "Darwin"
CONFIGURE_ARGS+=	--disable-mixed-case
.endif

.if ${OPSYS} == "SunOS"
USE_LANGUAGES+=		c99
.endif

.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
TOOL_DEPENDS+=		ncurses-${NC_VERS}:../../devel/ncurses
CONFIGURE_ENV+=		BUILD_CC=${NATIVE_CC:Q}
CONFIGURE_ENV+=		ac_cv_path_TIC_PATH=${LOCALBASE}/bin/tic
.endif

.if !defined(TOOLS_TBL)
# This means that groff needs to be built to get tbl(1).
# We can only build groff if there is a builtin implementation of curses,
# otherwise we get a circular dependency problem.
# Additionally, Interix is special, see ../../mk/curses.buildlink3.mk
.  if !(exists(/usr/include/curses.h) || exists(/usr/include/ncurses.h)) || \
	${OPSYS} == "Interix"
# None was available, so disable use of tbl(1)
USE_TOOLS:=		${USE_TOOLS:Ntbl}
CONFIGURE_ARGS+=	--without-manpage-tbl
.  endif
.endif

.include "../../mk/compiler.mk"

.if ${OPSYS} == "SunOS"
. if !empty(CC_VERSION:Mgcc-4.*)
#This may yet need to be adapted for systems prior to Solaris 10
BUILDLINK_TRANSFORM+=	opt:-D_XOPEN_SOURCE=500:-D_POSIX_C_SOURCE=200112L
BUILDLINK_TRANSFORM+=	rm:-D_XOPEN_SOURCE_EXTENDED
. endif
TERMINFO_SRC=	${WRKSRC}/misc/terminfo.src
TERMINFODIR=	share/lib/terminfo
.else
TERMINFODIR=	share/terminfo
.endif

.if !empty(CC_VERSION:Mgcc-5.*)
# Inhibit generation of line markers in the output from the preprocessor
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60723
CPPFLAGS+=	-P
.endif

# This prevents tic from writing into ~/.terminfo
INSTALLATION_DIRS+=	${TERMINFODIR}

PLIST_SUBST+=	TERMINFODIR=${TERMINFODIR}