On Having Built Linux for a Small System


Explanation: Config/host-gcc/v2.95.3-2.mak

${EXTTEMP}/gcc-${VERSION}-xdc/.configured:
		cd ${EXTTEMP}/gcc-${VERSION}-xdc || exit 1 ;\
		CC=${XTC_ROOT}/usr/bin/${TARGET_SPEC}-gcc \
		  CC_FOR_BUILD=${HTC_GCC} \
		  HOSTCC=${HTC_GCC} \
		  GCC_FOR_TARGET=${XTC_ROOT}/usr/bin/${TARGET_SPEC}-gcc \
	  	  AR=${XTC_ROOT}/usr/bin/${TARGET_SPEC}-ar \
	  	  AS=${XTC_ROOT}/usr/bin/${TARGET_SPEC}-as \
	  	  LD=${XTC_ROOT}/usr/bin/${TARGET_SPEC}-ld \
	  	  NM=${XTC_ROOT}/usr/bin/${TARGET_SPEC}-nm \
	  	  RANLIB=${XTC_ROOT}/usr/bin/${TARGET_SPEC}-ranlib \
	    	  CFLAGS=-O2 \
			../${EXTPATH}/configure \
			  --prefix=${XDC_ROOT}/usr \
			  --host=$(shell echo ${NATIVE_SPEC} | sed 's/-gnulibc1//') \
			  --build=${TARGET_SPEC} \
			  --target=${TARGET_SPEC} \
			  --disable-multilib \
			  --with-headers=${XDC_ROOT}/usr/${TARGET_SPEC}/include \
			  --with-libs=${XDC_ROOT}/usr/${TARGET_SPEC}/lib \
			  --program-transform-cross-name='s,x,x,' \
			  --with-sysroot=/ \
			  --with-build-sysroot=/ \
			  --enable-languages=c \
			  --disable-nls \
			  --enable-shared \
			  --with-gnu-as \
			  --with-gnu-ld \
			  || exit 1 ;\
		find ./ -name Makefile | while read MF ; do \
			echo $${MF} ;\
			mv $${MF} $${MF}.OLD || exit 1 ;\
			cat $${MF}.OLD \
				| sed	' /LANGUAGES=/	s/ c++// ; /^gcc_tooldir/ s%..target_alias.%% ; /^SYSTEM_HEADER_DIR/ s%..tooldir./sys%/usr/% ' > $${MF} || exit 1 ;\
			done ;\

		make all-gcc prefix=/usr || exit 1 ;\

		make install prefix=${XDC_ROOT}/usr || exit 1 ;\
		cat gcc/specs \
			| sed	'	s/ld-linux.so.2/ld-uClibc.so.0/ ; /cross_compile/,+2 s/1/0/ ' > ${XDC_ROOT}/usr/lib/gcc-lib/${TARGET_SPEC}/${VERSION}/specs || exit 1 \