blob: 78e3ed87f092fdb4f2fce49cd9c3e45f72a0dfa9 [file] [log] [blame]
Shih-wei Liaoe264f622010-02-10 11:10:31 -08001#!/bin/sh
2
3# This includes the Bourne shell library from llvm-top. Since this file is
4# generally only used when building from llvm-top, it is safe to assume that
5# llvm is checked out into llvm-top in which case .. just works.
6. ../library.sh
7
8# Process the options passed in to us by the build script into standard
9# variables.
10process_arguments "$@"
11
12# First, see if the build directory is there. If not, create it.
13build_dir="$LLVM_TOP/build.llvm"
14if test ! -d "$build_dir" ; then
15 mkdir -p "$build_dir"
16fi
17
18# See if we have previously been configured by sensing the presence
19# of the config.status scripts
20config_status="$build_dir/config.status"
21if test ! -f "$config_status" -o "$config_status" -ot "$0" ; then
22 # We must configure so build a list of configure options
23 config_options="--prefix=$PREFIX --with-llvmgccdir=$PREFIX"
24 if test "$OPTIMIZED" -eq 1 ; then
25 config_options="$config_options --enable-optimized"
26 else
27 config_options="$config_options --disable-optimized"
28 fi
29 if test "$DEBUG" -eq 1 ; then
30 config_options="$config_options --enable-debug"
31 else
32 config_options="$config_options --disable-debug"
33 fi
34 if test "$ASSERTIONS" -eq 1 ; then
35 config_options="$config_options --enable-assertions"
36 else
37 config_options="$config_options --disable-assertions"
38 fi
39 if test "$CHECKING" -eq 1 ; then
40 config_options="$config_options --enable-expensive-checks"
41 else
42 config_options="$config_options --disable-expensive-checks"
43 fi
44 if test "$DOXYGEN" -eq 1 ; then
45 config_options="$config_options --enable-doxygen"
46 else
47 config_options="$config_options --disable-doxygen"
48 fi
49 if test "$THREADS" -eq 1 ; then
50 config_options="$config_options --enable-threads"
51 else
52 config_options="$config_options --disable-threads"
53 fi
54 config_options="$config_options $OPTIONS_DASH $OPTIONS_DASH_DASH"
55 src_dir=`pwd`
56 cd "$build_dir"
57 msg 0 Configuring $module with:
58 msg 0 " $src_dir/configure" $config_options
59 $src_dir/configure $config_options || \
60 die $? "Configuring $module module failed"
61else
62 msg 0 Module $module already configured, ignoring configure options.
63 cd "$build_dir"
64fi
65
66msg 0 Building $module with:
67msg 0 " make" $OPTIONS_ASSIGN tools-only
68make $OPTIONS_ASSIGN tools-only