blob: 2a68c79965b8408748bf33f0d2a5077adb6c31cb [file] [log] [blame]
Reid Spencer09d05942007-07-16 08:05:18 +00001#!/bin/sh
2
Reid Spencer8d1b8f72007-07-17 07:17:02 +00003# 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.
Reid Spencer5cd2aab2007-07-21 09:33:41 +000010process_arguments "$@"
Reid Spencer09d05942007-07-16 08:05:18 +000011
Reid Spencerc5a879c2007-08-31 19:53:42 +000012# See if we have previously been configured by sensing the presence
Reid Spencer09d05942007-07-16 08:05:18 +000013# of the config.status scripts
Reid Spencer3b523082007-07-16 22:54:42 +000014if test ! -x "config.status" ; then
Reid Spencer09d05942007-07-16 08:05:18 +000015 # We must configure so build a list of configure options
16 config_options="--prefix=$PREFIX --with-llvmgccdir=$PREFIX"
Reid Spencerc5a879c2007-08-31 19:53:42 +000017 if test "$OPTIMIZED" -eq 1 ; then
18 config_options="$config_options --enable-optimized"
19 else
20 config_options="$config_options --disable-optimized"
21 fi
22 if test "$DEBUG" -eq 1 ; then
23 config_options="$config_options --enable-debug"
24 else
25 config_options="$config_options --disable-debug"
26 fi
27 if test "$ASSERTIONS" -eq 1 ; then
28 config_options="$config_options --enable-assertions"
29 else
30 config_options="$config_options --disable-assertions"
31 fi
32 if test "$CHECKING" -eq 1 ; then
33 config_options="$config_options --enable-expensive-checks"
34 else
35 config_options="$config_options --disable-expensive-checks"
36 fi
37 if test "$DOXYGEN" -eq 1 ; then
38 config_options="$config_options --enable-doxygen"
39 else
40 config_options="$config_options --disable-doxygen"
41 fi
42 if test "$THREADS" -eq 1 ; then
43 config_options="$config_options --enable-threads"
44 else
45 config_options="$config_options --disable-threads"
46 fi
Reid Spencer8d1b8f72007-07-17 07:17:02 +000047 config_options="$config_options $OPTIONS_DASH $OPTIONS_DASH_DASH"
48 msg 0 Configuring $module with:
49 msg 0 " ./configure" $config_options
Reid Spencerc5a879c2007-08-31 19:53:42 +000050 $LLVM_TOP/llvm/configure $config_options || \
51 die $? "Configuring llvm module failed"
52else
53 msg 0 Module $module already configured, ignoring configure options.
Reid Spencer09d05942007-07-16 08:05:18 +000054fi
55
Reid Spencer8d1b8f72007-07-17 07:17:02 +000056msg 0 Building $module with:
57msg 0 " make" $OPTIONS_ASSIGN tools-only
58make $OPTIONS_ASSIGN tools-only