summaryrefslogtreecommitdiffstats
path: root/lang/clisp/Makefile
blob: 2dc5b978e62f055b1253dfea9cb79a923a17f937 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# New ports collection makefile for:    clisp
# Date created:         Feb  5 2000
# Whom:                 Jeff Brown <jabrown@caida.org>
#
# $FreeBSD$
#

PORTNAME=	clisp
PORTVERSION=	2.41
CATEGORIES=	lang lisp
MASTER_SITES=	SF/${PORTNAME} \
		GNU/${PORTNAME}/release/${PORTVERSION} \
		ftp://sunsite.unc.edu/pub/Linux/devel/lang/lisp/

MAINTAINER=	alepulver@FreeBSD.org
COMMENT=	A Common Lisp implementation

BUILD_DEPENDS=	${LOCALBASE}/lib/libsigsegv.a:${PORTSDIR}/devel/libsigsegv \
		dvipdf:${PORTSDIR}/${GHOSTSCRIPT_PORT}
LIB_DEPENDS=	readline.5:${PORTSDIR}/devel/readline

NOT_FOR_ARCHS=	ia64
NOT_FOR_ARCHS_REASON=	does not currently support this architecture
USE_BZIP2=	yes
USE_ICONV=	yes
USE_GETTEXT=	yes
GNU_CONFIGURE=	yes
BUILD_WRKSRC=	${WRKSRC}/${CONFIGURE_TARGET}
INSTALL_WRKSRC=	${BUILD_WRKSRC}

CPPFLAGS=	-I${LOCALBASE}/include
LDFLAGS=	-L${LOCALBASE}/lib
MAKE_ENV=	${CONFIGURE_ENV}
CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
MAKEMAKE_ARGS=	--prefix=${PREFIX} --mandir=${PREFIX}/man \
		--srcdir=${WRKSRC}/src --with-dynamic-ffi

OPTIONS=	BDB "Build Berkeley Database module" off \
		CLX_MIT "Build X11 module (original MIT version)" off \
		CLX_NEW "Build X11 module (new faster version)" off \
		FASTCGI "Build FastCGI module" off \
		ORACLE "Build Oracle database module" off \
		PARI "Build PARI (math and calculator lib) module" off \
		PCRE "Build PCRE (Perl Compatible Regexp) module" off \
		PGSQL "Build PostgreSQL database module" off \
		RAWSOCK "Build Raw Socket Access module" on \
		WILDCARD "Build wildcard matching module" on \
		ZLIB "Build ZLib interface module " off

MAN1=		clisp.1

.include <bsd.port.pre.mk>

MODULES=	BDB CLX_MIT CLX_NEW FASTCGI ORACLE PARI PCRE PGSQL RAWSOCK \
		WILDCARD ZLIB

.if ${ARCH} == "amd64"
CONFIGURE_TARGET=	x86_64-portbld-freebsd${OSREL}
CONFIGURE_ARGS+=--disable-mmap
MAKEMAKE_ARGS+=	--disable-mmap
.endif

.for mod in ${MODULES}
.   if defined(WITH_${mod})
PLIST_SUB+=	${mod}=""
.   else
PLIST_SUB+=	${mod}="@comment "
.   endif
.endfor

.if defined(WITH_BDB)
USE_BDB=	42+
MAKEMAKE_ARGS+=	--with-module=berkeley-db
CPPFLAGS+=	-I${LOCALBASE}/include/db${BDB_VER}
LDFLAGS+=	-L${LOCALBASE}/lib/db${BDB_VER}
.endif

.if defined(WITH_CLX_MIT) && defined(WITH_CLX_NEW)
IGNORE=		selected different implementations of the same X11 module
.endif
.if defined(WITH_CLX_MIT) || defined(WITH_CLX_NEW)
# Avoid USE_XLIB because of the additional CONFIGURE_ARGS.
LIB_DEPENDS+=	X11.6:${X_LIBRARIES_PORT}
.endif
.if defined(WITH_CLX_MIT)
MAKEMAKE_ARGS+=	--with-module=clx/mit-clx
.endif
.if defined(WITH_CLX_NEW)
MAKEMAKE_ARGS+=	--with-module=clx/new-clx
.endif

.if defined(WITH_FASTCGI)
LIB_DEPENDS+=	fcgi.0:${PORTSDIR}/www/fcgi
MAKEMAKE_ARGS+=	--with-module=fastcgi
.endif

.if defined(WITH_ORACLE)
BUILD_DEPENDS+=	${ORACLE_HOME}:${PORTSDIR}/databases/oracle8-client
MAKEMAKE_ARGS+=	--with-module=oracle
CPPFLAGS+=	-I${ORACLE_HOME}/rdbms/demo -I${ORACLE_HOME}/rdbms/public
LDFLAGS+=	-L${ORACLE_HOME}/lib
ORACLE_HOME=	${LOCALBASE}/oracle8-client
.endif

.if defined(WITH_PARI)
LIB_DEPENDS+=	pari.2:${PORTSDIR}/math/pari
MAKEMAKE_ARGS+=	--with-module=pari
BROKEN=		Lisp stack overflow when building PARI module
.endif

.if defined(WITH_PCRE)
LIB_DEPENDS+=	pcre.0:${PORTSDIR}/devel/pcre
MAKEMAKE_ARGS+=--with-module=pcre
.endif

.if defined(WITH_PGSQL)
USE_PGSQL=	yes
MAKEMAKE_ARGS+=	--with-module=postgresql
.endif

.if defined(WITH_RAWSOCK)
MAKEMAKE_ARGS+=	--with-module=rawsock
.endif

.if defined(WITH_WILDCARD)
MAKEMAKE_ARGS+=	--with-module=wildcard
.endif

.if defined(WITH_ZLIB)
MAKEMAKE_ARGS+=	--with-module=zlib
.endif

post-patch:
.if ${ARCH} == "amd64"
	@${REINPLACE_CMD} -Ee \
		"s|^(subdir_configure_args=')|\1--build=${CONFIGURE_TARGET}|; \
		 s|^(module_configure_flags=')|\1--build=${CONFIGURE_TARGET}|" \
		${WRKSRC}/configure ${WRKSRC}/src/makemake.in
.endif
.if defined(WITH_ORACLE)
	@${REINPLACE_CMD} -e 's|-ldl||; s|-lpthread|-lcompat ${PTHREAD_LIBS}|' \
		${WRKSRC}/modules/oracle/link.sh
.endif

post-configure:
	cd ${BUILD_WRKSRC} && \
		${SETENV} ${CONFIGURE_ENV} ./makemake ${MAKEMAKE_ARGS} > Makefile && \
		${MAKE} config.lisp
	@${REINPLACE_CMD} -Ee 's|^(CFLAGS =)|\1 ${CPPFLAGS} ${CFLAGS}|' \
		${BUILD_WRKSRC}/${MAKEFILE}

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud