Reid Spencer | 38fd88a | 2005-01-05 06:41:10 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | die () { |
| 3 | echo "$@" 1>&2 |
| 4 | exit 1 |
| 5 | } |
| 6 | test -d autoconf && test -f autoconf/configure.ac && cd autoconf |
| 7 | test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first" |
Dan Gohman | c9ebae3 | 2009-03-24 23:45:13 +0000 | [diff] [blame] | 8 | autoconf --version | egrep '2\.[56][0-9]' > /dev/null |
Reid Spencer | 38fd88a | 2005-01-05 06:41:10 +0000 | [diff] [blame] | 9 | if test $? -ne 0 ; then |
Dan Gohman | c9ebae3 | 2009-03-24 23:45:13 +0000 | [diff] [blame] | 10 | die "Your autoconf was not detected as being 2.5x or 2.6x" |
Reid Spencer | 38fd88a | 2005-01-05 06:41:10 +0000 | [diff] [blame] | 11 | fi |
| 12 | cwd=`pwd` |
| 13 | if test -d ../../../autoconf/m4 ; then |
| 14 | cd ../../../autoconf/m4 |
Peter Collingbourne | 1fbf5a4 | 2010-12-12 21:41:56 +0000 | [diff] [blame] | 15 | llvm_src_root=../.. |
| 16 | llvm_obj_root=../.. |
Reid Spencer | 38fd88a | 2005-01-05 06:41:10 +0000 | [diff] [blame] | 17 | cd $cwd |
| 18 | elif test -d ../../llvm/autoconf/m4 ; then |
| 19 | cd ../../llvm/autoconf/m4 |
Daniel Dunbar | 2532fa2 | 2011-10-18 23:10:47 +0000 | [diff] [blame] | 20 | llvm_src_root=../.. |
| 21 | llvm_obj_root=../.. |
Reid Spencer | 38fd88a | 2005-01-05 06:41:10 +0000 | [diff] [blame] | 22 | cd $cwd |
| 23 | else |
Reid Spencer | 30ea478 | 2006-04-18 06:27:47 +0000 | [diff] [blame] | 24 | while true ; do |
| 25 | echo "LLVM source root not found." |
Dan Gohman | 9f16bcb | 2009-03-24 20:21:37 +0000 | [diff] [blame] | 26 | read -p "Enter full path to LLVM source:" REPLY |
Reid Spencer | 30ea478 | 2006-04-18 06:27:47 +0000 | [diff] [blame] | 27 | if test -d "$REPLY/autoconf/m4" ; then |
| 28 | llvm_src_root="$REPLY" |
Dan Gohman | 9f16bcb | 2009-03-24 20:21:37 +0000 | [diff] [blame] | 29 | read -p "Enter full path to LLVM objects (empty for same as source):" REPLY |
Reid Spencer | 30ea478 | 2006-04-18 06:27:47 +0000 | [diff] [blame] | 30 | 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 Spencer | 38fd88a | 2005-01-05 06:41:10 +0000 | [diff] [blame] | 38 | fi |
| 39 | echo "Regenerating aclocal.m4 with aclocal" |
| 40 | rm -f aclocal.m4 |
Daniel Dunbar | 2532fa2 | 2011-10-18 23:10:47 +0000 | [diff] [blame] | 41 | aclocal -I $cwd/m4 || die "aclocal failed" |
Dan Gohman | c9ebae3 | 2009-03-24 23:45:13 +0000 | [diff] [blame] | 42 | echo "Regenerating configure with autoconf" |
Reid Spencer | f20856d | 2005-02-24 18:42:34 +0000 | [diff] [blame] | 43 | autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed" |
Reid Spencer | 38fd88a | 2005-01-05 06:41:10 +0000 | [diff] [blame] | 44 | cd .. |
| 45 | exit 0 |