scripts: initial work to enable usage of common sources directory per build configuration
[AROS.git] / scripts / nightly / setup
blob75adebe8710e768dcaf8dcacb80c8f94ab4fba31
1 # Import configuration
2 source $SP/cfg/defaults
3 source $SP/cfg/$CFG_NAME
5 # Determine version
6 VERSION=$(date -u +"%Y%m%d")
7 BASENAME=AROS-$VERSION
9 # Setup important paths
10 ROOT=$(pwd)
12 SOURCE_ROOT=$ROOT/Source
13 SOURCE_AROS=$SOURCE_ROOT/AROS
14 SOURCE_CONTRIB=$SOURCE_ROOT/Contrib
15 SOURCE_DOCS=$SOURCE_ROOT/Documentation
17 BUILD_ROOT=$ROOT/Build
18 BUILD_BASE=$BUILD_ROOT/$VERSION
20 ARCHIVE_ROOT=$ROOT/Archive
21 ARCHIVE_BASE=$ARCHIVE_ROOT/$VERSION
23 PORTSSOURCES_ROOT=$ROOT/PortsSources
25 # Setup log paths
26 LOG_BASE=$ARCHIVE_BASE/logs/$CFG_NAME
27 LOG_ALL=$LOG_BASE/all.log
28 LOG_THIS=/dev/null
30 # Figure out the host platform
31 HOST_OS=$(uname)
32 case $HOST_OS in
33     Linux)
34         HOST_OS=linux
35         ;;
36     FreeBSD)
37         HOST_OS=freebsd
38         ;;
39 esac
40         
41 HOST_CPU=$(uname -m)
42 case $HOST_CPU in
43     i?86)
44         HOST_CPU=i386
45         ;;
46     ppc)
47         HOST_CPU=ppc
48         ;;
49 esac
52 # Figure out the build tools
53 if [[ $HOST_OS == "freebsd" ]]; then
54     alias make='execute gmake'
55 else
56     alias make='execute make'
59 alias makedir='execute mkdir -p'
60 alias  delete='execute rm -rf'
61 alias    copy='execute cp -pRL'
62 alias    move='execute mv -f'
64 export CC=$CFG_CC
65 export PYTHON=$CFG_PYTHON
66 MAKE_JOBS=$CFG_MAKE_JOBS
67 PORTSSOURCESOPT=""
69 # Enable --with-portssources ?
70 if [[ "$CFG_PORTSSOURCES_ENABLE" == "yes" ]]; then
71     PORTSSOURCESOPT="--with-portssources=$PORTSSOURCES_ROOT"
74 # Initial setup, if requested
75 if [[ $1 == "initial" ]]; then
76     # Setup directories if needed
77     rm -rf $BUILD_BASE $ARCHIVE_BASE
78     mkdir -p $BUILD_ROOT $BUILD_BASE
79     mkdir -p $ARCHIVE_BASE
80     mkdir -p $LOG_BASE
81     
82     if [ ! -f $LOG_ALL ]; then
83         touch $LOG_ALL
84     fi
87 # Import functions
88 source $SP/functions