Reid Spencer | 09d0594 | 2007-07-16 08:05:18 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Reid Spencer | 8d1b8f7 | 2007-07-17 07:17:02 +0000 | [diff] [blame] | 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. |
Reid Spencer | 5cd2aab | 2007-07-21 09:33:41 +0000 | [diff] [blame] | 10 | process_arguments "$@" |
Reid Spencer | 09d0594 | 2007-07-16 08:05:18 +0000 | [diff] [blame] | 11 | |
Reid Spencer | c5a879c | 2007-08-31 19:53:42 +0000 | [diff] [blame] | 12 | # See if we have previously been configured by sensing the presence |
Reid Spencer | 09d0594 | 2007-07-16 08:05:18 +0000 | [diff] [blame] | 13 | # of the config.status scripts |
Reid Spencer | 3b52308 | 2007-07-16 22:54:42 +0000 | [diff] [blame] | 14 | if test ! -x "config.status" ; then |
Reid Spencer | 09d0594 | 2007-07-16 08:05:18 +0000 | [diff] [blame] | 15 | # We must configure so build a list of configure options |
| 16 | config_options="--prefix=$PREFIX --with-llvmgccdir=$PREFIX" |
Reid Spencer | c5a879c | 2007-08-31 19:53:42 +0000 | [diff] [blame] | 17 | 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 Spencer | 8d1b8f7 | 2007-07-17 07:17:02 +0000 | [diff] [blame] | 47 | config_options="$config_options $OPTIONS_DASH $OPTIONS_DASH_DASH" |
| 48 | msg 0 Configuring $module with: |
| 49 | msg 0 " ./configure" $config_options |
Reid Spencer | c5a879c | 2007-08-31 19:53:42 +0000 | [diff] [blame] | 50 | $LLVM_TOP/llvm/configure $config_options || \ |
| 51 | die $? "Configuring llvm module failed" |
| 52 | else |
| 53 | msg 0 Module $module already configured, ignoring configure options. |
Reid Spencer | 09d0594 | 2007-07-16 08:05:18 +0000 | [diff] [blame] | 54 | fi |
| 55 | |
Reid Spencer | 8d1b8f7 | 2007-07-17 07:17:02 +0000 | [diff] [blame] | 56 | msg 0 Building $module with: |
| 57 | msg 0 " make" $OPTIONS_ASSIGN tools-only |
| 58 | make $OPTIONS_ASSIGN tools-only |