Generate lists of template sources ("tmpsrcs") for each libraries. We'll

need these to create wrappers of tmpsrcs and define correct dependencies.
This commit is contained in:
uebayasi 2009-11-30 08:00:20 +00:00
parent 141ef6c4d0
commit 1380d82f90
1 changed files with 40 additions and 2 deletions

View File

@ -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_copts () {
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 @@ get_libgcc_new () {
_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_new () {
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 () {