autogen.sh 2.88 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"

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

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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
27
# source helper functions
David Schleef's avatar
David Schleef committed
28
if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
29 30 31
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
32 33
  exit 1
fi
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
34
. common/gst-autogen.sh
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
35

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

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

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

51 52 53 54
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
55
autogen_options $@
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
56

57
printf "+ check for build tools"
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
if test -z "$NOCHECK"; then
  echo

  printf "  checking for autoreconf ... "
  echo
  which "autoreconf" 2>/dev/null || {
    echo "not found! Please install the autoconf package."
    exit 1
  }

  printf "  checking for pkg-config ... "
  echo
  which "pkg-config" 2>/dev/null || {
    echo "not found! Please install pkg-config."
    exit 1
  }
else
  echo ": skipped version checks"
fi
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
77

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
78
# if no arguments specified then this will be printed
79
if test -z "$*" && test -z "$NOCONFIGURE"; then
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
80 81 82 83 84
  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
85 86
fi

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
87 88
toplevel_check $srcfile

89
# autopoint
90
if test -d po && grep ^AM_GNU_GETTEXT_VERSION configure.ac >/dev/null ; then
91
  tool_run "autopoint" "--force"
92
fi
93

94 95 96
# aclocal
if test -f acinclude.m4; then rm acinclude.m4; fi

97
autoreconf --force --install || exit 1
98

99
test -n "$NOCONFIGURE" && {
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
100 101 102
  echo "+ skipping configure stage for package $package, as requested."
  echo "+ autogen.sh done."
  exit 0
103
}
104

105 106
cd "$olddir"

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
107
echo "+ running configure ... "
108 109
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
110 111
echo

112 113
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
114 115
        echo "  configure failed"
        exit 1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
116 117 118
}

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