autogen.sh 1.17 KB
Newer Older
Arturo Espinosa's avatar
Arturo Espinosa committed
1 2 3 4 5 6
#!/bin/sh
# Run this to generate all the initial makefiles, etc.

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

7
PKG_NAME="Gnumeric"
Arturo Espinosa's avatar
Arturo Espinosa committed
8 9 10 11 12 13 14 15 16

(test -f $srcdir/configure.in \
  && test -d $srcdir/src \
  && test -f $srcdir/src/gnumeric.h) || {
    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
    echo " top-level gnumeric directory"
    exit 1
}

Morten Welinder's avatar
Morten Welinder committed
17 18
if libtool --version >/dev/null 2>&1; then
    vers=`libtool --version | sed -e "s/^[^0-9]*//" -e "s/ .*$//" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
19
    if test "$vers" -ge 1003003; then
Morten Welinder's avatar
Morten Welinder committed
20 21
        true
    else
22
        echo "Please upgrade your libtool to version 1.3.3 or better." 1>&2
Morten Welinder's avatar
Morten Welinder committed
23 24 25
        exit 1
    fi
fi
26

Jody Goldberg's avatar
Jody Goldberg committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
ifs_save="$IFS"; IFS=":"
for dir in $PATH ; do
  test -z "$dir" && dir=.
  if test -f $dir/gnome-autogen.sh ; then
    gnome_autogen="$dir/gnome-autogen.sh"
    gnome_datadir=`echo $dir | sed -e 's,/bin$,/share,'`
    break
  fi
done
IFS="$ifs_save"

if test -z "$gnome_autogen" ; then
  echo "You need to install the gnome-common module and make"
  echo "sure the gnome-autogen.sh script is in your \$PATH."
  exit 1
fi

GNOME_DATADIR="$gnome_datadir" USE_GNOME2_MACROS=1 . $gnome_autogen