Source-Changes-HG archive

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

[src/trunk]: src/tools/gcc Generate lists of template sources ("tmpsrcs") for...



details:   https://anonhg.NetBSD.org/src/rev/530304dfeb9f
branches:  trunk
changeset: 749448:530304dfeb9f
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Mon Nov 30 08:00:20 2009 +0000

description:
Generate lists of template sources ("tmpsrcs") for each libraries.  We'll
need these to create wrappers of tmpsrcs and define correct dependencies.

diffstat:

 tools/gcc/mknative-gcc |  42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diffs (71 lines):

diff -r 6a09e724e854 -r 530304dfeb9f tools/gcc/mknative-gcc
--- a/tools/gcc/mknative-gcc    Mon Nov 30 07:19:58 2009 +0000
+++ b/tools/gcc/mknative-gcc    Mon Nov 30 08:00:20 2009 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: mknative-gcc,v 1.32 2009/11/30 07:19:58 uebayasi Exp $
+#      $NetBSD: mknative-gcc,v 1.33 2009/11/30 08:00:20 uebayasi Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of src/gnu/dist/gcc.
@@ -141,6 +141,40 @@
        get_libgcc_list_objs_xflags fmx
 }
 
+get_libgcc_libgcc_mk_libs_list_tmpsrcs_files () {
+       local _lib=$1
+       local _tmpallsrcs=$( mktemp /tmp/mknative-gcc._tmpallsrcs.XXXXXX )
+
+       touch $_TOP/${libgcc_db_tmpsrcs}.tmpsrc.${_lib%.*}s
+       touch $_TOP/${libgcc_db_tmpsrcs}.tmpfpsrcs.${_lib%.*}
+       touch $_TOP/${libgcc_db_tmpsrcs}.tmpasmsrcs.${_lib%.*}
+
+       # all files
+       local _lib_prefix=${_lib%.*}
+       local _lib_suffix=${_lib#*.}
+       join $_TOP/$libgcc_db_objs_libs $_TOP/$libgcc_db_objs_tmpsrcs | \
+       grep ${_lib_prefix}'\.'${_lib_suffix} | cut -d' ' -f 3 | sort -u > \
+       $_tmpallsrcs
+
+       # TMPFPSRCS = [fdp]p-bit.c
+       grep '[fdt]p-bit\.c' <$_tmpallsrcs | sort -u | \
+       writefile ${libgcc_db_tmpsrcs}.tmpfpsrcs.${_lib%.*}
+
+       # TMPASMSRCS = $(LIB1ASMSRC)
+       grep '\$(LIB1ASMSRC)' <$_tmpallsrcs | sort -u | \
+       writefile ${libgcc_db_tmpsrcs}.tmpasmsrcs.${_lib%.*}
+
+       # TMPSRCS is anything else; exclude TMPFPSRCS and TMPASMSRCS
+       cat $_tmpallsrcs | \
+       comm -23 /dev/stdin $_TOP/${libgcc_db_tmpsrcs}.tmpfpsrcs.${_lib%.*} | \
+       comm -23 /dev/stdin $_TOP/${libgcc_db_tmpsrcs}.tmpasmsrcs.${_lib%.*} | \
+       writefile ${libgcc_db_tmpsrcs}.tmpsrc.${_lib%.*}s
+
+       rm -f $_tmpallsrcs
+}
+
+#####
+
 get_libgcc_new () {
        _subdir="$1"
 
@@ -149,7 +183,7 @@
        _machine_arch_subdir=gnu/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH
 
        libgcc_db_funcs=${_machine_arch_subdir}/funcs
-       libgcc_db_files=${_machine_arch_subdir}/files
+       libgcc_db_tmpsrcs=${_machine_arch_subdir}/tmpsrcs
        libgcc_db_objs_libs=${_machine_arch_subdir}/objs.libs
        libgcc_db_objs_srcs=${_machine_arch_subdir}/objs.srcs
        libgcc_db_objs_tmpsrcs=${_machine_arch_subdir}/objs.tmpsrcs
@@ -178,6 +212,10 @@
        get_libgcc_list_objs_tmpsrcs | writefile ${libgcc_db_objs_tmpsrcs}
        get_libgcc_list_objs_cppflags | writefile ${libgcc_db_objs_cppflags}
        get_libgcc_list_objs_copts | writefile ${libgcc_db_objs_copts}
+
+       for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
+               get_libgcc_libgcc_mk_libs_list_tmpsrcs_files $_lib
+       done
 }
 
 get_libgcc () {



Home | Main Index | Thread Index | Old Index