autorun.sh 1.19 KB
Newer Older
1 2 3
#!/bin/sh
# Create MySQL autotools infrastructure

4 5
die() { echo "$@"; exit 1; }

unknown's avatar
unknown committed
6 7
# Handle "glibtoolize" (e.g., for native OS X autotools) as another
# name for "libtoolize". Use the first one, either name, found in PATH.
unknown's avatar
unknown committed
8 9 10 11
LIBTOOLIZE=libtoolize  # Default
IFS="${IFS=   }"; save_ifs="$IFS"; IFS=':'
for dir in $PATH
do
unknown's avatar
unknown committed
12
  if test -x $dir/glibtoolize
13 14
  then
    LIBTOOLIZE=glibtoolize
unknown's avatar
unknown committed
15
    break
unknown's avatar
unknown committed
16
  elif test -x $dir/libtoolize
unknown's avatar
unknown committed
17 18 19 20 21
  then
    break
  fi
done
IFS="$save_ifs"
22

23
rm -rf configure
24 25
aclocal || die "Can't execute aclocal" 
autoheader || die "Can't execute autoheader"
26
# --force means overwrite ltmain.sh script if it already exists 
unknown's avatar
unknown committed
27
$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
28
  
29 30
# --add-missing instructs automake to install missing auxiliary files
# and --force to overwrite them if they already exist
unknown's avatar
unknown committed
31
automake --add-missing --force  --copy || die "Can't execute automake"
32
autoconf || die "Can't execute autoconf"
33 34 35 36 37 38
# Do not use autotools generated configure directly. Instead, use a script
# that will either call CMake or original configure shell script at build 
# time (CMake is preferred if installed).
mv configure configure.am
cp BUILD/choose_configure.sh configure
chmod a+x configure