Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tools/binutils all `tooldir/nbmake-$ARCH native-binutils' su...



details:   https://anonhg.NetBSD.org/src/rev/72c2c558ee0a
branches:  trunk
changeset: 555760:72c2c558ee0a
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Nov 27 10:12:02 2003 +0000

description:
all `tooldir/nbmake-$ARCH native-binutils' support, to regenerate binutils
configury files for the integrated toolchain.

diffstat:

 tools/binutils/Makefile          |   55 +++-----------
 tools/binutils/mknative-binutils |  141 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 154 insertions(+), 42 deletions(-)

diffs (246 lines):

diff -r f241c3336821 -r 72c2c558ee0a tools/binutils/Makefile
--- a/tools/binutils/Makefile   Thu Nov 27 09:45:33 2003 +0000
+++ b/tools/binutils/Makefile   Thu Nov 27 10:12:02 2003 +0000
@@ -1,56 +1,36 @@
-#      $NetBSD: Makefile,v 1.3 2003/10/26 07:25:38 lukem Exp $
+#      $NetBSD: Makefile,v 1.4 2003/11/27 10:12:02 mrg Exp $
 
 .include <bsd.own.mk>
 
-# XXX make this "binutils" when binutils moves to gnu/dist/binutils
+.if ${HAVE_BINUTILS214} == "yes"
+MODULE=                binutils
+.else
 MODULE=                toolchain
+.endif
 
-FIND_ARGS=     \! \( -type d -name sim -prune \)
-
-#CONFIGURE_ENV=        LANGUAGES="c c++ objc f77"
 CONFIGURE_ARGS=        --target=${MACHINE_GNU_PLATFORM} --disable-nls \
                --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"
 
-MAKE_ARGS=     MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \
-               LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC=
+MAKE_ARGS=     MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
 
 ALL_TARGET=    all-binutils all-gas all-ld
 INSTALL_TARGET=        install-binutils install-gas install-ld
 
 .include "${.CURDIR}/../Makefile.gnuhost"
 
-CCADDFLAGS=    -I${DESTDIR}/usr/include -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
+CCADDFLAGS=    -I${DESTDIR}/usr/include -L${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
 
 NEWCONFIGDIR?= ${.CURDIR}/../..
-
-bootstrap-libgcc: .configure_done
-       @echo 'Creating files needed for libgcc by a native bootstrap build.'
-       @MAKE=${MAKE:Q} ${HOST_SH} ${.CURDIR}/mknative libgcc \
-               ${.OBJDIR}/build ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
-
-native: .native/.configure_done
-       @echo 'Extracting GNU configury for a native toolchain.'
-       @MAKE=${MAKE:Q} ${HOST_SH}  ${.CURDIR}/mknative all \
-               ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
+MKNATIVE?=     ${.CURDIR}/mknative-binutils
 
 native-binutils: .native/.configure_done
        @echo 'Extracting GNU binutils configury for a native toolchain.'
-       @MAKE=${MAKE:Q} ${HOST_SH}  ${.CURDIR}/mknative binutils \
-               ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
-
-native-gcc: .native/.configure_done
-       @echo 'Extracting GNU GCC configury for a native toolchain.'
-       @MAKE=${MAKE:Q} ${HOST_SH}  ${.CURDIR}/mknative gcc \
-               ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
-
-native-gdb: .native/.configure_done
-       @echo 'Extracting GNU GDB configury for a native toolchain.'
-       @MAKE=${MAKE:Q} ${HOST_SH}  ${.CURDIR}/mknative gdb \
+       @MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} binutils \
                ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
 
 .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
-       @mkdir .native 2>/dev/null || true
-       @PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
+       mkdir .native 2>/dev/null || true
+       PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
                (cd .native && ${CONFIGURE_ENV:NC*:NLD*} \
                        CC_FOR_BUILD=${HOST_CC:Q} \
                        CC=${CC:Q}' '${CCADDFLAGS:Q} \
@@ -62,27 +42,18 @@
                        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 \
                        ${HOST_SH} ${GNUHOSTDIST}/configure \
                        --build=`${.CURDIR}/../../gnu/dist/toolchain/config.guess` \
                        --host=${MACHINE_GNU_PLATFORM} \
                        --target=${MACHINE_GNU_PLATFORM}) && \
+               (cd .native && ${MAKE} configure-host) && \
                (cd .native/bfd && ${MAKE} bfd.h) && \
-               (cd .native/gcc && ${MAKE} tree-check.h HOST_CC=${HOST_CC:Q}) && \
                (cd .native/ld && ${MAKE} ldemul-list.h) && \
-               (cd .native && touch gcc/cc1obj gcc/cc1plus gcc/f771 && \
+               (cd .native && \
                        ${MAKE} configure-target-libiberty \
-                       configure-target-libf2c configure-target-libobjc \
-                       configure-target-libio configure-target-libstdc++ \
-                       ALL_GCC_C= ALL_GCC_CXX= \
                        CC_FOR_TARGET=${CC:Q}' '${CCADDFLAGS:Q} \
                        CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q} \
                        CPP=${CPP:Q}' '-I${DESTDIR}/usr/include) && \
-               (cd .native/${MACHINE_GNU_PLATFORM}/libio && \
-                       ${MAKE} _G_config.h)
                (cd .native/${MACHINE_GNU_PLATFORM}/libiberty && \
                        ${MAKE} needed-list)
        @touch $@
diff -r f241c3336821 -r 72c2c558ee0a tools/binutils/mknative-binutils
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/binutils/mknative-binutils  Thu Nov 27 10:12:02 2003 +0000
@@ -0,0 +1,141 @@
+#!/bin/sh
+#      $NetBSD: mknative-binutils,v 1.1 2003/11/27 10:12:02 mrg Exp $
+#
+# Shell script for generating all the constants needed for a native
+# platform build of src/gnu/dist/binutils.
+#
+
+# initialise
+
+_TMPDIR=$2
+_TOP=$3
+_PLATFORM=$4
+_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*= ,,'`
+
+. $_TOP/tools/gcc/mknative.common
+
+##### gnu/lib/libbfd #####
+
+get_libbfd () {
+       mkdir -p $_TOP/gnu/lib/libbfd/arch/$MACHINE_ARCH
+
+       {
+               getvars bfd/Makefile \
+                       libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
+                       INCLUDES TDEFAULTS
+       } | write_mk gnu/lib/libbfd/arch/$MACHINE_ARCH/defs.mk
+
+       write_c gnu/lib/libbfd/arch/$MACHINE_ARCH/bfd.h <$_TMPDIR/bfd/bfd.h
+
+       {
+               cat $_TMPDIR/bfd/config.h
+       } | write_c gnu/lib/libbfd/arch/$MACHINE_ARCH/config.h
+}
+
+##### gnu/lib/libopcodes #####
+
+get_libopcodes () {
+       mkdir -p $_TOP/gnu/lib/libopcodes/arch/$MACHINE_ARCH
+
+       {
+               getvars opcodes/Makefile \
+                       archdefs BFD_MACHINES libopcodes_la_SOURCES
+       } | write_mk gnu/lib/libopcodes/arch/$MACHINE_ARCH/defs.mk
+
+       {
+               cat $_TMPDIR/opcodes/config.h
+       } | write_c gnu/lib/libopcodes/arch/$MACHINE_ARCH/config.h
+}
+
+##### gnu/lib/libiberty #####
+
+get_libiberty () {
+       mkdir -p $_TOP/gnu/lib/libiberty
+
+       getvars libiberty/Makefile \
+               ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
+               | write_mk gnu/lib/libiberty/defs.mk
+
+       write_c gnu/lib/libiberty/config.h \
+               <$_TMPDIR/libiberty/config.h
+}
+
+##### gnu/usr.bin/binutils #####
+
+get_binutils () {
+       ### common
+
+       mkdir -p $_TOP/gnu/usr.bin/binutils/common/arch/$MACHINE_ARCH
+
+       {
+               getvars binutils/Makefile \
+                       VERSION DEFS INCLUDES PROGRAMS
+               getvars binutils/doc/Makefile \
+                       man_MANS TEXINFOS
+
+               for f in `getvars binutils/Makefile PROGRAMS | sed 'y,-,_,;s,^[^=]*=,,'`; do
+                       getvars binutils/Makefile ${f}_OBJECTS ${f}_DEPENDENCIES
+               done
+       } | write_mk gnu/usr.bin/binutils/common/arch/$MACHINE_ARCH/defs.mk
+
+       write_c gnu/usr.bin/binutils/common/arch/$MACHINE_ARCH/config.h \
+               <$_TMPDIR/binutils/config.h
+
+       ### gas
+
+       mkdir -p $_TOP/gnu/usr.bin/binutils/gas/arch/$MACHINE_ARCH
+
+       getvars gas/Makefile \
+               DEFS INCLUDES OBJS \
+               | write_mk gnu/usr.bin/binutils/gas/arch/$MACHINE_ARCH/defs.mk
+
+       for f in config itbl-cpu obj-format targ-cpu targ-env; do
+               write_c gnu/usr.bin/binutils/gas/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gas/$f.h
+       done
+
+       ### gprof
+
+       mkdir -p $_TOP/gnu/usr.bin/binutils/gprof/arch/$MACHINE_ARCH
+
+       getvars gprof/Makefile \
+               DEFS gprof_OBJECTS INCLUDES TEXINFOS \
+               | write_mk gnu/usr.bin/binutils/gprof/arch/$MACHINE_ARCH/defs.mk
+
+       write_c gnu/usr.bin/binutils/gprof/arch/$MACHINE_ARCH/gconfig.h <$_TMPDIR/gprof/gconfig.h
+
+       ### ld
+
+       mkdir -p $_TOP/gnu/usr.bin/binutils/ld/arch/$MACHINE_ARCH
+
+       {
+               getvars ld/Makefile \
+                       DEFS EMUL EMULATION_OFILES INCLUDES OFILES STRINGIFY TEXINFOS
+               getvars ld/Makefile \
+                       target_alias | sed 's,[\._0-9A-Z]*$,,'
+       } | write_mk gnu/usr.bin/binutils/ld/arch/$MACHINE_ARCH/defs.mk
+
+       for f in config ldemul-list; do
+               write_c gnu/usr.bin/binutils/ld/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/ld/$f.h
+       done
+}
+
+##### main #####
+
+case $1 in
+all)   # everything (uses "canadian cross" temp environment)
+       get_binutils
+       get_libbfd
+       get_libopcodes
+       get_libiberty
+       exit 0
+       ;;
+
+binutils)
+       get_binutils
+       get_libbfd
+       get_libopcodes
+       exit 0
+       ;;
+
+*)     echo invalid arguments; exit 1;;
+esac



Home | Main Index | Thread Index | Old Index