summaryrefslogtreecommitdiff
path: root/lang/modula-3-lib/scripts/configure
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1998-09-18 01:02:04 +0000
committerJohn Polstra <jdp@FreeBSD.org>1998-09-18 01:02:04 +0000
commit736d3c5ca34012873b99c6102c91e62cdc73ab7a (patch)
tree1d97bd4fea568c356125f3d94d48eaf415e510ae /lang/modula-3-lib/scripts/configure
parentActivate mergemaster. (diff)
Make these ports work on ELF systems.
Notes
Notes: svn path=/head/; revision=13211
Diffstat (limited to '')
-rw-r--r--lang/modula-3-lib/scripts/configure55
1 files changed, 32 insertions, 23 deletions
diff --git a/lang/modula-3-lib/scripts/configure b/lang/modula-3-lib/scripts/configure
index 7a814e57703d..4275660b42e6 100644
--- a/lang/modula-3-lib/scripts/configure
+++ b/lang/modula-3-lib/scripts/configure
@@ -1,36 +1,45 @@
#! /bin/sh
#
-# $Id: configure,v 1.2 1998/05/29 17:58:09 jdp Exp $
+# $Id: configure,v 1.3 1998/06/02 23:22:23 jdp Exp $
umask 022
-files_to_patch="\
- ${WRKSRC}/m3/m3build/templates/FreeBSD2"
temp_prefix=${WRKSRC}/installed
+plist_src=${PKGDIR}/${PLIST##*/}
+template_src=${FILESDIR}/FreeBSD2.${PORTOBJFORMAT}
+template="${WRKSRC}/m3/m3build/templates/FreeBSD2"
-if [ -f /usr/lib/crt0.o ]; then
- crt=/usr/lib/crt0.o
-elif [ -f /usr/lib/aout/crt0.o ]; then
- crt=/usr/lib/aout/crt0.o
+if [ "${PORTOBJFORMAT}" = aout -a -f /usr/lib/aout/crt0.o ]; then
+ crt0=/usr/lib/aout/crt0.o
else
- echo "Cannot find a \"crt0.o\" file" >&2
- exit 1
+ crt0=/usr/lib/crt0.o
fi
-
-if [ -f /usr/lib/libgcc.a ]; then
- libgcc=/usr/lib/libgcc.a
-elif [ -f /usr/lib/aout/libgcc.a ]; then
+if [ "${PORTOBJFORMAT}" = aout -a -f /usr/lib/aout/libgcc.a ]; then
libgcc=/usr/lib/aout/libgcc.a
else
- echo "Cannot find a \"libgcc.a\" file" >&2
- exit 1
+ libgcc=/usr/lib/libgcc.a
fi
-for i in ${files_to_patch}; do
- test -f ${i}.bak || cp -p ${i} ${i}.bak
- rm -f ${i}
- sed -e "s|/usr/local/|${temp_prefix}/|g" \
- -e "s|/usr/lib/crt0\.o|${crt}|g" \
- -e "s|/usr/lib/libgcc\.a|${libgcc}|g" \
- ${i}.bak >${i}
-done
+# Copy the appropriate m3build template file into place, patching up
+# various pathnames in the process.
+rm -f ${template}
+sed -e "s|/usr/local/|${temp_prefix}/|g" \
+ -e "s|!PREFIX!|${PREFIX}|g" \
+ -e "s|/usr/lib/crt0\.o|${crt0}|g" \
+ -e "s|/usr/lib/libgcc\.a|${libgcc}|g" \
+ ${template_src} >${template}
+
+# Our PLIST templates contain only the "libfoo.so" names for shared
+# libraries. Here we add the "libfoo.so.${MAJOR}" names. This saves
+# us from having to fix the PLIST every time we bump the version number.
+sed -e "/\.so\$/p" \
+ -e "s/\.so\$/&.${MAJOR}/" \
+ ${plist_src} > ${PLIST}
+
+# Also generate a "PLIST.real" file which includes the minor version
+# numbers on shared library names if the object format is a.out.
+if [ "${PORTOBJFORMAT}" = aout ]; then
+ sed -e "s/\.so\.${MAJOR}\$/&.0/" ${PLIST} > ${PLIST}.real
+else
+ cp ${PLIST} ${PLIST}.real
+fi