1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-04 01:48:54 +00:00
freebsd-ports/base/gcc/Makefile
Tijl Coosemans 02f27a83b4 The output of tools like awk, date, sort, tr,... depends on the current
locale set by the user.  Add LANG=C and LC_ALL=C at the beginning of
bsd.port.mk and export them so all commands are executed with the C locale.
LC_ALL=C overrides all other LC_* variables.  LANG is used by setlocale(3)
as default value for LC_* variables, so normally it isn't used when LC_ALL
is set, but there's code out there that looks at LANG directly so it's safer
to set it as well.  The only commands not captured by this are !=
assignments before any inclusion of bsd.port.*mk.

Introduce USE_LOCALE=<locale> that adds LANG=<locale> and LC_ALL=<locale> to
CONFIGURE_ENV and MAKE_ENV so upstream build systems can be executed with a
different locale (e.g. USE_LOCALE=en_US.UTF-8).

PR:		215882
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2017-01-18 13:20:31 +00:00

76 lines
2.1 KiB
Makefile

# $FreeBSD$
PORTNAME= gcc
PORTVERSION= 5.4.0
CATEGORIES= devel
MASTER_SITES= GCC/releases/gcc-${DISTVERSION} \
http://www.mpfr.org/mpfr-current/:mpfr \
GNU/gmp:gmp \
http://www.multiprecision.org/mpc/download/:mpc
DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \
mpfr-3.1.4.tar.xz:mpfr \
gmp-5.1.3.tar.xz:gmp \
mpc-1.0.3.tar.gz:mpc
PKGNAMEPREFIX= ${OPSYS:tl}-
MAINTAINER= bapt@FreeBSD.org
COMMENT= GNU Compiler Collection
LICENSE= GPLv3 GPLv3RLE
LICENSE_COMB= multi
.if !defined(CROSS_TOOLCHAIN)
.error Please define CROSS_TOOLCHAIN before building
.endif
.if !defined(CROSS_SYSROOT)
.error Please define CROSS_SYSROOT before building
.endif
PREFIX= /usr
CONFIGURE_ENV= gcc_gxx_include_dir="/usr/include/c++/v1"
TARGET_ARCH= ${CROSS_TOOLCHAIN:C,-.*$,,}
GCC_TARGET= ${TARGET_ARCH}-portbld-${OPSYS:tl}${OSREL}
USES= gmake libtool tar:bzip2 makeinfo
PLIST_SUB= TARGETARCH=${TARGET_ARCH} \
OPSYS=${OPSYS:tl} \
GCC_TARGET=${GCC_TARGET} \
GCC_VERSION=${PORTVERSION}
TARGET_ARCH= ${CROSS_TOOLCHAIN:C,-.*$,,}
EXTRA_PATCHES+= ${.CURDIR}/../../devel/powerpc64-gcc/files/freebsd-format-extensions
GNU_CONFIGURE= yes
CONFIGURE_OUTSOURCE= yes
CONFIGURE_ARGS+=--target=${GCC_TARGET} --disable-nls \
--enable-languages=c,c++ \
--without-headers \
--with-build-sysroot=${CROSS_SYSROOT} \
-with-pkgversion="GNU Collection for FreeBSD"
ALL_TARGET?= all-gcc
INSTALL_TARGET?= install-gcc
post-extract:
cd ${WRKSRC}; ${LN} -sf ../mpfr-3.1.4 mpfr ; \
${LN} -sf ../gmp-5.1.3 gmp ; \
${LN} -sf ../mpc-1.0.3 mpc
post-patch:
@${REINPLACE_CMD} -e '/LIBSTDCXX/ s/stdc\+\+/c\+\+/g ' \
${WRKSRC}//gcc/cp/g++spec.c
post-install:
for tool in cpp gcc g++ gcov; do \
${LN} -sf ${GCC_TARGET}-$${tool} ${STAGEDIR}/usr/bin/$${tool} ; \
${LN} -sf ${GCC_TARGET}-$${tool}.1.gz ${STAGEDIR}/${MANDIR}1/$${tool}.1.gz ; \
done ; \
${LN} -sf ${GCC_TARGET}-g++ ${STAGEDIR}/usr/bin/c++ ; \
${LN} -sf ${GCC_TARGET}-g++.1.gz ${STAGEDIR}/${MANDIR}1/c++.1.gz
${LN} -sf ${GCC_TARGET}-gcc ${STAGEDIR}/usr/bin/cc ; \
${LN} -sf ${GCC_TARGET}-gcc.1.gz ${STAGEDIR}/${MANDIR}1/cc.1.gz
${RM} -r ${STAGEDIR}/usr/share/info
.include <bsd.port.mk>