|
From: <jb...@us...> - 2003-11-13 16:30:42
|
Update of /cvsroot/linux-vax/toolchain
In directory sc8-pr-cvs1:/tmp/cvs-serv19666
Added Files:
build-native-compiler.sh
Log Message:
- Initial (public) version.
--- NEW FILE: build-native-compiler.sh ---
#!/bin/sh
#
# This script tries to first build a cross-compiler, then we build
# uClibc support for it. The last step then is to build glibc,
# which may or may not work... You may give "force" as a command
# line argument to indicate that you don't need your .config files
# any longer. Otherwise than that, we're expecting to see pristine
# sources.
#
# Copyright (C) 2003 by Jan-Benedict Glaw <jb...@lu...>
#
# Use this script under the terms of the GNU General Public License,
# Version 2.
#
# Nov 13, 2003: jbglaw - First public release
#
#
# CVS sources
#
# Please notice that uClibc needs to have a patch applied to not
# buils the linux-2.4.x style module loader interface. Look at
# ./kernel-2.5/Documentation/vax/userland.txt for that patch...
#
TOOLCHAIN=/home/jbglaw/vax-linux/toolchain
UCLIBC=/home/jbglaw/vax-linux/uClibc
GLIBC=/home/jbglaw/vax-linux/glibc
LINUX26=/home/jbglaw/vax-linux/kernel-2.5
#
# Build/Target configuration
#
XX_TARGET=vax-dec-linux
XX_BUILD=i386-linux
#
# Where to install?
#
CROSSTOOLS_INSTALL=/home/jbglaw/vax-linux/vax-cross-dev
NATIVE_ROOT_INSTALL=/home/jbglaw/vax-linux/vax-native-dev
#
# # # # # Nothing to change below this line # # # #
#
set -e
FORCE=""
#
# Force build? That is, we may drop .config files.
#
[ $# -gt 0 ] && [ "${1}" = "force" ] && FORCE=1
#
# We need pristine source trees. That is, we expect that there
# are *no* .config files, neither for uClibc, not for the
# kernel itself because we're to overwrite them...
#
if ! [ "${FORCE}" = 1 ]; then
if [ -e "${LINUX26}/.config" ]; then
echo "There's a .config file in your linux-2.6 sources. I need pristine sources..." >&2
exit 1
fi
if [ -e "${UCLIBC}/.config" ]; then
echo "There's a .config file in your uClibc sources. I need pristine sources..." >&2
exit 1
fi
fi
#
# Prepare kernel headers for uClibc
#
cd "${LINUX26}"
[ -e .config ] && rm -f .config
make ka650_defconfig
make include/asm
make include/linux/version.h
#
# Build C-only VAX cross-compiler
#
cd "${TOOLCHAIN}"
./build-vax.sh prefix="${CROSSTOOLS_INSTALL}"
./build-vax.sh install
#
# Build uClibc. We mostly want to use the "defconfig", but I prefer to
# have some values set to non-standard values. So I'll override them and
# reload the .config file.
#
cd "${UCLIBC}"
[ -e .config ] && rm -f .config
make defconfig
echo "KERNEL_SOURCE=\"${LINUX26}\"" >> .config
echo "DO_C99_MATH=y" >> .config
echo "UCLIBC_HAS_WCHAR=y" >> .config
echo "UCLIBC_HAS_THREADS=y" >> .config
echo "PTHREADS_DEBUG_SUPPORT=n" >> .config
echo "UCLIBC_HAS_IPV6=y" >> .config
echo "UCLIBC_HAS_FULL_RPC=y" >> .config
echo "SHARED_LIB_LOADER_PATH=\"/lib\"" >> .config
echo "DEVEL_PREFIX=\"${CROSSTOOLS_INSTALL}\"" >> .config
echo "SYSTEM_DEVEL_PREFIX=\"\$(DEVEL_PREFIX)\"" >> .config
echo "DEVEL_TOOL_PREFIX=\"\$(DEVEL_PREFIX)/usr\"" >> .config
make oldconfig
make clean
make CROSS="${XX_TARGET}-"
make install
make PREFIX="${NATIVE_ROOT_INSTALL}" install_target
#
# Build native compiler
#
export PATH="${PATH}:${CROSSTOOLS_INSTALL}/bin"
cd "${TOOLCHAIN}"
[ -e "${TOOLCHAIN}/b-vax-native" ] && rm -rf "${TOOLCHAIN}/b-vax-native"
mkdir "${TOOLCHAIN}/b-vax-native"
cd "${TOOLCHAIN}/b-vax-native"
CC=vax-uclibc-gcc ../src/configure --host="${XX_TARGET}" \
--build="${XX_BUILD}" --target="${XX_TARGET}" \
--enable-languages=c --prefix=/usr
make LDFLAGS=-lm
make install prefix="${NATIVE_ROOT_INSTALL}/usr"
#
# Build glibc
#
cd "${TOOLCHAIN}"
[ -e b-glibc ] && rm -rf b-glibc
mkdir b-glibc
cd b-glibc
"${GLIBC}/configure" --host="${XX_TARGET}" --build="${XX_BUILD}" \
--with-headers="${LINUX26}/include" --enable-add-ons \
--disable-profile --without-gd --without-fp
make lib
make prefix="${NATIVE_ROOT_INSTALL} install"
|