1996-10-29 18:01:55 -05:00
|
|
|
# New ports collection makefile for: modula-3-lib
|
|
|
|
# Date created: 28 Oct 1996
|
|
|
|
# Whom: John Polstra <jdp@polstra.com>
|
|
|
|
#
|
1999-08-25 02:35:40 -04:00
|
|
|
# $FreeBSD$
|
1996-10-29 18:01:55 -05:00
|
|
|
#
|
|
|
|
|
2000-04-12 02:21:15 -04:00
|
|
|
PORTNAME= modula-3-lib
|
|
|
|
PORTVERSION= 3.6
|
1996-11-11 21:19:40 -05:00
|
|
|
CATEGORIES= lang
|
1997-04-29 23:18:09 -04:00
|
|
|
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
2000-06-09 17:59:16 -04:00
|
|
|
MASTER_SITE_SUBDIR= asami/LOCAL_PORTS
|
1998-09-17 21:02:04 -04:00
|
|
|
DISTFILES= m3-fbsd-src-3.6.tar.gz \
|
|
|
|
m3-fbsd-m3cc-3.6.tar.gz \
|
1999-09-29 01:00:43 -04:00
|
|
|
m3-fbsd-m3ccelf-3.6.tar.gz \
|
|
|
|
m3-fbsd-gcc-3.6.tar.gz
|
1996-10-29 18:01:55 -05:00
|
|
|
# Note: Depending on what is already installed on the system, the code
|
|
|
|
# below may add some more DISTFILES.
|
|
|
|
|
|
|
|
MAINTAINER= jdp@polstra.com
|
|
|
|
|
|
|
|
NO_WRKSUBDIR= yes
|
1998-09-17 21:02:04 -04:00
|
|
|
SCRIPTS_ENV+= MAJOR=${major} PKGDIR=${PKGDIR} PLIST=${PLIST}
|
1996-10-29 18:01:55 -05:00
|
|
|
|
|
|
|
# There are two distfiles that may or may not be needed, depending on
|
|
|
|
# what is already installed on the system. First, we need an executable
|
|
|
|
# for the Modula-3 compiler, in order to compile the new compiler, which
|
|
|
|
# is written in Modula-3. Often, there will already be such an executable
|
|
|
|
# installed on the system. Second, we need many files from gcc-2.7.2.1.
|
|
|
|
# Often, we can find these in the system sources, under "/usr/src/contrib".
|
|
|
|
#
|
|
|
|
# This code tries to avoid fetching the distfiles, unless necessary.
|
|
|
|
# We look on the system to see whether the necessary files are present,
|
|
|
|
# and use those if we can. If we cannot find the needed files, we
|
|
|
|
# fetch the distfiles.
|
|
|
|
|
|
|
|
# For the Modula-3 compiler, we look in ${PREFIX} and in /usr/local.
|
|
|
|
.ifdef PREFIX
|
|
|
|
have_boot!= /bin/sh scripts/check_files files/T.boot installed ${PREFIX}
|
|
|
|
.else
|
|
|
|
have_boot=
|
|
|
|
.endif
|
|
|
|
.if empty(have_boot)
|
|
|
|
have_boot!= /bin/sh scripts/check_files files/T.boot installed /usr/local
|
|
|
|
.endif
|
|
|
|
.if empty(have_boot)
|
|
|
|
DISTFILES+= m3-fbsd-boot-3.6.tar.gz
|
|
|
|
.endif
|
|
|
|
|
1999-12-23 12:31:15 -05:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
.if ${OSVERSION} >= 400011
|
2000-10-07 18:17:57 -04:00
|
|
|
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-new-sigset-aa \
|
|
|
|
${PATCHDIR}/extra-patch-new-sigset-ab \
|
|
|
|
${PATCHDIR}/extra-patch-new-sigset-ac
|
1999-12-23 12:31:15 -05:00
|
|
|
.else
|
2000-10-07 18:17:57 -04:00
|
|
|
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-old-sigset-aa
|
1999-12-23 12:31:15 -05:00
|
|
|
.endif
|
|
|
|
|
1996-10-29 18:01:55 -05:00
|
|
|
# Startup script, run at boot time
|
|
|
|
startup_dir= ${PREFIX}/etc/rc.d
|
1996-11-29 14:49:19 -05:00
|
|
|
startup_script= ${startup_dir}/50.m3.sh
|
1996-10-29 18:01:55 -05:00
|
|
|
|
|
|
|
# The Modula-3 build process insists on installing each individual
|
|
|
|
# component immediately after that component is built. To avoid having
|
|
|
|
# to do the entire build as root, we arrange for everything to first
|
|
|
|
# be "installed" into the following directory, which we own.
|
|
|
|
temp_prefix= ${WRKSRC}/installed
|
|
|
|
|
1998-09-17 21:02:04 -04:00
|
|
|
# Where shared libraries are installed, relative to the PREFIX.
|
|
|
|
libdir= lib/m3/FreeBSD2
|
|
|
|
|
|
|
|
# Shared library major version number
|
|
|
|
major= 6
|
|
|
|
|
1999-01-28 00:39:19 -05:00
|
|
|
# Support building on systems with or without X11 installed.
|
2000-04-16 20:18:05 -04:00
|
|
|
.ifdef WITHOUT_X11
|
2000-10-07 22:16:32 -04:00
|
|
|
PLIST= ${WRKDIR}/pkg-plist.noX11
|
1999-01-28 00:39:19 -05:00
|
|
|
.else
|
|
|
|
pre-fetch:
|
2000-04-16 20:18:05 -04:00
|
|
|
@${ECHO_MSG} "To build this port without X11, define \"WITHOUT_X11\"."
|
1999-01-28 00:39:19 -05:00
|
|
|
|
|
|
|
USE_XLIB= yes
|
2000-10-28 15:58:02 -04:00
|
|
|
PLIST= ${WRKDIR}/pkg-plist
|
1999-01-28 00:39:19 -05:00
|
|
|
.endif
|
|
|
|
|
1996-10-29 18:01:55 -05:00
|
|
|
post-extract:
|
|
|
|
.if !empty(have_boot)
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "Copying bootstrap modula-3 compiler from ${have_boot}"
|
1997-07-13 14:49:31 -04:00
|
|
|
@${SH} ${SCRIPTDIR}/copy_files ${FILESDIR}/T.boot installed \
|
1996-10-29 18:01:55 -05:00
|
|
|
${have_boot} ${WRKSRC}
|
|
|
|
.endif
|
|
|
|
@cd ${WRKSRC}/m3cc/gcc; \
|
1999-08-22 15:01:07 -04:00
|
|
|
${CHMOD} +x config.sub configure move-if-change
|
1996-10-29 18:01:55 -05:00
|
|
|
|
|
|
|
do-build:
|
1996-11-11 21:19:40 -05:00
|
|
|
@test -d ${temp_prefix}/bin || ${MKDIR} ${temp_prefix}/bin
|
|
|
|
@test -d ${temp_prefix}/man/man1 || ${MKDIR} ${temp_prefix}/man/man1
|
1996-10-29 18:01:55 -05:00
|
|
|
@test -d ${temp_prefix}/lib/m3/pkg/m3build/templates || \
|
1996-11-11 21:19:40 -05:00
|
|
|
${MKDIR} ${temp_prefix}/lib/m3/pkg/m3build/templates
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "++++++++++ quake ++++++++++"
|
1996-10-29 18:01:55 -05:00
|
|
|
@test -d ${WRKSRC}/m3/quake/FreeBSD2 || \
|
1996-11-11 21:19:40 -05:00
|
|
|
${MKDIR} ${WRKSRC}/m3/quake/FreeBSD2
|
1996-10-29 18:01:55 -05:00
|
|
|
@cd ${WRKSRC}/m3/quake/FreeBSD2; \
|
|
|
|
make -f ../src/makefile TARGET=FreeBSD2 COPT=-O CDEBUG= ; \
|
1996-11-11 21:19:40 -05:00
|
|
|
${CP} -p quake ${temp_prefix}/bin; \
|
|
|
|
${CP} -p ../src/quake.1 ${temp_prefix}/man/man1
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "++++++++++ m3build ++++++++++"
|
1996-10-29 18:01:55 -05:00
|
|
|
@cd ${WRKSRC}/m3/m3build; \
|
|
|
|
PATH=${temp_prefix}/bin:$$PATH ./build FreeBSD2; \
|
1996-11-11 21:19:40 -05:00
|
|
|
${CP} -p FreeBSD2/m3build FreeBSD2/m3ship FreeBSD2/m3where \
|
1996-10-29 18:01:55 -05:00
|
|
|
${temp_prefix}/bin; \
|
1998-09-17 21:02:04 -04:00
|
|
|
${CP} -p FreeBSD2/m3mkdir ${temp_prefix}/${libdir}; \
|
1996-11-11 21:19:40 -05:00
|
|
|
${CP} -p templates/CLEANUP templates/COMMON templates/COMMON.BOOT \
|
1996-10-29 18:01:55 -05:00
|
|
|
templates/FreeBSD2 templates/PLATFORMS templates/POSIX \
|
|
|
|
${temp_prefix}/lib/m3/pkg/m3build/templates; \
|
1996-11-11 21:19:40 -05:00
|
|
|
${CP} -p FreeBSD2/m3build.1 FreeBSD2/m3ship.1 FreeBSD2/m3where.1 \
|
1996-10-29 18:01:55 -05:00
|
|
|
${temp_prefix}/man/man1
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "++++++++++ m3cc ++++++++++"
|
1996-11-11 21:19:40 -05:00
|
|
|
@test -d ${WRKSRC}/m3cc/FreeBSD2 || ${MKDIR} ${WRKSRC}/m3cc/FreeBSD2
|
1996-10-29 18:01:55 -05:00
|
|
|
@cd ${WRKSRC}/m3cc/FreeBSD2; \
|
|
|
|
../gcc/configure i486-unknown-freebsd; \
|
1997-02-14 17:17:03 -05:00
|
|
|
make m3cgc1 CC="${CC}" CFLAGS="${CFLAGS}"; \
|
1998-09-17 21:02:04 -04:00
|
|
|
${CP} -p m3cgc1 ${temp_prefix}/${libdir}
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "++++++++++ everything else ++++++++++"
|
1996-10-29 18:01:55 -05:00
|
|
|
@cd ${WRKSRC}/m3; \
|
1998-09-17 21:02:04 -04:00
|
|
|
LD_LIBRARY_PATH=${temp_prefix}/${libdir}:$$LD_LIBRARY_PATH; \
|
1996-10-29 18:01:55 -05:00
|
|
|
PATH=${temp_prefix}/bin:$$PATH; \
|
|
|
|
export LD_LIBRARY_PATH PATH; \
|
|
|
|
m3build
|
|
|
|
|
|
|
|
pre-install:
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "Checking for conflicting shared libraries"
|
2000-10-08 06:23:48 -04:00
|
|
|
@PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
1996-10-29 18:01:55 -05:00
|
|
|
|
|
|
|
do-install:
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "Installing shared libraries"
|
1996-10-29 18:01:55 -05:00
|
|
|
@cd ${temp_prefix}; \
|
|
|
|
umask 022; \
|
1999-08-23 00:23:59 -04:00
|
|
|
${GREP} '^lib/m3/' ${PLIST}.real | \
|
1996-11-14 18:18:58 -05:00
|
|
|
cpio -dump -R ${BINOWN}.${BINGRP} ${PREFIX}
|
1996-10-29 18:01:55 -05:00
|
|
|
@cd ${PREFIX}; \
|
1999-08-23 00:23:59 -04:00
|
|
|
${GREP} '^lib/m3/' ${PLIST}.real | xargs ${CHMOD} go=u-w; \
|
1999-08-22 15:01:07 -04:00
|
|
|
find -X lib/m3 -type d | xargs ${CHOWN} ${BINOWN}.${BINGRP}; \
|
|
|
|
find -X lib/m3 -type d | xargs ${CHMOD} 755
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "Installing copyright notice"
|
1997-03-27 23:38:47 -05:00
|
|
|
@if [ ! -d ${PREFIX}/share/modula-3-lib ]; then \
|
|
|
|
${MKDIR} ${PREFIX}/share/modula-3-lib; \
|
1999-08-22 15:01:07 -04:00
|
|
|
${CHMOD} 755 ${PREFIX}/share/modula-3-lib; \
|
1997-03-27 23:38:47 -05:00
|
|
|
fi
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/m3/src/COPYRIGHT \
|
|
|
|
${PREFIX}/share/modula-3-lib
|
1996-10-29 18:01:55 -05:00
|
|
|
@if [ ! -f ${startup_script} ]; then \
|
1999-08-27 18:30:39 -04:00
|
|
|
${ECHO_MSG} "Installing ${startup_script} file"; \
|
1996-11-11 21:19:40 -05:00
|
|
|
test -d ${startup_dir} || ${MKDIR} ${startup_dir}; \
|
2000-07-05 08:37:06 -04:00
|
|
|
${INSTALL_SCRIPT} ${FILESDIR}/50.m3.sh ${startup_script}; \
|
1996-10-29 18:01:55 -05:00
|
|
|
fi
|
1999-08-27 18:30:39 -04:00
|
|
|
@${ECHO_MSG} "Running ldconfig"
|
1998-09-17 21:02:04 -04:00
|
|
|
@${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/lib/m3/FreeBSD2
|
1996-10-29 18:01:55 -05:00
|
|
|
|
1999-12-23 12:31:15 -05:00
|
|
|
.include <bsd.port.post.mk>
|