aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/flex/Makefile
blob: a0823d95bc64340cd2b5b86a715f7356b0b2cb84 (plain) (blame)
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
# $FreeBSD$

PORTNAME=   flex
PORTVERSION=    2.6.1
CATEGORIES= textproc
MASTER_SITES=   https://github.com/westes/flex/releases/download/v${PORTVERSION}/

MAINTAINER= johans@FreeBSD.org
COMMENT=    Fast lexical analyzer generator

BUILD_DEPENDS=  help2man:${PORTSDIR}/misc/help2man \
        gm4:${PORTSDIR}/devel/m4
RUN_DEPENDS=    gm4:${PORTSDIR}/devel/m4

USES=       bison gmake libtool makeinfo tar:xz
GNU_CONFIGURE=  yes
# install flex header to its own dir to avoid conflict with system flex.
CONFIGURE_ARGS= --includedir=${PREFIX}/include/flex --disable-shared
CONFIGURE_ENV=  M4=${LOCALBASE}/bin/gm4 MAKEINFO="makeinfo --no-split"
INSTALL_TARGET= install-strip

INFO=       flex
PORTDOCS=   *
PORTEXAMPLES=   *

OPTIONS_DEFINE= DOCS EXAMPLES NLS
OPTIONS_SUB=    yes
NLS_USES=   gettext iconv
NLS_CONFIGURE_ENABLE=   nls

.include <bsd.port.options.mk>

post-patch: .SILENT
    ${REINPLACE_CMD} -Ee 's/tests//' \
        -e '/mode=compile ..CC/s/\\$$/-fPIC -DPIC &/' \
        ${WRKSRC}/Makefile.in
    ${RM} -f ${WRKSRC}/doc/*.info*

post-install:
.if ${PORT_OPTIONS:MEXAMPLES}
    ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    ${CP} -r ${WRKSRC}/examples/* ${STAGEDIR}${EXAMPLESDIR}/
    ${RM} ${STAGEDIR}${EXAMPLESDIR}/Makefile.am
.endif

.include <bsd.port.mk>