David Schleef | d271f13 | 2003-05-09 08:09:38 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 2 | # Run this to generate all the initial makefiles, etc. |
| 3 | |
| 4 | DIE=0 |
Andy Wingo | 5582665 | 2005-09-12 16:14:48 +0000 | [diff] [blame] | 5 | package=gst-plugins-good |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 6 | srcfile=gst/law/alaw.c |
Andy Wingo | 6da1174 | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 7 | |
Edward Hervey | 6d325c2 | 2009-01-21 04:31:58 +0100 | [diff] [blame] | 8 | # Make sure we have common |
| 9 | if test ! -f common/gst-autogen.sh; |
Thomas Vander Stichele | 5cfcaf5 | 2005-09-06 14:05:33 +0000 | [diff] [blame] | 10 | then |
Edward Hervey | 6d325c2 | 2009-01-21 04:31:58 +0100 | [diff] [blame] | 11 | echo "+ Setting up common submodule" |
| 12 | git submodule init |
Thomas Vander Stichele | 8999b72 | 2002-02-06 18:46:39 +0000 | [diff] [blame] | 13 | fi |
Edward Hervey | 6d325c2 | 2009-01-21 04:31:58 +0100 | [diff] [blame] | 14 | git submodule update |
Thomas Vander Stichele | 8999b72 | 2002-02-06 18:46:39 +0000 | [diff] [blame] | 15 | |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 16 | # source helper functions |
David Schleef | d271f13 | 2003-05-09 08:09:38 +0000 | [diff] [blame] | 17 | if test ! -f common/gst-autogen.sh; |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 18 | then |
| 19 | echo There is something wrong with your source tree. |
| 20 | echo You are missing common/gst-autogen.sh |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 21 | exit 1 |
| 22 | fi |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 23 | . common/gst-autogen.sh |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 24 | |
Edward Hervey | 4e3472a | 2009-01-22 06:05:26 +0100 | [diff] [blame] | 25 | # install pre-commit hook for doing clean commits |
Edward Hervey | cd906c2 | 2009-01-30 08:53:06 +0100 | [diff] [blame] | 26 | if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); |
Edward Hervey | 4e3472a | 2009-01-22 06:05:26 +0100 | [diff] [blame] | 27 | then |
Edward Hervey | cd906c2 | 2009-01-30 08:53:06 +0100 | [diff] [blame] | 28 | rm -f .git/hooks/pre-commit |
| 29 | ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit |
Edward Hervey | 4e3472a | 2009-01-22 06:05:26 +0100 | [diff] [blame] | 30 | fi |
| 31 | |
| 32 | |
Tim-Philipp Müller | 16e1c0a | 2006-06-16 10:56:24 +0000 | [diff] [blame] | 33 | CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc --enable-plugin-docs' |
Thomas Vander Stichele | bc465f1 | 2002-05-27 14:01:51 +0000 | [diff] [blame] | 34 | |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 35 | autogen_options $@ |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 36 | |
Jan Schmidt | 9ab7cfd | 2009-06-26 15:00:14 +0100 | [diff] [blame] | 37 | printf "+ check for build tools" |
Brian Cameron | 1c7d5ad | 2003-05-21 15:16:49 +0000 | [diff] [blame] | 38 | if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi |
David I. Lehn | ea99323 | 2002-11-02 05:37:37 +0000 | [diff] [blame] | 39 | version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \ |
Thomas Vander Stichele | 579f0d0 | 2002-09-30 07:20:35 +0000 | [diff] [blame] | 40 | "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 |
Jan Schmidt | 234f34c | 2009-06-26 14:40:14 +0100 | [diff] [blame] | 41 | version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10 automake-1.9 automake-1.7 automake-1.6 automake-1.5" \ |
Thomas Vander Stichele | 5a027ff | 2006-06-11 13:57:19 +0000 | [diff] [blame] | 42 | "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1 |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 43 | version_check "autopoint" "autopoint" \ |
Sebastian Dröge | 2cb242b | 2008-11-29 13:31:55 +0000 | [diff] [blame] | 44 | "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1 |
Edward Hervey | f8efd71 | 2006-05-08 11:53:03 +0000 | [diff] [blame] | 45 | version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \ |
Thomas Vander Stichele | 147a44c | 2004-02-29 08:35:55 +0000 | [diff] [blame] | 46 | "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 |
Thomas Vander Stichele | 579f0d0 | 2002-09-30 07:20:35 +0000 | [diff] [blame] | 47 | version_check "pkg-config" "" \ |
| 48 | "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 49 | |
Thomas Vander Stichele | 16facd5 | 2002-05-18 22:45:56 +0000 | [diff] [blame] | 50 | die_check $DIE |
| 51 | |
David Schleef | 4088af9 | 2003-04-13 20:13:58 +0000 | [diff] [blame] | 52 | autoconf_2_52d_check || DIE=1 |
Thomas Vander Stichele | 05489e6 | 2002-04-18 21:57:05 +0000 | [diff] [blame] | 53 | aclocal_check || DIE=1 |
Thomas Vander Stichele | bc465f1 | 2002-05-27 14:01:51 +0000 | [diff] [blame] | 54 | autoheader_check || DIE=1 |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 55 | |
Thomas Vander Stichele | 16facd5 | 2002-05-18 22:45:56 +0000 | [diff] [blame] | 56 | die_check $DIE |
| 57 | |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 58 | # if no arguments specified then this will be printed |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 59 | if test -z "$*"; then |
Thomas Vander Stichele | 77b3751 | 2002-02-07 14:30:20 +0000 | [diff] [blame] | 60 | echo "+ checking for autogen.sh options" |
| 61 | echo " This autogen script will automatically run ./configure as:" |
| 62 | echo " ./configure $CONFIGURE_DEF_OPT" |
| 63 | echo " To pass any additional options, please specify them on the $0" |
| 64 | echo " command line." |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 65 | fi |
| 66 | |
| 67 | toplevel_check $srcfile |
| 68 | |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 69 | # autopoint |
| 70 | # older autopoint (< 0.12) has a tendency to complain about mkinstalldirs |
Benjamin Otte | dba7257 | 2004-02-22 15:59:08 +0000 | [diff] [blame] | 71 | if test -x mkinstalldirs; then rm mkinstalldirs; fi |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 72 | # first remove patch if necessary, then run autopoint, then reapply |
Andy Wingo | 266b874 | 2005-07-08 10:47:30 +0000 | [diff] [blame] | 73 | if test -f po/Makefile.in.in; |
| 74 | then |
| 75 | patch -p0 -R < common/gettext.patch |
| 76 | fi |
| 77 | tool_run "$autopoint --force" |
| 78 | patch -p0 < common/gettext.patch |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 79 | |
David Schleef | 95c7066 | 2003-08-17 23:35:38 +0000 | [diff] [blame] | 80 | tool_run "$libtoolize" "--copy --force" |
Marc-Andre Lureau | 49335fa | 2009-05-10 11:17:23 +0200 | [diff] [blame] | 81 | tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" |
Thomas Vander Stichele | bc465f1 | 2002-05-27 14:01:51 +0000 | [diff] [blame] | 82 | tool_run "$autoheader" |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 83 | |
| 84 | # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo |
| 85 | echo timestamp > stamp-h.in 2> /dev/null |
| 86 | |
Thomas Vander Stichele | 3a6a66c | 2002-03-02 12:03:23 +0000 | [diff] [blame] | 87 | tool_run "$autoconf" |
Tim-Philipp Müller | fac0992 | 2009-05-22 01:12:35 +0100 | [diff] [blame] | 88 | tool_run "$automake" "-a -c" |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 89 | |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 90 | # if enable exists, add an -enable option for each of the lines in that file |
| 91 | if test -f enable; then |
| 92 | for a in `cat enable`; do |
Thomas Vander Stichele | 453d871 | 2003-05-12 15:08:49 +0000 | [diff] [blame] | 93 | CONFIGURE_FILE_OPT="--enable-$a" |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 94 | done |
| 95 | fi |
| 96 | |
| 97 | # if disable exists, add an -disable option for each of the lines in that file |
| 98 | if test -f disable; then |
| 99 | for a in `cat disable`; do |
Thomas Vander Stichele | 453d871 | 2003-05-12 15:08:49 +0000 | [diff] [blame] | 100 | CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a" |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 101 | done |
| 102 | fi |
| 103 | |
Andy Wingo | 6da1174 | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 104 | test -n "$NOCONFIGURE" && { |
Thomas Vander Stichele | 77b3751 | 2002-02-07 14:30:20 +0000 | [diff] [blame] | 105 | echo "+ skipping configure stage for package $package, as requested." |
| 106 | echo "+ autogen.sh done." |
| 107 | exit 0 |
Andy Wingo | 6da1174 | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 108 | } |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 109 | |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 110 | echo "+ running configure ... " |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 111 | test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" |
| 112 | test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" |
Thomas Vander Stichele | 453d871 | 2003-05-12 15:08:49 +0000 | [diff] [blame] | 113 | test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT" |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 114 | echo |
| 115 | |
Thomas Vander Stichele | 453d871 | 2003-05-12 15:08:49 +0000 | [diff] [blame] | 116 | ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || { |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 117 | echo " configure failed" |
| 118 | exit 1 |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 119 | } |
| 120 | |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 121 | echo "Now type 'make' to compile $package." |