2004-02-27 07:26:15 +00:00
|
|
|
# New ports collection makefile for: ocaml
|
1997-01-03 11:25:47 +00:00
|
|
|
# Date created: 24 December 1996
|
|
|
|
# Whom: Kiriyama Kazuhiko <kiri@kiri.toba-cmt.ac.jp>
|
|
|
|
#
|
1999-08-25 06:35:40 +00:00
|
|
|
# $FreeBSD$
|
1997-01-03 11:25:47 +00:00
|
|
|
#
|
|
|
|
|
2000-04-12 06:21:15 +00:00
|
|
|
PORTNAME= ocaml
|
2009-06-29 10:46:44 +00:00
|
|
|
PORTVERSION= 3.11.1
|
|
|
|
PORTREVISION= 0
|
1997-01-03 11:25:47 +00:00
|
|
|
CATEGORIES= lang
|
2004-12-04 15:57:11 +00:00
|
|
|
MASTER_SITES= http://caml.inria.fr/distrib/${DISTNAME:R}/ \
|
|
|
|
ftp://ftp.inria.fr/INRIA/caml-light/${DISTNAME:R}/ \
|
2006-06-14 21:46:40 +00:00
|
|
|
ftp://ftp.kurims.kyoto-u.ac.jp/pub/lang/caml-light/${DISTNAME:R}/ \
|
|
|
|
${MASTER_SITE_GENTOO}
|
|
|
|
MASTER_SITE_SUBDIR= distfiles
|
2004-02-27 07:26:15 +00:00
|
|
|
PKGNAMESUFFIX= ${SFX}
|
2003-12-06 00:05:05 +00:00
|
|
|
|
2006-09-20 10:44:30 +00:00
|
|
|
MAINTAINER?= stas@FreeBSD.org
|
2004-02-27 07:26:15 +00:00
|
|
|
COMMENT?= The Objective Caml compiler and programming environment
|
2003-12-06 00:05:05 +00:00
|
|
|
|
2006-08-02 14:00:20 +00:00
|
|
|
USE_BZIP2= yes
|
|
|
|
REINPLACE_ARGS= -i ""
|
|
|
|
HAS_CONFIGURE= yes
|
2009-04-11 13:23:05 +00:00
|
|
|
USE_LDCONFIG= yes
|
2006-08-02 14:00:20 +00:00
|
|
|
ALL_TARGET= world.opt
|
|
|
|
STRIP=
|
2009-05-21 11:55:56 +00:00
|
|
|
MAKE_JOBS_UNSAFE= yes
|
2006-08-02 14:00:20 +00:00
|
|
|
|
|
|
|
CONFIGURE_ARGS= -prefix ${PREFIX}
|
|
|
|
OPTIONS= X11 "Build with X11 support" on \
|
|
|
|
TK "Build LablTk library (requires X11 support)" on \
|
|
|
|
THREADS "Build with Posix threads support" on \
|
|
|
|
CMP_LIB "Install compiler's libraries" off \
|
|
|
|
OPT_DEF "Use system-optimized binaries by default" off
|
|
|
|
|
|
|
|
MODOPT= camlp4o camlp4r ocamlc ocamldep ocamldoc ocamllex ocamlopt
|
|
|
|
PATTERN= [[:space:]]*(do|then)?[[:space:]]*)(\$$\(CP\)|cp)([[:space:]]
|
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
MAN1!= ${CAT} ${FILESDIR}/man1
|
|
|
|
MANN!= ${CAT} ${FILESDIR}/mann
|
|
|
|
MLINKS!=${CAT} ${FILESDIR}/manlinks
|
|
|
|
|
|
|
|
.if !defined(WITHOUT_THREADS)
|
|
|
|
DEPENDS_ARGS+= WITH_THREADS=yes
|
|
|
|
CONFIGURE_ARGS+=-with-pthread
|
|
|
|
THR_CPP= ${PTHREAD_CFLAGS}
|
|
|
|
THR_LD= ${PTHREAD_LIBS}
|
2003-06-28 17:41:27 +00:00
|
|
|
.else
|
2006-08-02 14:00:20 +00:00
|
|
|
THR_CPP= #empty
|
|
|
|
THR_LD= #empty
|
|
|
|
CONFIGURE_ARGS+=-no-pthread
|
|
|
|
.endif
|
|
|
|
|
2006-08-19 09:38:45 +00:00
|
|
|
.if !defined(WITHOUT_X11)
|
2003-06-28 17:41:27 +00:00
|
|
|
PLIST_SUB+= X11=""
|
- Remove unneeded dependency from gtk12/gtk20 [1]
- Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORG
- Remove X11BASE support in favor of LOCALBASE or PREFIX
- Use USE_LDCONFIG instead of INSTALLS_SHLIB
- Remove unneeded USE_GCC 3.4+
Thanks to all Helpers:
Dmitry Marakasov, Chess Griffin, beech@, dinoex, rafan, gahr,
ehaupt, nox, itetcu, flz, pav
PR: 116263
Tested on: pointyhat
Approved by: portmgr (pav)
2008-04-19 17:56:05 +00:00
|
|
|
USE_XORG= x11
|
|
|
|
CONFIGURE_ARGS+=-x11include ${LOCALBASE}/include -x11lib ${LOCALBASE}/lib
|
2006-08-02 14:00:20 +00:00
|
|
|
.else
|
|
|
|
PLIST_SUB+= X11="@comment "
|
|
|
|
WITHOUT_TK= yes
|
|
|
|
SFX= -nox11
|
|
|
|
CONFLICTS+= ocaml-[0-9]* ocaml-notk-[0-9]*
|
2006-08-19 09:38:45 +00:00
|
|
|
CONFIGURE_ARGS+=-no-x11
|
2006-08-02 14:00:20 +00:00
|
|
|
.endif
|
|
|
|
|
2002-02-11 05:22:16 +00:00
|
|
|
.if defined(WITHOUT_TK)
|
2002-08-12 14:22:37 +00:00
|
|
|
PLIST_SUB+= TK="@comment "
|
2004-02-27 07:26:15 +00:00
|
|
|
SFX= -notk
|
2005-06-27 14:10:29 +00:00
|
|
|
CONFLICTS+= ocaml-[0-9]* ocaml-nox11-[0-9]*
|
2006-08-02 14:00:20 +00:00
|
|
|
CONFIGURE_ARGS+=-no-tk
|
2002-02-11 05:22:16 +00:00
|
|
|
.else
|
2009-04-11 13:23:05 +00:00
|
|
|
USE_TK= 84+
|
|
|
|
.include "${PORTSDIR}/Mk/bsd.tcl.mk"
|
2002-08-12 14:22:37 +00:00
|
|
|
PLIST_SUB+= TK=""
|
2005-06-27 14:10:29 +00:00
|
|
|
CONFLICTS+= ocaml-nox11-[0-9]* ocaml-notk-[0-9]*
|
2009-04-11 13:23:05 +00:00
|
|
|
CONFIGURE_ARGS+= -tkdefs \
|
|
|
|
"-I${TCL_INCLUDEDIR} -I${TK_INCLUDEDIR} ${THR_CPP}" \
|
|
|
|
-tklibs "-L${LOCALBASE}/lib ${THR_LD}"
|
2000-08-13 12:21:21 +00:00
|
|
|
.endif
|
2004-05-13 09:10:03 +00:00
|
|
|
|
2005-10-28 22:50:21 +00:00
|
|
|
.if ${ARCH} == sparc64 || ${ARCH} == ia64
|
2006-06-14 21:46:40 +00:00
|
|
|
BROKEN= ocamlc.opt seg-faults on ${ARCH}, please try to fix
|
2005-07-04 14:50:07 +00:00
|
|
|
.endif
|
2004-05-13 09:10:03 +00:00
|
|
|
|
2005-04-23 01:34:05 +00:00
|
|
|
post-configure:
|
|
|
|
# CFLAGS safeness
|
|
|
|
@${REINPLACE_CMD} -E \
|
2006-08-02 14:00:20 +00:00
|
|
|
-e 's|(BYTECCCOMPOPTS[ \t]*=.*)|\1 ${CFLAGS} ${THR_CPP}|' \
|
|
|
|
-e 's|(NATIVECCCOMPOPTS[ \t]*=.*)|\1 ${CFLAGS} ${THR_CPP}|' \
|
2008-04-06 19:44:41 +00:00
|
|
|
-e '/^PTHREAD_LINK/s,-pthread,${THR_LD},g' \
|
2005-07-03 06:02:21 +00:00
|
|
|
-e 's|gcc|${CC}|g' \
|
2005-04-23 01:34:05 +00:00
|
|
|
${WRKSRC}/config/Makefile
|
2006-08-02 14:00:20 +00:00
|
|
|
|
2005-04-23 01:34:05 +00:00
|
|
|
# INSTALL* safeness (which preserves the correct permissions despite
|
|
|
|
# user's umask(1)
|
|
|
|
@${FIND} ${WRKDIR} -type f -name Makefile -print0 | \
|
2006-08-02 14:00:20 +00:00
|
|
|
${XARGS} -0 -n 5 -x ${REINPLACE_CMD} -E \
|
2005-07-03 06:02:21 +00:00
|
|
|
-e 's,\$$\(ARCH\),${ARCH:sparc64=sparc},g' \
|
2006-08-02 14:00:20 +00:00
|
|
|
-e 's,^(${PATTERN}+.*INSTALLDIR),\1\$${BSD_INSTALL_DATA} \4,' \
|
|
|
|
-e 's,^(${PATTERN}+.*BINDIR),\1\$${BSD_INSTALL_PROGRAM} \4,' \
|
|
|
|
-e 's,^(${PATTERN}+.*LIBDIR),\1\$${BSD_INSTALL_DATA} \4,' \
|
|
|
|
-e 's,(${PATTERN}+.*(MANDIR|MANODIR|MANEXT)),\1\$${BSD_INSTALL_MAN} \4,'
|
2005-04-23 01:34:05 +00:00
|
|
|
|
1997-01-03 11:25:47 +00:00
|
|
|
post-install:
|
2004-11-12 19:27:46 +00:00
|
|
|
@${TOUCH} ${PREFIX}/lib/ocaml/ocamldoc/custom/.keep
|
2002-02-11 05:22:16 +00:00
|
|
|
.if !defined(WITHOUT_TK)
|
|
|
|
@${MKDIR} ${EXAMPLESDIR}
|
2006-08-02 14:00:20 +00:00
|
|
|
@(cd ${WRKSRC}/otherlibs/labltk && \
|
|
|
|
${COPYTREE_SHARE} examples_labltk ${EXAMPLESDIR} \
|
|
|
|
"! -name .cvsignore" && \
|
|
|
|
${COPYTREE_SHARE} examples_camltk ${EXAMPLESDIR} \
|
|
|
|
"! -name .cvsignore")
|
1997-11-18 12:31:09 +00:00
|
|
|
.endif
|
2006-08-02 14:00:20 +00:00
|
|
|
|
2008-04-06 19:44:41 +00:00
|
|
|
.for PROG in camlp4o.opt camlp4r.opt ocamlc.opt ocamldep.opt ocamldoc.opt \
|
2004-02-27 07:26:15 +00:00
|
|
|
ocamllex.opt ocamlopt.opt ocamlrun ocamlyacc
|
2008-04-06 19:44:41 +00:00
|
|
|
@${STRIP_CMD} ${PREFIX}/bin/${PROG}
|
2004-02-27 07:26:15 +00:00
|
|
|
.endfor
|
2006-08-02 14:00:20 +00:00
|
|
|
|
|
|
|
# Fix permissions for ld.conf
|
|
|
|
@${CHMOD} 644 ${PREFIX}/lib/ocaml/ld.conf
|
|
|
|
|
2005-06-08 21:16:02 +00:00
|
|
|
# Do we want .opt version of tools to be the default ?
|
2006-08-02 14:00:20 +00:00
|
|
|
.if defined(WITH_OPT_DEF)
|
2005-06-08 21:16:02 +00:00
|
|
|
. for module in ${MODOPT}
|
2006-08-02 14:00:20 +00:00
|
|
|
# First, we save bytecode version
|
2005-06-08 21:16:02 +00:00
|
|
|
@${MV} ${PREFIX}/bin/${module} ${PREFIX}/bin/${module}.byte
|
2006-08-02 14:00:20 +00:00
|
|
|
|
|
|
|
# Next make .opt version be the default one (via link)
|
2005-06-08 21:16:02 +00:00
|
|
|
@${LN} ${PREFIX}/bin/${module}.opt ${PREFIX}/bin/${module}
|
2006-08-02 14:00:20 +00:00
|
|
|
@${ECHO_CMD} "bin/${module}.byte" >> ${TMPPLIST}
|
|
|
|
@${ECHO_CMD} "@exec ${LN} %D/${module}.opt %D/${module}" >> ${TMPPLIST}
|
2005-06-08 21:16:02 +00:00
|
|
|
. endfor
|
|
|
|
.endif
|
2006-08-02 14:00:20 +00:00
|
|
|
|
2005-06-08 21:16:02 +00:00
|
|
|
# Add compiler's libs if required
|
2006-08-02 14:00:20 +00:00
|
|
|
.if defined(WITH_CMP_LIB)
|
2005-06-08 21:16:02 +00:00
|
|
|
@${MKDIR} ${PREFIX}/lib/ocaml/compiler-lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/utils/*.cm* ${PREFIX}/lib/ocaml/compiler-lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/utils/*.o ${PREFIX}/lib/ocaml/compiler-lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/parsing/*.cm* ${PREFIX}/lib/ocaml/compiler-lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/parsing/*.o ${PREFIX}/lib/ocaml/compiler-lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/typing/*.cm* ${PREFIX}/lib/ocaml/compiler-lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/typing/*.o ${PREFIX}/lib/ocaml/compiler-lib
|
|
|
|
@${FIND} ${PREFIX}/lib/ocaml/compiler-lib -type f | \
|
|
|
|
${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
|
|
|
|
@${ECHO_CMD} "@dirrm lib/ocaml/compiler-lib" >> ${TMPPLIST}
|
|
|
|
.endif
|
|
|
|
@${ECHO_CMD} "@dirrm lib/ocaml" >> ${TMPPLIST}
|
|
|
|
|
2004-05-13 09:10:03 +00:00
|
|
|
.include <bsd.port.post.mk>
|