summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-09-27 12:28:15 +0000
committerjlam <jlam@pkgsrc.org>2002-09-27 12:28:15 +0000
commitcd04e9997ad3d37feb8e7ad857125243894aca28 (patch)
treef21871d1bca7dc3f562c5378f661908467a1ac8d /lang
parent73b1e2ab06792fe5996cf132e890e802a816c0ce (diff)
downloadpkgsrc-cd04e9997ad3d37feb8e7ad857125243894aca28.tar.gz
Use bsd.pkg.install.mk, correct the PLISTs to refer to ${PKGNAME}.mk
(instead of hardcoding the version number), and general cleanups to the Makefile to make this package easier to maintain.
Diffstat (limited to 'lang')
-rw-r--r--lang/gcc/INSTALL46
-rw-r--r--lang/gcc/Makefile120
-rw-r--r--lang/gcc/PLIST4
-rw-r--r--lang/gcc/PLIST.SunOS3
-rw-r--r--lang/gcc/files/gcc.mk10
5 files changed, 87 insertions, 96 deletions
diff --git a/lang/gcc/INSTALL b/lang/gcc/INSTALL
index 5ca5923bb7c..5a6d8972dec 100644
--- a/lang/gcc/INSTALL
+++ b/lang/gcc/INSTALL
@@ -1,37 +1,27 @@
#!/bin/sh
#
-# Prior versions of the "gcc" package would install a corrupted
+# Previous versions of the "gcc" package would install a corrupted
# info entry for "chill", which would foil subsequent installations.
# This script attempts to clean up that entry.
-if [ $# -ne 2 -o ! -d "${PKG_PREFIX}" -o ! -w "${PKG_PREFIX}/info/dir" ]
-# Script was called improperly.
-then
- exit 1
-fi
-
-if [ "$2" != "PRE-INSTALL" ]
-# No problem
-then
- exit 0
-fi
-
-if [ ! -x /bin/ed ]
-# Who knows? Give up.
-then
- exit 0
-fi
-
-echo Fixing up infodir from previous installation\.\.\.
-/bin/ed "${PKG_PREFIX}/info/dir" 2> /dev/null << END
+case ${STAGE} in
+PRE-INSTALL)
+ if [ ! -w "${PKG_PREFIX}/info/dir" ]; then
+ exit 1
+ fi
+ if [ -x /bin/ed ]; then
+ ${ECHO} "Fixing up info/dir from previous installation..."
+ /bin/ed "${PKG_PREFIX}/info/dir" 2> /dev/null << END
/^* Chill/d
w
q
END
-if [ $? -eq 0 ]
-then
- echo \.\.\.fixed\.
- exit 0
-fi
-echo \.\.\.nothing to fix\.
-exit 0
+ if [ $? -eq 0 ]; then
+ ${ECHO} "...fixed."
+ else
+ ${ECHO} "...nothing to fix."
+ fi
+ fi
+ ;;
+esac
+
diff --git a/lang/gcc/Makefile b/lang/gcc/Makefile
index 17983549830..78fbc3d127b 100644
--- a/lang/gcc/Makefile
+++ b/lang/gcc/Makefile
@@ -1,14 +1,12 @@
-# $NetBSD: Makefile,v 1.46 2002/09/27 09:41:40 jlam Exp $
+# $NetBSD: Makefile,v 1.47 2002/09/27 12:28:15 jlam Exp $
# Make sure that the version number in "Makefile.gcc" matches this.
DISTNAME= gcc-2.95.3
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/}
-
#
-# Synced from patches against main source tree as of:
+# Synced from patches against main source tree as of 2002-03-28
#
-# 03/28/02
MAINTAINER= packages@netbsd.org
HOMEPAGE= http://www.gnu.org/software/gcc/gcc.html
COMMENT= GNU Compiler Collection
@@ -18,89 +16,91 @@ PATCHFILES= gcc-2.95.3-diff-2002-08-29.gz
BUILD_DEPENDS+= bison-[0-9]*:../../devel/bison
+USE_BUILDLINK2= YES
USE_GMAKE= YES
+
HAS_CONFIGURE= YES
-CONFIGURE_ARGS= --host=${MACHINE_GNU_PLATFORM} \
- --prefix=${GCC_PREFIX} \
- --enable-shared
CONFIGURE_SCRIPT= ${SRCDIR}/configure
-INFO_FILES= chill.info cpp.info g77.info gcc.info
+CONFIGURE_ARGS= --host=${MACHINE_GNU_PLATFORM}
+CONFIGURE_ARGS+= --prefix=${GCC_PREFIX}
+CONFIGURE_ARGS+= --enable-shared
PLIST_SUBST+= GCC_VERSION=${PKGVERSION}
SRCDIR= ${WRKDIR}/${DISTNAME}
WRKSRC= ${WRKDIR}/objdir
+INFO_FILES= chill.info cpp.info g77.info gcc.info
+
.include "../../mk/bsd.prefs.mk"
-.if (${OPSYS} != SunOS)
-CONFIGURE_ARGS+= --with-gnu-as --with-gnu-ld --infodir=${PREFIX}/info
-GCC_PREFIX= ${LOCALBASE}/${PKGNAME}
-PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
-.else
-.if (${CC} != gcc)
+.if ${OPSYS} == "SunOS"
+CONFLICTS+= gcc-[0-9]* pgcc-[0-9]*
+. if ${CC} != "gcc"
ALL_TARGET= bootstrap
-.endif
-GCC_PREFIX= ${LOCALBASE}
+. endif
+GCC_PREFIX= ${PREFIX}
PLIST_SRC= ${PKGDIR}/PLIST.SunOS
-MESSAGE= ${PKGDIR}/MESSAGE.SunOS
-CONFLICTS+= gcc-[0-9]* pgcc-[0-9]*
+MESSAGE_SRC= ${PKGDIR}/MESSAGE.SunOS
+.else
+GCC_PREFIX= ${PREFIX}/${PKGNAME}
+CONFIGURE_ARGS+= --with-gnu-as
+CONFIGURE_ARGS+= --with-gnu-ld
+CONFIGURE_ARGS+= --infodir=${PREFIX}/info
+PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
.endif
+GCC_ARCHDIR= ${GCC_PREFIX}/lib/gcc-lib/${MACHINE_GNU_PLATFORM}/${PKGVERSION}
+FILES_SUBST+= GCC_PREFIX=${GCC_PREFIX}
+
post-extract:
${MKDIR} ${WRKSRC}
- cd ${WRKSRC}/../${DISTNAME}/gcc/config; \
- ${CP} ${FILESDIR}/xm-netbsd.h .; \
- ${CP} ${FILESDIR}/xm-target64.h .; \
- for FILE in ${FILESDIR}/*_* ; do \
- ARCH=`${BASENAME} $${FILE} | cut -d_ -f1`; \
- DEST=`${BASENAME} $${FILE} | sed -e "s/$${ARCH}_//"`; \
- ${MKDIR} $${ARCH}; \
- ${CP} $${FILE} $${ARCH}/$${DEST}; \
- done; \
- cd ${WRKSRC}/../${DISTNAME}; \
- for i in gcc/config/alpha/netbsd-elf.h gcc/config/arm/t-netbsd gcc/config/mips/x-netbsd libf2c/libF77/dtime_.c libf2c/libF77/etime_.c; do \
- ${RM} $${i};\
+ ${CP} ${FILESDIR}/xm-netbsd.h ${SRCDIR}/gcc/config
+ ${CP} ${FILESDIR}/xm-target64.h ${SRCDIR}/gcc/config
+ for file in ${FILESDIR}/*_* ; do \
+ arch=`${BASENAME} $${file} | ${SED} -e "s/_.*//"`; \
+ dest=`${BASENAME} $${file} | ${SED} -e "s/$${arch}_//"`; \
+ ${MKDIR} ${SRCDIR}/gcc/config/$${arch}; \
+ ${CP} $${file} ${SRCDIR}/gcc/config/$${arch}/$${dest}; \
done
+ ${RM} ${SRCDIR}/gcc/config/alpha/netbsd-elf.h
+ ${RM} ${SRCDIR}/gcc/config/arm/t-netbsd
+ ${RM} ${SRCDIR}/gcc/config/mips/x-netbsd
+ ${RM} ${SRCDIR}/libf2c/libF77/dtime_.c
+ ${RM} ${SRCDIR}/libf2c/libF77/etime_.c
-post-patch:
- ${ECHO} "bogus" >${WRKSRC}/../${DISTNAME}/gcc/cstamp-h.in
+pre-configure:
+ ${ECHO} "bogus" > ${SRCDIR}/gcc/cstamp-h.in
-.if (${OPSYS} != SunOS)
post-build:
- for FILE in ${FILESDIR}/gcc.mk; do \
- ${SED} -e 's#@@MAKE@@#${MAKE}#g' \
- -e 's#@@PKGNAME@@#${PKGNAME}#g' \
- -e 's#@@PREFIX@@#${PREFIX}#g' \
- <$$FILE >${WRKDIR}/`${BASENAME} $$FILE`; \
- done
-.endif
-
-pre-install:
- ${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${INSTALL_FILE} any PRE-INSTALL
+ @${SED} ${FILES_SUBST_SED} ${FILESDIR}/gcc.mk > ${WRKDIR}/gcc.mk
-.if (${OPSYS} != SunOS)
+.if (${OPSYS} == SunOS)
+#
+# remove empty file and directories that show up when one does:
+# make install; make deinstall; make install
+#
post-install:
-. if exists(/usr/include/g++/FlexLexer.h)
- ${LN} -s /usr/include/g++/FlexLexer.h \
- ${PREFIX}/${PKGNAME}/include/g++-3/FlexLexer.h
-. endif
- ${RM} -f ${GCC_PREFIX}/lib/gcc-lib/${MACHINE_GNU_PLATFORM}/${PKGVERSION}/include/curses.h ${PREFIX}/${PKGNAME}/bin/cc
- ${LN} -s gcc ${PREFIX}/${PKGNAME}/bin/cc
- ${INSTALL_DATA} ${WRKDIR}/gcc.mk ${PREFIX}/etc/${PKGNAME}.mk
- ${CP} -f ${PKGDIR}/PLIST ${PLIST_SRC}
- ${FIND} ${PREFIX}/${PKGNAME} -type f -print | ${SORT} -r | ${SED} 's;${PREFIX}/;;g' >> ${PLIST_SRC}
- ${FIND} ${PREFIX}/${PKGNAME} -type l -print | ${SORT} -r | ${SED} 's;${PREFIX}/;;g' >> ${PLIST_SRC}
- ${FIND} ${PREFIX}/${PKGNAME} -type d -print | ${SORT} -r | ${SED} 's;${PREFIX}/;@dirrm ;g' >> ${PLIST_SRC}
+ -cd ${GCC_ARCHDIR}/include && ${RM} -f fixed && ${RMDIR} v7 v9
.else
-# remove empty file and directories that show up when one
-# does make install; make deinstall; make install
post-install:
- -cd ${GCC_PREFIX}/lib/gcc-lib/${MACHINE_GNU_PLATFORM}/${PKGVERSION}/include && \
- ${RM} -f fixed && \
- ${RMDIR} v7 v9
+ ${INSTALL_DATA} ${WRKDIR}/gcc.mk ${PREFIX}/etc/${PKGNAME}.mk
+. if exists(/usr/include/g++/FlexLexer.h)
+ ${LN} -fs /usr/include/g++/FlexLexer.h \
+ ${GCC_PREFIX}/include/g++-3/FlexLexer.h
+. endif
+ ${RM} -f ${GCC_ARCHDIR}/include/curses.h ${GCC_PREFIX}/bin/cc
+ ${LN} -s gcc ${GCC_PREFIX}/bin/cc
+ ${CP} -f ${PKGDIR}/PLIST ${PLIST_SRC}
+ ${FIND} ${GCC_PREFIX} \( -type f -o -type l \) -print \
+ | ${SORT} | ${SED} -e "s,${PREFIX}/,,g" \
+ >> ${PLIST_SRC}
+ ${FIND} ${GCC_PREFIX} -type d -print \
+ | ${SORT} -r | ${SED} -e "s,${PREFIX}/,@dirrm ,g" \
+ >> ${PLIST_SRC}
.endif
.include "../../mk/texinfo.mk"
+.include "../../mk/bsd.pkg.install.mk"
.include "../../mk/bsd.pkg.mk"
# Make bootstrap with compiler != gcc possible.
diff --git a/lang/gcc/PLIST b/lang/gcc/PLIST
index fa8c45fab82..d4f1bf19010 100644
--- a/lang/gcc/PLIST
+++ b/lang/gcc/PLIST
@@ -1,5 +1,5 @@
-@comment $NetBSD: PLIST,v 1.6 2002/04/08 12:11:43 dmcmahill Exp $
-etc/gcc-2.95.3.mk
+@comment $NetBSD: PLIST,v 1.7 2002/09/27 12:28:15 jlam Exp $
+etc/${PKGNAME}.mk
@unexec ${INSTALL_INFO} --delete %D/info/chill.info %D/info/dir
info/chill.info
@exec ${INSTALL_INFO} %D/info/chill.info %D/info/dir
diff --git a/lang/gcc/PLIST.SunOS b/lang/gcc/PLIST.SunOS
index 74712faa8f3..c27f756ab5e 100644
--- a/lang/gcc/PLIST.SunOS
+++ b/lang/gcc/PLIST.SunOS
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST.SunOS,v 1.5 2002/09/09 03:23:06 dmcmahill Exp $
+@comment $NetBSD: PLIST.SunOS,v 1.6 2002/09/27 12:28:15 jlam Exp $
${MACHINE_GNU_PLATFORM}/include/_G_config.h
${MACHINE_GNU_PLATFORM}/include/assert.h
bin/${MACHINE_GNU_PLATFORM}-gcc
@@ -14,6 +14,7 @@ bin/gcjh
bin/gcov
bin/jcf-dump
bin/jv-scan
+etc/${PKGNAME}.mk
include/g++-3/PlotFile.h
include/g++-3/SFile.h
include/g++-3/algo.h
diff --git a/lang/gcc/files/gcc.mk b/lang/gcc/files/gcc.mk
index 1895fb4d180..84ae399902c 100644
--- a/lang/gcc/files/gcc.mk
+++ b/lang/gcc/files/gcc.mk
@@ -1,7 +1,7 @@
-# $NetBSD: gcc.mk,v 1.3 2002/01/03 21:19:09 tron Exp $
+# $NetBSD: gcc.mk,v 1.4 2002/09/27 12:28:16 jlam Exp $
#
-# make configuration file for @@PKGNAME@@
+# make configuration file for @PKGNAME@
-CC= @@PREFIX@@/@@PKGNAME@@/bin/cc
-CPP= @@PREFIX@@/@@PKGNAME@@/bin/cpp
-CXX= @@PREFIX@@/@@PKGNAME@@/bin/c++
+CC= @GCC_PREFIX@/bin/cc
+CPP= @GCC_PREFIX@/bin/cpp
+CXX= @GCC_PREFIX@/bin/c++