2 # $NetBSD: mknative-gcc,v 1.68 2012/09/25 06:55:10 skrll Exp $
4 # Shell script for generating all the constants needed for a native
5 # platform build of gcc.
15 _VPATH
=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
16 _GNU_DIST
=`cd ${_VPATH}; pwd`
18 if [ -z "$_DESTDIR" ]; then
19 echo "\$_DESTDIR is empty" 2>&1
23 .
$_TOP/tools
/gcc
/mknative.common
25 # default to GCC 4.1 for now
29 ##### gnu/lib/crtstuff #####
33 mkdir
-p $_OUTDIR/lib
/$_subdir/arch
35 getvars gcc
/Makefile \
36 INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS CRTSTUFF_T_CFLAGS_S \
37 tm_defines xm_file xm_defines \
38 |
sed "s,-I$_DESTDIR/usr/include,,g" \
39 | write_mk
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH.mk
42 ##### gnu/lib/libg2c #####
45 mkdir
-p $_OUTDIR/lib
/libg2c
3/arch
/$MACHINE_ARCH
47 write_c
$_OUTDIRBASE/lib
/libg2c
3/arch
/$MACHINE_ARCH/config.h
<$_TMPDIR/$_PLATFORM/libf2c
/libU77
/config.h
48 write_c
$_OUTDIRBASE/lib
/libg2c
3/arch
/$MACHINE_ARCH/g2c.h
<$_TMPDIR/$_PLATFORM/libf2c
/g2c.h
51 getvars
$_PLATFORM/libf2c
/Makefile \
53 getvars
$_PLATFORM/libf2c
/libF77
/Makefile \
55 getvars
$_PLATFORM/libf2c
/libI77
/Makefile \
56 ALL_CFLAGS OBJS |
sed 's,=,+=,'
57 getvars
$_PLATFORM/libf2c
/libU77
/Makefile \
58 ALL_CFLAGS OBJS |
sed 's,=,+=,'
59 } | write_mk
$_OUTDIRBASE/lib
/libg2c
3/arch
/$MACHINE_ARCH/defs.mk
62 ##### gnu/lib/libgcc #####
64 get_libgcc_list_funcs_asm
() {
66 getvars gcc
/Makefile LIB1ASMFUNCS |
{
67 # print newline separated list
75 getvars gcc
/Makefile LIB2FUNCS_EXTRA |
{
76 # print newline separated list
84 /\.S$/ { s,^.*/,,; s,\.S$,,; p; }
85 /\.asm$/ { s,^.*/,,; s,\.asm$,,; p; }
100 get_libgcc_list_funcs_lib
() {
102 local _lib_prefix
=${_lib%.*}
103 local _lib_suffix
=${_lib#*.}
104 local _abi
=${2:-'\.'}
106 cat build
/gcc
/libgcc.mk | \
107 grep '/'${_abi}'/' | \
109 /^'${_abi}'\/'${_lib_prefix}'\.'${_lib_suffix}': .*\.o$/ {
117 get_libgcc_list_objs_libs
() {
118 local _abi
=${1:-'\.'}
120 cat build
/gcc
/libgcc.mk | \
121 grep '/'${_abi}'/' | \
122 egrep '^'${_abi}'\/(libgcc_s\.so|libgcc\.a|libgcc_eh\.a|libgcov\.a): (libgcc_s|libgcc|libgcc_eh|libgcov)\/.*\.o$' | \
126 s,^\(.*\) \(.*\)$,\2 \1,
130 get_libgcc_list_objs_srcs
() {
131 local _abi
=${1:-'\.'} # XXX not used
133 if [ -e $_TOP/${libgcc_db_funcs}.S
]; then
134 cut
-f1 $_TOP/${libgcc_db_objs_libs} |
sed -e 's,\.o$,,' | \
135 comm -23 /dev
/stdin
$_TOP/${libgcc_db_funcs}.S | \
136 sed -e 's,\(.*\),\1.o \1.c,'
138 cut
-f1 $_TOP/${libgcc_db_objs_libs} |
sed -e 's,\.o$,,' | \
139 comm -12 /dev
/stdin
$_TOP/${libgcc_db_funcs}.S | \
140 sed -e 's,\(.*\),\1.o \1.S,'
142 cut
-f1 $_TOP/${libgcc_db_objs_libs} |
sed -e 's,\.o$,,' | \
143 sed -e 's,\(.*\),\1.o \1.c,'
147 get_libgcc_list_objs_tmplsrcs
() {
148 local _abi
=${1:-'\.'}
150 grep 'GCC_FOR_TARGET.*\.o$' build
/gcc
/libgcc.mk | \
151 grep '/'${_abi}'/' | \
153 s,^.* -c \([^ ]*\).* -o .*/\([^ ]*\.o\)$,\2 \1,
161 get_libgcc_list_objs_xflags
() {
163 local _abi
=${2:-'\.'}
165 grep 'GCC_FOR_TARGET.*\.o$' build
/gcc
/libgcc.mk | \
166 grep '/'${_abi}'/' | \
171 s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\5 \2/p
173 s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\1 \3 \4\/\5/
179 get_libgcc_list_objs_cppflags
() {
180 get_libgcc_list_objs_xflags D
$1
183 get_libgcc_list_objs_copts
() {
184 get_libgcc_list_objs_xflags fmx
$1
187 get_libgcc_list_tmplsrcs
() {
189 local _abi
=$2 # XXX not used
190 local _tmplallsrcs
=$
( mktemp
/tmp
/mknative-gcc._tmplallsrcs.XXXXXX
)
192 touch $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.
${_lib%.*}
193 touch $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.
${_lib%.*}
194 touch $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.
${_lib%.*}
197 local _lib_prefix
=${_lib%.*}
198 local _lib_suffix
=${_lib#*.}
199 join $_TOP/$libgcc_db_objs_libs $_TOP/$libgcc_db_objs_tmplsrcs | \
200 grep ${_lib_prefix}'\.'${_lib_suffix} | cut
-d' ' -f 3 |
sort -u > \
203 # TMPLFPSRCS = [fdp]p-bit.c
204 grep '[fdt]p-bit\.c' <$_tmplallsrcs |
sort -u | \
205 writefile
${libgcc_db_tmplsrcs}.tmplfpsrcs.
${_lib%.*}
207 # TMPLASMSRCS = $(LIB1ASMSRC)
208 grep '\$(LIB1ASMSRC)' <$_tmplallsrcs |
sort -u | \
209 writefile
${libgcc_db_tmplsrcs}.tmplasmsrcs.
${_lib%.*}
211 # TMPLSRCS is anything else; exclude TMPLFPSRCS and TMPLASMSRCS
212 cat $_tmplallsrcs | \
213 comm -23 /dev
/stdin
$_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.
${_lib%.*} | \
214 comm -23 /dev
/stdin
$_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.
${_lib%.*} | \
215 writefile
${libgcc_db_tmplsrcs}.tmplsrcs.
${_lib%.*}
220 get_libgcc_new_analyze
() {
223 mkdir
-p $_TOP/${_machine_arch_subdir}
225 touch $_TOP/${libgcc_db_funcs}.S
226 get_libgcc_list_funcs_asm | \
227 writefile
${libgcc_db_funcs}.S
229 for _lib
in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a
; do
230 touch $_TOP/${libgcc_db_funcs}.
${_lib%.*}
231 get_libgcc_list_funcs_lib
$_lib $_abi | \
232 writefile
${libgcc_db_funcs}.
${_lib%.*}
235 get_libgcc_list_objs_libs
$_abi | writefile
${libgcc_db_objs_libs}
236 get_libgcc_list_objs_srcs
$_abi | writefile
${libgcc_db_objs_srcs}
237 get_libgcc_list_objs_tmplsrcs
$_abi | writefile
${libgcc_db_objs_tmplsrcs}
238 get_libgcc_list_objs_cppflags
$_abi | writefile
${libgcc_db_objs_cppflags}
239 get_libgcc_list_objs_copts
$_abi | writefile
${libgcc_db_objs_copts}
241 for _lib
in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a
; do
242 get_libgcc_list_tmplsrcs
$_lib $_abi
248 get_libgcc_gen_tmplsrcs_tmplsrcs
() {
252 printf 'TMPLSRCS.%s = \\\n' $_lib
253 sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.
${_lib%.*}
256 get_libgcc_gen_tmplsrcs_tmplfpsrcs
() {
260 printf 'TMPLFPSRCS.%s = \\\n' $_lib
261 sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.
${_lib%.*}
264 get_libgcc_gen_tmplsrcs_tmplasmsrcs
() {
268 printf 'TMPLASMSRCS.%s = \\\n' $_lib
269 sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.
${_lib%.*} | \
270 sed -e 's,LIB1ASMSRC,G_&,'
273 get_libgcc_gen_srcs
() {
277 printf 'SRCS.%s = \\\n' $_lib
278 if [ -e $_TOP/${libgcc_db_funcs}.S
]; then
279 comm -23 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
280 sed -e 's,$,.c,; s,^,tmp_,'
281 comm -12 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
282 sed -e 's,$,.S,; s,^,tmp_,'
284 cat $_TOP/${libgcc_db_funcs}.
${_lib%.*} | \
285 sed -e 's,$,.c,; s,^,tmp_,'
287 sed -e 's,^, ,; s,$, \\,'
291 local _obj
=$1; local _key
=$2
293 eval grep \^
$_obj\\\ \
$_TOP/\
${libgcc_db_objs_${_key}} | cut
-f2
296 get_libgcc_gen_srcs_tmplsrcs
() {
297 cut
-f1 $_TOP/${libgcc_db_objs_libs} | \
299 printf 'SRCS.tmp_%s=%s\n' \
300 "$( _lookup_objs $_obj srcs )" \
301 "$( _lookup_objs $_obj tmplsrcs )"
303 sed -e 's,\$(\(.*\)),${G_\1},'
306 get_libgcc_gen_srcs_cppflags
() {
307 cut
-f1 $_TOP/${libgcc_db_objs_libs} | \
309 printf '_CPPFLAGS.tmp_%s=%s\n' \
310 "$( _lookup_objs $_obj srcs )" \
311 "$( _lookup_objs $_obj cppflags | xargs )"
315 get_libgcc_gen_srcs_copts
() {
316 cut
-f1 $_TOP/${libgcc_db_objs_libs} | \
318 printf 'COPTS.tmp_%s=%s\n' \
319 "$( _lookup_objs $_obj srcs )" \
320 "$( _lookup_objs $_obj copts | xargs )"
324 get_libgcc_new_generate
() {
327 for _lib
in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a
; do
328 for _tmpl
in tmplsrcs tmplfpsrcs tmplasmsrcs
; do
329 eval get_libgcc_gen_tmplsrcs_
${_tmpl} $_lib | \
330 write_mk
${libgcc_libs_mk}.${_lib%.*}.tmplsrcs.${_tmpl}.mk
333 get_libgcc_gen_srcs
$_lib | \
334 write_mk
${libgcc_libs_mk}.
${_lib%.*}.srcs.mk
337 for _arg
in tmplsrcs cppflags copts
; do
338 eval get_libgcc_gen_srcs_
${_arg} | \
339 eval writefile \
$libgcc_srcs_mk_${_arg}
349 # List of generated files.
351 _machine_arch_subdir
=$_OUTDIRBASE/lib
/lib
$_subdir/arch
${_archsubdir}/$MACHINE_ARCH/$_abi
353 libgcc_db_funcs
=${_machine_arch_subdir}/funcs
354 libgcc_db_tmplsrcs
=${_machine_arch_subdir}/tmplsrcs
355 libgcc_db_objs_libs
=${_machine_arch_subdir}/objs.libs
356 libgcc_db_objs_srcs
=${_machine_arch_subdir}/objs.srcs
357 libgcc_db_objs_tmplsrcs
=${_machine_arch_subdir}/objs.tmplsrcs
358 libgcc_db_objs_cppflags
=${_machine_arch_subdir}/objs.cppflags
359 libgcc_db_objs_copts
=${_machine_arch_subdir}/objs.copts
361 get_libgcc_new_analyze
$_abi
363 libgcc_libs_mk
=${_machine_arch_subdir}/libs
364 libgcc_srcs_mk
=${_machine_arch_subdir}/srcs.mk
365 libgcc_srcs_mk_tmplsrcs
=${_machine_arch_subdir}/srcs.tmplsrcs.mk
366 libgcc_srcs_mk_cppflags
=${_machine_arch_subdir}/srcs.cppflags.mk
367 libgcc_srcs_mk_copts
=${_machine_arch_subdir}/srcs.copts.mk
369 get_libgcc_new_generate
$_abi
374 mkdir
-p $_OUTDIR/lib
/lib
$_subdir/arch
378 _extravars
="COLLECT2 UNWIND_H xm_include_list"
383 # DPBIT, FPBIT only used on mn10[23]00, we don't need them.
384 # XXX we should probably grab everything Just In Case for
387 getvars gcc
/Makefile \
388 INCLUDES LIB2ADD LIB2ADDEH LIB2ADD_ST \
389 LIB1ASMFUNCS LIB1ASMSRC \
390 LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \
393 SHLIB_MKMAP SHLIB_MKMAP_OPTS \
394 SHLIB_MAPFILES SHLIB_NM_FLAGS \
395 EXTRA_HEADERS xm_defines \
396 tm_defines
${_extravars}
397 } |
sed "s,-I$_DESTDIR/usr/include,,g" \
398 | write_mk
$_OUTDIRBASE/lib
/lib
$_subdir/arch
${_archsubdir}/$MACHINE_ARCH.mk
400 # Generate new style files.
401 if [ -n "${MKNATIVE_LIBGCC_NEW}" ]; then
402 get_libgcc_new
$_subdir $_ABI
406 ##### gnu/lib/libgcov #####
411 mkdir
-p $_OUTDIR/lib
/lib
$_subdir/libgcov
/arch
/$MACHINE_ARCH
414 getvars gcc
/Makefile \
416 } | write_mk
$_OUTDIRBASE/lib
/lib
$_subdir/libgcov
/arch
/$MACHINE_ARCH/defs.mk
418 write_c
$_OUTDIRBASE/lib
/lib
$_subdir/libgcov
/arch
/$MACHINE_ARCH/gcov-iov.h \
419 <$_TMPDIR/gcc
/gcov-iov.h
423 ##### gnu/usr.bin/gcc[34]/libiberty #####
425 get_gcc_libiberty
() {
429 _libibertydir
="usr.bin/$_subdir/libiberty"
432 _libibertydir
="lib/libiberty"
435 mkdir
-p $_OUTDIR/$_libibertydir/arch
/$MACHINE_ARCH
437 getvars libiberty
/Makefile \
438 ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
439 | write_mk
$_OUTDIRBASE/$_libibertydir/defs.mk
441 write_c
$_OUTDIRBASE/$_libibertydir/arch
/$MACHINE_ARCH/config.h \
442 <$_TMPDIR/libiberty
/config.h
445 ##### lib/libdecnumber #####
447 get_libdecnumber
() {
450 mkdir
-p $_OUTDIR/usr.bin
/$_subdir/arch
/$MACHINE_ARCH
451 write_c
$_OUTDIRBASE/usr.bin
/$_subdir/arch
/$MACHINE_ARCH/config.h \
452 <$_TMPDIR/libdecnumber
/config.h
455 ##### lib/libgomp #####
460 mkdir
-p $_OUTDIR/lib
/$_subdir/arch
/$MACHINE_ARCH
461 write_c
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/config.h \
462 <$_TMPDIR/$_PLATFORM/libgomp
/config.h
463 write_c
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/libgomp_f.h \
464 <$_TMPDIR/$_PLATFORM/libgomp
/libgomp_f.h
465 write_mk
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/libgomp.spec \
466 <$_TMPDIR/$_PLATFORM/libgomp
/libgomp.spec
467 write_c
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/omp.h \
468 <$_TMPDIR/$_PLATFORM/libgomp
/omp.h
471 ##### gnu/lib/libobjc #####
474 _subdir
="$1/arch/$MACHINE_ARCH"
475 _options
="ALL_OPT_FILES"
478 mkdir
-p $_OUTDIR/lib
/$_subdir
481 if [ -n "$_options" ]; then
482 getvars gcc
/Makefile
$_options
484 getvars
$_PLATFORM/libobjc
/Makefile \
485 ALL_CFLAGS INCLUDES OBJS OBJC_H \
486 |
sed "s,$_GNU_DIST,\${GNUHOSTDIST},g"
487 if [ -n "$_unwind" ]; then
488 getvars gcc
/Makefile
$_unwind
490 } | write_mk
$_OUTDIRBASE/lib
/$_subdir/defs.mk
492 write_c
$_OUTDIRBASE/lib
/$_subdir/config.h \
493 <$_TMPDIR/$_PLATFORM/libobjc
/config.h
496 ##### gnu/lib/libstdc++-v3 #####
498 get_libstdcxx_v3
() {
500 mkdir
-p $_OUTDIR/lib
/$_subdir/arch
/$MACHINE_ARCH
504 _src_CC_files
="atomicity_file CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_CC CLOCALE_CC BASIC_FILE_CC"
505 _headers1
="host_headers debug_headers tr1_headers c_compatibility_headers_extra tr1_impl_headers parallel_headers decimal_headers"
506 _headers2
="thread_host_headers host_headers_extra"
507 _build_headers
="c++allocator.h c++config.h cxxabi_tweaks.h gthr-default.h gthr-posix.h gthr-single.h gthr-tpf.h gthr.h"
513 for h
in $_build_headers; do
514 write_c
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/$h \
515 <$_TMPDIR/$_PLATFORM/libstdc
++-v3/include
/$_PLATFORM/bits
/$h
518 write_c
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/config.h \
519 <$_TMPDIR/$_PLATFORM/libstdc
++-v3/config.h
520 write_c
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/gstdint.h \
521 <$_TMPDIR/$_PLATFORM/libstdc
++-v3/include
/gstdint.h
525 getvars
$_PLATFORM/libstdc
++-v3/libsupc
++/Makefile \
526 sources |
sed 's/^G_sources=/G_LIBSUPCXX_SOURCES=/'
527 getvars
$_PLATFORM/libstdc
++-v3/libsupc
++/Makefile \
528 c_sources |
sed 's/^G_c_sources=/G_LIBSUPCXX_C_SOURCES=/'
531 getvars
$_PLATFORM/libstdc
++-v3/src
/Makefile \
532 sources
$_src_CC_files SECTION_FLAGS |
sed 's/^G_sources=/G_SRC_SOURCES=/'
535 getvars
$_PLATFORM/libstdc
++-v3/include
/Makefile \
536 c_base_headers std_headers |
sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
537 getvars
$_PLATFORM/libstdc
++-v3/include
/Makefile \
538 bits_headers backward_headers ext_headers c_base_headers_extra \
539 $_headers1 |
sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
540 getvars
$_PLATFORM/libstdc
++-v3/include
/Makefile \
541 $_headers2 |
sed -e 's#\./[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
543 if [ -n "$_unwind" ]; then
544 getvars gcc
/Makefile
$_unwind
546 } | write_mk
$_OUTDIRBASE/lib
/$_subdir/arch
/$MACHINE_ARCH/defs.mk
549 ##### gnu/usr.bin/gcc3 #####
551 get_gcc_bootstrap
() {
553 mkdir
-p $_OUTDIR/usr.bin
/$_subdir/arch
/$MACHINE_ARCH
554 for f
in auto-host tm config gthr-default
; do
555 write_c
$_OUTDIRBASE/usr.bin
/$_subdir/arch
/$MACHINE_ARCH/$f.h
<$_TMPDIR/gcc
/$f.h
561 mkdir
-p $_OUTDIR/usr.bin
/$_subdir/arch
/$MACHINE_ARCH
562 mkdir
-p $_OUTDIR/usr.bin
/libcpp
/arch
/$MACHINE_ARCH
567 _extravars
="TM_H ALL_OPT_FILES"
569 _extravars2
="tm_file_list build_xm_include_list"
570 _extravars3
="tm_p_include_list"
576 _extravars
="TM_H ALL_OPT_FILES"
578 _extravars2
="tm_file_list build_xm_include_list"
579 _extravars3
="tm_p_include_list"
584 getvars gcc
/Makefile \
585 ${_buildname}EARLY_SUPPORT ${_buildname}ERRORS ${_buildname}PRINT \
586 ${_buildname}RTL ${_buildname}SUPPORT ${_buildname}VARRAY | \
587 sed -e 's#build/errors.o#build-errors.o#g' \
588 -e 's#build/print-rtl.o#build-print-rtl.o#g' \
589 -e 's#build/rtl.o#build-rtl.o#g' \
590 -e 's#build/varray.o#build-varray.o#g' \
591 -e 's#build/ggc-none.o#build-ggc-none.o#g' \
593 getvars gcc
/Makefile \
594 ALL_CFLAGS ALL_CPPFLAGS C_AND_OBJC_OBJS C_OBJS CCCP_OBJS \
595 GCOV_OBJS PROTO_OBJS
${_extravars1} \
596 INCLUDES md_file OBJC_OBJS OBJS out_file version \
597 BUILD_PREFIX RTL_H TREE_H
${_hconfig_h} BASIC_BLOCK_H GCC_H \
598 GTFILES_SRCDIR GTFILES_FILES_FILES GTFILES_FILES_LANGS \
599 GTFILES GTFILES_LANG_DIR_NAMES \
600 tm_defines host_xm_file host_xm_defines tm_p_file \
601 target_cpu_default
${_extravars} ${_extravars2} \
602 lang_specs_files
${_extravars3} \
603 |
sed "s,-I$_DESTDIR/usr/include,,g"
604 getvars gcc
/Makefile \
605 LIB2ADDEHDEP |
sed 's/unwind.inc//'
606 getvars gcc
/Makefile \
607 CXX_OBJS CXX_C_OBJS |
sed 's/cp\///g'
608 getvars gcc
/Makefile \
609 F77_OBJS |
sed 's/f\///g'
612 getvars libcpp
/Makefile \
616 getvars gcc
/Makefile \
620 getvars gcc
/Makefile \
624 echo G_SHLIB_LINK
="$CC -shared"
625 echo G_SHLIB_MULTILIB
=.
628 } | write_mk
$_OUTDIRBASE/usr.bin
/$_subdir/arch
/$MACHINE_ARCH/defs.mk
632 write_c
$_OUTDIRBASE/usr.bin
/$_subdir/libcpp
/arch
/$MACHINE_ARCH/config.h
<$_TMPDIR/libcpp
/config.h
633 hfiles
='auto-host gencheck configargs gthr-default tm bconfig config multilib'
636 write_c
$_OUTDIRBASE/usr.bin
/libcpp
/arch
/$MACHINE_ARCH/config.h
<$_TMPDIR/libcpp
/config.h
637 hfiles
='auto-host configargs gthr-default tm bconfig config multilib bversion plugin-version'
641 write_c
$_OUTDIRBASE/usr.bin
/$_subdir/arch
/$MACHINE_ARCH/$f.h
<$_TMPDIR/gcc
/$f.h
642 if [ "${MACHINE_ARCH}" = "powerpc" -a "${f}" = "configargs" ]
644 ex
<<__EOF__ $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h
645 /configuration_arguments/ s/$//
651 s/";$/ -with-float=soft";/
657 /configure_default_options/ s/{ NULL.*$//
671 for f
in all-tree.def
; do
672 cp $_TMPDIR/gcc
/$f $_OUTDIR/usr.bin
/$_subdir/arch
/$MACHINE_ARCH/$f
676 for f
in gtyp-input.list
; do
677 sed -e 's/^.*external\/gpl3\/gcc\/dist/SRCDIR/' < $_TMPDIR/gcc
/$f > $_OUTDIR/usr.bin
/$_subdir/arch
/$MACHINE_ARCH/$f
681 if [ "${MACHINE_ARCH}" = "sh3el" -o "${MACHINE_ARCH}" = "sh3eb" ]; then
682 write_c
$_OUTDIRBASE/usr.bin
/$_subdir/arch
/$MACHINE_ARCH/sysroot-suffix.h
<$_TMPDIR/gcc
/sysroot-suffix.h
689 # .mk and .h files for libgcc bootstrap (from host build)
692 get_crtstuff crtstuff3
698 get_crtstuff crtstuff4
703 _OUTDIR
="$_TOP/external/gpl3/gcc"
704 _OUTDIRBASE
="external/gpl3/gcc"
706 get_crtstuff crtstuff
708 get_gcc_bootstrap gcc
717 get_crtstuff crtstuff4
718 get_gcc_libiberty gcc4
720 get_libstdcxx_v3 libstdc
++-v3_4
725 _OUTDIR
="$_TOP/external/gpl3/gcc"
726 _OUTDIRBASE
="external/gpl3/gcc"
730 get_crtstuff crtstuff
731 get_gcc_libiberty gcc
733 get_libstdcxx_v3 libstdc
++-v3
734 get_libdecnumber libdecnumber
740 *) echo invalid arguments
; exit 1;;