2010-10-13 00:57:55 +02:00
|
|
|
# $NetBSD: Makefile,v 1.94 2010/10/12 22:57:55 joerg Exp $
|
2000-03-25 00:41:20 +01:00
|
|
|
|
2002-01-03 21:40:37 +01:00
|
|
|
DISTNAME= gcc-2.95.3
|
2006-02-06 00:08:03 +01:00
|
|
|
PKGREVISION= 7
|
2000-03-25 00:41:20 +01:00
|
|
|
CATEGORIES= lang
|
|
|
|
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/}
|
2003-07-06 16:28:08 +02:00
|
|
|
|
|
|
|
PATCH_SITES= ${MASTER_SITE_LOCAL}
|
|
|
|
PATCHFILES= gcc-2.95.3-diff-2002-08-29.gz
|
|
|
|
|
2002-03-28 11:11:50 +01:00
|
|
|
#
|
2002-09-27 14:28:15 +02:00
|
|
|
# Synced from patches against main source tree as of 2002-03-28
|
2002-03-28 11:11:50 +01:00
|
|
|
#
|
2006-03-04 22:28:51 +01:00
|
|
|
MAINTAINER= pkgsrc-users@NetBSD.org
|
2009-09-20 16:41:52 +02:00
|
|
|
HOMEPAGE= http://gcc.gnu.org/
|
2003-08-08 11:31:00 +02:00
|
|
|
COMMENT= GNU Compiler Collection, version 2
|
2000-03-25 00:41:20 +01:00
|
|
|
|
2007-06-12 22:10:17 +02:00
|
|
|
NOT_FOR_PLATFORM= Darwin-*-* Interix-*-* *-*-x86_64 DragonFly-*-*
|
2003-01-11 11:44:27 +01:00
|
|
|
|
2010-10-13 00:57:55 +02:00
|
|
|
USE_TOOLS+= gmake bison
|
2004-03-26 00:34:01 +01:00
|
|
|
MAKEFLAGS+= GMAKE_LOCALE=no
|
2002-09-27 14:28:15 +02:00
|
|
|
|
2000-09-16 01:58:47 +02:00
|
|
|
HAS_CONFIGURE= YES
|
2002-10-26 16:32:49 +02:00
|
|
|
CONFIGURE_SCRIPT= ${WRKSRC}/configure
|
2005-12-06 00:55:01 +01:00
|
|
|
CONFIGURE_ARGS+= --host=${MACHINE_GNU_PLATFORM:Q}
|
|
|
|
CONFIGURE_ARGS+= --prefix=${GCC_PREFIX:Q}
|
2002-09-27 14:28:15 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-shared
|
2000-03-25 00:41:20 +01:00
|
|
|
|
2005-06-24 19:04:00 +02:00
|
|
|
USE_TOOLS+= chmod
|
2005-12-05 21:49:47 +01:00
|
|
|
MAKE_ENV+= ac_cv_prog_chmod=${TOOLS_CHMOD:Q}
|
2006-09-27 17:46:11 +02:00
|
|
|
MAKE_ENV+= SHELL=${CONFIG_SHELL}
|
2005-06-24 19:04:00 +02:00
|
|
|
|
2002-10-26 16:32:49 +02:00
|
|
|
CONFIGURE_DIRS= ${WRKDIR}/objdir
|
|
|
|
BUILD_DIRS= ${CONFIGURE_DIRS}
|
2000-03-27 10:54:53 +02:00
|
|
|
|
2006-03-20 19:15:37 +01:00
|
|
|
FILES_SUBST+= DISTNAME=${DISTNAME:Q} \
|
|
|
|
GCC_PREFIX=${GCC_PREFIX:Q}
|
2003-07-24 00:30:12 +02:00
|
|
|
MESSAGE_SUBST+= DISTNAME=${DISTNAME}
|
2006-03-20 19:15:37 +01:00
|
|
|
PLIST_SUBST+= DISTNAME=${DISTNAME:Q} \
|
|
|
|
GCC_PREFIX=${GCC_PREFIX:S|^${PREFIX}/||:Q}
|
2003-07-24 00:30:12 +02:00
|
|
|
|
2006-03-20 19:15:37 +01:00
|
|
|
INFO_FILES= # PLIST
|
2002-09-27 14:28:15 +02:00
|
|
|
|
2001-01-11 07:53:10 +01:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2008-02-01 08:50:01 +01:00
|
|
|
.if !empty(MACHINE_PLATFORM:MNetBSD-4*)
|
|
|
|
GCC_REQD+= 3.0
|
|
|
|
USE_PKGSRC_GCC= yes
|
|
|
|
.endif
|
|
|
|
|
2002-09-27 14:28:15 +02:00
|
|
|
.if ${OPSYS} == "SunOS"
|
|
|
|
CONFLICTS+= gcc-[0-9]* pgcc-[0-9]*
|
2003-04-14 02:20:50 +02:00
|
|
|
. if ${CC:M*gcc*} == ""
|
2004-12-03 16:14:50 +01:00
|
|
|
BUILD_TARGET= bootstrap
|
2003-04-14 02:20:50 +02:00
|
|
|
. endif
|
|
|
|
# we know it's a GNU toolchain on Linux and the BSDs.
|
2003-04-14 02:28:17 +02:00
|
|
|
.elif ${OPSYS:M*BSD} != "" || ${OPSYS} == "Linux"
|
2002-09-27 14:28:15 +02:00
|
|
|
CONFIGURE_ARGS+= --with-gnu-as
|
|
|
|
CONFIGURE_ARGS+= --with-gnu-ld
|
2003-04-14 02:20:50 +02:00
|
|
|
.else
|
|
|
|
# play it safe, force a bootstrap build if we don't know for sure it
|
|
|
|
# is gcc.
|
2003-04-14 02:28:17 +02:00
|
|
|
. if ${CC:M*gcc*} == ""
|
2004-12-03 16:14:50 +01:00
|
|
|
BUILD_TARGET= bootstrap
|
2003-04-14 02:20:50 +02:00
|
|
|
. endif
|
2001-01-11 07:53:10 +01:00
|
|
|
.endif
|
|
|
|
|
2003-07-24 00:30:12 +02:00
|
|
|
GCC_PREFIX= ${PREFIX}/${DISTNAME}
|
|
|
|
GCC_VERSION= ${PKGVERSION:C|nb.*||}
|
2003-07-06 14:31:57 +02:00
|
|
|
GCC_ARCHDIR= ${GCC_PREFIX}/lib/gcc-lib/${MACHINE_GNU_PLATFORM}/${GCC_VERSION}
|
2003-07-24 00:30:12 +02:00
|
|
|
PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
|
2002-09-27 14:28:15 +02:00
|
|
|
|
2000-03-25 00:41:20 +01:00
|
|
|
post-extract:
|
|
|
|
${MKDIR} ${WRKSRC}
|
2002-10-26 16:32:49 +02:00
|
|
|
${CP} ${FILESDIR}/xm-netbsd.h ${WRKSRC}/gcc/config
|
|
|
|
${CP} ${FILESDIR}/xm-target64.h ${WRKSRC}/gcc/config
|
2002-09-27 14:28:15 +02:00
|
|
|
for file in ${FILESDIR}/*_* ; do \
|
|
|
|
arch=`${BASENAME} $${file} | ${SED} -e "s/_.*//"`; \
|
|
|
|
dest=`${BASENAME} $${file} | ${SED} -e "s/$${arch}_//"`; \
|
2002-10-26 16:32:49 +02:00
|
|
|
${MKDIR} ${WRKSRC}/gcc/config/$${arch}; \
|
|
|
|
${CP} $${file} ${WRKSRC}/gcc/config/$${arch}/$${dest}; \
|
2002-03-28 11:11:50 +01:00
|
|
|
done
|
2002-10-26 16:32:49 +02:00
|
|
|
${RM} ${WRKSRC}/gcc/config/alpha/netbsd-elf.h
|
|
|
|
${RM} ${WRKSRC}/gcc/config/arm/t-netbsd
|
|
|
|
${RM} ${WRKSRC}/gcc/config/mips/x-netbsd
|
|
|
|
${RM} ${WRKSRC}/libf2c/libF77/dtime_.c
|
|
|
|
${RM} ${WRKSRC}/libf2c/libF77/etime_.c
|
2000-03-25 00:41:20 +01:00
|
|
|
|
2002-09-27 14:28:15 +02:00
|
|
|
pre-configure:
|
2002-10-26 16:32:49 +02:00
|
|
|
${MKDIR} ${BUILD_DIRS}
|
2003-05-26 22:50:36 +02:00
|
|
|
cd ${WRKSRC} && contrib/egcs_update --touch
|
2000-09-26 00:19:19 +02:00
|
|
|
|
2000-09-16 01:58:47 +02:00
|
|
|
post-build:
|
2002-09-27 14:28:15 +02:00
|
|
|
@${SED} ${FILES_SUBST_SED} ${FILESDIR}/gcc.mk > ${WRKDIR}/gcc.mk
|
2001-12-29 18:41:45 +01:00
|
|
|
|
2003-04-14 02:20:50 +02:00
|
|
|
.if ${OPSYS} == "SunOS"
|
2002-09-27 14:28:15 +02:00
|
|
|
#
|
|
|
|
# remove empty file and directories that show up when one does:
|
|
|
|
# make install; make deinstall; make install
|
|
|
|
#
|
2000-09-16 01:58:47 +02:00
|
|
|
post-install:
|
2002-09-27 14:28:15 +02:00
|
|
|
-cd ${GCC_ARCHDIR}/include && ${RM} -f fixed && ${RMDIR} v7 v9
|
2002-01-09 17:33:32 +01:00
|
|
|
.else
|
|
|
|
post-install:
|
2002-09-27 14:28:15 +02:00
|
|
|
. 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
|
2003-05-27 10:40:19 +02:00
|
|
|
.endif
|
2003-07-06 16:23:31 +02:00
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/${DISTNAME}
|
|
|
|
${INSTALL_DATA} ${WRKDIR}/gcc.mk ${PREFIX}/share/examples/${DISTNAME}/mk.conf
|
2002-09-27 14:28:15 +02:00
|
|
|
${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}
|
2000-09-16 01:58:47 +02:00
|
|
|
|
2000-03-25 00:41:20 +01:00
|
|
|
.include "../../mk/bsd.pkg.mk"
|
2001-01-11 07:53:10 +01:00
|
|
|
|
|
|
|
# Make bootstrap with compiler != gcc possible.
|
2002-05-14 16:01:33 +02:00
|
|
|
LDFLAGS= ${_STRIPFLAG_CC}
|