Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tools/gcc - Generate a list of CPP flags used to build *.o. ...
details: https://anonhg.NetBSD.org/src/rev/3db4c4c8f76e
branches: trunk
changeset: 749446:3db4c4c8f76e
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Mon Nov 30 07:08:03 2009 +0000
description:
- Generate a list of CPP flags used to build *.o. Some files are build
repeatedly with different -DXXX to generate similar objects (e.g. different
type size).
- Generate a list of other CC options to build *.o.
(See my sed-fu using hold space in get_libgcc_list_objs_xflags().)
diffstat:
tools/gcc/mknative-gcc | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diffs (50 lines):
diff -r 4052fc994f88 -r 3db4c4c8f76e tools/gcc/mknative-gcc
--- a/tools/gcc/mknative-gcc Mon Nov 30 07:02:24 2009 +0000
+++ b/tools/gcc/mknative-gcc Mon Nov 30 07:08:03 2009 +0000
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: mknative-gcc,v 1.30 2009/11/30 06:56:15 uebayasi Exp $
+# $NetBSD: mknative-gcc,v 1.31 2009/11/30 07:08:03 uebayasi Exp $
#
# Shell script for generating all the constants needed for a native
# platform build of src/gnu/dist/gcc.
@@ -106,6 +106,30 @@
} | sort
}
+get_libgcc_list_objs_xflags () {
+ local _flags=$1
+
+ grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \
+ sed -n '
+ x
+ :loop
+ g
+ s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\5 \2/p
+ g
+ s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\1 \3 \4\/\5/
+ h
+ t loop
+ ' | sort
+}
+
+get_libgcc_list_objs_cppflags () {
+ get_libgcc_list_objs_xflags D
+}
+
+get_libgcc_list_objs_copts () {
+ get_libgcc_list_objs_xflags fmx
+}
+
get_libgcc_new () {
_subdir="$1"
@@ -140,6 +164,8 @@
get_libgcc_list_objs_libs | writefile ${libgcc_db_objs_libs}
get_libgcc_list_objs_srcs | writefile ${libgcc_db_objs_srcs}
+ get_libgcc_list_objs_cppflags | writefile ${libgcc_db_objs_cppflags}
+ get_libgcc_list_objs_copts | writefile ${libgcc_db_objs_copts}
}
get_libgcc () {
Home |
Main Index |
Thread Index |
Old Index