Home | History | Annotate | Line # | Download | only in gcc
mknative-gcc revision 1.113
      1 #!/bin/sh
      2 #	$NetBSD: mknative-gcc,v 1.113 2021/04/11 01:44:14 mrg Exp $
      3 #
      4 # Shell script for generating all the constants needed for a native
      5 # platform build of gcc.
      6 #
      7 # This version is for GCC 10.3
      8 
      9 # initialise
     10 
     11 _TMPDIR=$2
     12 _TOP=$3
     13 _SRC=$4
     14 _PLATFORM=$5
     15 _MACHINE_ARCH=$6
     16 _DESTDIR=$7
     17 _TOOLDIR=$8
     18 _VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ 	]*,,'`
     19 _GNU_DIST=`cd ${_VPATH}; pwd`
     20 
     21 if [ -z "$_DESTDIR" ]; then
     22 	echo "\$_DESTDIR is empty" 2>&1
     23 	exit 1
     24 fi
     25 
     26 . $_TOP/tools/gcc/mknative.common
     27 
     28 case $0 in
     29 	*mknative-gcc.old)
     30 		_OUTDIRBASE="external/gpl3/gcc.old"
     31 		;;
     32 	*)
     33 		_OUTDIRBASE="external/gpl3/gcc"
     34 		;;
     35 esac
     36 _OUTDIR="$_TOP/$_OUTDIRBASE"
     37 
     38 sanitise_includes () {
     39 	sed \
     40 		-e "s,-I$_DESTDIR/usr/include,,g" \
     41 		-e "s,-I$_SRC/external/lgpl3/mpfr/dist/src,,g" \
     42 		-e "s,-I$_SRC/external/lgpl3/mpc/dist/src,,g" \
     43 		-e "s,-I$_SRC/external/lgpl3/gmp/lib/libgmp/arch/[a-z_0-9-]*,,g" \
     44 		-e "s,-I$_TOOLDIR/include,,g" \
     45 		-e "s,-I/usr/include/[^ 	]*,,"
     46 }
     47 
     48 ##### lib/libg2c #####
     49 
     50 get_libg2c () {
     51 	mkdir -p $_OUTDIR/lib/libg2c3/arch/$_MACHINE_ARCH
     52 
     53 	write_c $_OUTDIRBASE/lib/libg2c3/arch/$_MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h
     54 	write_c $_OUTDIRBASE/lib/libg2c3/arch/$_MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h
     55 
     56 	{
     57 		getvars $_PLATFORM/libf2c/Makefile \
     58 			F2CEXT
     59 		getvars $_PLATFORM/libf2c/libF77/Makefile \
     60 			ALL_CFLAGS OBJS
     61 		getvars $_PLATFORM/libf2c/libI77/Makefile \
     62 			ALL_CFLAGS OBJS | sed 's,=,+=,'
     63 		getvars $_PLATFORM/libf2c/libU77/Makefile \
     64 			ALL_CFLAGS OBJS | sed 's,=,+=,'
     65 	} | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$_MACHINE_ARCH/defs.mk
     66 }
     67 
     68 ##### lib/libgcc #####
     69 
     70 get_libgcc () {
     71 	_subdir="$1"
     72 	mkdir -p $_OUTDIR/lib/lib$_subdir/arch
     73 
     74 	# DPBIT, FPBIT only used on mn10[23]00, we don't need them.
     75 	# XXX we should probably grab everything Just In Case for
     76 	# the future.
     77 
     78 	mkdir -p $_OUTDIR/lib/lib$_subdir/arch/$_MACHINE_ARCH
     79 	cd $_TMPDIR/$_PLATFORM/libgcc
     80 	{
     81 		getvars $_PLATFORM/libgcc/Makefile \
     82 			INCLUDES \
     83 			INTERNAL_CFLAGS \
     84 			LIB2ADD LIB2ADDEH LIB2ADD_ST \
     85 			LIB1ASMFUNCS LIB1ASMSRC \
     86 			LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \
     87 			LIB2FUNCS_EXTRA \
     88 			LIBGCC2_CFLAGS \
     89 			SHLIB_MKMAP SHLIB_MKMAP_OPTS \
     90 			SHLIB_MAPFILES SHLIB_NM_FLAGS
     91 		getvars gcc/Makefile \
     92 			NOEXCEPTION_FLAGS EXTRA_HEADERS
     93 	}	| sanitise_includes \
     94 		| write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$_MACHINE_ARCH/defs.mk
     95 
     96 	cd $_TMPDIR/$_PLATFORM/libgcc
     97 	{
     98 		getvars $_PLATFORM/libgcc/Makefile \
     99 			enable_execute_stack \
    100 			unwind_header md_unwind_header \
    101 			sfp_machine_header thread_header
    102 	}	| sanitise_includes \
    103 		| write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$_MACHINE_ARCH/gthr-defs.mk
    104 
    105 	if [ "${_MACHINE_ARCH}" = "m68000" ]
    106 	then
    107 		ex <<__EOF__ $_OUTDIR/lib/lib$_subdir/arch/$_MACHINE_ARCH/defs.mk
    108 /G_LIBGCC2_CFLAGS/ s/-fPIC//
    109 wq
    110 __EOF__
    111 	fi
    112 
    113 	for f in auto-target.h; do
    114 		write_c $_OUTDIRBASE/lib/lib$_subdir/arch/$_MACHINE_ARCH/$f \
    115 		    <$_TMPDIR/$_PLATFORM/libgcc/$f
    116 	done
    117 }
    118 
    119 ##### lib/libgcov #####
    120 
    121 get_libgcov () {
    122 	_subdir="$1"
    123 	_mf="$2"
    124 
    125 	mkdir -p $_OUTDIR/lib/lib$_subdir/libgcov/arch/$_MACHINE_ARCH
    126 
    127 	{
    128 		getvars $_mf \
    129 			LIBGCOV_MERGE \
    130 			LIBGCOV_PROFILER \
    131 			LIBGCOV_INTERFACE \
    132 			LIBGCOV_DRIVER
    133 	} | write_mk $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$_MACHINE_ARCH/defs.mk
    134 
    135 	write_c $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$_MACHINE_ARCH/gcov-iov.h \
    136 	   <$_TMPDIR/gcc/gcov-iov.h
    137 
    138 }
    139 
    140 ##### lib/libiberty #####
    141 
    142 get_gcc_libiberty () {
    143 	_subdir="$1"
    144 	_libibertydir="lib/libiberty"
    145 	mkdir -p $_OUTDIR/$_libibertydir/arch/$_MACHINE_ARCH
    146 
    147 	getvars libiberty/Makefile \
    148 		ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
    149 		| write_mk $_OUTDIRBASE/$_libibertydir/defs.mk
    150 
    151 	write_c $_OUTDIRBASE/$_libibertydir/arch/$_MACHINE_ARCH/config.h \
    152 		<$_TMPDIR/libiberty/config.h
    153 }
    154 
    155 ##### lib/libdecnumber #####
    156 
    157 get_libdecnumber () {
    158 	_subdir="$1"
    159 
    160 	mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH
    161 	write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/config.h \
    162 		<$_TMPDIR/libdecnumber/config.h
    163 }
    164 
    165 ##### lib/libgomp #####
    166 
    167 get_libgomp () {
    168 	_subdir="$1"
    169 
    170 	mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
    171 
    172 	getvars $_PLATFORM/libgomp/Makefile \
    173 		libgomp_la_SOURCES \
    174 		| write_mk $_OUTDIRBASE/lib/$_subdir/defs.mk
    175 
    176 	write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/config.h \
    177 		<$_TMPDIR/$_PLATFORM/libgomp/config.h
    178 	write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/libgomp_f.h \
    179 		<$_TMPDIR/$_PLATFORM/libgomp/libgomp_f.h
    180 	write_mk $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/libgomp.spec \
    181 		<$_TMPDIR/$_PLATFORM/libgomp/libgomp.spec
    182 	write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/omp.h \
    183 		<$_TMPDIR/$_PLATFORM/libgomp/omp.h
    184 }
    185 
    186 ##### lib/libbacktrace #####
    187 
    188 get_libbacktrace () {
    189 	_subdir="$1"
    190 
    191 	mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
    192 	write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/config.h \
    193 		<$_TMPDIR/$_PLATFORM/$_subdir/config.h
    194 	write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/backtrace-supported.h \
    195 		<$_TMPDIR/$_PLATFORM/$_subdir/backtrace-supported.h
    196 }
    197 
    198 ##### lib/libobjc #####
    199 
    200 get_libobjc () {
    201 	_subdir="$1/arch/$_MACHINE_ARCH"
    202 	_options="ALL_OPT_FILES"
    203 
    204 	mkdir -p $_OUTDIR/lib/$_subdir
    205 
    206 	{
    207 		if [ -n "$_options" ]; then
    208 			getvars gcc/Makefile $_options
    209 		fi
    210 		getvars $_PLATFORM/libobjc/Makefile \
    211 			ALL_CFLAGS INCLUDES OBJC_SOURCE_FILES C_SOURCE_FILES OBJC_H \
    212 			| sed "s,$_GNU_DIST,\${GNUHOSTDIST},g"
    213 	} | sanitise_includes \
    214 	  | write_mk $_OUTDIRBASE/lib/$_subdir/defs.mk
    215 
    216 	write_c $_OUTDIRBASE/lib/$_subdir/config.h \
    217 		<$_TMPDIR/$_PLATFORM/libobjc/config.h
    218 }
    219 
    220 ##### lib/libstdc++-v3 #####
    221 
    222 get_libstdcxx_v3 () {
    223 	_subdir="$1"
    224 	_ver="$2"
    225 
    226 	mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
    227 
    228 	_build_headers="c++config.h cxxabi_tweaks.h"
    229 	_headers1="backward_headers c_base_headers_extra"
    230 	_headers1="$_headers1 c_base_headers_extra_install"
    231 	_headers1="$_headers1 tr1_headers tr2_headers"
    232 	_headers1="$_headers1 decimal_headers c_compatibility_headers_install"
    233 	_headers1="$_headers1 debug_headers parallel_headers"
    234 	_headers1="$_headers1 pb_headers1 pb_headers2 pb_headers3 pb_headers4"
    235 	_headers1="$_headers1 pb_headers5 pb_headers6 pb_headers7"
    236 	_headers1="$_headers1 bits_headers ext_headers host_headers"
    237 	_headers1="$_headers1 thread_host_headers pstl_headers"
    238 	_headers1="$_headers1 profile_headers profile_impl_headers"
    239 
    240 	# build files
    241 	for h in $_build_headers; do
    242 		write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/$h \
    243 			<$_TMPDIR/$_PLATFORM/libstdc++-v3/include/$_PLATFORM/bits/$h
    244 	done
    245 
    246 	write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/gstdint.h \
    247 		<$_TMPDIR/$_PLATFORM/libstdc++-v3/include/gstdint.h
    248 	write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/symver-config.h \
    249 		<$_TMPDIR/$_PLATFORM/libstdc++-v3/config.h
    250 
    251 	{
    252 		getvars $_PLATFORM/libstdc++-v3/Makefile \
    253 			port_specific_symbol_files
    254 		getvars $_PLATFORM/libstdc++-v3/src/Makefile \
    255 			cxx17_sources \
    256 			cxx11_sources \
    257 			cxx98_sources
    258 
    259 		# libsupc++
    260 		getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
    261 			sources | sed 's/^G_sources=/G_LIBSUPCXX_SOURCES=/'
    262 		getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \
    263 			c_sources | sed 's/^G_c_sources=/G_LIBSUPCXX_C_SOURCES=/'
    264 
    265 		# includes
    266 		getvars $_PLATFORM/libstdc++-v3/include/Makefile \
    267 			c_base_headers std_headers | sed -e 's#/[^ 	][^ 	]*/##g' -e 's/\${GNUHOSTDIST}//g'
    268 
    269 		# src
    270 		getvars $_PLATFORM/libstdc++-v3/src/Makefile \
    271 			libstdc___la_SOURCES | sed 's/^G_libstdc___la_SOURCES=/G_SRC_SOURCES=/'
    272 		getvars $_PLATFORM/libstdc++-v3/src/c++17/Makefile \
    273 			libc__17convenience_la_SOURCES | \
    274 			sed -e 's/^G_libc__17convenience_la_SOURCES=/G_CPP17_SOURCES=/'
    275 		getvars $_PLATFORM/libstdc++-v3/src/c++11/Makefile \
    276 			libc__11convenience_la_SOURCES | \
    277 			sed -e 's/^G_libc__11convenience_la_SOURCES=/G_CPP11_SOURCES=/' \
    278 			    -e 's/codecvt.cc/c11-codecvt.cc/'
    279 		getvars $_PLATFORM/libstdc++-v3/src/c++98/Makefile \
    280 			GLIBCXX_ABI_FLAGS libc__98convenience_la_SOURCES | \
    281 			sed -e 's/^G_libc__98convenience_la_SOURCES=/G_CPP98_SOURCES=/' \
    282 			    -e 's/codecvt.cc/c98-codecvt.cc/'
    283 		getvars $_PLATFORM/libstdc++-v3/src/filesystem/Makefile \
    284 			libstdc__fs_la_SOURCES | \
    285 			sed -e 's/^G_libstdc__fs_la_SOURCES=/G_FILESYSTEM_SOURCES=/'
    286 		getvars $_PLATFORM/libstdc++-v3/Makefile ATOMICITY_SRCDIR \
    287 			BASIC_FILE_CC CLOCALE_CC CCODECVT_CC CCOLLATE_CC \
    288 			CCTYPE_CC  CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_CC \
    289 			CPU_OPT_BITS_RANDOM
    290 
    291 		# includes
    292 		getvars $_PLATFORM/libstdc++-v3/include/Makefile \
    293 			$_headers1 | \
    294 				sed -e 's#\${GNUHOSTDIST}/libstdc++-v3/include/##g' \
    295 				    -e 's#\${GNUHOSTDIST}/libstdc++-v3/config/##g'
    296 		getvars $_PLATFORM/libstdc++-v3/include/Makefile \
    297 			BASIC_FILE_H ALLOCATOR_H CSTDIO_H CLOCALE_H CMESSAGES_H CTIME_H
    298 	} | sanitise_includes \
    299 	  | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/defs.mk
    300 }
    301 
    302 ##### lib/libsanitizer #####
    303 
    304 get_libsanitizer () {
    305 	_subdir="$1"
    306 
    307 	mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
    308 
    309 	{
    310 		getvars $_PLATFORM/libsanitizer/asan/Makefile \
    311 			asan_files
    312 		getvars $_PLATFORM/libsanitizer/lsan/Makefile \
    313 			lsan_files
    314 		getvars $_PLATFORM/libsanitizer/tsan/Makefile \
    315 			tsan_files
    316 		getvars $_PLATFORM/libsanitizer/ubsan/Makefile \
    317 			ubsan_files
    318 		getvars $_PLATFORM/libsanitizer/interception/Makefile \
    319 			interception_files
    320 
    321 	} | sanitise_includes \
    322 	  | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/defs.mk
    323 }
    324 
    325 ##### usr.bin/gcc* #####
    326 
    327 get_gcc_bootstrap () {
    328 	_subdir="$1"
    329 	mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH
    330 	for f in auto-host tm config; do
    331 		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
    332 	done
    333 	# XXXGCC5 don't really want to copy insn-modes as we build
    334 	# it but libgcc needs to too early yet
    335 	for f in insn-modes; do
    336 		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
    337 	done
    338 }
    339 
    340 get_gcc () {
    341 	_subdir="$1"
    342 	mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH
    343 	mkdir -p $_OUTDIR/usr.bin/libcpp/arch/$_MACHINE_ARCH
    344 	mkdir -p $_OUTDIR/usr.bin/include/arch
    345 	mkdir -p $_OUTDIR/usr.bin/common-target/arch
    346 	_buildname="BUILD_"
    347 	_libcppsubdir=""
    348 	_extravars="TM_H ALL_OPT_FILES"
    349 	_hconfig_h=""
    350 	_extravars2="tm_file_list build_xm_include_list"
    351 	_extravars3="tm_p_include_list"
    352 
    353 	{
    354 		getvars gcc/Makefile \
    355 			${_buildname}EARLY_SUPPORT ${_buildname}ERRORS ${_buildname}PRINT \
    356 			${_buildname}RTL ${_buildname}SUPPORT ${_buildname}VARRAY \
    357 			${_buildname}MD | \
    358 		    sed -e 's#build/errors.o#build-errors.o#g' \
    359 			-e 's#build/print-rtl.o#build-print-rtl.o#g' \
    360 			-e 's#build/rtl.o#build-rtl.o#g' \
    361 			-e 's#build/varray.o#build-varray.o#g' \
    362 			-e 's#build/ggc-none.o#build-ggc-none.o#g' \
    363 			-e 's#build/##g'
    364 		getvars gcc/Makefile \
    365 			ALL_CFLAGS ALL_CPPFLAGS C_AND_OBJC_OBJS C_OBJS CCCP_OBJS \
    366 			GCC_OBJS GCOV_OBJS GCOV_DUMP_OBJS GXX_OBJS GTM_H PROTO_OBJS ${_extravars1} \
    367 			INCLUDES md_file OBJC_OBJS OBJS out_file version \
    368 			BUILD_PREFIX RTL_H RTL_BASE_H TREE_H ${_hconfig_h} BASIC_BLOCK_H GCC_H \
    369 			D_TARGET_DEF \
    370 			GTFILES_SRCDIR GTFILES_FILES_FILES GTFILES_FILES_LANGS \
    371 			GTFILES GTFILES_LANG_DIR_NAMES HASH_TABLE_H \
    372 			NOEXCEPTION_FLAGS NATIVE_SYSTEM_HEADER_DIR \
    373 			tm_defines host_xm_file host_xm_defines tm_p_file \
    374 			target_cpu_default ${_extravars} ${_extravars2} \
    375 			lang_specs_files ${_extravars3} \
    376 			common_out_file \
    377 				| sanitise_includes
    378 		getvars gcc/Makefile \
    379 			LIB2ADDEHDEP | sed 's/unwind.inc//'
    380 		getvars gcc/Makefile \
    381 			CXX_OBJS CXX_C_OBJS | sed 's/cp\///g'
    382 		getvars gcc/Makefile \
    383 			F77_OBJS | sed 's/f\///g'
    384 		getvars libcpp/Makefile \
    385 			libcpp_a_OBJS
    386 		getvars gcc/Makefile \
    387 			ENABLE_SHARED
    388 		echo G_SHLIB_LINK="$CC -shared"
    389 		echo G_SHLIB_MULTILIB=.
    390 	} | write_mk $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/defs.mk
    391 
    392 	getvars gcc/Makefile \
    393 		EXTRA_HEADERS \
    394 			| write_mk $_OUTDIRBASE/usr.bin/include/arch/$_MACHINE_ARCH.mk
    395 
    396 	getvars gcc/Makefile \
    397 		OBJS-libcommon \
    398 			| write_mk $_OUTDIRBASE/usr.bin/common/defs.mk
    399 	getvars gcc/Makefile \
    400 		OBJS-libcommon-target \
    401 			| write_mk $_OUTDIRBASE/usr.bin/common-target/arch/$_MACHINE_ARCH.mk
    402 
    403 	write_c $_OUTDIRBASE/usr.bin/libcpp/arch/$_MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h
    404 	hfiles='auto-host configargs config bconfig bversion plugin-version multilib tm'
    405 	for f in $hfiles; do
    406 		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
    407 		if [ "${_MACHINE_ARCH}" = "powerpc" -a "${f}" = "configargs" ]
    408 		then
    409 			ex <<__EOF__ $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h
    410 /configuration_arguments/ s/$//
    411 ya
    412 i
    413 #ifdef _SOFT_FLOAT
    414 .
    415 pu
    416 s/";$/ -with-float=soft";/
    417 a
    418 #else
    419 #endif
    420 .
    421 . m +1
    422 /configure_default_options/ s/{ NULL.*$//
    423 a
    424 #ifdef _SOFT_FLOAT
    425   { "float", "soft" },
    426 #endif
    427   { NULL, NULL }
    428 };
    429 .
    430 wq
    431 __EOF__
    432 		fi
    433 		if [ "${f}" = "configargs" ]
    434 		then
    435 			_srcquoted=$(echo "$_SRC" | sed 's/\//\\\//g')
    436 			sed -i -E -e "s,$_srcquoted,/usr/src,g" \
    437 				  -e 's/--build=[^ ]+ --host=([^ ]+)/--build=\1 --host=\1/' \
    438 				$_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h
    439 		fi
    440 	done
    441 
    442 	# keep identical
    443 	for f in all-tree.def; do
    444 		cp $_TMPDIR/gcc/$f $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f
    445 	done
    446 
    447 	# special transforms
    448 	for f in gtyp-input.list; do
    449 		sed -e "s@^.*$_OUTDIRBASE/dist@SRCDIR@" < $_TMPDIR/gcc/$f > $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f
    450 	done
    451 
    452 	# special platforms
    453 	if [ "${_MACHINE_ARCH}" = "sh3el" -o "${_MACHINE_ARCH}" = "sh3eb" ]; then
    454 		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/sysroot-suffix.h <$_TMPDIR/gcc/sysroot-suffix.h
    455 	fi
    456 
    457 	if [ "${_MACHINE_ARCH}" = "i386" -o "${_MACHINE_ARCH}" = "x86_64" ]; then
    458 		write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/i386-builtin-types.inc <$_TMPDIR/gcc/i386-builtin-types.inc
    459 	fi
    460 
    461 	case "${_MACHINE_ARCH}" in
    462 	(*arm*)
    463 		d=$_OUTDIRBASE/usr.bin/$_subdir/arch/${_MACHINE_ARCH}
    464 		for f in arm-cpu.h arm-cpu-cdata.h arm-cpu-data.h arm-isa.h; do
    465 			write_c $d/$f <$_TMPDIR/gcc/$f
    466 		done
    467 		;;
    468 	esac
    469 }
    470 
    471 ##### main #####
    472 
    473 case "$1" in
    474 # .mk and .h files for libgcc bootstrap (from host build)
    475 
    476 libgcc*-bootstrap)
    477 	get_libgcc gcc
    478 	get_libgcov gcc $_PLATFORM/libgcc/Makefile
    479 	get_gcc_bootstrap gcc
    480 	exit 0
    481 	;;
    482 
    483 libstdc++-bootstrap)
    484 	get_libstdcxx_v3 libstdc++-v3 gcc
    485 	exit 0
    486 	;;
    487 
    488 gcc*)
    489 	get_gcc gcc
    490 	get_libgcc gcc
    491 	get_libgcov gcc $_PLATFORM/libgcc/Makefile
    492 	get_gcc_bootstrap gcc
    493 	get_gcc_libiberty gcc
    494 	get_libobjc libobjc
    495 	get_libstdcxx_v3 libstdc++-v3 gcc
    496 	get_libsanitizer libsanitizer
    497 	get_libdecnumber libdecnumber
    498 	get_libgomp libgomp
    499 	get_libbacktrace libbacktrace
    500 	exit 0
    501 	;;
    502 
    503 
    504 *)
    505 	echo invalid arguments;
    506 	exit 1
    507 	;;
    508 esac
    509