2004-02-15 22:52:27 +03:00
|
|
|
# $NetBSD: Makefile,v 1.13 2004/02/15 19:52:27 skrll Exp $
|
2003-07-25 20:26:51 +04:00
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
MODULE= gcc
|
|
|
|
|
|
|
|
CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
|
2003-08-22 03:53:12 +04:00
|
|
|
--enable-long-long \
|
2003-08-01 06:44:55 +04:00
|
|
|
--disable-multilib \
|
|
|
|
--enable-threads \
|
2003-07-25 20:26:51 +04:00
|
|
|
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
|
|
|
|
--enable-languages="c c++ objc f77"
|
|
|
|
|
|
|
|
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \
|
2003-10-10 05:18:54 +04:00
|
|
|
LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \
|
2004-02-15 22:52:27 +03:00
|
|
|
EXTRA_PARTS= CPPFLAGS=-DNETBSD_TOOLS
|
2003-07-25 20:26:51 +04:00
|
|
|
|
|
|
|
ALL_TARGET= all-gcc
|
|
|
|
INSTALL_TARGET= install-gcc
|
|
|
|
|
|
|
|
.include "${.CURDIR}/../Makefile.gnuhost"
|
|
|
|
|
2003-08-23 14:07:25 +04:00
|
|
|
CCADDFLAGS= -isystem ${DESTDIR}/usr/include -isystem-cxx ${DESTDIR}/usr/include/g++ -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
|
2003-07-25 20:26:51 +04:00
|
|
|
|
|
|
|
NEWCONFIGDIR?= ${.CURDIR}/../..
|
|
|
|
MKNATIVE?= ${.CURDIR}/mknative-gcc
|
|
|
|
|
|
|
|
bootstrap-libgcc: .configure_done
|
|
|
|
@echo 'Creating files needed for libgcc by a native bootstrap build.'
|
2003-10-26 10:25:33 +03:00
|
|
|
@MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} libgcc \
|
2003-07-25 20:26:51 +04:00
|
|
|
${.OBJDIR}/build ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
|
|
|
|
|
|
|
native-gcc: .native/.configure_done
|
|
|
|
@echo 'Extracting GNU GCC configury for a native toolchain.'
|
2003-11-27 04:05:32 +03:00
|
|
|
@MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gcc3 \
|
2003-07-25 20:26:51 +04:00
|
|
|
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
|
|
|
|
|
|
|
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
|
2003-11-27 03:56:20 +03:00
|
|
|
mkdir .native 2>/dev/null || true
|
|
|
|
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
2003-07-25 20:26:51 +04:00
|
|
|
(cd .native && ${CONFIGURE_ENV:NC*:NLD*} \
|
|
|
|
CC_FOR_BUILD=${HOST_CC:Q} \
|
|
|
|
CC=${CC:Q}' '${CCADDFLAGS:Q} \
|
|
|
|
CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
|
|
|
|
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
|
|
|
|
CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
|
|
|
|
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
|
|
|
|
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
|
|
|
|
LIBS=-lintl \
|
|
|
|
ac_cv_prog_cc_cross=yes \
|
|
|
|
ac_cv_func_strcoll_works=yes \
|
|
|
|
gcc_cv_func_printf_ptr=yes \
|
|
|
|
gdb_cv_printf_has_long_double=yes \
|
|
|
|
gdb_cv_printf_has_long_long=yes \
|
|
|
|
gdb_cv_scanf_has_long_double=yes \
|
2003-10-26 10:25:33 +03:00
|
|
|
${HOST_SH} ${GNUHOSTDIST}/configure \
|
2003-08-22 03:53:12 +04:00
|
|
|
--enable-long-long \
|
2003-07-27 18:44:00 +04:00
|
|
|
--disable-multilib \
|
2003-07-29 10:48:14 +04:00
|
|
|
--enable-threads \
|
2004-02-10 12:37:58 +03:00
|
|
|
--disable-symvers \
|
2003-07-25 20:26:51 +04:00
|
|
|
--build=`${.CURDIR}/../../gnu/dist/gcc/config.guess` \
|
|
|
|
--host=${MACHINE_GNU_PLATFORM} \
|
|
|
|
--target=${MACHINE_GNU_PLATFORM}) && \
|
|
|
|
(cd .native/libiberty && ${MAKE} ${CONFIGURE_ENV} all) && \
|
|
|
|
(cd .native/gcc && ${MAKE} tree-check.h HOST_CC=${HOST_CC:Q}) && \
|
|
|
|
(cd .native && touch gcc/cc1obj gcc/cc1plus gcc/f771 && \
|
|
|
|
${MAKE} configure-target-libiberty \
|
|
|
|
configure-target-libf2c configure-target-libobjc \
|
|
|
|
configure-target-libstdc++-v3 \
|
|
|
|
ALL_GCC_C= ALL_GCC_CXX= \
|
|
|
|
CC_FOR_TARGET=${CC:Q}' '${CCADDFLAGS:Q} \
|
|
|
|
CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q} \
|
2004-02-10 12:37:58 +03:00
|
|
|
ac_cv_prog_cc_cross=yes \
|
2003-07-25 20:26:51 +04:00
|
|
|
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include) && \
|
|
|
|
(cd .native/${MACHINE_GNU_PLATFORM}/libstdc++-v3/include && \
|
|
|
|
${MAKE} all-local) && \
|
|
|
|
(cd .native/${MACHINE_GNU_PLATFORM}/libiberty && \
|
|
|
|
${MAKE} needed-list)
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
clean: clean.native
|
|
|
|
clean.native:
|
|
|
|
-rm -r -f .native
|