Module Name:    src
Committed By:   uebayasi
Date:           Mon Nov 30 07:08:03 UTC 2009

Modified Files:
        src/tools/gcc: mknative-gcc

Log Message:
- 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().)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tools/gcc/mknative-gcc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/gcc/mknative-gcc
diff -u src/tools/gcc/mknative-gcc:1.30 src/tools/gcc/mknative-gcc:1.31
--- src/tools/gcc/mknative-gcc:1.30	Mon Nov 30 06:56:15 2009
+++ src/tools/gcc/mknative-gcc	Mon Nov 30 07:08:03 2009
@@ -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 () {

Reply via email to