summaryrefslogtreecommitdiff
path: root/lang/gcc42
diff options
context:
space:
mode:
authorGerald Pfeifer <gerald@FreeBSD.org>2009-05-26 14:26:22 +0000
committerGerald Pfeifer <gerald@FreeBSD.org>2009-05-26 14:26:22 +0000
commit1c13cbbe50dede93d0010816dc2308fee655efd7 (patch)
tree6c5cce97803d9f7e4f78ff55bc5065be5211d5c6 /lang/gcc42
parent- refactor the port to ease maintenance [1] (diff)
Move the snapshot date from PORTREVISION to being a part of PORTVERSION
to allow for PORTREVISION bumps. Simplify pre-everything and adjust PLIST_SUB accordingly. Extract SUFFIX from PORTVERSION. Use SUFFIX for TARGLIB (and thus for the library path used by this port). Also use SUFFIX for the libexec directory instead of the full port version and flatten the directory structure and simplify the logic along the way. Move VERSIONSTRING down to pacify portlint after all those years and extract it from PORTVERSION, too. Make the determination of CONFIGURE_SCRIPT more robust. Address a long term FIXME related to older versions of FreeBSD by removing NOMANCOMPRESS=yes. Adjust Makefile header; nothing really left from the original.
Notes
Notes: svn path=/head/; revision=234581
Diffstat (limited to 'lang/gcc42')
-rw-r--r--lang/gcc42/Makefile29
1 files changed, 14 insertions, 15 deletions
diff --git a/lang/gcc42/Makefile b/lang/gcc42/Makefile
index b9f72f53415c..bf5f1777e55c 100644
--- a/lang/gcc42/Makefile
+++ b/lang/gcc42/Makefile
@@ -1,16 +1,14 @@
# ex:ts=8
-# Ports collection makefile for: egcs
-# Date created: 9 Jan 1998
-# Whom: John Polstra <jdp@polstra.com>
+# Ports collection makefile for: gcc42
+# Date created: 2005-12-11
+# Whom: Gerald Pfeifer <gerald@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= gcc
-PORTVERSION= 4.2.5
-PORTREVISION= 20090325
+PORTVERSION= 4.2.5.20090325
CATEGORIES= lang java
-VERSIONSTRING= 4.2-${PORTREVISION}
MASTER_SITES= ${MASTER_SITE_GCC}
MASTER_SITE_SUBDIR= snapshots/${VERSIONSTRING}
DISTFILES= gcc-core-${VERSIONSTRING}${EXTRACT_SUFX} \
@@ -23,7 +21,8 @@ COMMENT= GNU Compiler Collection 4.2
LIB_DEPENDS= gmp.8:${PORTSDIR}/math/libgmp4 \
mpfr.3:${PORTSDIR}/math/mpfr
-SUFFIX= 42
+VERSIONSTRING= ${PORTVERSION:C/([0-9]+\.[0-9]+).*\.([0-9]+)/\1-\2/}
+SUFFIX= ${PORTVERSION:C/([0-9]+).([0-9]+).*/\1\2/}
LATEST_LINK= gcc${SUFFIX}${PKGNAMESUFFIX}
NOT_FOR_ARCHS= ia64 powerpc
USE_BISON= build
@@ -35,8 +34,7 @@ MAKE_JOBS_SAFE= yes
WANT_GNOME= yes
PATCH_WRKSRC= ${SRCDIR}
-CONFIGURE_SCRIPT= ../${SRCDIR:C/${WRKDIR}//}/configure
-NOMANCOMPRESS= yes # too hard to deal with differences on 5-cur and releng4
+CONFIGURE_SCRIPT= ../${SRCDIR:S/${WRKDIR}\///}/configure
.include <bsd.port.pre.mk>
@@ -52,7 +50,8 @@ CONFIGURE_TARGET= ${ARCH}-portbld-freebsd${OSREL}
SRCDIR= ${WRKDIR}/gcc-${VERSIONSTRING}
WRKSRC= ${WRKDIR}/build
-TARGLIB= ${PREFIX}/lib/gcc-${PORTVERSION}
+TARGLIB= ${PREFIX}/lib/gcc${SUFFIX}
+LIBEXEC= ${PREFIX}/libexec/gcc${SUFFIX}
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --disable-nls \
--with-system-zlib \
@@ -60,11 +59,13 @@ CONFIGURE_ARGS+= --disable-nls \
--with-gmp=${LOCALBASE} \
--program-suffix=${SUFFIX} \
--libdir=${TARGLIB} \
+ --libexecdir=${LIBEXEC} \
--with-gxx-include-dir=${TARGLIB}/include/c++/
MAKE_ARGS+= MAKEINFOFLAGS="--no-split"
ALL_TARGET= bootstrap-lean
USE_LDCONFIG= ${TARGLIB}
-PLIST_SUB= GCC_VER=${PORTVERSION} GNU_HOST=${CONFIGURE_TARGET} \
+PLIST_SUB= GCC_VER=${PORTVERSION:C/(.+)\.[0-9]+/\1/} \
+ GNU_HOST=${CONFIGURE_TARGET} \
SUFFIX=${SUFFIX}
MAN1= cpp${SUFFIX}.1 \
g++${SUFFIX}.1 \
@@ -111,7 +112,7 @@ PLIST_SUB+= JAVA="@comment "
.endif
pre-everything::
- @${ECHO_MSG} "Making GCC ${DISTNAME:S/^gcc-//} for ${OPSYS} ${OSREL} target=${CONFIGURE_TARGET}"
+ @${ECHO_MSG} "Making GCC ${PORTVERSION} for ${OPSYS} ${OSREL} target=${CONFIGURE_TARGET}"
pre-extract:
@# Building libgcj with lang/gcc295 installed is causing a failure
@@ -136,15 +137,13 @@ post-install:
${RM} -f ${TARGLIB}/*.la
# Add target libraries and include files to packaging list.
${RM} -f ${WRKDIR}/PLIST.lib
-.for d in ${TARGLIB:S/^${PREFIX}\///} libexec/gcc/${CONFIGURE_TARGET}/${PORTVERSION} include/gcj include/gnu include/java include/javax
+.for d in ${TARGLIB:S/^${PREFIX}\///} ${LIBEXEC:S/^${PREFIX}\///} include/gcj include/gnu include/java include/javax
cd ${PREFIX} ; if [ -d $d ]; then \
${FIND} $d -type f -o -type l >>${WRKDIR}/PLIST.lib ;\
${FIND} $d -type d | ${SORT} -r \
| ${SED} -e 's/^/@dirrm /g' >>${WRKDIR}/PLIST.lib ;\
fi
.endfor
- ${ECHO_CMD} "@unexec ${RMDIR} %D/libexec/gcc/${CONFIGURE_TARGET} 2>&1 || true" >> ${WRKDIR}/PLIST.lib
- ${ECHO_CMD} "@unexec ${RMDIR} %D/libexec/gcc 2>&1 || true" >> ${WRKDIR}/PLIST.lib
cd ${WRKDIR} ; ${SED} -i -e "/PLIST.lib/ r PLIST.lib" ${TMPPLIST}
.include <bsd.port.post.mk>