1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-13 23:36:08 +00:00
freebsd-ports/lang/modula-3-lib/scripts/configure
1998-09-18 01:02:04 +00:00

46 lines
1.4 KiB
Bash

#! /bin/sh
#
# $Id: configure,v 1.3 1998/06/02 23:22:23 jdp Exp $
umask 022
temp_prefix=${WRKSRC}/installed
plist_src=${PKGDIR}/${PLIST##*/}
template_src=${FILESDIR}/FreeBSD2.${PORTOBJFORMAT}
template="${WRKSRC}/m3/m3build/templates/FreeBSD2"
if [ "${PORTOBJFORMAT}" = aout -a -f /usr/lib/aout/crt0.o ]; then
crt0=/usr/lib/aout/crt0.o
else
crt0=/usr/lib/crt0.o
fi
if [ "${PORTOBJFORMAT}" = aout -a -f /usr/lib/aout/libgcc.a ]; then
libgcc=/usr/lib/aout/libgcc.a
else
libgcc=/usr/lib/libgcc.a
fi
# 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