summaryrefslogtreecommitdiff
path: root/lang/gcc/Makefile
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2000-09-15 23:58:47 +0000
committertron <tron@pkgsrc.org>2000-09-15 23:58:47 +0000
commit178cf5b6274a2b03097f6f8ce8ebc0866c2411f6 (patch)
treeeec98b048f42008dd646a65c97203e5a41627235 /lang/gcc/Makefile
parent0e02ae3631136706875def194b314cb1b67e294e (diff)
downloadpkgsrc-178cf5b6274a2b03097f6f8ce8ebc0866c2411f6.tar.gz
- Add patches from NetBSD-current to fix build on i386 ELF systems.
- Install into "${LOCALBASE}/gcc-2.95.2" to avoid that e.g. "bsd.pkg.mk" picks up the new compiler by accident. - Add a file "${LOCALBASE}/etc/gcc-2.95.2.mk" which makes it possible to use the new "gcc" like this: make MAKECONF=/usr/pkg/etc/gcc-2.95.2.mk
Diffstat (limited to 'lang/gcc/Makefile')
-rw-r--r--lang/gcc/Makefile41
1 files changed, 29 insertions, 12 deletions
diff --git a/lang/gcc/Makefile b/lang/gcc/Makefile
index a4577832f66..acc723ffff7 100644
--- a/lang/gcc/Makefile
+++ b/lang/gcc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2000/05/23 22:09:58 tron Exp $
+# $NetBSD: Makefile,v 1.4 2000/09/15 23:58:47 tron Exp $
DISTNAME= gcc-2.95.2
CATEGORIES= lang
@@ -9,24 +9,41 @@ HOMEPAGE= http://www.gnu.org/software/gcc/gcc.html
BUILD_DEPENDS+= ${LOCALBASE}/bin/bison:../../devel/bison
-# TODO:
-# - rename binaries to avoid conflicts with base distribution
-# - improve directory structure
-# - support more platforms
+# NetBSD-arm32 and NetBSD-i386 are the only tested platform so far.
+# If you got it working on other platforms please add them.
+ONLY_FOR_PLATFORM= NetBSD-*-arm32 NetBSD-*-i386
-# NetBSD-arm32 is the only tested platform so far. If you got it
-# working on other platforms please add them.
-ONLY_FOR_PLATFORM= NetBSD-*-arm32
+.include "../../mk/bsd.prefs.mk"
-USE_GMAKE= yes
-GNU_CONFIGURE= yes
+.if (${OPSYS} == "NetBSD") && (${OBJECT_FMT} == "ELF")
+MACHINE_GCC_PLATFORM= ${MACHINE_GNU_PLATFORM}elf
+.else
+MACHINE_GCC_PLATFORM= ${MACHINE_GNU_PLATFORM}
+.endif
+
+USE_GMAKE= YES
+HAS_CONFIGURE= YES
+CONFIGURE_ARGS= --host=${MACHINE_GCC_PLATFORM} \
+ --prefix=${LOCALBASE}/${PKGNAME} \
+ --with-gnu-as --with-gnu-ld
CONFIGURE_SCRIPT= ${SRCDIR}/configure
-CONFIGURE_ARGS+= --with-gnu-as --with-gnu-ld
-SRCDIR= ${WRKDIR}/${DISTNAME}
+GCC_VERSION= ${PKGNAME:C/.*-//}
+PLIST_SUBST+= GCC_VERSION=${GCC_VERSION} \
+ MACHINE_GCC_PLATFORM=${MACHINE_GCC_PLATFORM}
+SRCDIR= ${WRKDIR}/${PKGNAME}
WRKSRC= ${WRKDIR}/objdir
post-extract:
${MKDIR} ${WRKSRC}
+post-build:
+ ${SED} -e 's#@@PKGNAME@@#${PKGNAME}#g' -e 's#@@PREFIX@@#${PREFIX}#g' \
+ <${FILESDIR}/gcc.mk >${WRKDIR}/gcc.mk
+
+post-install:
+ ${RM} -f ${PREFIX}/${PKGNAME}/lib/gcc-lib/${MACHINE_GCC_PLATFORM}/${GCC_VERSION}/include/curses.h ${PREFIX}/${PKGNAME}/bin/cc
+ ${LN} -s gcc ${PREFIX}/${PKGNAME}/bin/cc
+ ${INSTALL_DATA} ${WRKDIR}/gcc.mk ${PREFIX}/etc/${PKGNAME}.mk
+
.include "../../mk/bsd.pkg.mk"