# start
-export hdw_version="0.3" # version of hdw-linux
+export hdw_version="1.0" # version of hdw-linux
export hdw_target="default" # which target to build
# currently:
# sparc - 32bit sparc
# sparc64 - 64bit sparc
# ppc - powerpc's
+ # mips - mips architctures
-export hdw_arch_opt="i686" # choose optimization
- # currently: ia32 : i[3-6]86
- # sparc64 : sparc_v9
- # sparc : sparc_v[7-8]
- # ppc : "" (still in dev)
+export hdw_arch_opt="" # choose optimization
+ # currently: ia32 : i386, i586, i686 ...
+ # sparc64 : v9, ultrasparc ...
+ # sparc : v7, v8, supersparc ...
+ # ppc : 603e, 604, 740 ...
+ # mips : r2k, r3k, r4k ...
-export hdw_use_dietlibc="0" # 0: use gnu c library (glibc)
- # 1: use dietlibc
+export hdw_use_dietlibc="0" # 0: use gnu c library
+ # 1: use dietlibc (devel)
export hdw_opt="3" # choose -O optimization value
# default : 3
export hdw_crossbuild="0" # 0: native build
- # 1: crossbuild - warning: devel!
+ # 1: crossbuild
-export hdw_real_build="" # set real build arch in case hdw_crossbuild is
- # set to 1 & the scripts guess wrong build arch
- # (example: sparc64 with 32 bit userland)
+export hdw_real_build="" # set real build arch
+ # uname output may not match available compiler
export hdw_build_id="$hdw_target-$hdw_arch-$hdw_arch_opt-$hdw_version" # id
+*) 2005-05-13
+
+- changes major scripts improving toolchain and crossbuild concept (devel)
+
*) 2005-05-03
- updated fontconfig package
rm -rf $root/tmp/src.binutils
# show new linker to gcc
+ cr="" ; [ "$hdw_crossbuild" != "0" ] && cr=/${s1_prefix}
SPECFILE="`gcc --print-file specs`"
- sed -e "s@ /${s1_prefix}/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g" \
- -e "s@ /${s1_prefix}/lib/ld.so.1@ /lib/ld.so.1@g" \
+ sed -e "s@ /${s1_prefix}/lib/ld-linux.so.2@ $cr/lib/ld-linux.so.2@g" \
+ -e "s@ /${s1_prefix}/lib/ld.so.1@ $cr/lib/ld.so.1@g" \
$SPECFILE > tempspecfile
mv tempspecfile $SPECFILE
unset SPECFILE
# [D] binutils-2.15.91.0.1.tar.bz2 http://ftp.kernel.org/pub/linux/devel/binutils/
if [ "$priority" = "1" ] ; then
- confopt=${confopt//--host* /--host=$hdw_arch_build }
confopt="$confopt --disable-nls"
# use host system tools
hdw_arch_prefix=""
. ./scripts/optimization
unset CFLAGS
- make_conf="LDFLAGS=-all-static"
libpath="$prefix/lib"
fi
rm -rf $root/tmp/src.binutils
# show new linker to gcc
- SPECFILE=$prefix/lib/gcc-lib/*/*/specs &&
+ SPECFILE="`gcc --print-file specs`" &&
sed -e "s@/lib/ld.so.1@$prefix/lib/ld.so.1@g" \
-e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" \
$SPECFILE > tempspecfile
if [ "$priority" = "5" ] ; then
confopt="$confopt --enable-shared --with-lib-path=$prefix/lib"
- make_conf=""
- libpath="/usr/lib:/lib"
+ if [ "$hdw_crossbuild" = "0" ] ; then
+ libpath="/usr/lib:/lib"
+ else
+ libpath="$prefix/usr/lib:$prefix/lib"
+ fi
fi
build_main() {
mkdir -p ../binutils-build
cd ../binutils-build
../binutils-${ver}/configure $confopt &&
- [ "$priority" = "1" ] && make configure-host
make $make_conf &&
- make install
+ make $install_conf install
}
post_install() {
# linkers default library path (where our glibc will go)
make -C ld clean
- make -C ld $make_conf LIB_PATH=$libpath
+ make -C ld LIB_PATH=$libpath
# __very__ ___ugly___
# store binutils tree to reinstall after glibc build
cd $root && mkdir -p tmp
fi
# architecture specific stuff
confopt="$confopt --build=$hdw_arch_build"
- confopt="$confopt --host=$hdw_arch_target"
+ confopt="$confopt --host=$hdw_arch_host"
# crosscompiling
[ "$package" = "gcc" -o "$package" = "binutils" ] && \
confopt="$confopt --target=$hdw_arch_target"
fi
# lets see what root is:
-[ "$hdw_status" = "2" -o "$hdw_status" = "3" ] && root=""
-if [ "$hdw_status" -lt 2 -o "$hdw_crossbuild" != "0" ] ; then
+root=""
+if [ "$hdw_crossbuild" != "0" -a "$hdw_status" -lt "2" ] ; then
+ # check for properly configured build directory
if [ -z "$hdw_build_dir" ] ; then
echo "please set hdw_build_dir in ./Config!"
exit 1
set +h
umask 022
export LC_ALL=POSIX
-[ "$hdw_status" -lt "2" ] && export PATH="$root/${s1_prefix}/bin:$PATH"
+[ "$hdw_status" -lt "2" -o "$hdw_crossbuild" != "0" ] && \
+ export PATH="$root/${s1_prefix}/bin:$PATH"
# let's do optimization and care for crossbuilds
-if [ ! -z "`uname --version | grep sh-utils`" ] ; then
+#
+# as gnu autoconf terminology has been confusing me again and again,
+# there are a few comments following ;)
+#
+# ref: gcc docs - hardware models and configurations
+# @ http://gcc.gnu.org/onlinedocs/
+#
+
+# --build: the system the actual executable is created on. uname will tell us.
+# you may set hdw_real_build, or
+# you may fake uname output using fake_utsname kernel module!
+if [ -n "`uname --version | grep sh-utils`" ] ; then
hdw_arch_build="`uname -m -p | tr " " -`-linux-gnu"
else
hdw_arch_build="`uname -m`-unknown-linux-gnu"
fi
+[ -n "$hdw_real_build" ] && hdw_arch_build="${hdw_real_build}-unknown-linux-gnu"
+
+# --target: the system for which the executable is going to produce code.
case "$hdw_arch" in
ia32) if [ -z "$hdw_arch_opt" ] ; then
hdw_arch_target="i386-pc-linux-gnu"
- elif [ ! -z "$hdw_arch_opt" ] ; then
+ else
hdw_arch_target="${hdw_arch_opt}-pc-linux-gnu"
hdw_cflags="-march=${hdw_arch_opt}"
fi
sparc*) if [ -z "$hdw_arch_opt" ] ; then
hdw_arch_target="$hdw_arch-unknown-linux-gnu"
else
- # hack this! :)
- echo "pls hack sparc* opt. options and submit :)"
- echo "no optimization used!"
hdw_arch_target="$hdw_arch-unknown-linux-gnu"
hdw_cflags="-march={hdw_arch_opt}"
fi ;;
ppc)
hdw_arch_target="powerpc-unknown-linux-gnu"
- [ ! -z "$hdw_arch_opt" ] && hdw_cflags="-march=${hdw_arch_opt}"
+ if [ -z "$hdw_arch_opt" ] ; then
+ hdw_cflags="-mcpu=common"
+ else
+ hdw_cflags="-mcpu=${hdw_arch_opt}"
+ fi
hdw_arch_build=${hdw_arch_build//ppc/powerpc} ;;
mips) hdw_arch_target="mips-unknown-linux-gnu"
- [ ! -z "$hdw_arch_opt" ] && hdw_cflags="-march=${hdw_arch_opt}"
- ;;
- *) echo "not supported yet"
+ if [ -z "$hdw_arch_opt" ] ; then
+ echo "info: no optimization set"
+ else
+ hdw_cflags="-march=${hdw_arch_opt}"
+ fi ;;
+ *) echo "$hdw_arch_target not supported yet"
echo "please choose a valid optimization and build platform."
exit 1 ;;
esac
+
+# --host: system where the created executable runs on.
+hdw_arch_host=${hdw_arch_build}
+[ "$hdw_status" != "0" ] && hdw_arch_host=${hdw_arch_target}
+
# -O flag
-[ ! -z "$hdw_opt" ] && hdw_cflags="-O${hdw_opt} $hdw_cflags"
+# optimization only at stages >= 1
+[ -n "$hdw_opt" ] && hdw_cflags="-O${hdw_opt} $hdw_cflags"
# build tools to use
-hdw_arch_prefix=""
-if [ "$hdw_crossbuild" != "0" ] ; then
- hdw_arch_prefix="$hdw_arch_target-"
- if [ "$hdw_real_build" ] ; then
- if [ "$hdw_arch" = "ia32" ] ; then
- hdw_arch_build=${hdw_arch_build//$hdw_arch_opt/$hdw_real_build}
- else
- hdw_arch_build=${hdw_arch_build//$hdw_arch/$hdw_real_build}
- fi
- fi
-fi
-# test: actually we always use the compilers for target
-# hdw_arch_prefix="$hdw_arch_target-"
+# should be the same like host imho, right?
+hdw_arch_prefix="$hdw_arch_host-"
-# resume ...
+# print decissions for debugging ...
echo "hdw_arch_target variable set to $hdw_arch_target"
echo "hdw_arch_build variable set to $hdw_arch_build"
+echo "hdw_arch_host variable ste to $hdw_arch_host"
+echo "hdw_arch_prefix variable set to $hdw_arch_prefix"
echo "hdw_cflags variable set to $hdw_cflags"
[ "$hdw_status" = "1" ] && echo "hdw_stage1_prefix set to '$s1_prefix'"
# the tools
export CC="${hdw_arch_prefix}gcc"
+export CPP="${hdw_arch_prefix}g++"
export CXX="${hdw_arch_prefix}c++"
export AS="${hdw_arch_prefix}as"
export STRIP="${hdw_arch_prefix}strip"
export KCC="${hdw_arch_prefix}kcc"
# flags - edit this at own risk
-# export CPP
export CFLAGS="${hdw_cflags}"
-# export CPPFLAGS
-# export CXXFLAGS
+export CPPFLAGS="${hdw_cflags}"
+export CXXFLAGS="${hdw_cflags}"
# export ASFLAGS
# export ARFLAGS
# export LDFLAGS