Skip to content

Commit

Permalink
Patch to build llvm with srcdir != objdir from
Browse files Browse the repository at this point in the history
llvm-top.  By Michael Schuerig, with some small
tweaks to make the "don't configure if already
configured" logic work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62842 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
CunningBaldrick committed Jan 23, 2009
1 parent 95900f2 commit 2603580
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ModuleInfo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DepModule:
BuildCmd: ./build-for-llvm-top.sh
CleanCmd: make clean
InstallCmd: make install
CleanCmd: make clean -C ../build.llvm
InstallCmd: make install -C ../build.llvm
18 changes: 14 additions & 4 deletions build-for-llvm-top.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
# variables.
process_arguments "$@"

# First, see if the build directory is there. If not, create it.
build_dir="$LLVM_TOP/build.llvm"
if test ! -d "$build_dir" ; then
mkdir -p "$build_dir"
fi

# See if we have previously been configured by sensing the presence
# of the config.status scripts
if test ! -x "config.status" ; then
config_status="$build_dir/config.status"
if test ! -f "$config_status" -o "$config_status" -ot "$0" ; then
# We must configure so build a list of configure options
config_options="--prefix=$PREFIX --with-llvmgccdir=$PREFIX"
if test "$OPTIMIZED" -eq 1 ; then
Expand Down Expand Up @@ -45,12 +52,15 @@ if test ! -x "config.status" ; then
config_options="$config_options --disable-threads"
fi
config_options="$config_options $OPTIONS_DASH $OPTIONS_DASH_DASH"
src_dir=`pwd`
cd "$build_dir"
msg 0 Configuring $module with:
msg 0 " ./configure" $config_options
$LLVM_TOP/llvm/configure $config_options || \
die $? "Configuring llvm module failed"
msg 0 " $src_dir/configure" $config_options
$src_dir/configure $config_options || \
die $? "Configuring $module module failed"
else
msg 0 Module $module already configured, ignoring configure options.
cd "$build_dir"
fi

msg 0 Building $module with:
Expand Down

0 comments on commit 2603580

Please sign in to comment.