mknative-gcc revision 1.35
11.1Smrg#!/bin/sh 21.26Suebayasi# $NetBSD: mknative-gcc,v 1.35 2009/11/30 08:20:23 uebayasi Exp $ 31.1Smrg# 41.1Smrg# Shell script for generating all the constants needed for a native 51.10Smrg# platform build of src/gnu/dist/gcc. 61.1Smrg# 71.1Smrg 81.9Smrg# initialise 91.9Smrg 101.9Smrg_TMPDIR=$2 111.9Smrg_TOP=$3 121.9Smrg_PLATFORM=$4 131.15Smrg_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'` 141.9Smrg_GNU_DIST=`cd ${_VPATH}; pwd` 151.9Smrg 161.9Smrg. $_TOP/tools/gcc/mknative.common 171.1Smrg 181.14Sthorpej##### gnu/lib/crtstuff ##### 191.14Sthorpej 201.14Sthorpejget_crtstuff () { 211.16Smrg _subdir="$1" 221.16Smrg mkdir -p $_TOP/gnu/lib/$_subdir/arch 231.14Sthorpej 241.14Sthorpej getvars gcc/Makefile \ 251.14Sthorpej INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS \ 261.14Sthorpej tm_defines xm_file xm_defines \ 271.16Smrg | write_mk gnu/lib/$_subdir/arch/$MACHINE_ARCH.mk 281.14Sthorpej} 291.14Sthorpej 301.1Smrg##### gnu/lib/libg2c ##### 311.1Smrg 321.1Smrgget_libg2c () { 331.1Smrg mkdir -p $_TOP/gnu/lib/libg2c3/arch/$MACHINE_ARCH 341.1Smrg 351.1Smrg write_c gnu/lib/libg2c3/arch/$MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h 361.1Smrg write_c gnu/lib/libg2c3/arch/$MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h 371.1Smrg 381.1Smrg { 391.1Smrg getvars $_PLATFORM/libf2c/Makefile \ 401.1Smrg F2CEXT 411.1Smrg getvars $_PLATFORM/libf2c/libF77/Makefile \ 421.1Smrg ALL_CFLAGS OBJS 431.1Smrg getvars $_PLATFORM/libf2c/libI77/Makefile \ 441.1Smrg ALL_CFLAGS OBJS | sed 's,=,+=,' 451.1Smrg getvars $_PLATFORM/libf2c/libU77/Makefile \ 461.1Smrg ALL_CFLAGS OBJS | sed 's,=,+=,' 471.1Smrg } | write_mk gnu/lib/libg2c3/arch/$MACHINE_ARCH/defs.mk 481.1Smrg} 491.1Smrg 501.1Smrg##### gnu/lib/libgcc ##### 511.1Smrg 521.28Suebayasiget_libgcc_list_funcs_asm () { 531.28Suebayasi getvars gcc/Makefile LIB1ASMFUNCS | { 541.28Suebayasi # print newline separated list 551.28Suebayasi sed -e ' 561.28Suebayasi s,^.*=,, 571.28Suebayasi s, *$,, 581.28Suebayasi s, *, ,g 591.28Suebayasi s, ,\ 601.28Suebayasi,g' 611.28Suebayasi } | { 621.28Suebayasi # print foo and foo_s 631.28Suebayasi sed -ne ' 641.28Suebayasi /./ { 651.28Suebayasi p 661.28Suebayasi s,$,_s, 671.28Suebayasi p 681.28Suebayasi } 691.28Suebayasi ' 701.28Suebayasi } | sort 711.28Suebayasi} 721.28Suebayasi 731.29Suebayasiget_libgcc_list_funcs_lib () { 741.29Suebayasi local _lib=$1 751.29Suebayasi local _lib_prefix=${_lib%.*} 761.29Suebayasi local _lib_suffix=${_lib#*.} 771.29Suebayasi 781.29Suebayasi sed -ne ' 791.29Suebayasi /^\.\/'${_lib_prefix}'\.'${_lib_suffix}': .*\.o$/ { 801.29Suebayasi s,^.*/,, 811.29Suebayasi s,\.o$,, 821.29Suebayasi p 831.29Suebayasi } 841.29Suebayasi ' build/gcc/libgcc.mk | sort 851.29Suebayasi} 861.29Suebayasi 871.30Suebayasiget_libgcc_list_objs_libs () { 881.30Suebayasi cat build/gcc/libgcc.mk | \ 891.30Suebayasi egrep '^\.\/(libgcc_s\.so|libgcc\.a|libgcc_eh\.a|libgcov\.a): (libgcc_s|libgcc|libgcc_eh|libgcov)\/.*\.o$' | \ 901.30Suebayasi sed -e ' 911.30Suebayasi s,^\.\/,, 921.30Suebayasi s,: .*/, , 931.30Suebayasi s,^\(.*\) \(.*\)$,\2 \1, 941.30Suebayasi ' | sort 951.30Suebayasi} 961.30Suebayasi 971.30Suebayasiget_libgcc_list_objs_srcs () { 981.30Suebayasi { 991.30Suebayasi cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \ 1001.30Suebayasi comm -23 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \ 1011.30Suebayasi sed -e 's,\(.*\),\1.o \1.c,' 1021.30Suebayasi 1031.30Suebayasi cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \ 1041.30Suebayasi comm -12 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \ 1051.30Suebayasi sed -e 's,\(.*\),\1.o \1.S,' 1061.30Suebayasi } | sort 1071.30Suebayasi} 1081.30Suebayasi 1091.32Suebayasiget_libgcc_list_objs_tmpsrcs () { 1101.32Suebayasi grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \ 1111.32Suebayasi sed -ne ' 1121.32Suebayasi s,^.* -c \([^ ]*\).* -o .*/\([^ ]*\.o\)$,\2 \1, 1131.32Suebayasi # basename 1141.32Suebayasi /\$/ { s,\$.*/,,; } 1151.32Suebayasi /\// { s,\/.*/,,; } 1161.32Suebayasi p 1171.32Suebayasi ' | sort 1181.32Suebayasi} 1191.32Suebayasi 1201.31Suebayasiget_libgcc_list_objs_xflags () { 1211.31Suebayasi local _flags=$1 1221.31Suebayasi 1231.31Suebayasi grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \ 1241.31Suebayasi sed -n ' 1251.31Suebayasi x 1261.31Suebayasi :loop 1271.31Suebayasi g 1281.31Suebayasi s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\5 \2/p 1291.31Suebayasi g 1301.31Suebayasi s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\1 \3 \4\/\5/ 1311.31Suebayasi h 1321.31Suebayasi t loop 1331.31Suebayasi ' | sort 1341.31Suebayasi} 1351.31Suebayasi 1361.31Suebayasiget_libgcc_list_objs_cppflags () { 1371.31Suebayasi get_libgcc_list_objs_xflags D 1381.31Suebayasi} 1391.31Suebayasi 1401.31Suebayasiget_libgcc_list_objs_copts () { 1411.31Suebayasi get_libgcc_list_objs_xflags fmx 1421.31Suebayasi} 1431.31Suebayasi 1441.35Suebayasiget_libgcc_list_tmpsrcs () { 1451.33Suebayasi local _lib=$1 1461.33Suebayasi local _tmpallsrcs=$( mktemp /tmp/mknative-gcc._tmpallsrcs.XXXXXX ) 1471.33Suebayasi 1481.34Suebayasi touch $_TOP/${libgcc_db_tmpsrcs}.tmpsrcs.${_lib%.*} 1491.33Suebayasi touch $_TOP/${libgcc_db_tmpsrcs}.tmpfpsrcs.${_lib%.*} 1501.33Suebayasi touch $_TOP/${libgcc_db_tmpsrcs}.tmpasmsrcs.${_lib%.*} 1511.33Suebayasi 1521.33Suebayasi # all files 1531.33Suebayasi local _lib_prefix=${_lib%.*} 1541.33Suebayasi local _lib_suffix=${_lib#*.} 1551.33Suebayasi join $_TOP/$libgcc_db_objs_libs $_TOP/$libgcc_db_objs_tmpsrcs | \ 1561.33Suebayasi grep ${_lib_prefix}'\.'${_lib_suffix} | cut -d' ' -f 3 | sort -u > \ 1571.33Suebayasi $_tmpallsrcs 1581.33Suebayasi 1591.33Suebayasi # TMPFPSRCS = [fdp]p-bit.c 1601.33Suebayasi grep '[fdt]p-bit\.c' <$_tmpallsrcs | sort -u | \ 1611.33Suebayasi writefile ${libgcc_db_tmpsrcs}.tmpfpsrcs.${_lib%.*} 1621.33Suebayasi 1631.33Suebayasi # TMPASMSRCS = $(LIB1ASMSRC) 1641.33Suebayasi grep '\$(LIB1ASMSRC)' <$_tmpallsrcs | sort -u | \ 1651.33Suebayasi writefile ${libgcc_db_tmpsrcs}.tmpasmsrcs.${_lib%.*} 1661.33Suebayasi 1671.33Suebayasi # TMPSRCS is anything else; exclude TMPFPSRCS and TMPASMSRCS 1681.33Suebayasi cat $_tmpallsrcs | \ 1691.33Suebayasi comm -23 /dev/stdin $_TOP/${libgcc_db_tmpsrcs}.tmpfpsrcs.${_lib%.*} | \ 1701.33Suebayasi comm -23 /dev/stdin $_TOP/${libgcc_db_tmpsrcs}.tmpasmsrcs.${_lib%.*} | \ 1711.34Suebayasi writefile ${libgcc_db_tmpsrcs}.tmpsrcs.${_lib%.*} 1721.33Suebayasi 1731.33Suebayasi rm -f $_tmpallsrcs 1741.33Suebayasi} 1751.33Suebayasi 1761.35Suebayasiget_libgcc_new_analyze () { 1771.35Suebayasi mkdir -p $_TOP/${_machine_arch_subdir} 1781.35Suebayasi 1791.35Suebayasi get_libgcc_list_funcs_asm | \ 1801.35Suebayasi writefile ${libgcc_db_funcs}.S 1811.35Suebayasi 1821.35Suebayasi for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do 1831.35Suebayasi get_libgcc_list_funcs_lib $_lib | \ 1841.35Suebayasi writefile ${libgcc_db_funcs}.${_lib%.*} 1851.35Suebayasi done 1861.35Suebayasi 1871.35Suebayasi get_libgcc_list_objs_libs | writefile ${libgcc_db_objs_libs} 1881.35Suebayasi get_libgcc_list_objs_srcs | writefile ${libgcc_db_objs_srcs} 1891.35Suebayasi get_libgcc_list_objs_tmpsrcs | writefile ${libgcc_db_objs_tmpsrcs} 1901.35Suebayasi get_libgcc_list_objs_cppflags | writefile ${libgcc_db_objs_cppflags} 1911.35Suebayasi get_libgcc_list_objs_copts | writefile ${libgcc_db_objs_copts} 1921.35Suebayasi 1931.35Suebayasi for _lib in libgcc_s.so libgcc.a libgcc_eh.a libgcov.a; do 1941.35Suebayasi get_libgcc_list_tmpsrcs $_lib 1951.35Suebayasi done 1961.35Suebayasi} 1971.35Suebayasi 1981.35Suebayasi##### 1991.35Suebayasi 2001.35Suebayasiget_libgcc_new_generate () { 2011.35Suebayasi} 2021.35Suebayasi 2031.33Suebayasi##### 2041.33Suebayasi 2051.28Suebayasiget_libgcc_new () { 2061.28Suebayasi _subdir="$1" 2071.27Suebayasi 2081.29Suebayasi # List of generated files. 2091.29Suebayasi 2101.28Suebayasi _machine_arch_subdir=gnu/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH 2111.27Suebayasi 2121.28Suebayasi libgcc_db_funcs=${_machine_arch_subdir}/funcs 2131.33Suebayasi libgcc_db_tmpsrcs=${_machine_arch_subdir}/tmpsrcs 2141.28Suebayasi libgcc_db_objs_libs=${_machine_arch_subdir}/objs.libs 2151.28Suebayasi libgcc_db_objs_srcs=${_machine_arch_subdir}/objs.srcs 2161.28Suebayasi libgcc_db_objs_tmpsrcs=${_machine_arch_subdir}/objs.tmpsrcs 2171.28Suebayasi libgcc_db_objs_cppflags=${_machine_arch_subdir}/objs.cppflags 2181.28Suebayasi libgcc_db_objs_copts=${_machine_arch_subdir}/objs.copts 2191.28Suebayasi 2201.28Suebayasi libgcc_srcs_mk=${_machine_arch_subdir}/srcs.mk 2211.28Suebayasi libgcc_srcs_mk_tmpsrc=${_machine_arch_subdir}/srcs.tmpsrc.mk 2221.28Suebayasi libgcc_srcs_mk_cppflags=${_machine_arch_subdir}/srcs.cppflags.mk 2231.28Suebayasi libgcc_srcs_mk_copts=${_machine_arch_subdir}/srcs.copts.mk 2241.28Suebayasi 2251.35Suebayasi get_libgcc_new_analyze 2261.28Suebayasi 2271.35Suebayasi get_libgcc_new_generate 2281.26Suebayasi} 2291.26Suebayasi 2301.1Smrgget_libgcc () { 2311.16Smrg _subdir="$1" 2321.16Smrg mkdir -p $_TOP/gnu/lib/lib$_subdir/arch 2331.16Smrg 2341.16Smrg case "$_subdir" in 2351.16Smrg gcc3) 2361.16Smrg _extravars="USE_COLLECT2 LIB2FUNCS_1 LIB2FUNCS_2 xm_file" 2371.16Smrg _archsubdir="" 2381.16Smrg ;; 2391.16Smrg gcc4) 2401.16Smrg _extravars="COLLECT2 UNWIND_H xm_include_list" 2411.16Smrg _archsubdir="" 2421.16Smrg ;; 2431.16Smrg esac 2441.1Smrg 2451.1Smrg # DPBIT, FPBIT only used on mn10[23]00, we don't need them. 2461.4Smrg # XXX we should probably grab everything Just In Case for 2471.4Smrg # the future. 2481.16Smrg { 2491.16Smrg getvars gcc/Makefile \ 2501.16Smrg INCLUDES LIB2ADD LIB2ADDEH \ 2511.16Smrg LIB1ASMFUNCS LIB1ASMSRC \ 2521.16Smrg LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \ 2531.16Smrg LIBGCC2_CFLAGS \ 2541.16Smrg SHLIB_MKMAP SHLIB_MKMAP_OPTS \ 2551.16Smrg SHLIB_MAPFILES SHLIB_NM_FLAGS \ 2561.16Smrg EXTRA_HEADERS xm_defines \ 2571.16Smrg tm_defines ${_extravars} 2581.16Smrg } | write_mk gnu/lib/lib$_subdir/arch${_archsubdir}/$MACHINE_ARCH.mk 2591.26Suebayasi 2601.26Suebayasi # Generate new style files. 2611.27Suebayasi if [ -n "${MKNATIVE_LIBGCC_NEW}" ]; then 2621.28Suebayasi get_libgcc_new $_subdir 2631.26Suebayasi fi 2641.1Smrg} 2651.1Smrg 2661.24Sskrll##### gnu/lib/libgcov ##### 2671.24Sskrll 2681.24Sskrllget_libgcov () { 2691.24Sskrll _subdir="$1" 2701.24Sskrll 2711.24Sskrll mkdir -p $_TOP/gnu/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH 2721.24Sskrll 2731.24Sskrll { 2741.24Sskrll getvars gcc/Makefile \ 2751.24Sskrll LIBGCOV 2761.24Sskrll } | write_mk gnu/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/defs.mk 2771.24Sskrll 2781.24Sskrll write_c gnu/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/gcov-iov.h \ 2791.24Sskrll <$_TMPDIR/gcc/gcov-iov.h 2801.24Sskrll 2811.24Sskrll} 2821.24Sskrll 2831.16Smrg##### gnu/usr.bin/gcc[34]/libiberty ##### 2841.1Smrg 2851.16Smrgget_gcc_libiberty () { 2861.16Smrg _subdir="$1" 2871.16Smrg mkdir -p $_TOP/gnu/usr.bin/$_subdir/libiberty/arch/$MACHINE_ARCH 2881.1Smrg 2891.1Smrg getvars libiberty/Makefile \ 2901.1Smrg ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \ 2911.16Smrg | write_mk gnu/usr.bin/$_subdir/libiberty/defs.mk 2921.1Smrg 2931.16Smrg write_c gnu/usr.bin/$_subdir/libiberty/arch/$MACHINE_ARCH/config.h \ 2941.1Smrg <$_TMPDIR/libiberty/config.h 2951.1Smrg} 2961.1Smrg 2971.1Smrg##### gnu/lib/libobjc ##### 2981.1Smrg 2991.1Smrgget_libobjc () { 3001.18Smrg case "$1" in 3011.18Smrg *4) 3021.18Smrg _subdir="$1/arch/$MACHINE_ARCH" 3031.18Smrg _options="ALL_OPT_FILES" 3041.20Sskrll _unwind="UNWIND_H" 3051.18Smrg ;; 3061.18Smrg *) 3071.18Smrg _subdir="$1" 3081.18Smrg _options="" 3091.20Sskrll _unwind="" 3101.18Smrg ;; 3111.18Smrg esac 3121.18Smrg 3131.16Smrg mkdir -p $_TOP/gnu/lib/$_subdir 3141.1Smrg 3151.16Smrg { 3161.18Smrg if [ -n "$_options" ]; then 3171.18Smrg getvars gcc/Makefile $_options 3181.18Smrg fi 3191.16Smrg getvars $_PLATFORM/libobjc/Makefile \ 3201.16Smrg ALL_CFLAGS INCLUDES OBJS OBJC_H \ 3211.16Smrg | sed "s,$_GNU_DIST,\${GNUHOSTDIST},g" 3221.20Sskrll if [ -n "$_unwind" ]; then 3231.20Sskrll getvars gcc/Makefile $_unwind 3241.20Sskrll fi 3251.16Smrg } | write_mk gnu/lib/$_subdir/defs.mk 3261.23Sskrll 3271.23Sskrll write_c gnu/lib/$_subdir/config.h \ 3281.23Sskrll <$_TMPDIR/$_PLATFORM/libobjc/config.h 3291.1Smrg} 3301.1Smrg 3311.1Smrg##### gnu/lib/libstdc++-v3 ##### 3321.1Smrg 3331.1Smrgget_libstdcxx_v3 () { 3341.16Smrg _subdir="$1" 3351.16Smrg mkdir -p $_TOP/gnu/lib/$_subdir/arch/$MACHINE_ARCH 3361.1Smrg 3371.16Smrg case ${_subdir} in 3381.16Smrg *4) 3391.16Smrg _src_CC_files="atomicity_file CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_CC CLOCALE_CC BASIC_FILE_CC" 3401.16Smrg _headers1="host_headers debug_headers tr1_headers c_compatibility_headers_extra" 3411.16Smrg _headers2="thread_host_headers host_headers_extra" 3421.19Smrg _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" 3431.20Sskrll _unwind="UNWIND_H" 3441.16Smrg ;; 3451.16Smrg *) 3461.16Smrg _src_CC_files="" 3471.16Smrg _headers1="target_headers" 3481.16Smrg _headers2="thread_target_headers target_headers_extra" 3491.19Smrg _build_headers="c++config.h gthr-default.h gthr-posix.h gthr-single.h gthr.h" 3501.20Sskrll _unwind="" 3511.16Smrg ;; 3521.16Smrg esac 3531.16Smrg 3541.19Smrg # build files 3551.19Smrg for h in $_build_headers; do 3561.19Smrg write_c gnu/lib/$_subdir/arch/$MACHINE_ARCH/$h \ 3571.19Smrg <$_TMPDIR/$_PLATFORM/libstdc++-v3/include/$_PLATFORM/bits/$h 3581.19Smrg done 3591.19Smrg 3601.16Smrg write_c gnu/lib/$_subdir/arch/$MACHINE_ARCH/config.h \ 3611.6Smrg <$_TMPDIR/$_PLATFORM/libstdc++-v3/config.h 3621.6Smrg 3631.1Smrg { 3641.1Smrg # libmath 3651.1Smrg getvars $_PLATFORM/libstdc++-v3/libmath/Makefile \ 3661.1Smrg libmath_la_SOURCES libmath_la_LIBADD 3671.1Smrg 3681.1Smrg # libsupc++ 3691.1Smrg getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \ 3701.1Smrg sources | sed 's/^G_sources=/G_LIBSUPCXX_SOURCES=/' 3711.1Smrg getvars $_PLATFORM/libstdc++-v3/libsupc++/Makefile \ 3721.1Smrg c_sources | sed 's/^G_c_sources=/G_LIBSUPCXX_C_SOURCES=/' 3731.1Smrg 3741.1Smrg # src 3751.1Smrg getvars $_PLATFORM/libstdc++-v3/src/Makefile \ 3761.16Smrg sources $_src_CC_files SECTION_FLAGS | sed 's/^G_sources=/G_SRC_SOURCES=/' 3771.1Smrg 3781.1Smrg # include 3791.1Smrg getvars $_PLATFORM/libstdc++-v3/include/Makefile \ 3801.1Smrg c_base_headers_rename std_headers_rename 3811.1Smrg getvars $_PLATFORM/libstdc++-v3/include/Makefile \ 3821.1Smrg bits_headers backward_headers ext_headers c_base_headers_extra \ 3831.17Smrg $_headers1 | sed -e 's#/[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g' 3841.1Smrg getvars $_PLATFORM/libstdc++-v3/include/Makefile \ 3851.17Smrg $_headers2 | sed -e 's#\./[^ ][^ ]*/##g' -e 's/\${GNUHOSTDIST}//g' 3861.16Smrg 3871.20Sskrll if [ -n "$_unwind" ]; then 3881.20Sskrll getvars gcc/Makefile $_unwind 3891.20Sskrll fi 3901.16Smrg } | write_mk gnu/lib/$_subdir/arch/$MACHINE_ARCH/defs.mk 3911.1Smrg} 3921.1Smrg 3931.1Smrg##### gnu/usr.bin/gcc3 ##### 3941.1Smrg 3951.1Smrgget_gcc () { 3961.16Smrg _subdir="$1" 3971.16Smrg mkdir -p $_TOP/gnu/usr.bin/$_subdir/arch/$MACHINE_ARCH 3981.19Smrg case ${_subdir} in 3991.19Smrg gcc4) 4001.19Smrg mkdir -p $_TOP/gnu/usr.bin/$_subdir/libcpp/arch/$MACHINE_ARCH 4011.19Smrg _buildname="BUILD_" 4021.19Smrg _libcppsubdir="" 4031.20Sskrll _extravars="TM_H ALL_OPT_FILES" 4041.20Sskrll _hconfig_h="" 4051.20Sskrll _extravars2="tm_file_list build_xm_include_list" 4061.20Sskrll _extravars3="tm_p_include_list" 4071.20Sskrll 4081.19Smrg ;; 4091.19Smrg *) 4101.19Smrg _buildname="HOST_" 4111.19Smrg _libcppsubdir="gcc/" 4121.20Sskrll _extravars="" 4131.20Sskrll _hconfig_h="HCONFIG_H" 4141.20Sskrll _extravars2="" 4151.20Sskrll _extravars3="" 4161.19Smrg ;; 4171.19Smrg esac 4181.1Smrg 4191.1Smrg { 4201.1Smrg getvars gcc/Makefile \ 4211.19Smrg ${_buildname}EARLY_SUPPORT ${_buildname}ERRORS ${_buildname}PRINT \ 4221.19Smrg ${_buildname}RTL ${_buildname}SUPPORT ${_buildname}VARRAY | \ 4231.16Smrg sed -e 's#build/errors.o#build-errors.o#g' \ 4241.16Smrg -e 's#build/print-rtl.o#build-print-rtl.o#g' \ 4251.16Smrg -e 's#build/rtl.o#build-rtl.o#g' \ 4261.16Smrg -e 's#build/varray.o#build-varray.o#g' \ 4271.22Smrg -e 's#build/ggc-none.o#build-ggc-none.o#g' \ 4281.16Smrg -e 's#build/##g' 4291.16Smrg getvars gcc/Makefile \ 4301.1Smrg ALL_CFLAGS ALL_CPPFLAGS C_AND_OBJC_OBJS C_OBJS CCCP_OBJS \ 4311.20Sskrll GCOV_OBJS PROTO_OBJS ${_extravars1} \ 4321.1Smrg INCLUDES md_file OBJC_OBJS OBJS out_file version \ 4331.20Sskrll BUILD_PREFIX RTL_H TREE_H ${_hconfig_h} BASIC_BLOCK_H GCC_H \ 4341.1Smrg GTFILES_SRCDIR GTFILES_FILES_FILES GTFILES_FILES_LANGS \ 4351.1Smrg GTFILES GTFILES_LANG_DIR_NAMES \ 4361.1Smrg tm_defines host_xm_file host_xm_defines tm_p_file \ 4371.21Smrg target_cpu_default ${_extravars} ${_extravars2} \ 4381.20Sskrll lang_specs_files ${_extravars3} 4391.1Smrg getvars gcc/Makefile \ 4401.1Smrg LIB2ADDEHDEP | sed 's/unwind.inc//' 4411.1Smrg getvars gcc/Makefile \ 4421.1Smrg CXX_OBJS CXX_C_OBJS | sed 's/cp\///g' 4431.1Smrg getvars gcc/Makefile \ 4441.1Smrg F77_OBJS | sed 's/f\///g' 4451.19Smrg case ${_subdir} in 4461.19Smrg gcc4) 4471.19Smrg getvars libcpp/Makefile \ 4481.19Smrg libcpp_a_OBJS 4491.19Smrg ;; 4501.19Smrg gcc3) 4511.19Smrg getvars gcc/Makefile \ 4521.19Smrg LIBCPP_OBJS LIBCPP_H 4531.19Smrg ;; 4541.19Smrg esac 4551.12Sskrll getvars gcc/Makefile \ 4561.16Smrg ENABLE_SHARED 4571.20Sskrll case ${_subdir} in 4581.20Sskrll gcc4) 4591.20Sskrll echo G_SHLIB_LINK="$CC -shared" 4601.20Sskrll echo G_SHLIB_MULTILIB=. 4611.20Sskrll ;; 4621.20Sskrll gcc3) 4631.20Sskrll getvars gcc/Makefile \ 4641.20Sskrll SHLIB_LINK SHLIB_MULTILIB 4651.20Sskrll ;; 4661.20Sskrll esac 4671.16Smrg } | write_mk gnu/usr.bin/$_subdir/arch/$MACHINE_ARCH/defs.mk 4681.16Smrg 4691.16Smrg case "$_subdir" in 4701.16Smrg gcc3) 4711.16Smrg hfiles='auto-host configargs cs-hconfig gencheck hconfig gthr-default' 4721.16Smrg ;; 4731.16Smrg gcc4) 4741.16Smrg write_c gnu/usr.bin/$_subdir/libcpp/arch/$MACHINE_ARCH/config.h <$_TMPDIR/libcpp/config.h 4751.25Smrg hfiles='auto-host configargs gencheck gthr-default tm bconfig config multilib' 4761.16Smrg ;; 4771.16Smrg esac 4781.16Smrg for f in $hfiles; do 4791.16Smrg write_c gnu/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h 4801.1Smrg done 4811.1Smrg} 4821.1Smrg 4831.1Smrg##### main ##### 4841.1Smrg 4851.16Smrgcase "$1" in 4861.16Smrg# .mk and .h files for libgcc bootstrap (from host build) 4871.16Smrglibgcc) 4881.16Smrg get_libgcc gcc3 4891.16Smrg get_crtstuff crtstuff3 4901.16Smrg exit 0 4911.16Smrg ;; 4921.16Smrg 4931.16Smrglibgcc4) 4941.16Smrg get_libgcc gcc4 4951.16Smrg get_crtstuff crtstuff4 4961.16Smrg exit 0 4971.16Smrg ;; 4981.16Smrg 4991.16Smrg# gcc files 5001.16Smrggcc4) 5011.16Smrg get_gcc gcc4 5021.16Smrg get_libgcc gcc4 5031.24Sskrll get_libgcov gcc4 5041.16Smrg get_crtstuff crtstuff4 5051.16Smrg get_gcc_libiberty gcc4 5061.16Smrg get_libobjc libobjc4 5071.16Smrg get_libstdcxx_v3 libstdc++-v3_4 5081.1Smrg exit 0 5091.1Smrg ;; 5101.1Smrg 5111.1Smrggcc3) 5121.16Smrg get_gcc gcc3 5131.1Smrg get_libg2c 5141.20Sskrll get_libgcc gcc3 5151.16Smrg get_crtstuff crtstuff3 5161.20Sskrll get_gcc_libiberty gcc3 5171.16Smrg get_libobjc libobjc3 5181.16Smrg get_libstdcxx_v3 libstdc++-v3 5191.1Smrg exit 0 5201.1Smrg ;; 5211.1Smrg 5221.1Smrg*) echo invalid arguments; exit 1;; 5231.1Smrgesac 524