123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- PROGRAM="${0##*/}"
- if test "$1" = -h -o "$1" = --help
- then
- echo "Deploy static cross-compilers for easy distribution."
- echo ""
- echo "Usage: $PROGRAM [TARGET]..."
- echo ""
- echo "Where TARGET is any target found in the directory \"targets\"."
- echo "If no target names are passed, all available targets will be built."
- echo ""
- exit 0
- fi
- set -e
- LC_ALL=C
- export LC_ALL
- CWD=$(CDPATH= cd -P -- $(dirname -- "$0") && printf "$PWD")
- output="${CWD}/OUTPUT.darkcrusade"
- TMPDIR=${output}/sources
- export TMPDIR
- tarname=darkcrusade_"$(date +%Y%b)"
- phase_one=${output}/phase1-native-"$(uname -m)".$$
- echo "${PROGRAM}: Creating native cross compiler on $phase_one ..."
- "${CWD}"/bootstrap -s0 -o $phase_one
- echo "${PROGRAM}: Using (existing) compiler from $phase_one ..."
- for BTCC in ${phase_one}/cross/*/bin/*-gcc
- do
- if test -x "$BTCC"
- then
- BTCC="$BTCC"
- break
- fi
- done
- for BTCXX in ${phase_one}/cross/*/bin/*-g++
- do
- if test -x "$BTCXX"
- then
- BTCXX="$BTCXX"
- break
- fi
- done
- BTCC="$BTCC -static -Wl,-Bstatic -static-libgcc"
- BTCXX="$BTCXX -static -Wl,-Bstatic -static-libgcc"
- IS_DARKCRUSADE=IS_DARKCRUSADE
- export BTCC BTCXX IS_DARKCRUSADE
- for target in "${CWD}"/targets/${@:-*}
- do
- target="${target##*/}"
- phase_two=${output}/phase2-${target}.$$
- echo "darkcrusade: Making target $target ..."
- "${CWD}"/bootstrap -s0 -a $target -o $phase_two 2>&1 | \
- tee ${output}/${tarname}-${target}.log
-
- lzip -9 ${output}/${tarname}-${target}.log
-
- cd $output && rm -f ${tarname}-${target}.tar ${tarname}-${target}.tar.lz
- cd $phase_two && tarlz -c cross/ > ${output}/${tarname}-${target}.tar.lz
- cd $output && sha256sum ${tarname}-${target}.tar.lz \
- > ${tarname}-${target}.tar.lz.sha256
-
- cd -- "$CWD"
- done
|