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

4
PKG_NAME="Gnumeric"
5

6 7
test -n "$srcdir" || srcdir=$(dirname "$0")
test -n "$srcdir" || srcdir=.
Arturo Espinosa's avatar
Arturo Espinosa committed
8

9
olddir=$(pwd)
10

11
(test -f $srcdir/configure.ac \
12 13 14 15
  && 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"
16
    exit 1
17 18
}

19 20 21 22 23 24 25
cd $srcdir
aclocal --install || exit 1
glib-gettextize --force --copy || exit 1
gtkdocize --copy || exit 1
intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install || exit 1
cd $olddir
26 27


28 29 30 31
# We have our own copy of Makefile.in.in generated October 2008.
# One of the reasons why we need a local copy is that
# we generate po-functions/Makefile.in.in from it, which is committed to
# SVN, so this file cannot depend on the versions of the tools which the
32
# developers have installed.
33
#
34
echo "Creating po/Makefile.in.in and po-functions/Makefile.in.in."
35 36 37
rm -f $srcdir/po/Makefile.in.in $srcdir/po-functions/Makefile.in.in
cp $srcdir/po/Makefile.in.in.own $srcdir/po/Makefile.in.in
sed '/^\(GETTEXT_PACKAGE\|subdir\) =/s/[ 	]*$/-functions/
38
s|$(srcdir)/LINGUAS|$(top_srcdir)/po/LINGUAS|g
39 40
/^GETTEXT_PACKAGE =/a\
XGETTEXT_KEYWORDS = --keyword --keyword=F_
41
/^EXTRA_DISTFILES/s/ LINGUAS//
42 43
' $srcdir/po/Makefile.in.in >$srcdir/po-functions/Makefile.in.in

44
echo "Creating po-functions/POTFILES.{in,skip}."
45
rm -f $srcdir/po-functions/POTFILES.in $srcdir/po-functions/POTFILES.skip
46
# This regex matches names of XML files:
Stepan Kasal's avatar
Stepan Kasal committed
47
xml_file_name='^((schemas|templates)/.+|[^/]+)\.in$|\.(glade|xml)(\.in)?$'
48 49 50 51 52 53 54
( echo "# Generated by autogen.sh; do not edit."
  egrep -v "^#|$xml_file_name" $srcdir/po/POTFILES.in
) >$srcdir/po-functions/POTFILES.in
( echo "# Generated by autogen.sh; do not edit."
  test -f $srcdir/po/POTFILES.skip && grep -v '^#' $srcdir/po/POTFILES.skip
  egrep "$xml_file_name" $srcdir/po/POTFILES.in
) >$srcdir/po-functions/POTFILES.skip
55

56 57 58 59 60 61 62 63 64

if [ "$NOCONFIGURE" = "" ]; then
        $srcdir/configure "$@" || exit 1

        if [ "$1" = "--help" ]; then exit 0 else
                echo "Now type 'make' to compile $PKG_NAME" || exit 1
        fi
else
        echo "Skipping configure process."
65
fi