David Schleef | 1bdef6b | 2003-05-09 08:09:38 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 2 | # |
| 3 | # gst-plugins-bad autogen.sh |
| 4 | # |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 5 | # Run this to generate all the initial makefiles, etc. |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 6 | # |
| 7 | # This file has been generated from common/autogen.sh.in via common/update-autogen |
| 8 | |
| 9 | |
Benjamin Gaignard | a78d56f | 2013-01-30 09:33:49 +0100 | [diff] [blame] | 10 | test -n "$srcdir" || srcdir=`dirname "$0"` |
| 11 | test -n "$srcdir" || srcdir=. |
| 12 | |
| 13 | olddir=`pwd` |
| 14 | cd "$srcdir" |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 15 | |
Christian Schaller | 1176550 | 2008-06-03 15:41:05 +0000 | [diff] [blame] | 16 | package=gst-plugins-bad |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 17 | srcfile=gst-plugins-bad.doap |
Andy Wingo | e5d9d6e | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 18 | |
Edward Hervey | 8734fde | 2009-01-21 04:32:16 +0100 | [diff] [blame] | 19 | # Make sure we have common |
| 20 | if test ! -f common/gst-autogen.sh; |
Thomas Vander Stichele | c320202 | 2005-09-06 14:05:50 +0000 | [diff] [blame] | 21 | then |
Edward Hervey | 8734fde | 2009-01-21 04:32:16 +0100 | [diff] [blame] | 22 | echo "+ Setting up common submodule" |
| 23 | git submodule init |
Thomas Vander Stichele | 3031af9 | 2002-02-06 18:46:39 +0000 | [diff] [blame] | 24 | fi |
Edward Hervey | 8734fde | 2009-01-21 04:32:16 +0100 | [diff] [blame] | 25 | git submodule update |
Thomas Vander Stichele | 3031af9 | 2002-02-06 18:46:39 +0000 | [diff] [blame] | 26 | |
Thomas Vander Stichele | cb4e3c8 | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 27 | # source helper functions |
David Schleef | 1bdef6b | 2003-05-09 08:09:38 +0000 | [diff] [blame] | 28 | if test ! -f common/gst-autogen.sh; |
Thomas Vander Stichele | cb4e3c8 | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 29 | then |
| 30 | echo There is something wrong with your source tree. |
| 31 | echo You are missing common/gst-autogen.sh |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 32 | exit 1 |
| 33 | fi |
Thomas Vander Stichele | cb4e3c8 | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 34 | . common/gst-autogen.sh |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 35 | |
Edward Hervey | 71789c9 | 2009-01-22 06:12:55 +0100 | [diff] [blame] | 36 | # install pre-commit hook for doing clean commits |
Edward Hervey | 681e1c8 | 2009-01-30 08:54:42 +0100 | [diff] [blame] | 37 | if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); |
Edward Hervey | 71789c9 | 2009-01-22 06:12:55 +0100 | [diff] [blame] | 38 | then |
Edward Hervey | e1d532d | 2009-01-30 09:03:42 +0100 | [diff] [blame] | 39 | rm -f .git/hooks/pre-commit |
Nicolas Dufresne | 08a31bb | 2015-12-07 09:08:15 -0500 | [diff] [blame] | 40 | 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 Hervey | 71789c9 | 2009-01-22 06:12:55 +0100 | [diff] [blame] | 45 | fi |
| 46 | |
David Schleef | 60df59b | 2012-02-21 18:56:42 -0800 | [diff] [blame] | 47 | # GNU gettext automake support doesn't get along with git. |
| 48 | # https://bugzilla.gnome.org/show_bug.cgi?id=661128 |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 49 | if test -d po ; then |
| 50 | touch -t 200001010000 po/gst-plugins-bad-1.0.pot |
| 51 | fi |
David Schleef | 60df59b | 2012-02-21 18:56:42 -0800 | [diff] [blame] | 52 | |
Julien Moutte | 2438f58 | 2005-11-06 21:55:01 +0000 | [diff] [blame] | 53 | CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc' |
Thomas Vander Stichele | f5a8b5b | 2002-05-27 14:01:51 +0000 | [diff] [blame] | 54 | |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 55 | if test "x$package" = "xgstreamer"; then |
| 56 | CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-docbook --enable-failing-tests --enable-poisoning" |
Sebastian Dröge | a6c3dab | 2015-12-23 12:16:54 +0100 | [diff] [blame] | 57 | elif test "x$package" = "xgst-plugins-bad"; then |
| 58 | CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-player-tests" |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 59 | fi |
| 60 | |
Thomas Vander Stichele | cb4e3c8 | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 61 | autogen_options $@ |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 62 | |
Jan Schmidt | 024b44b | 2009-06-26 15:10:05 +0100 | [diff] [blame] | 63 | printf "+ check for build tools" |
Stefan Sauer | 437867f | 2015-06-07 17:16:25 +0200 | [diff] [blame] | 64 | if test -z "$NOCHECK"; then |
| 65 | echo |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 66 | |
Stefan Sauer | 437867f | 2015-06-07 17:16:25 +0200 | [diff] [blame] | 67 | 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 | } |
| 80 | else |
| 81 | echo ": skipped version checks" |
| 82 | fi |
Thomas Vander Stichele | 3e59c1e | 2002-05-18 22:45:56 +0000 | [diff] [blame] | 83 | |
Thomas Vander Stichele | cb4e3c8 | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 84 | # if no arguments specified then this will be printed |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 85 | if test -z "$*" && test -z "$NOCONFIGURE"; then |
Thomas Vander Stichele | 7474f54 | 2002-02-07 14:30:20 +0000 | [diff] [blame] | 86 | 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 Stichele | cb4e3c8 | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 91 | fi |
| 92 | |
| 93 | toplevel_check $srcfile |
| 94 | |
Thomas Vander Stichele | 22f4937 | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 95 | # autopoint |
Stefan Sauer | 437867f | 2015-06-07 17:16:25 +0200 | [diff] [blame] | 96 | if test -d po && grep ^AM_GNU_GETTEXT_VERSION configure.ac >/dev/null ; then |
Tim-Philipp Müller | 264f6d2 | 2015-04-03 18:57:58 +0100 | [diff] [blame] | 97 | tool_run "autopoint" "--force" |
Andy Wingo | ae4309d | 2005-07-08 10:47:28 +0000 | [diff] [blame] | 98 | fi |
Thomas Vander Stichele | 22f4937 | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 99 | |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 100 | # aclocal |
| 101 | if test -f acinclude.m4; then rm acinclude.m4; fi |
| 102 | |
Tim-Philipp Müller | 264f6d2 | 2015-04-03 18:57:58 +0100 | [diff] [blame] | 103 | autoreconf --force --install || exit 1 |
Thomas Vander Stichele | 2819ff0 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 104 | |
Andy Wingo | e5d9d6e | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 105 | test -n "$NOCONFIGURE" && { |
Thomas Vander Stichele | 7474f54 | 2002-02-07 14:30:20 +0000 | [diff] [blame] | 106 | echo "+ skipping configure stage for package $package, as requested." |
| 107 | echo "+ autogen.sh done." |
| 108 | exit 0 |
Andy Wingo | e5d9d6e | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 109 | } |
Thomas Vander Stichele | 2819ff0 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 110 | |
Benjamin Gaignard | a78d56f | 2013-01-30 09:33:49 +0100 | [diff] [blame] | 111 | cd "$olddir" |
| 112 | |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 113 | echo "+ running configure ... " |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 114 | test ! -z "$CONFIGURE_DEF_OPT" && echo " default flags: $CONFIGURE_DEF_OPT" |
| 115 | test ! -z "$CONFIGURE_EXT_OPT" && echo " external flags: $CONFIGURE_EXT_OPT" |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 116 | echo |
| 117 | |
Tim-Philipp Müller | 58e1894 | 2013-04-14 17:55:28 +0100 | [diff] [blame] | 118 | echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT |
| 119 | "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { |
Thomas Vander Stichele | cb4e3c8 | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 120 | echo " configure failed" |
| 121 | exit 1 |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 122 | } |
| 123 | |
Thomas Vander Stichele | 49d345d | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 124 | echo "Now type 'make' to compile $package." |