autogen.sh 2.75 KB
Newer Older
David Schleef's avatar
David Schleef committed
1
#!/bin/sh
2 3 4
#
# gst-plugins-good autogen.sh
#
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
5
# Run this to generate all the initial makefiles, etc.
6 7 8
#
# This file has been generated from common/autogen.sh.in via common/update-autogen

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
9

10 11 12 13 14 15
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.

olddir=`pwd`
cd "$srcdir"

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
16
DIE=0
17
package=gst-plugins-good
18
srcfile=gst-plugins-good.doap
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
19

Edward Hervey's avatar
Edward Hervey committed
20 21
# Make sure we have common
if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
22
then
Edward Hervey's avatar
Edward Hervey committed
23 24
  echo "+ Setting up common submodule"
  git submodule init
25
fi
Edward Hervey's avatar
Edward Hervey committed
26
git submodule update
27

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
28
# source helper functions
David Schleef's avatar
David Schleef committed
29
if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
30 31 32
then
  echo There is something wrong with your source tree.
  echo You are missing common/gst-autogen.sh
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
33 34
  exit 1
fi
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
35
. common/gst-autogen.sh
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
36

37
# install pre-commit hook for doing clean commits
38
if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
39
then
40 41
    rm -f .git/hooks/pre-commit
    ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
42 43
fi

44 45
# GNU gettext automake support doesn't get along with git.
# https://bugzilla.gnome.org/show_bug.cgi?id=661128
46 47 48
if test -d po ; then
  touch -t 200001010000 po/gst-plugins-good-1.0.pot
fi
49

50
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
51

52 53 54 55
if test "x$package" = "xgstreamer"; then
  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-docbook --enable-failing-tests --enable-poisoning"
fi

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
56
autogen_options $@
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
57

58
printf "+ check for build tools"
59
if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else  echo; fi
60
version_check "autoreconf" "autoreconf " \
61
              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 68 || DIE=1
62 63
version_check "pkg-config" "" \
              "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
64

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
65 66
die_check $DIE

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
67
# if no arguments specified then this will be printed
68
if test -z "$*" && test -z "$NOCONFIGURE"; then
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
69 70 71 72 73
  echo "+ checking for autogen.sh options"
  echo "  This autogen script will automatically run ./configure as:"
  echo "  ./configure $CONFIGURE_DEF_OPT"
  echo "  To pass any additional options, please specify them on the $0"
  echo "  command line."
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
74 75
fi

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
76 77
toplevel_check $srcfile

78
# autopoint
79
if test -d po ; then
80
  tool_run "autopoint" "--force"
81
fi
82

83 84 85
# aclocal
if test -f acinclude.m4; then rm acinclude.m4; fi

86
autoreconf --force --install || exit 1
87

88
test -n "$NOCONFIGURE" && {
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
89 90 91
  echo "+ skipping configure stage for package $package, as requested."
  echo "+ autogen.sh done."
  exit 0
92
}
93

94 95
cd "$olddir"

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
96
echo "+ running configure ... "
97 98
test ! -z "$CONFIGURE_DEF_OPT" && echo "  default flags:  $CONFIGURE_DEF_OPT"
test ! -z "$CONFIGURE_EXT_OPT" && echo "  external flags: $CONFIGURE_EXT_OPT"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
99 100
echo

101 102
echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
103 104
        echo "  configure failed"
        exit 1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
105 106 107
}

echo "Now type 'make' to compile $package."