aboutsummaryrefslogtreecommitdiff
path: root/lang/fpc/Makefile
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2015-01-09 20:00:30 +0000
committerJohn Marino <marino@FreeBSD.org>2015-01-09 20:00:30 +0000
commitfe0e6bcacc782a7db3826ef2a1cc47d11320ce1a (patch)
treef1bfc512f652b0503a8133a20f67470577cd1fe1 /lang/fpc/Makefile
parent97c332e87a5a4995bdd3058ef432a5ef4c4ab94e (diff)
downloadports-fe0e6bcacc782a7db3826ef2a1cc47d11320ce1a.tar.gz
ports-fe0e6bcacc782a7db3826ef2a1cc47d11320ce1a.zip
lang/fpc: Prepare for 3.0 and the use of older bootstrap
The Free Pascal Compiler port currently mandates that the bootstrap compiler be the same version of the compiler being built. This means that every update requires a new bootstrap compiler to be generated before the update. This goes against the philosophy of a bootstrap compiler, which aims to allow older compilers to build self-hosting modern compilers. FPC is capable of this, but the feature wasn't being leveraged. There are a lot of changes in this commit, but I believe the resulting compiler is the same as before the commit, thus PORTREVISION has not been bumped. Changes include: * Add DragonFly bootstrap compiler 2.6.4 to list of distfiles * use OPSYS to make builds generic between FreeBSD and DragonFly * Add FREEBSD PLIST variable as FreeBSD builds an extra unit * Create the framework to have a bootstrap compiler of an older version than the current version (BOOTVER variable) * split PP variable out of MAKE_ARGS and use NEWPPC or BOOTPPC to specify PP uniquely (required when bootstrap version is different) * wrap compound command with parenthesis * Use options lists on TAR man page (xfz without hyphen is legacy) * unmask installation commands * respect 80-column limits, wrapping as necessary * bring in some dports-specific changes that have no effect on port to eliminate dports patch files future work: When version 3.0 is released, the new fpc make program will be built which will have some moderate impacts to the build process and it will use a "bootstrap" target. The intention is to continue using the 2.6.4 bootstrap compilers to build the upcoming 3.0 compiler when it is released. New bootstrap compilers will not be generated until the existing bootstrap compilers are unable to bootstrap the upcoming release.
Notes
Notes: svn path=/head/; revision=376655
Diffstat (limited to 'lang/fpc/Makefile')
-rw-r--r--lang/fpc/Makefile90
1 files changed, 59 insertions, 31 deletions
diff --git a/lang/fpc/Makefile b/lang/fpc/Makefile
index e5e9eeaa5d86..98179f54c6aa 100644
--- a/lang/fpc/Makefile
+++ b/lang/fpc/Makefile
@@ -11,6 +11,7 @@ MASTER_SITES= ftp://ftp.freepascal.org/pub/fpc/dist/${PORTVERSION}/source/:sourc
ftp://freepascal.stack.nl/pub/fpc/dist/${PORTVERSION}/source/:source \
ftp://ftp.no.freepascal.org/pub/fpc/dist/${PORTVERSION}/source/:source \
ftp://ftp.us.freepascal.org/pub/fpc/dist/${PORTVERSION}/source/:source \
+ http://leaf.dragonflybsd.org/~marino/dports-src/:DragonFlybootstrap \
SF/freepascal/Source/${PORTVERSION}:source \
${MASTER_SITE_GOOGLE_CODE}:bootstrap \
${MASTER_SITE_LOCAL:S|$|acm/freepascal/:bootstrap|} \
@@ -25,19 +26,15 @@ COMMENT?= Free Pascal compiler with Turbo and Delphi
PROJECTHOST= bsdistfiles
USES= gmake iconv
ONLY_FOR_ARCHS= i386 amd64
+BOOTVER= 2.6.4
OPTIONSFILE= ${PORT_DBDIR}/${PORTNAME}${PKGNAMESUFFIX}/options
-#OPT?=-Ur -CX
OPT?=-CX
FPCSRCDIR= ${PORTNAME}-${PORTVERSION}
.include <bsd.port.pre.mk>
-.if ${OPSYS} == DragonFly
-IGNORE= not supported on DragonFly yet
-.endif
-
.if ${ARCH} == "i386"
PPNAME= ppc386
FPC_ARCH= i386
@@ -50,44 +47,66 @@ PLIST_SUB= FPC_I386="@comment " \
FPC_AMD64=""
.endif
+.if ${OPSYS} == FreeBSD
+PLIST_SUB+= FREEBSD=""
+.else
+PLIST_SUB+= FREEBSD="@comment "
+.endif
+
.if !defined(PKGNAMESUFFIX)
SUB_FILES= pkg-message
-BUILDNAME= ${FPC_ARCH}-freebsd
+BUILDNAME= ${FPC_ARCH}-${OPSYS:tl}
PLIST_SUB+= PORTVERSION=${PORTVERSION} \
BUILDNAME=${BUILDNAME}
-DISTFILES+= ${PPNAME}-${PORTVERSION}-${OPSYS:tl}${EXTRACT_SUFX}:bootstrap \
+DISTFILES+= ${BOOTDIR}${EXTRACT_SUFX}:${OPSYS:MDragonFly}bootstrap \
${DISTNAME:S/$/.man/}${EXTRACT_SUFX}:man
-MAKE_ARGS+= PP=${WRKDIR}/${PPNAME}-${PORTVERSION}-${OPSYS:tl} \
- FPCMAKE=${WRKDIR}/${FPCSRCDIR}/utils/fpcm/fpcmake \
+MAKE_ARGS+= FPCMAKE=${WRKDIR}/${FPCSRCDIR}/utils/fpcm/fpcmake \
FPCTARGET=${BUILDNAME} \
ARCH=${FPC_ARCH} \
OPT="${OPT}" \
BSDHIER=1 \
INSTALL_PREFIX=${STAGEDIR}${PREFIX}
+NEWPPC= PP=${WRKSRC}/compiler/${PPNAME}
+NEWFPC= FPC=${WRKSRC}/compiler/${PPNAME}
+BOOTDIR= ${PPNAME}-${BOOTVER}-${OPSYS:tl}
+BOOTPPC= PP=${WRKDIR}/${BOOTDIR}
do-extract:
# unpack binary distribution
@${MKDIR} ${WRKDIR}
- @${TAR} xfz ${_DISTDIR}/${PPNAME}-${PORTVERSION}-${OPSYS:tl}${EXTRACT_SUFX} --directory \
- ${WRKDIR} && ${CHMOD} +x ${WRKDIR}/${PPNAME}-${PORTVERSION}-${OPSYS:tl}
+ @${TAR} -xzf ${_DISTDIR}/${BOOTDIR}${EXTRACT_SUFX} \
+ --directory ${WRKDIR} && ${CHMOD} +x ${WRKDIR}/${BOOTDIR}
# unpack man files
- @${TAR} xfz ${_DISTDIR}/${DISTNAME:S/$/.man/}${EXTRACT_SUFX} --directory \
- ${WRKDIR}
+ @${TAR} -xzf ${_DISTDIR}/${DISTNAME:S/$/.man/}${EXTRACT_SUFX} \
+ --directory ${WRKDIR}
# unpack source distribution
- @cd ${WRKDIR} && \
- ${GZIP_CMD} -dc ${_DISTDIR}/${DISTNAME:S/$/.source/}${EXTRACT_SUFX} \
- | ${TAR} xf - ${FPCSRCDIR}/compiler ${FPCSRCDIR}/rtl \
- ${FPCSRCDIR}/utils/fpcmkcfg ${FPCSRCDIR}/packages/fcl-base \
- ${FPCSRCDIR}/packages/fcl-process ${FPCSRCDIR}/utils/fpcm
+ @(cd ${WRKDIR} && ${GZIP_CMD} -dc \
+ ${_DISTDIR}/${DISTNAME:S/$/.source/}${EXTRACT_SUFX} | \
+ ${TAR} -xf - \
+ ${FPCSRCDIR}/compiler \
+ ${FPCSRCDIR}/rtl \
+ ${FPCSRCDIR}/utils/fpcmkcfg \
+ ${FPCSRCDIR}/packages/fcl-base \
+ ${FPCSRCDIR}/packages/fcl-process \
+ ${FPCSRCDIR}/utils/fpcm)
post-patch:
.if ${ARCH} == "i386"
- @${REINPLACE_CMD} -i "" -e 's|504000|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
+ @${REINPLACE_CMD} -i "" -e 's|504000|${OSVERSION}|g' \
+ ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
.elif ${ARCH} == "amd64"
- @${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
- @${REINPLACE_CMD} -i "" -e 's|502110|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/gprt0.as
- @${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/prt0.as
+. if ${OPSYS} == FreeBSD
+ @${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' \
+ ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
+ @${REINPLACE_CMD} -i "" -e 's|502110|${OSVERSION}|g' \
+ ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/gprt0.as
+ @${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' \
+ ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/prt0.as
+. else
+ @${REINPLACE_CMD} -i "" -e 's|400000|${DFLYVERSION}|g' \
+ ${WRKSRC}/${FPCSRCDIR}/rtl/dragonfly/${FPC_ARCH}/*.as
+. endif
.endif
.if empty(ICONV_LIB)
@${REINPLACE_CMD} -e "s|if (s<>'c') or reorder then|if ((s<>'c') and (s<>'iconv')) or reorder then|" \
@@ -98,22 +117,31 @@ post-patch:
do-build:
# build fpc compiler
- @cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} cycle ${MAKE_ARGS}
+ (cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} cycle ${MAKE_ARGS} ${BOOTPPC})
# build fpcmkcfg
- @cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcm && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
- @cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-base && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
- @cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-process && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
- @cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
+ (cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcm && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
+ (cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-base && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
+ (cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-process && \
+ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
+ (cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && \
+ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
do-install:
# Installing fpc compiler
- @cd ${WRKDIR}/${FPCSRCDIR}/rtl && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
+ (cd ${WRKDIR}/${FPCSRCDIR}/rtl && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} install ${MAKE_ARGS} ${NEWFPC})
# Installing fpc runtime
- @cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
+ (cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} install ${MAKE_ARGS} ${NEWFPC})
# Installng fpcmkcfg
- @cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
+ (cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && ${SETENV} ${MAKE_ENV} \
+ ${MAKE_CMD} install ${MAKE_ARGS} ${NEWFPC})
# Installng fpcmake
- @cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcm && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
+ ${INSTALL_PROGRAM} ${WRKDIR}/${FPCSRCDIR}/utils/fpcm/fpcmake \
+ ${STAGEDIR}${PREFIX}/bin
# Installing manpages
${INSTALL_MAN} ${WRKDIR}/man/man1/* ${STAGEDIR}${MAN1PREFIX}/man/man1
${INSTALL_MAN} ${WRKDIR}/man/man5/* ${STAGEDIR}${MAN1PREFIX}/man/man5