This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

first pass at "mini-crosstool"


  for my own benefit (and for anyone else who might find it handy
after it's done), i decided to create what i call "mini-crosstool".
when it's finished, it will be an *extremely* simplified version of
crosstool that makes all kinds of wild assumptions and does no
error-checking whatsoever.  so what's the point?

  it's meant almost exclusively as a teaching tool so folks can
understand the *really* fundamental operations behind crosstool.  i'm
also trying as much as possible to follow the directory layout in
karim yaghmour's book so folks can follow along in that book while
seeing how each step works.  the final version will be more heavily
annotated but will still not even *try* to match the full feature set
of crosstool.  like i said, it's a teaching tool to get over that
first hump before getting into dan's crosstool proper.

  here's the results of an hour of hacking -- i can post the finished
version when it's done, perhaps after the weekend, if there's any
interest.  otherwise, just e-mail me offline.


#
#  Short version of crosstool, following most of Yaghmour's standards.
# This script is *extremely* simplified, makes plenty of assumptions,
# and does virtually no error-checking.  In short, it's like a lot of
# production software. :-)  It's primarily for teaching purposes and,
# if you're moderately lucky, it will actually build a working toolchain.
#
#  Variables you need to set for now:
#

RESULTS_DIR=~/results			# multiple chains directory
PROJECT=jornada				# give this build some name
TARGET=sh3-unknown-linux-gnu
ARCH=sh					# based on include/asm-${ARCH}
TARBALLS_DIR=~/ct/downloads		# where are the .bz2 tarballs?
PATCHES_DIR=~/ct/crosstool-0.38/patches	# stolen shamelessly

#  Software components, all in .bz2 form in ${TARBALLS_DIR}.

BINUTILS_VERSION=2.16.1
GCC_VERSION=4.0.2
GLIBC_VERSION=2.3.5
HEADERS_VERSION=2.6.12.0

# Build/configuration variables.

#  (empty for now, coming soon)

#
#  Directory layout:
#
#   ${RESULTS_DIR}/		(for *all* results if you want)
#     ${PROJECT}/		${PRJROOT}
#	tools/			${PREFIX}
#	  bin/			(actual cross-compile commands)
#	  ${TARGET}/		${TARGET_PREFIX}
#	    sys-root/		${SYSROOT_DIR}
#	build-tools/		${BUILD_DIR}
#	  linux-libc-headers-??
#	  binutils-??/
#	  build-binutils/
#	  ... more to come ...
#

PRJROOT=${RESULTS_DIR}/${PROJECT}	; rm -rf ${PRJROOT}
PREFIX=${PRJROOT}/tools
TARGET_PREFIX=${PREFIX}/${TARGET}
SYSROOT_DIR=${TARGET_PREFIX}/sys-root
BUILD_DIR=${PRJROOT}/build-tools
PATH=${PREFIX}/bin:${PATH}

mkdir -p ${PREFIX}
mkdir -p ${BUILD_DIR}

######################################################################
#
#  1. Unpack and install the sanitized kernel headers into sys-root.
#     (Patch utility coming soon.)
#
######################################################################

HEADERS=linux-libc-headers-${HEADERS_VERSION}
tar ${VERBOSE_TAR}xjf ${TARBALLS_DIR}/${HEADERS}.tar.bz2 \
	-C ${BUILD_DIR}
HEADERS_DIR=${SYSROOT_DIR}/usr/include
mkdir -p ${HEADERS_DIR}

#
#  Copy only the kernel headers you need.
#

cp -r ${BUILD_DIR}/${HEADERS}/include/linux ${HEADERS_DIR}
cp -r ${BUILD_DIR}/${HEADERS}/include/asm-${ARCH} ${HEADERS_DIR}/asm

# rm -rf ${BUILD_DIR}/${HEADERS}	# redundant now, right?

######################################################################
#
#  2. Unpack, patch and build binutils.
#
######################################################################


... etc etc more to come ...

rday

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]