blob: ee2ce928ece4fcf95fc7563b8d25d070765a786b [file] [log] [blame]
David Schleef1bdef6b2003-05-09 08:09:38 +00001#!/bin/sh
Tim-Philipp Müller58e18942013-04-14 17:55:28 +01002#
3# gst-plugins-bad autogen.sh
4#
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +00005# Run this to generate all the initial makefiles, etc.
Tim-Philipp Müller58e18942013-04-14 17:55:28 +01006#
7# This file has been generated from common/autogen.sh.in via common/update-autogen
8
9
Benjamin Gaignarda78d56f2013-01-30 09:33:49 +010010test -n "$srcdir" || srcdir=`dirname "$0"`
11test -n "$srcdir" || srcdir=.
12
13olddir=`pwd`
14cd "$srcdir"
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +000015
Christian Schaller11765502008-06-03 15:41:05 +000016package=gst-plugins-bad
Tim-Philipp Müller58e18942013-04-14 17:55:28 +010017srcfile=gst-plugins-bad.doap
Andy Wingoe5d9d6e2001-12-22 01:59:48 +000018
Edward Hervey8734fde2009-01-21 04:32:16 +010019# Make sure we have common
20if test ! -f common/gst-autogen.sh;
Thomas Vander Stichelec3202022005-09-06 14:05:50 +000021then
Edward Hervey8734fde2009-01-21 04:32:16 +010022 echo "+ Setting up common submodule"
23 git submodule init
Thomas Vander Stichele3031af92002-02-06 18:46:39 +000024fi
Edward Hervey8734fde2009-01-21 04:32:16 +010025git submodule update
Thomas Vander Stichele3031af92002-02-06 18:46:39 +000026
Thomas Vander Stichelecb4e3c82002-02-06 18:18:16 +000027# source helper functions
David Schleef1bdef6b2003-05-09 08:09:38 +000028if test ! -f common/gst-autogen.sh;
Thomas Vander Stichelecb4e3c82002-02-06 18:18:16 +000029then
30 echo There is something wrong with your source tree.
31 echo You are missing common/gst-autogen.sh
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +000032 exit 1
33fi
Thomas Vander Stichelecb4e3c82002-02-06 18:18:16 +000034. common/gst-autogen.sh
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +000035
Edward Hervey71789c92009-01-22 06:12:55 +010036# install pre-commit hook for doing clean commits
Edward Hervey681e1c82009-01-30 08:54:42 +010037if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
Edward Hervey71789c92009-01-22 06:12:55 +010038then
Edward Herveye1d532d2009-01-30 09:03:42 +010039 rm -f .git/hooks/pre-commit
Nicolas Dufresne08a31bb2015-12-07 09:08:15 -050040 if ! ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit 2> /dev/null
41 then
42 echo "Failed to create commit hook symlink, copying instead ..."
43 cp common/hooks/pre-commit.hook .git/hooks/pre-commit
44 fi
Edward Hervey71789c92009-01-22 06:12:55 +010045fi
46
David Schleef60df59b2012-02-21 18:56:42 -080047# GNU gettext automake support doesn't get along with git.
48# https://bugzilla.gnome.org/show_bug.cgi?id=661128
Tim-Philipp Müller58e18942013-04-14 17:55:28 +010049if test -d po ; then
50 touch -t 200001010000 po/gst-plugins-bad-1.0.pot
51fi
David Schleef60df59b2012-02-21 18:56:42 -080052
Julien Moutte2438f582005-11-06 21:55:01 +000053CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
Thomas Vander Stichelef5a8b5b2002-05-27 14:01:51 +000054
Tim-Philipp Müller58e18942013-04-14 17:55:28 +010055if test "x$package" = "xgstreamer"; then
56 CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-docbook --enable-failing-tests --enable-poisoning"
Sebastian Drögea6c3dab2015-12-23 12:16:54 +010057elif test "x$package" = "xgst-plugins-bad"; then
58 CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-player-tests"
Tim-Philipp Müller58e18942013-04-14 17:55:28 +010059fi
60
Thomas Vander Stichelecb4e3c82002-02-06 18:18:16 +000061autogen_options $@
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +000062
Jan Schmidt024b44b2009-06-26 15:10:05 +010063printf "+ check for build tools"
Stefan Sauer437867f2015-06-07 17:16:25 +020064if test -z "$NOCHECK"; then
65 echo
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +000066
Stefan Sauer437867f2015-06-07 17:16:25 +020067 printf " checking for autoreconf ... "
68 echo
69 which "autoreconf" 2>/dev/null || {
70 echo "not found! Please install the autoconf package."
71 exit 1
72 }
73
74 printf " checking for pkg-config ... "
75 echo
76 which "pkg-config" 2>/dev/null || {
77 echo "not found! Please install pkg-config."
78 exit 1
79 }
80else
81 echo ": skipped version checks"
82fi
Thomas Vander Stichele3e59c1e2002-05-18 22:45:56 +000083
Thomas Vander Stichelecb4e3c82002-02-06 18:18:16 +000084# if no arguments specified then this will be printed
Tim-Philipp Müller58e18942013-04-14 17:55:28 +010085if test -z "$*" && test -z "$NOCONFIGURE"; then
Thomas Vander Stichele7474f542002-02-07 14:30:20 +000086 echo "+ checking for autogen.sh options"
87 echo " This autogen script will automatically run ./configure as:"
88 echo " ./configure $CONFIGURE_DEF_OPT"
89 echo " To pass any additional options, please specify them on the $0"
90 echo " command line."
Thomas Vander Stichelecb4e3c82002-02-06 18:18:16 +000091fi
92
93toplevel_check $srcfile
94
Thomas Vander Stichele22f49372004-01-19 15:45:55 +000095# autopoint
Stefan Sauer437867f2015-06-07 17:16:25 +020096if test -d po && grep ^AM_GNU_GETTEXT_VERSION configure.ac >/dev/null ; then
Tim-Philipp Müller264f6d22015-04-03 18:57:58 +010097 tool_run "autopoint" "--force"
Andy Wingoae4309d2005-07-08 10:47:28 +000098fi
Thomas Vander Stichele22f49372004-01-19 15:45:55 +000099
Tim-Philipp Müller58e18942013-04-14 17:55:28 +0100100# aclocal
101if test -f acinclude.m4; then rm acinclude.m4; fi
102
Tim-Philipp Müller264f6d22015-04-03 18:57:58 +0100103autoreconf --force --install || exit 1
Thomas Vander Stichele2819ff02001-12-20 23:13:50 +0000104
Andy Wingoe5d9d6e2001-12-22 01:59:48 +0000105test -n "$NOCONFIGURE" && {
Thomas Vander Stichele7474f542002-02-07 14:30:20 +0000106 echo "+ skipping configure stage for package $package, as requested."
107 echo "+ autogen.sh done."
108 exit 0
Andy Wingoe5d9d6e2001-12-22 01:59:48 +0000109}
Thomas Vander Stichele2819ff02001-12-20 23:13:50 +0000110
Benjamin Gaignarda78d56f2013-01-30 09:33:49 +0100111cd "$olddir"
112
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +0000113echo "+ running configure ... "
Tim-Philipp Müller58e18942013-04-14 17:55:28 +0100114test ! -z "$CONFIGURE_DEF_OPT" && echo " default flags: $CONFIGURE_DEF_OPT"
115test ! -z "$CONFIGURE_EXT_OPT" && echo " external flags: $CONFIGURE_EXT_OPT"
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +0000116echo
117
Tim-Philipp Müller58e18942013-04-14 17:55:28 +0100118echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
119"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
Thomas Vander Stichelecb4e3c82002-02-06 18:18:16 +0000120 echo " configure failed"
121 exit 1
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +0000122}
123
Thomas Vander Stichele49d345d2001-12-17 18:37:01 +0000124echo "Now type 'make' to compile $package."