Commit a9961276 by Raymond Toy

Rearrange directory structure.

parent 17c9b814

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

#! /bin/sh
# Build all variants of cmucl. This means build x87 and sse2 versions
# for both unicode and non-unicode variants.
# Basically call build.sh to do the builds.
usage ()
{
echo "build-all.sh [-bBCvUP] [-o old] [-8 old8bit]"
echo ""
echo "Build all variants of cmucl for a specific architecture."
echo "This means build the unicode and non-unicode variants."
echo "For x86 architectures, the x87 and sse2 cores are also built."
echo "This script basically automates calling build.sh for all the"
echo "variants, using the most common options. If there are special"
echo "requirements, then you must use build.sh itself instead of this"
echo "script."
echo ""
echo " -b d Basename of the different build directories."
echo " ${d}-2, ${d}-3, ${d}-4 for unicode"
echo " ${d}-8bit-2, ${d}-8bit-3, ${d}-8bit-4 for non-unicode"
echo " -B file Use file as a boot file. Maybe be specified more than once"
echo " The file is relative to the bootfiles/<version> directory"
echo ' -C [l m] Create the build directories. The args are what'
echo ' you would give to create-target.sh for the lisp'
echo ' and motif variant.'
echo ' -v v Use the given string as the version.'
echo " -o x Use specified Lisp to build unicode version."
echo " (only applicable for build 1)"
echo " -8 x Use specified Lisp to build 8-bit version."
echo " (only applicable for build 1)"
echo " -U Update and overwite the translations files."
echo " -P On the last build, (re)generate cmucl.pot and the"
echo " translations"
}
BASE=build
CREATE_OPT=""
UPDATE_POT="-P"
while getopts "PUB:b:v:C:o:8:?" arg
do
case $arg in
b) BASE="$OPTARG" ;;
B) bootfiles="$bootfiles -B $OPTARG" ;;
C) CREATE_OPT="$OPTARG" ;;
o) OLDLISP="$OPTARG" ;;
8) OLD8="$OPTARG" ;;
v) VERSION="$OPTARG"; VERSION_SET=true ;;
U) UPDATE_TRANS="-U" ;;
P) UPDATE_POT="" ;;
\?) usage ;;
esac
done
if [ "$BASE" = "" ]; then
echo "-b option required"
exit 1
fi
if [ "$OLDLISP" = "" -a "$OLD8" = "" ]; then
echo "-o or -8 option required"
exit 1
fi
buildx86 ()
{
if [ -n "$OLD8" ]; then
# Build non-unicode versions
set -x
src/tools/build.sh -f x87 -b ${BASE}-8bit $bootfiles ${VERSION:+-v "$VERSION"} -C "${CREATE_OPT}" ${UPDATE_TRANS} ${UPDATE_POT} -o "$OLD8"
src/tools/build.sh -f sse2 -b ${BASE}-8bit $bootfiles ${VERSION:+-v "$VERSION"} -C "${CREATE_OPT}" ${UPDATE_TRANS} ${UPDATE_POT} -o "$OLD8"
set +x
fi
# Build the unicode versions
if [ -n "$OLDLISP" ]; then
set -x
src/tools/build.sh -f x87 -b ${BASE} $bootfiles ${VERSION:+-v "$VERSION"} -C "${CREATE_OPT}" ${UPDATE_TRANS} ${UPDATE_POT} -o "$OLDLISP"
src/tools/build.sh -f sse2 -b ${BASE} $bootfiles ${VERSION:+-v "$VERSION"} -C "${CREATE_OPT}" ${UPDATE_TRANS} ${UPDATE_POT} -o "$OLDLISP"
set +x
fi
}
buildsun4 ()
{
if [ "$VERSION_SET" = true ]; then
VERS="-v '"$VERSION"'"
fi
# Build non-unicode versions
if [ -n "$OLD8" ]; then
set -x
src/tools/build.sh -b ${BASE}-8bit $bootfiles ${VERS} -C "$CREATE_OPT" ${UPDATE_TRANS} ${UPDATE_POT} -o "$OLD8"
set +x
fi
# Build the unicode version.
if [ -n "$OLDLISP" ]; then
set -x
src/tools/build.sh -b ${BASE} $bootfiles ${VERS} -C "$CREATE_OPT" ${UPDATE_TRANS} ${UPDATE_POT} -o "$OLDLISP"
set +x
fi
}
case `uname -m` in
i386*|x86*|i86pc) buildx86 ;;
sun*) buildsun4 ;;
*) echo "Unsupported architecture: `uname -m`" ;;
esac
#!/bin/sh
# Build CMUCL from source. The intent of this script is to make it a
# little easier invoke the other scripts and build CMUCL. In the
# simplest case where your lisp is named cmulisp and no special
# bootfiles are needed, you would build CMUCL using:
#
# src/tools/build.sh -C ""
#
# This will create a set of directories named build-2, build-3, and
# build-4 and CMUCL will be built 3 consecutive times, using the
# version of CMUCL from the previous build.
#
#
# You can control which of the builds are done by using the -1, -2, -3
# options, but it is up to you to make sure the previous builds exist.
#
# A more realistic example would be
#
# src/tools/build.sh -v "My build" -B boot-19b.lisp -o "my-lisp -noinit"
#
# where you need to load the bootfile boot-19b.lisp and your lisp is
# not named cmulisp, but my-lisp.
#
# For more complicated builds, you will need to run create-target.sh
# manually, and adjust the bootstrap or setenv files by hand. Once
# this is done, you can run build.sh to build everything. Just be
# sure to leave off the -C option.
#
# Cross compiling is not supported with this script. You will have to
# do that by hand.
#
# For more information see src/BUILDING.
#
# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/tools/build.sh,v 1.38 2010/11/10 19:17:55 rtoy Exp $
#
ENABLE2="yes"
ENABLE3="yes"
ENABLE4="yes"
version=20c
SRCDIR=src
TOOLDIR=$SRCDIR/tools
VERSION="`date '+%Y-%m-%d %H:%M:%S'`"
GIT_HASH="`(cd src; git describe --dirty 2>/dev/null)`"
# Add the tree hash to the version
VERSION="$VERSION $GIT_HASH"
BASE=build
OLDLISPFLAGS="-noinit -nositeinit"
OLDLISP="cmulisp"
SKIPUTILS=no
# If gmake exists, assume it is GNU make and use it.
if [ -z "$MAKE" ]; then
MAKE="`which gmake`"
# Some versions of which set an error code if it fails. Others
# say "no foo in <path>". In either of these cases, just assume
# make is GNU make.
if [ $? -ne 0 ]; then
MAKE="make"
fi
if echo "X$MAKE" | grep '^Xno' > /dev/null; then
MAKE="make"
fi
fi
usage ()
{
echo "build.sh [-123obvuBCU?]"
echo " -1 Skip build 1"
echo " -2 Skip build 2"
echo " -3 Skip build 3"
echo " -o x Use specified Lisp to build. Default is cmulisp"
echo " (only applicable for build 1)"
echo ' -b d The different build directories are named ${d}-2, ${d}-3 ${d}-4'
echo ' with a default of "build"'
echo ' -v v Use the given string as the version. Default is'
echo " today's date"
echo " -u Don't build CLX, CLM, or Hemlock"
echo ' -i n Make build "n" interactive, so output is sent to *standard-output*'
echo ' instead of the log file. "n" should be a string consisting of'
echo ' the numbers 1, 2, or 3.'
echo " -B file Use file as a boot file. Maybe be specified more than once"
echo " The file is relative to the bootfiles/<version> directory"
echo ' -C [l m] Create the build directories. The args are what'
echo ' you would give to create-target.sh for the lisp'
echo ' and motif variant.'
echo ' -f mode FPU mode: x87, sse2, or auto. Default is auto'
echo ' -P On the last build, do NOT generate cmucl.pot and do NOT update'
echo ' the translations.'
echo " -? This help message"
echo " -w Specify a different build-world.sh script"
echo " -U If translations are done, overwrite the files with the"
echo " translations instead of computing and displaying the diffs."
echo " -O opt Any additional command-line flags to use when building."
echo " The flags always include -noinit -nositeinit"
exit 1
}
# Figure out if we need to run build-world twice
case `uname -s` in
SunOS) BUILD_WORLD2=yes ;;
Darwin)
case `uname -m` in
ppc) BUILD_WORLD2=yes ;;
esac ;;
esac
buildit ()
{
if echo $INTERACTIVE_BUILD | grep $BUILD > /dev/null; then
INTERACTIVE=t
else
INTERACTIVE=nil
fi
if [ ! -d $TARGET ]; then
if [ -n "$CREATE_DIRS" ]; then
$TOOLDIR/create-target.sh $TARGET $CREATE_OPT
fi
fi
if [ "$ENABLE" = "yes" ];
then
$TOOLDIR/clean-target.sh $CLEAN_FLAGS $TARGET || { echo "Failed: $TOOLDIR/clean-target.sh"; exit 1; }
time $BUILDWORLD $TARGET $OLDLISP $BOOT || { echo "Failed: $BUILDWORLD"; exit 1; }
# Set the LANG to C. For whatever reason, if I (rtoy) don't
# do this on my openSuSE system, any messages from gcc are
# basically garbled. This should be harmless on other
# systems.
LANG=C $MAKE -C $TARGET/lisp $MAKE_TARGET || { echo "Failed: $MAKE -C $TARGET/lisp"; exit 1; }
if [ "$BUILD_WORLD2" = "yes" ];
then
$BUILDWORLD $TARGET $OLDLISP $BOOT || { echo "Failed: $BUILDWORLD"; exit 1; }
fi
$TOOLDIR/load-world.sh $TARGET "$VERSION" || { echo "Failed: $TOOLDIR/load-world.sh"; exit 1; }
$TARGET/lisp/lisp -batch -noinit -nositeinit $FPU_MODE < /dev/null || { echo "Failed: $TARGET/lisp/lisp -batch -noinit $FPU_MODE"; exit 1; }
return 0;
fi
}
FPU_MODE=
BUILDWORLD="$TOOLDIR/build-world.sh"
BUILD_POT="yes"
UPDATE_TRANS=
while getopts "123Po:b:v:uB:C:Ui:f:w:O:?" arg
do
case $arg in
1) ENABLE2="no" ;;
2) ENABLE3="no" ;;
3) ENABLE4="no" ;;
o) OLDLISP=$OPTARG ;;
b) BASE=$OPTARG ;;
v) VERSION="$OPTARG $GIT_HASH" ;;
u) SKIPUTILS="yes" ;;
C) CREATE_OPT="$OPTARG"
CREATE_DIRS=yes ;;
B) bootfiles="$bootfiles $OPTARG" ;;
i) INTERACTIVE_BUILD="$OPTARG" ;;
f) FPU_MODE="-fpu $OPTARG" ;;
P) BUILD_POT=no ;;
w) BUILDWORLD="$OPTARG" ;;
U) UPDATE_TRANS="yes";;
O) OLDLISPFLAGS="$OLDLISPFLAGS $OPTARG" ;;
\?) usage
;;
esac
done
bootfiles_dir=$SRCDIR/bootfiles/$version
if [ -n "$bootfiles" ]; then
for file in $bootfiles; do
BOOT="$BOOT -load $bootfiles_dir/$file"
done
fi
build_started=`date`
echo "//starting build: $build_started"
TARGET=$BASE-2
ENABLE=$ENABLE2
MAKE_TARGET=all
export INTERACTIVE
BUILD=1
OLDLISP="$OLDLISP $OLDLISPFLAGS $FPU_MODE"
buildit
bootfiles=
TARGET=$BASE-3
OLDLISP="${BASE}-2/lisp/lisp $OLDLISPFLAGS $FPU_MODE"
ENABLE=$ENABLE3
BUILD=2
# We shouldn't have to run build-world again because nothing should
# have changed in the C code after the first build.
BUILD_WORLD2=
buildit
TARGET=$BASE-4
CLEAN_FLAGS="-K all"
OLDLISP="${BASE}-3/lisp/lisp $OLDLISPFLAGS $FPU_MODE"
ENABLE=$ENABLE4
if [ "${BUILD_POT}" = "yes" ]; then
MAKE_POT=yes
if [ "${UPDATE_TRANS}" = "yes" ]; then
MAKE_TARGET="all translations-update"
else
MAKE_TARGET="all translations"
fi
export MAKE_POT
fi
BUILD=3
buildit
if [ "$SKIPUTILS" = "no" ];
then
OLDLISP="${BASE}-4/lisp/lisp $OLDLISPFLAGS $FPU_MODE"
time $TOOLDIR/build-utils.sh $TARGET $FPU_MODE
fi
build_finished=`date`
echo
echo "//build started: $build_started"
echo "//build finished: $build_finished"
#!/bin/sh
diag() { echo "($prgm_name) $@" >&2; }
quit() { diag "not OK: $@"; exit 1; }
usage() {
echo "Usage: $prgm_name TARGET-DIR [LISP-VARIANT [MOTIF-VARIANT]]"
echo ""
echo "Creates a directory structure in TARGET-DIR for use in building CMUCL."
echo "A simple logic is used to find the optional -VARIANT parameters."
echo ""
# List possible values for lisp-variant and motif-variant
echo "Possible LISP-VARIANTs:"
( cd src/lisp/ && ls -1 Config.* ) | sed 's;^Config[.];;g' | pr -3at -o 8 || quit "Can't list lisp-variants"
echo "Possible MOTIF-VARIANTs:"
( cd src/motif/server/ && ls -1 Config.* ) | sed 's;^Config[.];;g' | pr -3at -o 8 || quit "Can't list lisp-variants"
exit 2
}
##--
prgm_name=`basename $0` bld_dir=$1 lisp_variant=$2 motif_variant=$3
exec 2>&1
[ -n "$bld_dir" ] || usage
uname_s=`uname -s`
uname_m=`uname -m 2>/dev/null`
[ -n "$lisp_variant" ] || {
case $uname_s in
Linux) lisp_variant=x86_linux ;;
FreeBSD) lisp_variant=x86_freebsd ;;
SunOS)
case $uname_m in
i86pc) lisp_variant=x86_solaris_sunc ;;
sun*) lisp_variant=sparc_gcc ;;
esac
;;
Darwin)
case $uname_m in
ppc) lisp_variant=ppc_darwin ;;
i386) lisp_variant=x86_darwin ;;
esac
;;
NetBSD) lisp_variant=x86_netbsd ;;
*) quit "Unsupported OS: $uname_s";;
esac
}
[ -n "$lisp_variant" ] || quit "Can't determine lisp_variant"
[ -f src/lisp/Config.$lisp_variant ] || quit "Config.$lisp_variant not found"
case $lisp_variant in
*linux*) lvshort=linux;;
*freebsd*) lvshort=freebsd;;
*solaris*) lvshort=solaris;;
*) lvshort=unknown;;
esac
# Beats me why we care about Motif today but let it be, other than on FreeBSD,
# where the config file is wrong anyway. (agoncharov, 2011-10-07)
case $uname_s in
FreeBSD) :;; # Free
*) # Enjoy
[ -n "$motif_variant" ] || {
case $lisp_variant in
NetBSD*) motif_variant=NetBSD ;;
OpenBSD*) motif_variant=OpenBSD ;;
*_darwin) motif_variant=Darwin ;;
sun4_solaris_gcc|sparc_gcc) motif_variant=solaris ;;
sun4_solaris_sunc|sparc_sunc|x86_solaris_sunc) motif_variant=solaris_sunc ;;
sun4c*) motif_variant=sun4c_411 ;;
hp700*) motif_variant=hpux_cc ;;
pmax_mach) motif_variant=pmax_mach ;;
sgi*) motif_variant=irix ;;
x86_linux|linux*) motif_variant=x86 ;;
esac
}
[ -f src/motif/server/Config.$motif_variant ] || quit "No such motif-variant could be found: Config.$motif_variant"
;;
esac
# Tell user what's we've configured
diag "Settings: bld_dir=$bld_dir lisp_variant=$lisp_variant ${motif_variant:+motif_variant=$motif_variant}"
# Create a directory tree that mirrors the source directory tree
[ -d "$bld_dir" -o -f "$bld_dir" ] && quit "Exists: `ls -ld $bld_dir`"
mkdir -p "$bld_dir"
(cd src && find . -name .git -prune -o -type d -print) | (cd $bld_dir && xargs mkdir -p) ||
quit "Can't create target directories"
top_dir=$PWD
cd $bld_dir/lisp || quit "Can't cd $bld_dir/lisp"
# Link Makefile and Config files
ln -s ../../src/lisp/GNUmakefile ../../src/lisp/Config.$lisp_variant ../../src/lisp/Config.*_common .
ln -s Config.$lisp_variant Config
[ -n "$motif_variant" ] && (
cd ../motif/server || quit "Can't cd motif/server" # We will still continue in the outer shell
ln -s ../../../src/motif/server/GNUmakefile ./Makefile
ln -s ../../../src/motif/server/Config.$motif_variant ./Config
)
echo 'Map file for lisp version 0' > lisp.nm # Empty initial map file
echo '#error You need to run genesis (via build-world.sh) before compiling the startup code!' > internals.h
(
setenv_dir=$top_dir/src/tools/setenv-scripts
cat $setenv_dir/base-features.lisp
case $lvshort in
linux|freebsd) gcname=":gencgc"; sed "s;@@gcname@@;$gcname;" $setenv_dir/$lvshort-features.lisp >> setenv.lisp;;
solaris) cat $setenv_dir/solaris-features.lisp;;
*) sed "s;@@LISP@@;$lisp_variant;" $setenv_dir/unknown.lisp;;
esac
) > ../setenv.lisp || quit "Can't create setenv.lisp"
;;;; -*- Package: Bignum -*-
;;;
;;; **********************************************************************
;;; This code was written as part of the CMU Common Lisp project at