2 # $NetBSD: mknative-gcc.old,v 1.1 2014/02/26 09:54:34 mrg Exp $
4 # was: NetBSD: mknative-gcc,v 1.75 2014/02/16 11:26:31 skrll Exp
6 # Shell script for generating all the constants needed for a native
7 # platform build of gcc.
10 # XXX split out GCC 4.1 support
20 _VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
21 _GNU_DIST=`cd ${_VPATH}; pwd`
23 if [ -z "$_DESTDIR" ]; then
24 echo "\$_DESTDIR is empty" 2>&1
28 . $_TOP/tools/gcc/mknative.common
30 # default to GCC 4.1 for now
34 sanitise_includes () {
36 -e "s,-I$_DESTDIR/usr/include,,g" \
37 -e "s,-I$_SRC/external/lgpl3/mpfr/dist/src,,g" \
38 -e "s,-I$_SRC/external/lgpl3/mpc/dist/src,,g" \
39 -e "s,-I$_SRC/external/lgpl3/gmp/lib/libgmp/arch/$MACHINE_ARCH,,g" \
40 -e "s,-I/usr/include/[^ ]*,,"
43 ##### gnu/lib/crtstuff #####
47 mkdir -p $_OUTDIR/lib/$_subdir/arch
49 getvars gcc/Makefile \
50 INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS CRTSTUFF_T_CFLAGS_S \
51 tm_defines xm_file xm_defines \
53 | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH.mk
56 ##### gnu/lib/libg2c #####
59 mkdir -p $_OUTDIR/lib/libg2c3/arch/$MACHINE_ARCH
61 write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h
62 write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h
65 getvars $_PLATFORM/libf2c/Makefile \
67 getvars $_PLATFORM/libf2c/libF77/Makefile \
69 getvars $_PLATFORM/libf2c/libI77/Makefile \
70 ALL_CFLAGS OBJS | sed 's,=,+=,'
71 getvars $_PLATFORM/libf2c/libU77/Makefile \
72 ALL_CFLAGS OBJS | sed 's,=,+=,'
73 } | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/defs.mk
76 ##### gnu/lib/libgcc #####
78 get_libgcc_list_funcs_asm () {
80 getvars gcc/Makefile LIB1ASMFUNCS | {
81 # print newline separated list
89 getvars gcc/Makefile LIB2FUNCS_EXTRA | {
90 # print newline separated list
98 /\.S$/ { s,^.*/,,; s,\.S$,,; p; }
99 /\.asm$/ { s,^.*/,,; s,\.asm$,,; p; }
103 # print foo and foo_s
114 get_libgcc_list_funcs_lib () {
116 local _lib_prefix=${_lib%.*}
117 local _lib_suffix=${_lib#*.}
118 local _abi=${2:-'\.'}
120 cat build/gcc/libgcc.mk | \
121 grep '/'${_abi}'/' | \
123 /^'${_abi}'\/'${_lib_prefix}'\.'${_lib_suffix}': .*\.o$/ {
131 get_libgcc_list_objs_libs () {
132 local _abi=${1:-'\.'}
134 cat build/gcc/libgcc.mk | \
135 grep '/'${_abi}'/' | \
136 egrep '^'${_abi}'\/(libgcc_s\.so|libgcc\.a|libgcc_eh\.a|libgcov\.a): (libgcc_s|libgcc|libgcc_eh|libgcov)\/.*\.o$' | \
140 s,^\(.*\) \(.*\)$,\2 \1,
144 get_libgcc_list_objs_srcs () {
145 local _abi=${1:-'\.'} # XXX not used
147 if [ -e $_TOP/${libgcc_db_funcs}.S ]; then
148 cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
149 comm -23 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
150 sed -e 's,\(.*\),\1.o \1.c,'
152 cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
153 comm -12 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
154 sed -e 's,\(.*\),\1.o \1.S,'
156 cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
157 sed -e 's,\(.*\),\1.o \1.c,'
161 get_libgcc_list_objs_tmplsrcs () {
162 local _abi=${1:-'\.'}
164 grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \
165 grep '/'${_abi}'/' | \
167 s,^.* -c \([^ ]*\).* -o .*/\([^ ]*\.o\)$,\2 \1,
175 get_libgcc_list_objs_xflags () {
177 local _abi=${2:-'\.'}
179 grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \
180 grep '/'${_abi}'/' | \
185 s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\5 \2/p
187 s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\1 \3 \4\/\5/
193 get_libgcc_list_objs_cppflags () {
194 get_libgcc_list_objs_xflags D $1
197 get_libgcc_list_objs_copts () {
198 get_libgcc_list_objs_xflags fmx $1
201 get_libgcc_list_tmplsrcs () {
203 local _abi=$2 # XXX not used
204 local _tmplallsrcs=$( mktemp /tmp/mknative-gcc._tmplallsrcs.XXXXXX )
206 touch $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
207 touch $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
208 touch $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*}
211 local _lib_prefix=${_lib%.*}
212 local _lib_suffix=${_lib#*.}
213 join $_TOP/$libgcc_db_objs_libs $_TOP/$libgcc_db_objs_tmplsrcs | \
214 grep ${_lib_prefix}'\.'${_lib_suffix} | cut -d' ' -f 3 | sort -u > \
217 # TMPLFPSRCS = [fdp]p-bit.c
218 grep '[fdt]p-bit\.c' <$_tmplallsrcs | sort -u | \
219 writefile ${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
221 # TMPLASMSRCS = $(LIB1ASMSRC)
222 grep '\$(LIB1ASMSRC)' <$_tmplallsrcs | sort -u | \
223 writefile ${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*}
225 # TMPLSRCS is anything else; exclude TMPLFPSRCS and TMPLASMSRCS
226 cat $_tmplallsrcs | \
227 comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*} | \
228 comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} | \
229 writefile ${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
234 get_libgcc_new_analyze () {
237 mkdir -p $_TOP/${_machine_arch_subdir}
239 touch $_TOP/${libgcc_db_funcs}.S
240 get_libgcc_list_funcs_asm | \
241 writefile ${libgcc_db_funcs}.S
243 for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
244 touch $_TOP/${libgcc_db_funcs}.${_lib%.*}
245 get_libgcc_list_funcs_lib $_lib $_abi | \
246 writefile ${libgcc_db_funcs}.${_lib%.*}
249 get_libgcc_list_objs_libs $_abi | writefile ${libgcc_db_objs_libs}
250 get_libgcc_list_objs_srcs $_abi | writefile ${libgcc_db_objs_srcs}
251 get_libgcc_list_objs_tmplsrcs $_abi | writefile ${libgcc_db_objs_tmplsrcs}
252 get_libgcc_list_objs_cppflags $_abi | writefile ${libgcc_db_objs_cppflags}
253 get_libgcc_list_objs_copts $_abi | writefile ${libgcc_db_objs_copts}
255 for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
256 get_libgcc_list_tmplsrcs $_lib $_abi
262 get_libgcc_gen_tmplsrcs_tmplsrcs () {
266 printf 'TMPLSRCS.%s = \\\n' $_lib
267 sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
270 get_libgcc_gen_tmplsrcs_tmplfpsrcs () {
274 printf 'TMPLFPSRCS.%s = \\\n' $_lib
275 sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
278 get_libgcc_gen_tmplsrcs_tmplasmsrcs () {
282 printf 'TMPLASMSRCS.%s = \\\n' $_lib
283 sed -e 's,^, ,; s,$, \\,' $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} | \
284 sed -e 's,LIB1ASMSRC,G_&,'
287 get_libgcc_gen_srcs () {
291 printf 'SRCS.%s = \\\n' $_lib
292 if [ -e $_TOP/${libgcc_db_funcs}.S ]; then
293 comm -23 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
294 sed -e 's,$,.c,; s,^,tmp_,'
295 comm -12 $_TOP/${libgcc_db_funcs}.${_lib%.*} $_TOP/${libgcc_db_funcs}.S | \
296 sed -e 's,$,.S,; s,^,tmp_,'
298 cat $_TOP/${libgcc_db_funcs}.${_lib%.*} | \
299 sed -e 's,$,.c,; s,^,tmp_,'
301 sed -e 's,^, ,; s,$, \\,'
305 local _obj=$1; local _key=$2
307 eval grep \^$_obj\\\ \$_TOP/\${libgcc_db_objs_${_key}} | cut -f2
310 get_libgcc_gen_srcs_tmplsrcs () {
311 cut -f1 $_TOP/${libgcc_db_objs_libs} | \
313 printf 'SRCS.tmp_%s=%s\n' \
314 "$( _lookup_objs $_obj srcs )" \
315 "$( _lookup_objs $_obj tmplsrcs )"
317 sed -e 's,\$(\(.*\)),${G_\1},'
320 get_libgcc_gen_srcs_cppflags () {
321 cut -f1 $_TOP/${libgcc_db_objs_libs} | \
323 printf '_CPPFLAGS.tmp_%s=%s\n' \
324 "$( _lookup_objs $_obj srcs )" \
325 "$( _lookup_objs $_obj cppflags | xargs )"
329 get_libgcc_gen_srcs_copts () {
330 cut -f1 $_TOP/${libgcc_db_objs_libs} | \
332 printf 'COPTS.tmp_%s=%s\n' \
333 "$( _lookup_objs $_obj srcs )" \
334 "$( _lookup_objs $_obj copts | xargs )"
338 get_libgcc_new_generate () {
341 for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do
342 for _tmpl in tmplsrcs tmplfpsrcs tmplasmsrcs; do
343 eval get_libgcc_gen_tmplsrcs_${_tmpl} $_lib | \
344 write_mk ${libgcc_libs_mk}.${_lib%.*}.tmplsrcs.${_tmpl}.mk
347 get_libgcc_gen_srcs $_lib | \
348 write_mk ${libgcc_libs_mk}.${_lib%.*}.srcs.mk
351 for _arg in tmplsrcs cppflags copts; do
352 eval get_libgcc_gen_srcs_${_arg} | \
353 eval writefile \$libgcc_srcs_mk_${_arg}
363 # List of generated files.
365 _machine_arch_subdir=$_OUTDIRBASE/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH/$_abi
367 libgcc_db_funcs=${_machine_arch_subdir}/funcs
368 libgcc_db_tmplsrcs=${_machine_arch_subdir}/tmplsrcs
369 libgcc_db_objs_libs=${_machine_arch_subdir}/objs.libs
370 libgcc_db_objs_srcs=${_machine_arch_subdir}/objs.srcs
371 libgcc_db_objs_tmplsrcs=${_machine_arch_subdir}/objs.tmplsrcs
372 libgcc_db_objs_cppflags=${_machine_arch_subdir}/objs.cppflags
373 libgcc_db_objs_copts=${_machine_arch_subdir}/objs.copts
375 get_libgcc_new_analyze $_abi
377 libgcc_libs_mk=${_machine_arch_subdir}/libs
378 libgcc_srcs_mk=${_machine_arch_subdir}/srcs.mk
379 libgcc_srcs_mk_tmplsrcs=${_machine_arch_subdir}/srcs.tmplsrcs.mk
380 libgcc_srcs_mk_cppflags=${_machine_arch_subdir}/srcs.cppflags.mk
381 libgcc_srcs_mk_copts=${_machine_arch_subdir}/srcs.copts.mk
383 get_libgcc_new_generate $_abi
388 mkdir -p $_OUTDIR/lib/lib$_subdir/arch
392 _extravars="COLLECT2 UNWIND_H xm_include_list"
397 # DPBIT, FPBIT only used on mn10[23]00, we don't need them.
398 # XXX we should probably grab everything Just In Case for
401 getvars gcc/Makefile \
402 INCLUDES LIB2ADD LIB2ADDEH LIB2ADD_ST \
403 LIB1ASMFUNCS LIB1ASMSRC \
404 LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \
407 SHLIB_MKMAP SHLIB_MKMAP_OPTS \
408 SHLIB_MAPFILES SHLIB_NM_FLAGS \
409 EXTRA_HEADERS xm_defines \
410 tm_defines ${_extravars}
411 } | sanitise_includes \
412 | write_mk $_OUTDIRBASE/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH.mk
414 # Generate new style files.
415 if [ -n "${MKNATIVE_LIBGCC_NEW}" ]; then
416 get_libgcc_new $_subdir $_ABI
420 ##### gnu/lib/libgcov #####
425 mkdir -p $_OUTDIR/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH
428 getvars gcc/Makefile \
430 } | write_mk $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/defs.mk
432 write_c $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/gcov-iov.h \
433 <$_TMPDIR/gcc/gcov-iov.h
437 ##### gnu/usr.bin/gcc[34]/libiberty #####
439 get_gcc_libiberty () {
443 _libibertydir="usr.bin/$_subdir/libiberty"
446 _libibertydir="lib/libiberty"
449 mkdir -p $_OUTDIR/$_libibertydir/arch/$MACHINE_ARCH
451 getvars libiberty/Makefile \
452 ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
453 | write_mk $_OUTDIRBASE/$_libibertydir/defs.mk
455 write_c $_OUTDIRBASE/$_libibertydir/arch/$MACHINE_ARCH/config.h \
456 <$_TMPDIR/libiberty/config.h
459 ##### lib/libdecnumber #####
461 get_libdecnumber () {
464 mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
465 write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/config.h \
466 <$_TMPDIR/libdecnumber/config.h
469 ##### lib/libgomp #####
474 mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
475 write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
476 <$_TMPDIR/$_PLATFORM/libgomp/config.h
477 write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp_f.h \
478 <$_TMPDIR/$_PLATFORM/libgomp/libgomp_f.h
479 write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp.spec \
480 <$_TMPDIR/$_PLATFORM/libgomp/libgomp.spec
481 write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/omp.h \
482 <$_TMPDIR/$_PLATFORM/libgomp/omp.h
485 ##### gnu/lib/libobjc #####
488 _subdir="$1/arch/$MACHINE_ARCH"
489 _options="ALL_OPT_FILES"
492 mkdir -p $_OUTDIR/lib/$_subdir
495 if [ -n "$_options" ]; then
496 getvars gcc/Makefile $_options
498 getvars $_PLATFORM/libobjc/Makefile \
499 ALL_CFLAGS INCLUDES OBJS OBJC_H \
500 | sed "s,$_GNU_DIST,\${GNUHOSTDIST},g"
501 if [ -n "$_unwind" ]; then
502 getvars gcc/Makefile $_unwind
504 } | write_mk $_OUTDIRBASE/lib/$_subdir/defs.mk
506 write_c $_OUTDIRBASE/lib/$_subdir/config.h \
507 <$_TMPDIR/$_PLATFORM/libobjc/config.h
510 ##### gnu/lib/libstdc++-v3 #####
512 get_libstdcxx_v3 () {
514 mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
518 _src_CC_files="atomicity_file CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_CC CLOCALE_CC BASIC_FILE_CC"
519 _headers1="host_headers debug_headers tr1_headers c_compatibility_headers_extra tr1_impl_headers parallel_headers decimal_headers"
520 _headers2="thread_host_headers host_headers_extra"
521 _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"
527 for h in $_build_headers; do
528 write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/$h \
529 <$_TMPDIR/$_PLATFORM/libstdc++-v3/include/$_PLATFORM/bits/$h
532 write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
533 <$_TMPDIR/$_PLATFORM/libstdc++-v3/config.h
534 write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/gstdint.h \
535 <$_TMPDIR/$_PLATFORM/libstdc++-v3/include/gstdint.h
539 getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
540 sources | sed 's/^G_sources=/G_LIBSUPCXX_SOURCES=/'
541 getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
542 c_sources | sed 's/^G_c_sources=/G_LIBSUPCXX_C_SOURCES=/'
545 getvars $_PLATFORM/libstdc++-v3/src/Makefile \
546 sources $_src_CC_files SECTION_FLAGS | sed 's/^G_sources=/G_SRC_SOURCES=/'
549 getvars $_PLATFORM/libstdc++-v3/include/Makefile \
550 c_base_headers std_headers | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
551 getvars $_PLATFORM/libstdc++-v3/include/Makefile \
552 bits_headers backward_headers ext_headers c_base_headers_extra \
553 $_headers1 | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
554 getvars $_PLATFORM/libstdc++-v3/include/Makefile \
555 $_headers2 | sed -e 's#\./[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g'
557 if [ -n "$_unwind" ]; then
558 getvars gcc/Makefile $_unwind
560 } | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/defs.mk
563 ##### gnu/usr.bin/gcc* #####
565 get_gcc_bootstrap () {
567 mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
568 for f in auto-host tm config gthr-default; do
569 write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
575 mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
576 mkdir -p $_OUTDIR/usr.bin/libcpp/arch/$MACHINE_ARCH
581 _extravars="TM_H ALL_OPT_FILES"
583 _extravars2="tm_file_list build_xm_include_list"
584 _extravars3="tm_p_include_list"
590 _extravars="TM_H ALL_OPT_FILES"
592 _extravars2="tm_file_list build_xm_include_list"
593 _extravars3="tm_p_include_list"
598 getvars gcc/Makefile \
599 ${_buildname}EARLY_SUPPORT ${_buildname}ERRORS ${_buildname}PRINT \
600 ${_buildname}RTL ${_buildname}SUPPORT ${_buildname}VARRAY | \
601 sed -e 's#build/errors.o#build-errors.o#g' \
602 -e 's#build/print-rtl.o#build-print-rtl.o#g' \
603 -e 's#build/rtl.o#build-rtl.o#g' \
604 -e 's#build/varray.o#build-varray.o#g' \
605 -e 's#build/ggc-none.o#build-ggc-none.o#g' \
607 getvars gcc/Makefile \
608 ALL_CFLAGS ALL_CPPFLAGS C_AND_OBJC_OBJS C_OBJS CCCP_OBJS \
609 GCOV_OBJS PROTO_OBJS ${_extravars1} \
610 INCLUDES md_file OBJC_OBJS OBJS out_file version \
611 BUILD_PREFIX RTL_H TREE_H ${_hconfig_h} BASIC_BLOCK_H GCC_H \
612 GTFILES_SRCDIR GTFILES_FILES_FILES GTFILES_FILES_LANGS \
613 GTFILES GTFILES_LANG_DIR_NAMES \
614 tm_defines host_xm_file host_xm_defines tm_p_file \
615 target_cpu_default ${_extravars} ${_extravars2} \
616 lang_specs_files ${_extravars3} \
618 getvars gcc/Makefile \
619 LIB2ADDEHDEP | sed 's/unwind.inc//'
620 getvars gcc/Makefile \
621 CXX_OBJS CXX_C_OBJS | sed 's/cp\///g'
622 getvars gcc/Makefile \
623 F77_OBJS | sed 's/f\///g'
626 getvars libcpp/Makefile \
630 getvars gcc/Makefile \
634 echo G_SHLIB_LINK="$CC -shared"
635 echo G_SHLIB_MULTILIB=.
638 } | write_mk $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/defs.mk
642 write_c $_OUTDIRBASE/usr.bin/$_subdir/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h
643 hfiles='auto-host gencheck configargs gthr-default tm bconfig config multilib'
646 write_c $_OUTDIRBASE/usr.bin/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h
647 hfiles='auto-host configargs gthr-default tm bconfig config multilib bversion plugin-version'
651 write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
652 if [ "${MACHINE_ARCH}" = "powerpc" -a "${f}" = "configargs" ]
654 ex <<__EOF__ $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h
655 /configuration_arguments/ s/$//
661 s/";$/ -with-float=soft";/
667 /configure_default_options/ s/{ NULL.*$//
681 for f in all-tree.def; do
682 cp $_TMPDIR/gcc/$f $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f
686 for f in gtyp-input.list; do
687 sed -e 's/^.*external\/gpl3\/gcc\.old\/dist/SRCDIR/' < $_TMPDIR/gcc/$f > $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f
691 if [ "${MACHINE_ARCH}" = "sh3el" -o "${MACHINE_ARCH}" = "sh3eb" ]; then
692 write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/sysroot-suffix.h <$_TMPDIR/gcc/sysroot-suffix.h
699 # .mk and .h files for libgcc bootstrap (from host build)
703 get_crtstuff crtstuff4
708 _OUTDIR="$_TOP/external/gpl3/gcc.old"
709 _OUTDIRBASE="external/gpl3/gcc.old"
711 get_crtstuff crtstuff
713 get_gcc_bootstrap gcc
722 get_crtstuff crtstuff4
723 get_gcc_libiberty gcc4
725 get_libstdcxx_v3 libstdc++-v3_4
730 _OUTDIR="$_TOP/external/gpl3/gcc.old"
731 _OUTDIRBASE="external/gpl3/gcc.old"
735 get_crtstuff crtstuff
736 get_gcc_libiberty gcc
738 get_libstdcxx_v3 libstdc++-v3
739 get_libdecnumber libdecnumber
745 *) echo invalid arguments; exit 1;;