mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-01 22:05:08 +00:00
d5a92ea924
"modula-3-lib". It installs only the shared libraries needed for executing Modula-3 programs. This saves a lot of disk space for people who need to run Modula-3 programs but don't need to build them. The original "modula-3" port now depends on this one, and uses it to install the compiler and the rest of the development system. Also, everything is now built with optimization. I have been testing this for at least a month, and haven't seen any problems from it. It makes the libraries and executables substantially smaller. This new port also includes some hooks that will make SOCKS support possible in the near future.
138 lines
5.0 KiB
Makefile
138 lines
5.0 KiB
Makefile
# New ports collection makefile for: modula-3-lib
|
|
# Version required: 3.6
|
|
# Date created: 28 Oct 1996
|
|
# Whom: John Polstra <jdp@polstra.com>
|
|
#
|
|
# $Id$
|
|
#
|
|
|
|
DISTNAME= modula-3-lib-3.6
|
|
CATEGORIES+= lang
|
|
MASTER_SITES= ftp://freefall.FreeBSD.ORG/pub/FreeBSD/LOCAL_PORTS/
|
|
DISTFILES= m3-fbsd-src-3.6.tar.gz m3-fbsd-m3cc-3.6.tar.gz
|
|
# 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
|
|
|
|
# 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
|
|
|
|
# For gcc-2.7.2.1, we look in /usr/src/contrib.
|
|
have_gcc!= /bin/sh scripts/check_files files/T.gcc m3cc /usr/src/contrib
|
|
.if empty(have_gcc)
|
|
DISTFILES+= m3-fbsd-gcc-3.6.tar.gz
|
|
.endif
|
|
|
|
# Startup script, run at boot time
|
|
startup_dir= ${PREFIX}/etc/rc.d
|
|
startup_script= ${startup_dir}/m3.sh
|
|
|
|
# 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
|
|
|
|
post-extract:
|
|
.if !empty(have_boot)
|
|
@echo "Copying bootstrap modula-3 compiler from ${have_boot}"
|
|
@/bin/sh ${SCRIPTDIR}/copy_files ${FILESDIR}/T.boot installed \
|
|
${have_boot} ${WRKSRC}
|
|
.endif
|
|
.if !empty(have_gcc)
|
|
@echo "Copying gcc sources from ${have_gcc}"
|
|
@/bin/sh ${SCRIPTDIR}/copy_files ${FILESDIR}/T.gcc m3cc \
|
|
${have_gcc} ${WRKSRC}
|
|
.endif
|
|
@cd ${WRKSRC}/m3cc/gcc; \
|
|
chmod +x config.sub configure move-if-change
|
|
|
|
do-build:
|
|
@test -d ${temp_prefix}/bin || mkdir -p ${temp_prefix}/bin
|
|
@test -d ${temp_prefix}/man/man1 || mkdir -p ${temp_prefix}/man/man1
|
|
@test -d ${temp_prefix}/lib/m3/pkg/m3build/templates || \
|
|
mkdir -p ${temp_prefix}/lib/m3/pkg/m3build/templates
|
|
@echo "++++++++++ quake ++++++++++"
|
|
@test -d ${WRKSRC}/m3/quake/FreeBSD2 || \
|
|
mkdir -p ${WRKSRC}/m3/quake/FreeBSD2
|
|
@cd ${WRKSRC}/m3/quake/FreeBSD2; \
|
|
make -f ../src/makefile TARGET=FreeBSD2 COPT=-O CDEBUG= ; \
|
|
cp -p quake ${temp_prefix}/bin; \
|
|
cp -p ../src/quake.1 ${temp_prefix}/man/man1
|
|
@echo "++++++++++ m3build ++++++++++"
|
|
@cd ${WRKSRC}/m3/m3build; \
|
|
PATH=${temp_prefix}/bin:$$PATH ./build FreeBSD2; \
|
|
cp -p FreeBSD2/m3build FreeBSD2/m3ship FreeBSD2/m3where \
|
|
${temp_prefix}/bin; \
|
|
cp -p FreeBSD2/m3mkdir ${temp_prefix}/lib/m3/FreeBSD2; \
|
|
cp -p templates/CLEANUP templates/COMMON templates/COMMON.BOOT \
|
|
templates/FreeBSD2 templates/PLATFORMS templates/POSIX \
|
|
${temp_prefix}/lib/m3/pkg/m3build/templates; \
|
|
cp -p FreeBSD2/m3build.1 FreeBSD2/m3ship.1 FreeBSD2/m3where.1 \
|
|
${temp_prefix}/man/man1
|
|
@echo "++++++++++ m3cc ++++++++++"
|
|
@test -d ${WRKSRC}/m3cc/FreeBSD2 || mkdir -p ${WRKSRC}/m3cc/FreeBSD2
|
|
@cd ${WRKSRC}/m3cc/FreeBSD2; \
|
|
../gcc/configure i486-unknown-freebsd; \
|
|
make m3cgc1 CC=cc CFLAGS=-O; \
|
|
cp -p m3cgc1 ${temp_prefix}/lib/m3/FreeBSD2
|
|
@echo "++++++++++ everything else ++++++++++"
|
|
@cd ${WRKSRC}/m3; \
|
|
LD_LIBRARY_PATH=${temp_prefix}/lib/m3/FreeBSD2:$$LD_LIBRARY_PATH; \
|
|
PATH=${temp_prefix}/bin:$$PATH; \
|
|
export LD_LIBRARY_PATH PATH; \
|
|
m3build
|
|
|
|
pre-install:
|
|
@echo "Checking for conflicting shared libraries"
|
|
@PREFIX=${PREFIX} /bin/sh ${PKGDIR}/INSTALL ${PKGNAME} PRE-INSTALL
|
|
|
|
do-install:
|
|
@echo "Installing shared libraries"
|
|
@cd ${temp_prefix}; \
|
|
umask 022; \
|
|
grep '^lib/m3/' ${PKGDIR}/PLIST | \
|
|
cpio -dump -R ${BINOWN}.${BINGRP} ${PREFIX}
|
|
@cd ${PREFIX}; \
|
|
grep '^lib/m3/' ${PKGDIR}/PLIST | xargs chmod go=u-w; \
|
|
find -X lib/m3 -type d | xargs chown ${BINOWN}.${BINGRP}; \
|
|
find -X lib/m3 -type d | xargs chmod 755
|
|
@if [ ! -f ${startup_script} ]; then \
|
|
echo "Installing ${startup_script} file"; \
|
|
test -d ${startup_dir} || mkdir -p ${startup_dir}; \
|
|
echo "#!/bin/sh" > ${startup_script}; \
|
|
echo "echo -n ' Modula-3'" >> ${startup_script}; \
|
|
echo "/sbin/ldconfig -m ${PREFIX}/lib/m3/FreeBSD2" \
|
|
>> ${startup_script}; \
|
|
chmod 755 ${startup_script}; \
|
|
fi
|
|
@echo "Running ldconfig"
|
|
@/sbin/ldconfig -m ${PREFIX}/lib/m3/FreeBSD2
|
|
|
|
.include <bsd.port.mk>
|