| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #!/bin/sh | | 1 | #!/bin/sh |
2 | # $NetBSD: mknative-gcc,v 1.35 2009/11/30 08:20:23 uebayasi Exp $ | | 2 | # $NetBSD: mknative-gcc,v 1.36 2009/11/30 09:32:13 uebayasi Exp $ |
3 | # | | 3 | # |
4 | # Shell script for generating all the constants needed for a native | | 4 | # Shell script for generating all the constants needed for a native |
5 | # platform build of src/gnu/dist/gcc. | | 5 | # platform build of src/gnu/dist/gcc. |
6 | # | | 6 | # |
7 | | | 7 | |
8 | # initialise | | 8 | # initialise |
9 | | | 9 | |
10 | _TMPDIR=$2 | | 10 | _TMPDIR=$2 |
11 | _TOP=$3 | | 11 | _TOP=$3 |
12 | _PLATFORM=$4 | | 12 | _PLATFORM=$4 |
13 | _VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'` | | 13 | _VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'` |
14 | _GNU_DIST=`cd ${_VPATH}; pwd` | | 14 | _GNU_DIST=`cd ${_VPATH}; pwd` |
15 | | | 15 | |
| @@ -187,53 +187,71 @@ get_libgcc_new_analyze () { | | | @@ -187,53 +187,71 @@ get_libgcc_new_analyze () { |
187 | get_libgcc_list_objs_libs | writefile ${libgcc_db_objs_libs} | | 187 | get_libgcc_list_objs_libs | writefile ${libgcc_db_objs_libs} |
188 | get_libgcc_list_objs_srcs | writefile ${libgcc_db_objs_srcs} | | 188 | get_libgcc_list_objs_srcs | writefile ${libgcc_db_objs_srcs} |
189 | get_libgcc_list_objs_tmpsrcs | writefile ${libgcc_db_objs_tmpsrcs} | | 189 | get_libgcc_list_objs_tmpsrcs | writefile ${libgcc_db_objs_tmpsrcs} |
190 | get_libgcc_list_objs_cppflags | writefile ${libgcc_db_objs_cppflags} | | 190 | get_libgcc_list_objs_cppflags | writefile ${libgcc_db_objs_cppflags} |
191 | get_libgcc_list_objs_copts | writefile ${libgcc_db_objs_copts} | | 191 | get_libgcc_list_objs_copts | writefile ${libgcc_db_objs_copts} |
192 | | | 192 | |
193 | for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do | | 193 | for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do |
194 | get_libgcc_list_tmpsrcs $_lib | | 194 | get_libgcc_list_tmpsrcs $_lib |
195 | done | | 195 | done |
196 | } | | 196 | } |
197 | | | 197 | |
198 | ##### | | 198 | ##### |
199 | | | 199 | |
| | | 200 | get_libgcc_gen_srcs () { |
| | | 201 | local _lib=$1 |
| | | 202 | |
| | | 203 | printf '\n' |
| | | 204 | printf 'SRCS.%s = \\\n' $_lib |
| | | 205 | { |
| | | 206 | comm -23 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \ |
| | | 207 | sed -e 's,$,.c,; s,^,tmp_,' |
| | | 208 | comm -12 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \ |
| | | 209 | sed -e 's,$,.S,; s,^,tmp_,' |
| | | 210 | } | sort | \ |
| | | 211 | sed -e 's,^, ,; s,$, \\,' |
| | | 212 | } |
| | | 213 | |
200 | get_libgcc_new_generate () { | | 214 | get_libgcc_new_generate () { |
| | | 215 | for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do |
| | | 216 | get_libgcc_gen_srcs $_lib | \ |
| | | 217 | write_mk ${_machine_arch_subdir}/${_lib%.*}.srcs.mk |
| | | 218 | done |
201 | } | | 219 | } |
202 | | | 220 | |
203 | ##### | | 221 | ##### |
204 | | | 222 | |
205 | get_libgcc_new () { | | 223 | get_libgcc_new () { |
206 | _subdir="$1" | | 224 | _subdir="$1" |
207 | | | 225 | |
208 | # List of generated files. | | 226 | # List of generated files. |
209 | | | 227 | |
210 | _machine_arch_subdir=gnu/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH | | 228 | _machine_arch_subdir=gnu/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH |
211 | | | 229 | |
212 | libgcc_db_funcs=${_machine_arch_subdir}/funcs | | 230 | libgcc_db_funcs=${_machine_arch_subdir}/funcs |
213 | libgcc_db_tmpsrcs=${_machine_arch_subdir}/tmpsrcs | | 231 | libgcc_db_tmpsrcs=${_machine_arch_subdir}/tmpsrcs |
214 | libgcc_db_objs_libs=${_machine_arch_subdir}/objs.libs | | 232 | libgcc_db_objs_libs=${_machine_arch_subdir}/objs.libs |
215 | libgcc_db_objs_srcs=${_machine_arch_subdir}/objs.srcs | | 233 | libgcc_db_objs_srcs=${_machine_arch_subdir}/objs.srcs |
216 | libgcc_db_objs_tmpsrcs=${_machine_arch_subdir}/objs.tmpsrcs | | 234 | libgcc_db_objs_tmpsrcs=${_machine_arch_subdir}/objs.tmpsrcs |
217 | libgcc_db_objs_cppflags=${_machine_arch_subdir}/objs.cppflags | | 235 | libgcc_db_objs_cppflags=${_machine_arch_subdir}/objs.cppflags |
218 | libgcc_db_objs_copts=${_machine_arch_subdir}/objs.copts | | 236 | libgcc_db_objs_copts=${_machine_arch_subdir}/objs.copts |
219 | | | 237 | |
| | | 238 | get_libgcc_new_analyze |
| | | 239 | |
220 | libgcc_srcs_mk=${_machine_arch_subdir}/srcs.mk | | 240 | libgcc_srcs_mk=${_machine_arch_subdir}/srcs.mk |
221 | libgcc_srcs_mk_tmpsrc=${_machine_arch_subdir}/srcs.tmpsrc.mk | | 241 | libgcc_srcs_mk_tmpsrc=${_machine_arch_subdir}/srcs.tmpsrc.mk |
222 | libgcc_srcs_mk_cppflags=${_machine_arch_subdir}/srcs.cppflags.mk | | 242 | libgcc_srcs_mk_cppflags=${_machine_arch_subdir}/srcs.cppflags.mk |
223 | libgcc_srcs_mk_copts=${_machine_arch_subdir}/srcs.copts.mk | | 243 | libgcc_srcs_mk_copts=${_machine_arch_subdir}/srcs.copts.mk |
224 | | | 244 | |
225 | get_libgcc_new_analyze | | | |
226 | | | | |
227 | get_libgcc_new_generate | | 245 | get_libgcc_new_generate |
228 | } | | 246 | } |
229 | | | 247 | |
230 | get_libgcc () { | | 248 | get_libgcc () { |
231 | _subdir="$1" | | 249 | _subdir="$1" |
232 | mkdir -p $_TOP/gnu/lib/lib$_subdir/arch | | 250 | mkdir -p $_TOP/gnu/lib/lib$_subdir/arch |
233 | | | 251 | |
234 | case "$_subdir" in | | 252 | case "$_subdir" in |
235 | gcc3) | | 253 | gcc3) |
236 | _extravars="USE_COLLECT2 LIB2FUNCS_1 LIB2FUNCS_2 xm_file" | | 254 | _extravars="USE_COLLECT2 LIB2FUNCS_1 LIB2FUNCS_2 xm_file" |
237 | _archsubdir="" | | 255 | _archsubdir="" |
238 | ;; | | 256 | ;; |
239 | gcc4) | | 257 | gcc4) |