blob: b91b3e446a13ee39a3a717966e394b544308139c [file] [log] [blame]
Reid Spencer38fd88a2005-01-05 06:41:10 +00001#!/bin/sh
2die () {
3 echo "$@" 1>&2
4 exit 1
5}
6test -d autoconf && test -f autoconf/configure.ac && cd autoconf
7test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first"
Dan Gohmanc9ebae32009-03-24 23:45:13 +00008autoconf --version | egrep '2\.[56][0-9]' > /dev/null
Reid Spencer38fd88a2005-01-05 06:41:10 +00009if test $? -ne 0 ; then
Dan Gohmanc9ebae32009-03-24 23:45:13 +000010 die "Your autoconf was not detected as being 2.5x or 2.6x"
Reid Spencer38fd88a2005-01-05 06:41:10 +000011fi
12cwd=`pwd`
13if test -d ../../../autoconf/m4 ; then
14 cd ../../../autoconf/m4
Peter Collingbourne1fbf5a42010-12-12 21:41:56 +000015 llvm_src_root=../..
16 llvm_obj_root=../..
Reid Spencer38fd88a2005-01-05 06:41:10 +000017 cd $cwd
18elif test -d ../../llvm/autoconf/m4 ; then
19 cd ../../llvm/autoconf/m4
Daniel Dunbar2532fa22011-10-18 23:10:47 +000020 llvm_src_root=../..
21 llvm_obj_root=../..
Reid Spencer38fd88a2005-01-05 06:41:10 +000022 cd $cwd
23else
Reid Spencer30ea4782006-04-18 06:27:47 +000024 while true ; do
25 echo "LLVM source root not found."
Dan Gohman9f16bcb2009-03-24 20:21:37 +000026 read -p "Enter full path to LLVM source:" REPLY
Reid Spencer30ea4782006-04-18 06:27:47 +000027 if test -d "$REPLY/autoconf/m4" ; then
28 llvm_src_root="$REPLY"
Dan Gohman9f16bcb2009-03-24 20:21:37 +000029 read -p "Enter full path to LLVM objects (empty for same as source):" REPLY
Reid Spencer30ea4782006-04-18 06:27:47 +000030 if test -d "$REPLY" ; then
31 llvm_obj_root="$REPLY"
32 else
33 llvm_obj_root="$llvm_src_root"
34 fi
35 break
36 fi
37 done
Reid Spencer38fd88a2005-01-05 06:41:10 +000038fi
39echo "Regenerating aclocal.m4 with aclocal"
40rm -f aclocal.m4
Daniel Dunbar2532fa22011-10-18 23:10:47 +000041aclocal -I $cwd/m4 || die "aclocal failed"
Dan Gohmanc9ebae32009-03-24 23:45:13 +000042echo "Regenerating configure with autoconf"
Reid Spencerf20856d2005-02-24 18:42:34 +000043autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed"
Reid Spencer38fd88a2005-01-05 06:41:10 +000044cd ..
45exit 0