freebsd-ports/lang/gcc/Makefile

171 lines
4.7 KiB
Makefile
Raw Normal View History

# Created by: Gerald Pfeifer <gerald@FreeBSD.org>
1999-08-25 08:35:40 +02:00
# $FreeBSD$
PORTNAME= gcc
PORTVERSION= 4.9.4
CATEGORIES= lang java
MASTER_SITES= GCC/releases/gcc-${DISTVERSION}
2005-03-02 09:46:01 +01:00
MAINTAINER= gerald@FreeBSD.org
COMMENT= GNU Compiler Collection 4.9
LICENSE= GPLv3 GPLv3RLE
LICENSE_COMB= multi
LIB_DEPENDS= libgmp.so:math/gmp \
libmpfr.so:math/mpfr \
libmpc.so:math/mpc
BUILD_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
RUN_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
2005-03-02 09:46:01 +01:00
.if defined(MAINTAINER_MODE)
BUILD_DEPENDS+= runtest:misc/dejagnu
.endif
CONFLICTS= gcc49*
CPE_VENDOR= gnu
# GCC_VERSION and SUFFIX relate to names of executables and directories
# once installed.
GCC_VERSION= ${PORTVERSION}
SUFFIX= ${PORTVERSION:C/([0-9]+).([0-9]+).*/\1\2/}
ONLY_FOR_ARCHS= amd64 armv6 i386 powerpc powerpc64 sparc64
USES= compiler cpe gmake iconv libtool makeinfo perl5 tar:bzip2
USE_BINUTILS= yes
USE_PERL5= build
SSP_UNSAFE= yes
OPTIONS_DEFINE= BOOTSTRAP
OPTIONS_DEFINE_i386= JAVA
OPTIONS_DEFINE_amd64= JAVA
OPTIONS_DEFINE_powerpc64= JAVA
OPTIONS_DEFAULT_i386= JAVA
OPTIONS_DEFAULT_amd64= JAVA
OPTIONS_DEFAULT_powerpc64= BOOTSTRAP
OPTIONS_EXCLUDE_DragonFly= JAVA
BOOTSTRAP_DESC= Build using a full bootstrap
.if exists(/usr/lib32/libc.so)
OPTIONS_DEFINE_powerpc64+= MULTILIB
OPTIONS_DEFAULT_powerpc64+= MULTILIB
MULTILIB_DESC= Build support for 32-bit and 64-bit targets
MULTILIB_CONFIGURE_ENABLE= multilib
.else
CONFIGURE_ARGS+= --disable-multilib
.endif
.include <bsd.port.pre.mk>
.if ${ARCH} == "amd64"
CONFIGURE_TARGET= x86_64-portbld-${OPSYS:tl}${OSREL}
.endif
Update the default version of GCC used in the Ports Collection from GCC 4.6.4 to GCC 4.7.3. This entails updating the lang/gcc port as well as changing the default in Mk/bsd.default-versions.mk. This adds powerpc64 as a supported architecture (and removes ia64, though it can be supported by manually installing lang/gcc48). New binaries %%GNU_HOST%%-gcc-ar47, %%GNU_HOST%%-gcc-nm47, and %%GNU_HOST%%-gcc-ranlib47 are provided to support link-time optimization (LTO) which scales significantly better. And it adds support for indirect functions (IFUNCS), experimental support for transactional memory in the compiler as well as a supporting run-time library called libitm, a new string length optimization pass, and support for atomic operations specifying the C++11/C11 memory model. Version 3.1 of the OpenMP specification is now supported for the C, C++, and Fortran compilers. GCC accepts the options -std=c11 and -std=gnu11 for the C11 revision of the ISO C standard which inlcude support for unicode strings, nonreturning functions (_Noreturn and <stdnoreturn.h>), alignment support (_Alignas, _Alignof, max_align_t, <stdalign.h>), and a __builtin_complex built-in function. The C++ frontend now accepts the -std=c++11, -std=gnu++11, and -Wc++11-compat options and implements many C++11 features of the language including extended friends syntax, explicit override control, non-static data member initializers, user-defined literals, alias declarations, delegating constructors, atomic classes, and more. The C++ standard library and Fortran frontend have received many improvements. See http://gcc.gnu.org/gcc-4.7/changes.html for an extense list of changes; http://gcc.gnu.org/gcc-4.7/porting_to.html for information on how to port to that new version. PR: 182136 Supported by: Christoph Moench-Tegeder <cmt@burggraben.net> (fixing many ports) Tested by: bdrewery (two -exp runs)
2014-03-10 21:41:10 +01:00
.if ${ARCH} == powerpc64
CONFIGURE_ENV+= UNAME_m="powerpc64"
.endif
.if ${ARCH} == "armv6"
# Override sys.mk including -O in CFLAGS which breaks libgomp building.
CFLAGS:= ${CFLAGS:S/-O/-O2/g}
. if ${COMPILER_TYPE} == clang
. if empty(PORT_OPTIONS:MBOOTSTRAP)
MAKE_ARGS+=CXXFLAGS=-fbracket-depth=512
. else
MAKE_ARGS+=STAGE1_CXXFLAGS=-fbracket-depth=512
. endif
. endif
.endif
LANGUAGES:= c,c++,objc,fortran
TARGLIB= ${PREFIX}/lib/gcc${SUFFIX}
LIBEXEC= ${PREFIX}/libexec/gcc${SUFFIX}
GNU_CONFIGURE= yes
CONFIGURE_OUTSOURCE= yes
.if empty(PORT_OPTIONS:MBOOTSTRAP)
CONFIGURE_ARGS+=--disable-bootstrap
.else
CONFIGURE_ARGS+=--with-build-config=bootstrap-debug
ALL_TARGET= bootstrap-lean
.endif
CONFIGURE_ARGS+=--disable-nls \
Update the default version of GCC used in the Ports Collection from GCC 4.6.4 to GCC 4.7.3. This entails updating the lang/gcc port as well as changing the default in Mk/bsd.default-versions.mk. This adds powerpc64 as a supported architecture (and removes ia64, though it can be supported by manually installing lang/gcc48). New binaries %%GNU_HOST%%-gcc-ar47, %%GNU_HOST%%-gcc-nm47, and %%GNU_HOST%%-gcc-ranlib47 are provided to support link-time optimization (LTO) which scales significantly better. And it adds support for indirect functions (IFUNCS), experimental support for transactional memory in the compiler as well as a supporting run-time library called libitm, a new string length optimization pass, and support for atomic operations specifying the C++11/C11 memory model. Version 3.1 of the OpenMP specification is now supported for the C, C++, and Fortran compilers. GCC accepts the options -std=c11 and -std=gnu11 for the C11 revision of the ISO C standard which inlcude support for unicode strings, nonreturning functions (_Noreturn and <stdnoreturn.h>), alignment support (_Alignas, _Alignof, max_align_t, <stdalign.h>), and a __builtin_complex built-in function. The C++ frontend now accepts the -std=c++11, -std=gnu++11, and -Wc++11-compat options and implements many C++11 features of the language including extended friends syntax, explicit override control, non-static data member initializers, user-defined literals, alias declarations, delegating constructors, atomic classes, and more. The C++ standard library and Fortran frontend have received many improvements. See http://gcc.gnu.org/gcc-4.7/changes.html for an extense list of changes; http://gcc.gnu.org/gcc-4.7/porting_to.html for information on how to port to that new version. PR: 182136 Supported by: Christoph Moench-Tegeder <cmt@burggraben.net> (fixing many ports) Tested by: bdrewery (two -exp runs)
2014-03-10 21:41:10 +01:00
--enable-gnu-indirect-function \
--libdir=${TARGLIB} \
--libexecdir=${LIBEXEC} \
--program-suffix=${SUFFIX} \
--with-as=${LOCALBASE}/bin/as \
--with-gmp=${LOCALBASE} \
--with-gxx-include-dir=${TARGLIB}/include/c++/ \
--with-ld=${LOCALBASE}/bin/ld \
${ICONV_CONFIGURE_ARG} \
--with-pkgversion="FreeBSD Ports Collection" \
--with-system-zlib
MAKE_ARGS+= MAKEINFOFLAGS="--no-split"
USE_LDCONFIG= ${TARGLIB}
PLIST_SUB= GCC_VERSION=${GCC_VERSION} \
GNU_HOST=${CONFIGURE_TARGET} \
SUFFIX=${SUFFIX}
INFO= gcc${SUFFIX}/cpp \
gcc${SUFFIX}/cppinternals \
gcc${SUFFIX}/gcc \
gcc${SUFFIX}/gccinstall \
gcc${SUFFIX}/gccint \
gcc${SUFFIX}/gfortran \
gcc${SUFFIX}/libgomp
# Release tarballs (as opposed to snapshots) always carry this.
Update the default version of GCC in the Ports Collection from GCC 4.7.4 to GCC 4.8.3. This entails updating the lang/gcc port as well as changing the default in Mk/bsd.default-versions.mk, and it replaces the CONFLICT between the lang/gcc and lang/gcc47 ports by lang/gcc48. GCC now uses C++ as its implementation language and performs more aggressive loop analysis which can be disabled via the -fno-aggressive-loop-optimizations command-line option. Compilation of extremely large functions has been signficantly improved, as have interprocedural optimizations. A new optimization level -Og has been introduced. It addresses the need for fast compilation and a superior debugging experience while providing a reasonable level of run-time performance. This should be better suitable for development than the default -O0. A new local register allocator (LRA) has been implemented, which replaces the 26 year old reload pass and improves generated code quality. For now it is active on the x86 and x86-64 targets. AddressSanitizer, a fast memory error detector, has been added and can be enabled via -fsanitize=address. Each diagnostic emitted now includes the original source line and a caret indicating the column. The new option -Wpedantic is an alias for -pedantic, which is now deprecated. The C++ frontend and associated run-time library libstdc++ have gained support for many additional C++11 features. As with previous releases the Fortrand frontend has seen many improvements as well. Support for the AArch64 has been added, and there are many improvements to the x86/x86-64 backend and others. See http://gcc.gnu.org/gcc-4.8/changes.html for an extense list of changes; http://gcc.gnu.org/gcc-4.8/porting_to.html for information on how to port to that new version. PR: 192025 Tested by: antoine (-exp runs)
2014-09-10 21:09:58 +02:00
#.if ${ARCH} == "i386" || ${ARCH} == "amd64"
Update the default version of GCC used in the Ports Collection from GCC 4.6.4 to GCC 4.7.3. This entails updating the lang/gcc port as well as changing the default in Mk/bsd.default-versions.mk. This adds powerpc64 as a supported architecture (and removes ia64, though it can be supported by manually installing lang/gcc48). New binaries %%GNU_HOST%%-gcc-ar47, %%GNU_HOST%%-gcc-nm47, and %%GNU_HOST%%-gcc-ranlib47 are provided to support link-time optimization (LTO) which scales significantly better. And it adds support for indirect functions (IFUNCS), experimental support for transactional memory in the compiler as well as a supporting run-time library called libitm, a new string length optimization pass, and support for atomic operations specifying the C++11/C11 memory model. Version 3.1 of the OpenMP specification is now supported for the C, C++, and Fortran compilers. GCC accepts the options -std=c11 and -std=gnu11 for the C11 revision of the ISO C standard which inlcude support for unicode strings, nonreturning functions (_Noreturn and <stdnoreturn.h>), alignment support (_Alignas, _Alignof, max_align_t, <stdalign.h>), and a __builtin_complex built-in function. The C++ frontend now accepts the -std=c++11, -std=gnu++11, and -Wc++11-compat options and implements many C++11 features of the language including extended friends syntax, explicit override control, non-static data member initializers, user-defined literals, alias declarations, delegating constructors, atomic classes, and more. The C++ standard library and Fortran frontend have received many improvements. See http://gcc.gnu.org/gcc-4.7/changes.html for an extense list of changes; http://gcc.gnu.org/gcc-4.7/porting_to.html for information on how to port to that new version. PR: 182136 Supported by: Christoph Moench-Tegeder <cmt@burggraben.net> (fixing many ports) Tested by: bdrewery (two -exp runs)
2014-03-10 21:41:10 +01:00
INFO+= gcc${SUFFIX}/libquadmath \
gcc${SUFFIX}/libitm
#.endif
SUB_FILES= pkg-message
SUB_LIST+= TARGLIB=${TARGLIB}
.if ${PORT_OPTIONS:MJAVA}
ECJ_JAR= ${LOCALBASE}/share/java/ecj-4.5.jar
BUILD_DEPENDS+= ${ECJ_JAR}:lang/gcc-ecj45 \
zip:archivers/zip
RUN_DEPENDS+= ${ECJ_JAR}:lang/gcc-ecj45
EXTRA_PATCHES+= ${FILESDIR}/java-patch-hier
CONFIGURE_ARGS+=--with-ecj-jar=${ECJ_JAR}
LANGUAGES:= ${LANGUAGES},java
INFO+= gcc${SUFFIX}/cp-tools \
gcc${SUFFIX}/gcj
PLIST_SUB+= JAVA=""
.else
CONFIGURE_ARGS+=--disable-libgcj
PLIST_SUB+= JAVA="@comment "
.endif
CONFIGURE_ARGS+=--enable-languages=${LANGUAGES}
pre-everything::
@${ECHO_MSG} "Making GCC ${PORTVERSION} for ${CONFIGURE_TARGET} [${LANGUAGES}]"
1998-08-11 10:22:46 +02:00
pre-configure:
cd ${WRKSRC} ; contrib/gcc_update --touch
@${RM} ${WRKSRC}/gcc/*/*.info*
.if defined(MAINTAINER_MODE)
full-regression-test: build
cd ${TEST_WRKSRC}; ${MAKE_CMD} -sk check \
; ${WRKSRC}/contrib/test_summary
.endif
2014-09-11 16:39:39 +02:00
post-stage:
${RM} ${STAGEDIR}${PREFIX}/man/man7/*
${RM} ${STAGEDIR}${PREFIX}/bin/rebuild-gcj-db${SUFFIX} \
${STAGEDIR}${PREFIX}/man/man1/rebuild-gcj-db${SUFFIX}.1
# Add target libraries and include files to packaging list.
${RM} ${WRKDIR}/PLIST.lib
.for d in ${TARGLIB:S/^${PREFIX}\///} ${LIBEXEC:S/^${PREFIX}\///} include/gcj include/gnu include/java include/javax
cd ${STAGEDIR}${PREFIX} ; if [ -d $d ]; then \
${FIND} $d -type f -o -type l >>${WRKDIR}/PLIST.lib ;\
fi
.endfor
cd ${WRKDIR} ; ${SED} -i -e "/PLIST.lib/ r PLIST.lib" ${TMPPLIST}
# This is the canonical GCC port, so add key commands without
# version numbers as part of their names.
for c in gfortran g++ gcc; do \
${LN} -s ${PREFIX}/bin/"$$c"${SUFFIX} ${STAGEDIR}${PREFIX}/bin/$$c ; \
done
1998-11-13 08:34:57 +01:00
.include <bsd.port.post.mk>