Commit 37ac3c7f by Jeffrey Oldham Committed by Jeffrey D. Oldham

gcc_build (bootstrap_gcc): New function.

2000-11-08  Jeffrey Oldham  <oldham@oz.codesourcery.com>

	* gcc_build (bootstrap_gcc): New function.
	(configure_gcc): Likewise.
	(build_gcc): Rewritten to use configure and bootstrap.
	(MAKE_BOOTSTRAP_OPTIONS): Replaced MAKE_OPTIONS.

From-SVN: r37323
parent 69908851
2000-11-08 Jeffrey Oldham <oldham@oz.codesourcery.com>
* gcc_build (bootstrap_gcc): New function.
(configure_gcc): Likewise.
(build_gcc): Rewritten to use configure and bootstrap.
(MAKE_BOOTSTRAP_OPTIONS): Replaced MAKE_OPTIONS.
2000-10-31 Mark Mitchell <mark@codesourcery.com> 2000-10-31 Mark Mitchell <mark@codesourcery.com>
* gcc_build (MAKE): New variable. * gcc_build (MAKE): New variable.
......
...@@ -61,12 +61,14 @@ usage() { ...@@ -61,12 +61,14 @@ usage() {
cat <<EOF cat <<EOF
gcc_build [-c configure_options] gcc_build [-c configure_options]
[-d destination_directory] [-d destination_directory]
[-m make_options] [-m make_boot_options]
[-u username] [-u username]
[-p protocol] [-p protocol]
[-t tarfile] [-t tarfile]
[bootstrap]
[build] [build]
[checkout] [checkout]
[configure]
[export] [export]
[install] [install]
[test] [test]
...@@ -128,9 +130,9 @@ update_gcc() { ...@@ -128,9 +130,9 @@ update_gcc() {
error "Could not update GCC" error "Could not update GCC"
} }
# Build GCC. # Configure for a build of GCC.
build_gcc() { configure_gcc() {
# Go to the source directory. # Go to the source directory.
changedir ${DESTINATION} changedir ${DESTINATION}
...@@ -143,14 +145,23 @@ build_gcc() { ...@@ -143,14 +145,23 @@ build_gcc() {
changedir ${OBJDIR} changedir ${OBJDIR}
# Configure the tree. # Configure the tree.
(eval ${DESTINATION}/configure ${CONFIGURE_OPTIONS} | (eval ${DESTINATION}/configure ${CONFIGURE_OPTIONS} 2>&1 |
tee -a ${LOGFILE}) 2>&1 || \ tee -a ${LOGFILE}) || \
error "Could not configure GCC" error "Could not configure the compiler"
}
# Bootstrap GCC. Assume configuration has already occurred.
bootstrap_gcc() {
# Go to the source directory.
changedir ${DESTINATION}
# Go to the object directory.
changedir ${OBJDIR}
# Bootstrap the compiler # Bootstrap the compiler
(eval ${MAKE} ${MAKE_OPTIONS} bootstrap 2>&1 | (eval ${MAKE} ${MAKE_BOOTSTRAP_OPTIONS} bootstrap 2>&1 |
tee -a ${LOGFILE}) || \ tee -a ${LOGFILE}) || \
error "Could not build GCC" error "Could not bootstrap the compiler"
} }
# Test GCC. # Test GCC.
...@@ -223,11 +234,12 @@ CONFIGURE_OPTIONS= ...@@ -223,11 +234,12 @@ CONFIGURE_OPTIONS=
# The `make' program. # The `make' program.
MAKE=${MAKE:-make} MAKE=${MAKE:-make}
# Options to pass to make. # Options to pass to make.
MAKE_OPTIONS= MAKE_BOOTSTRAP_OPTIONS=
# Modes of operation # Modes of operation
BUILD=0 BOOTSTRAP=0
CHECKOUT=0 CHECKOUT=0
CONFIGURE=0
EXPORT=0 EXPORT=0
INSTALL=0 INSTALL=0
TEST=0 TEST=0
...@@ -242,7 +254,7 @@ while getopts "c:d:m:p:t:u:" ARG; do ...@@ -242,7 +254,7 @@ while getopts "c:d:m:p:t:u:" ARG; do
case $ARG in case $ARG in
c) CONFIGURE_OPTIONS="${OPTARG}";; c) CONFIGURE_OPTIONS="${OPTARG}";;
d) DESTINATION="${OPTARG}";; d) DESTINATION="${OPTARG}";;
m) MAKE_OPTIONS="${OPTARG}";; m) MAKE_BOOTSTRAP_OPTIONS="${OPTARG}";;
p) CVS_PROTOCOL="${OPTARG}";; p) CVS_PROTOCOL="${OPTARG}";;
t) CVS_TARGFILE="${OPTARG}";; t) CVS_TARGFILE="${OPTARG}";;
u) CVS_USERNAME="${OPTARG}";; u) CVS_USERNAME="${OPTARG}";;
...@@ -254,8 +266,10 @@ shift `expr ${OPTIND} - 1` ...@@ -254,8 +266,10 @@ shift `expr ${OPTIND} - 1`
# Handle the major modes. # Handle the major modes.
while [ $# -ne 0 ]; do while [ $# -ne 0 ]; do
case $1 in case $1 in
build) BUILD=1;; bootstrap) BOOTSTRAP=1;;
build) CONFIGURE=1; BOOTSTRAP=1;;
checkout) CHECKOUT=1;; checkout) CHECKOUT=1;;
configure) CONFIGURE=1;;
export) EXPORT=1;; export) EXPORT=1;;
install) INSTALL=1;; install) INSTALL=1;;
test) TEST=1;; test) TEST=1;;
...@@ -282,9 +296,14 @@ elif [ ${UPDATE} -ne 0 ]; then ...@@ -282,9 +296,14 @@ elif [ ${UPDATE} -ne 0 ]; then
update_gcc update_gcc
fi fi
# Build the compiler. # Configure to build the tree.
if [ ${BUILD} -ne 0 ]; then if [ ${CONFIGURE} -ne 0 ]; then
build_gcc configure_gcc
fi
# Bootstrap the compiler.
if [ ${BOOTSTRAP} -ne 0 ]; then
bootstrap_gcc
fi fi
# Test the compiler # Test the compiler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment