Source-Changes-HG archive

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

[src/trunk]: src/tools/gcc Handle cases where database text files don't exist.



details:   https://anonhg.NetBSD.org/src/rev/4228b96a2f7e
branches:  trunk
changeset: 749473:4228b96a2f7e
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Mon Nov 30 14:34:17 2009 +0000

description:
Handle cases where database text files don't exist.

diffstat:

 tools/gcc/mknative-gcc |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (62 lines):

diff -r faeac635900a -r 4228b96a2f7e tools/gcc/mknative-gcc
--- a/tools/gcc/mknative-gcc    Mon Nov 30 13:24:32 2009 +0000
+++ b/tools/gcc/mknative-gcc    Mon Nov 30 14:34:17 2009 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: mknative-gcc,v 1.40 2009/11/30 10:03:57 uebayasi Exp $
+#      $NetBSD: mknative-gcc,v 1.41 2009/11/30 14:34:17 uebayasi Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of src/gnu/dist/gcc.
@@ -95,7 +95,7 @@
 }
 
 get_libgcc_list_objs_srcs () {
-       {
+       if [ -e $_TOP/${libgcc_db_funcs}.S ]; then
                cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
                comm -23 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
                sed -e 's,\(.*\),\1.o   \1.c,'
@@ -103,7 +103,10 @@
                cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
                comm -12 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
                sed -e 's,\(.*\),\1.o   \1.S,'
-       } | sort
+       else
+               cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
+               sed -e 's,\(.*\),\1.o   \1.c,'
+       fi | sort
 }
 
 get_libgcc_list_objs_tmplsrcs () {
@@ -176,10 +179,12 @@
 get_libgcc_new_analyze () {
        mkdir -p $_TOP/${_machine_arch_subdir}
 
+       touch $_TOP/${libgcc_db_funcs}.S
        get_libgcc_list_funcs_asm | \
        writefile ${libgcc_db_funcs}.S
 
        for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
+               touch $_TOP/${libgcc_db_funcs}.${_lib%.*}
                get_libgcc_list_funcs_lib $_lib | \
                writefile ${libgcc_db_funcs}.${_lib%.*}
        done
@@ -227,12 +232,15 @@
 
        printf '\n'
        printf 'SRCS.%s = \\\n' $_lib
-       {
+       if [ -e $_TOP/${libgcc_db_funcs}.S ]; then
                comm -23 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
                sed -e 's,$,.c,; s,^,tmp_,'
                comm -12 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
                sed -e 's,$,.S,; s,^,tmp_,'
-       } | sort | \
+       else
+               cat $_TOP/${libgcc_db_funcs}.${_lib%.*} | \
+               sed -e 's,$,.c,; s,^,tmp_,'
+       fi | sort | \
        sed -e 's,^,    ,; s,$, \\,'
 }
 



Home | Main Index | Thread Index | Old Index