2006-10-05 00:40:40 +02:00
|
|
|
# $NetBSD: Makefile,v 1.36 2006/10/04 22:40:40 rillig Exp $
|
2004-06-29 20:01:24 +02:00
|
|
|
#
|
|
|
|
|
2004-07-21 18:03:33 +02:00
|
|
|
DISTNAME= gcc-${GCC_VERSION}
|
2004-06-29 20:01:24 +02:00
|
|
|
PKGNAME= gcc34-${GCC_VERSION}
|
2006-10-05 00:40:40 +02:00
|
|
|
PKGREVISION= 1
|
2004-06-29 20:01:24 +02:00
|
|
|
CATEGORIES= lang
|
2004-07-21 18:03:33 +02:00
|
|
|
MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/}
|
2004-06-29 20:01:24 +02:00
|
|
|
EXTRACT_SUFX= .tar.bz2
|
|
|
|
|
|
|
|
MAINTAINER= shannonjr@NetBSD.org
|
|
|
|
HOMEPAGE= http://www.gnu.org/software/gcc/gcc.html
|
|
|
|
COMMENT= This is the gcc 3.4 compiler
|
|
|
|
|
2006-04-05 13:03:59 +02:00
|
|
|
GCC_VERSION= 3.4.6
|
2004-06-29 20:01:24 +02:00
|
|
|
|
2005-01-21 21:52:24 +01:00
|
|
|
NOT_FOR_PLATFORM= Interix-*-*
|
|
|
|
|
2004-06-29 20:01:24 +02:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2004-07-26 23:55:37 +02:00
|
|
|
# Determine whether to use binutils
|
|
|
|
.if ${OPSYS} == "NetBSD"
|
|
|
|
. if !defined(USE_BINUTILS)
|
2004-07-28 09:37:19 +02:00
|
|
|
AS_PATH:= ${AS}
|
2004-07-26 23:55:37 +02:00
|
|
|
. for _dir_ in ${PATH:C/\:/ /g}
|
|
|
|
. if empty(AS_PATH:M/*)
|
|
|
|
. if exists(${_dir_}/${AS})
|
2004-07-28 09:37:19 +02:00
|
|
|
AS_PATH:= ${_dir_}/${AS}
|
2004-07-26 23:55:37 +02:00
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. if !empty(AS_PATH:M${LOCALBASE}/*)
|
|
|
|
USE_BINUTILS= YES
|
|
|
|
. else
|
2004-08-01 12:14:16 +02:00
|
|
|
AS_VERSION!= ${AS_PATH} --version | ${AWK} '{ \
|
2004-07-26 23:55:37 +02:00
|
|
|
split($$3, v, /[.]/); \
|
|
|
|
printf "%02d%02d%02d%02d\n",v[1],v[2],v[3],v[4]; \
|
|
|
|
exit; \
|
|
|
|
}'
|
|
|
|
USE_BINUTILS!= ${TEST} ${AS_VERSION} -lt 02130201 && ${ECHO} YES || ${ECHO} NO
|
|
|
|
. endif
|
2005-12-05 21:49:47 +01:00
|
|
|
MAKEFLAGS+= USE_BINUTILS=${USE_BINUTILS:Q}
|
2004-07-26 23:55:37 +02:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
.if defined(USE_BINUTILS) && !empty(USE_BINUTILS:M[yY][eE][sS])
|
|
|
|
DEPENDS+= binutils>=2.14:../../devel/binutils
|
|
|
|
CONFIGURE_ARGS+= --with-as=${LOCALBASE}/bin/as
|
2004-08-01 12:14:16 +02:00
|
|
|
CONFIGURE_ARGS+= --with-ld=${LOCALBASE}/bin/ld
|
2004-07-26 23:55:37 +02:00
|
|
|
CONFIGURE_ARGS+= --with-gnu-as
|
|
|
|
CONFIGURE_ARGS+= --with-gnu-ld
|
|
|
|
.endif
|
|
|
|
|
2006-10-05 00:40:40 +02:00
|
|
|
REPLACE_AWK+= libjava/addr2name.awk
|
|
|
|
USE_TOOLS+= awk:run
|
|
|
|
|
2004-06-29 20:01:24 +02:00
|
|
|
# Optional languages - change as required
|
|
|
|
# If BUILD_ADA is YES, then you'll need to specify
|
|
|
|
# an Ada in the "Ada bootstrap compiler section"
|
2005-12-05 21:49:47 +01:00
|
|
|
BUILD_DEFS+= BUILD_ADA BUILD_CXX BUILD_F77 \
|
2004-06-29 20:01:24 +02:00
|
|
|
BUILD_JAVA BUILD_OBJC
|
|
|
|
BUILD_ADA?= NO
|
|
|
|
BUILD_CXX?= YES
|
2005-01-21 21:52:24 +01:00
|
|
|
BUILD_F77?= NO
|
|
|
|
BUILD_JAVA?= YES
|
2004-06-29 20:01:24 +02:00
|
|
|
BUILD_OBJC?= YES
|
|
|
|
|
|
|
|
LANGS='c'
|
|
|
|
.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
|
|
|
|
LANGS+='ada'
|
|
|
|
.endif
|
|
|
|
.if !empty(BUILD_CXX:M[Yy][Ee][Ss])
|
|
|
|
LANGS+='c++'
|
|
|
|
.endif
|
|
|
|
.if !empty(BUILD_F77:M[Yy][Ee][Ss])
|
|
|
|
LANGS+='f77'
|
|
|
|
.endif
|
|
|
|
.if !empty(BUILD_JAVA:M[Yy][Ee][Ss])
|
|
|
|
LANGS+='java'
|
|
|
|
.endif
|
|
|
|
.if !empty(BUILD_OBJC:M[Yy][Ee][Ss])
|
|
|
|
LANGS+='objc'
|
|
|
|
.endif
|
2005-12-06 00:55:01 +01:00
|
|
|
CONFIGURE_ARGS+= --enable-languages=${LANGS:Q}
|
2004-06-29 20:01:24 +02:00
|
|
|
CONFIGURE_ARGS+= --with-system-zlib
|
|
|
|
CONFIGURE_ARGS+= --enable-shared
|
|
|
|
CONFIGURE_ARGS+= --enable-__cxa_atexit
|
|
|
|
CONFIGURE_ARGS+= --enable-long-long
|
2005-12-06 00:55:01 +01:00
|
|
|
CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q}
|
2004-08-10 17:11:14 +02:00
|
|
|
CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
|
|
|
|
MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv}
|
2006-09-27 17:46:11 +02:00
|
|
|
MAKE_ENV+= SHELL=${CONFIG_SHELL}
|
2004-08-10 17:11:14 +02:00
|
|
|
|
2004-11-12 13:31:28 +01:00
|
|
|
.if !empty(BUILD_F77:M[Yy][Ee][Ss])
|
|
|
|
.include "../../devel/gmp/buildlink3.mk"
|
|
|
|
CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp}
|
2005-07-09 02:16:53 +02:00
|
|
|
USE_TOOLS+= chmod
|
2005-12-05 21:49:47 +01:00
|
|
|
MAKE_ENV+= ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD:Q}
|
2004-11-12 13:31:28 +01:00
|
|
|
.endif
|
|
|
|
|
2004-07-09 21:25:12 +02:00
|
|
|
# GNU pth is useless here
|
2004-07-09 22:11:36 +02:00
|
|
|
.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
|
|
|
|
# ADA tasking strictly requires native threads
|
2005-12-05 21:49:47 +01:00
|
|
|
PTHREAD_OPTS+= require native
|
2004-07-09 22:11:36 +02:00
|
|
|
.else
|
2005-12-05 21:49:47 +01:00
|
|
|
PTHREAD_OPTS+= native
|
2004-07-09 22:11:36 +02:00
|
|
|
.endif
|
|
|
|
.include "../../mk/pthread.buildlink3.mk"
|
2004-07-09 21:25:12 +02:00
|
|
|
.if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} != "native"
|
|
|
|
CONFIGURE_ARGS+= --disable-threads
|
|
|
|
.endif
|
2004-06-29 20:01:24 +02:00
|
|
|
|
2006-04-13 20:23:29 +02:00
|
|
|
USE_TOOLS+= gmake makeinfo msgfmt
|
2004-08-10 17:11:14 +02:00
|
|
|
HAS_CONFIGURE= YES # no GNU_CONFIGURE!
|
2004-07-26 23:55:37 +02:00
|
|
|
CONFIG_SHELL?= ${SH}
|
2005-12-05 21:49:47 +01:00
|
|
|
CONFIGURE_ENV+= CONFIG_SHELL=${CONFIG_SHELL:Q}
|
2006-03-05 17:27:22 +01:00
|
|
|
PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
|
2004-06-29 20:01:24 +02:00
|
|
|
|
|
|
|
.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
|
2004-07-09 21:25:12 +02:00
|
|
|
|
2004-06-29 20:01:24 +02:00
|
|
|
# Ada bootstrap compiler section
|
2004-07-28 14:14:49 +02:00
|
|
|
# An Ada compiler is required to build the Ada compiler. You
|
|
|
|
# may specify:
|
2004-06-29 20:01:24 +02:00
|
|
|
#USE_GCC34ADA =# Define to use gcc-3.4.x-ada
|
2004-07-28 14:14:49 +02:00
|
|
|
# Or, you may specify the path of any gcc/gnat Ada compiler
|
|
|
|
# by providing the full path of the compiler (example) below:
|
2004-06-29 20:01:24 +02:00
|
|
|
#ALT_GCC= prefix/bin/gcc
|
|
|
|
. if defined(ALT_GCC)
|
|
|
|
. if exists(${ALT_GCC})
|
2004-08-11 21:08:15 +02:00
|
|
|
ALT_GCC_RTS!= ${ALT_GCC} --print-file-name=adalib
|
|
|
|
. if !empty(ALT_GCC_RTS)
|
2004-06-29 20:01:24 +02:00
|
|
|
RALT_GCC_RTS= ${ALT_GCC_RTS:S%${LOCALBASE}%%:S%/%%}
|
2004-08-11 21:08:15 +02:00
|
|
|
. else
|
2005-12-05 21:49:47 +01:00
|
|
|
PKG_SKIP_REASON+= "${ALT_GCC} does not appear to be an Ada compiler"
|
2004-08-11 21:08:15 +02:00
|
|
|
. endif
|
2004-06-29 20:01:24 +02:00
|
|
|
. else
|
2005-12-05 21:49:47 +01:00
|
|
|
PKG_SKIP_REASON+= "Missing bootstrap Ada compiler"
|
2004-06-29 20:01:24 +02:00
|
|
|
. endif
|
|
|
|
. endif
|
2004-07-28 14:14:49 +02:00
|
|
|
. if !defined(USE_GCC34ADA) && !defined(ALT_GCC)
|
2005-12-05 21:49:47 +01:00
|
|
|
PKG_SKIP_REASON+= "An Ada bootstrap compiler must be specified to BUILD_ADA"
|
2004-06-29 20:01:24 +02:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
GCC_SUBPREFIX= gcc34
|
|
|
|
GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX}
|
2005-12-05 21:49:47 +01:00
|
|
|
FILES_SUBST+= PKGNAME=${PKGNAME:Q}
|
2004-06-29 20:01:24 +02:00
|
|
|
MESSAGE_SUBST+= GCC_PREFIX=${GCC_PREFIX}
|
2005-12-06 00:55:01 +01:00
|
|
|
CONFIGURE_ARGS+= --prefix=${GCC_PREFIX:Q}
|
2004-06-29 20:01:24 +02:00
|
|
|
CPPFLAGS+= -I${BUILDLINK_DIR}/include
|
|
|
|
CFLAGS+= -I${BUILDLINK_DIR}/include
|
2004-08-06 22:56:15 +02:00
|
|
|
.if ${OPSYS} == "NetBSD"
|
2004-08-10 17:11:14 +02:00
|
|
|
# thread / crtbegin / __cxa_atexit support depend on a "netbsd2" OS name
|
2004-08-11 21:08:15 +02:00
|
|
|
GCC_PLATFORM= ${LOWER_ARCH}--${LOWER_OPSYS}${APPEND_ELF}${LOWER_OS_VERSION:C/[_a-z].*//}
|
2005-12-06 00:55:01 +01:00
|
|
|
CONFIGURE_ARGS+= --host=${GCC_PLATFORM:Q}
|
2004-08-11 21:08:15 +02:00
|
|
|
ABI_BASELINE_PAIR= ${GCC_PLATFORM:C/--/-/}
|
2005-12-05 21:49:47 +01:00
|
|
|
MAKE_ENV+= ABI_BASELINE_PAIR=${ABI_BASELINE_PAIR:Q}
|
2004-08-10 17:11:14 +02:00
|
|
|
.endif # NetBSD
|
2004-06-29 20:01:24 +02:00
|
|
|
|
|
|
|
post-patch:
|
2004-08-10 17:11:14 +02:00
|
|
|
.if ${OPSYS} == "NetBSD"
|
|
|
|
. if exists(${FILESDIR}/${LOWER_ARCH}-baseline_symbols${LOWER_OS_VERSION:C/\..*//}.txt)
|
2004-08-11 21:08:15 +02:00
|
|
|
(${TEST} -d ${WRKSRC}/libstdc++-v3/config/abi/${ABI_BASELINE_PAIR} || \
|
|
|
|
${MKDIR} ${WRKSRC}/libstdc++-v3/config/abi/${ABI_BASELINE_PAIR})
|
2004-08-10 17:11:14 +02:00
|
|
|
${CP} ${FILESDIR}/${LOWER_ARCH}-baseline_symbols${LOWER_OS_VERSION:C/\..*//}.txt \
|
2004-08-11 21:08:15 +02:00
|
|
|
${WRKSRC}/libstdc++-v3/config/abi/${ABI_BASELINE_PAIR}/baseline_symbols.txt
|
2004-08-10 17:11:14 +02:00
|
|
|
. endif
|
2004-06-29 20:01:24 +02:00
|
|
|
.endif
|
|
|
|
(cd ${FILESDIR}; \
|
|
|
|
${CP} adasignal.c ${WRKSRC}/gcc/ada; \
|
|
|
|
${CP} ada_lwp_self.c ${WRKSRC}/gcc/ada; \
|
|
|
|
${CP} dummy_pthreads.c ${WRKSRC}/gcc/ada; \
|
|
|
|
for i in *.adb *.ads ; do \
|
|
|
|
${CP} $$i ${WRKSRC}/gcc/ada; \
|
|
|
|
done )
|
|
|
|
|
2004-07-28 23:30:19 +02:00
|
|
|
.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
|
2004-06-29 20:01:24 +02:00
|
|
|
. if defined(USE_GCC34ADA)
|
|
|
|
# Overide compiler.mk setup to use gcc-3.4.x-ada
|
|
|
|
pre-configure:
|
|
|
|
.include "../../lang/gcc34-ada/preconfigure.mk"
|
|
|
|
. elif defined(ALT_GCC)
|
|
|
|
pre-configure:
|
2004-07-28 23:30:19 +02:00
|
|
|
(${TEST} -d ${WRKDIR}/.gcc/bin/ || ${MKDIR} ${WRKDIR}/.gcc/bin/)
|
2004-06-29 20:01:24 +02:00
|
|
|
(cd ${WRKDIR}/.buildlink && ${MKDIR} ${RALT_GCC_RTS} && \
|
|
|
|
cd ${RALT_GCC_RTS} && ${LN} -sf ${ALT_GCC_RTS}/libgnat.a .)
|
|
|
|
(cd ${ALT_GCC:H} && \
|
2004-11-15 12:38:42 +01:00
|
|
|
bin_files=`${FIND} . -type f \( -perm -0100 \) -print` && \
|
2004-06-29 20:01:24 +02:00
|
|
|
cd ${WRKDIR}/.gcc/bin/ && \
|
|
|
|
for filename in ${ALT_GCC:T} $${bin_files} ; do \
|
2004-07-28 23:30:19 +02:00
|
|
|
${ECHO} '#!${TOOLS_SHELL}' > $${filename}; \
|
|
|
|
${ECHO} -n "exec ${ALT_GCC:H}/$${filename} " >>$${filename}; \
|
|
|
|
${ECHO} '"$$@"' >>$${filename}; \
|
|
|
|
${CHMOD} +x $${filename}; \
|
2004-06-29 20:01:24 +02:00
|
|
|
done )
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
do-configure:
|
2005-11-05 09:43:44 +01:00
|
|
|
${MKDIR} ${WRKDIR}/obj
|
|
|
|
cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS}
|
2004-06-29 20:01:24 +02:00
|
|
|
|
|
|
|
do-build:
|
|
|
|
(cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} bootstrap)
|
|
|
|
.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
|
2004-10-30 14:06:59 +02:00
|
|
|
(cd ${WRKDIR}/obj/gcc && ${SETENV} ${MAKE_ENV} ${GMAKE} gnatlib-shared)
|
2004-06-29 20:01:24 +02:00
|
|
|
(cd ${WRKDIR}/obj/gcc && ${SETENV} ${MAKE_ENV} ${GMAKE} gnatlib_and_tools)
|
|
|
|
.endif
|
|
|
|
|
|
|
|
do-test:
|
|
|
|
.if (${MACHINE_GNU_ARCH} == "x86_64")
|
2004-07-28 23:30:19 +02:00
|
|
|
(cd ${FILESDIR} && ${CP} netbsd64macro.dfs ${WRKSRC}/gcc/testsuite/ada/acats/support/macro.dfs)
|
2004-06-29 20:01:24 +02:00
|
|
|
.endif
|
|
|
|
(cd ${WRKDIR}/obj && ${GMAKE} -k check)
|
|
|
|
|
|
|
|
do-install:
|
2004-08-08 13:12:13 +02:00
|
|
|
(cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} install \
|
2004-06-29 20:01:24 +02:00
|
|
|
&& ${TEST} -f ${GCC_PREFIX}/bin/cc || ${LN} -f ${GCC_PREFIX}/bin/gcc ${GCC_PREFIX}/bin/cc)
|
|
|
|
.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
|
|
|
|
(SPECPATH=`${GCC_PREFIX}/bin/gcc -print-file-name=specs` && \
|
|
|
|
for EXPANDEDSPECPATH in $${SPECPATH} ; do \
|
|
|
|
SPECDIR=`${DIRNAME} $${EXPANDEDSPECPATH}`; \
|
|
|
|
${ECHO} $${SPECDIR}/adainclude > $${SPECDIR}/ada_source_path; \
|
|
|
|
${ECHO} $${SPECDIR}/adalib > $${SPECDIR}/ada_object_path; \
|
|
|
|
done )
|
|
|
|
.endif
|
|
|
|
|
|
|
|
post-install:
|
|
|
|
${CP} -f ${PKGDIR}/PLIST ${PLIST_SRC}
|
|
|
|
${FIND} ${GCC_PREFIX} \( -type f -o -type l \) -print \
|
|
|
|
| ${SORT} | ${SED} -e "s,${PREFIX}/,,g" \
|
|
|
|
>> ${PLIST_SRC}
|
|
|
|
${FIND} ${GCC_PREFIX} -type d -print \
|
|
|
|
| ${SORT} -r | ${SED} -e "s,${PREFIX}/,@dirrm ,g" \
|
|
|
|
>> ${PLIST_SRC}
|
|
|
|
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
|
2004-07-28 14:14:49 +02:00
|
|
|
. if defined(USE_GCC34ADA)
|
|
|
|
BUILDLINK_DEPMETHOD.gcc34-ada=build
|
2004-06-29 20:01:24 +02:00
|
|
|
.include "../../lang/gcc34-ada/buildlink3.mk"
|
|
|
|
. endif
|
|
|
|
.endif
|
2004-07-26 23:55:37 +02:00
|
|
|
.include "../../devel/zlib/buildlink3.mk"
|
2004-06-29 20:01:24 +02:00
|
|
|
.include "../../devel/gettext-lib/buildlink3.mk"
|
2004-08-08 13:12:13 +02:00
|
|
|
.include "../../converters/libiconv/buildlink3.mk"
|
2004-06-29 20:01:24 +02:00
|
|
|
.include "../../mk/bsd.pkg.mk"
|