diff options
author | jdp <jdp@FreeBSD.org> | 1998-09-18 09:02:04 +0800 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1998-09-18 09:02:04 +0800 |
commit | 3976977bc94968d44b3374b8deca664cdc7eee68 (patch) | |
tree | 4e967fe71a18d149431f08b404b4408008d617bb /lang/modula-3-lib/scripts | |
parent | 186395322f107a348e6f98aae1f4a1e0440c8da8 (diff) | |
download | freebsd-ports-graphics-3976977bc94968d44b3374b8deca664cdc7eee68.tar.gz freebsd-ports-graphics-3976977bc94968d44b3374b8deca664cdc7eee68.tar.zst freebsd-ports-graphics-3976977bc94968d44b3374b8deca664cdc7eee68.zip |
Make these ports work on ELF systems.
Diffstat (limited to 'lang/modula-3-lib/scripts')
-rw-r--r-- | lang/modula-3-lib/scripts/configure | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/lang/modula-3-lib/scripts/configure b/lang/modula-3-lib/scripts/configure index 7a814e57703..4275660b42e 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 |