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 | |
Thomas Vander Stichele | 5cfcaf5 | 2005-09-06 14:05:33 +0000 | [diff] [blame] | 8 | # a quick cvs co to ease the transition |
| 9 | if test ! -d common; |
| 10 | then |
Thomas Vander Stichele | 8999b72 | 2002-02-06 18:46:39 +0000 | [diff] [blame] | 11 | echo "+ getting common/ from cvs" |
Thomas Vander Stichele | 5cfcaf5 | 2005-09-06 14:05:33 +0000 | [diff] [blame] | 12 | if test -e CVS/Tag |
| 13 | then |
| 14 | TAG="-r `tail -c +2 CVS/Tag`" |
| 15 | fi |
| 16 | cvs co $TAG common |
Thomas Vander Stichele | 8999b72 | 2002-02-06 18:46:39 +0000 | [diff] [blame] | 17 | fi |
| 18 | |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 19 | # source helper functions |
David Schleef | d271f13 | 2003-05-09 08:09:38 +0000 | [diff] [blame] | 20 | if test ! -f common/gst-autogen.sh; |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 21 | then |
| 22 | echo There is something wrong with your source tree. |
| 23 | echo You are missing common/gst-autogen.sh |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 24 | exit 1 |
| 25 | fi |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 26 | . common/gst-autogen.sh |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 27 | |
Tim-Philipp Müller | 16e1c0a | 2006-06-16 10:56:24 +0000 | [diff] [blame] | 28 | 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] | 29 | |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 30 | autogen_options $@ |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 31 | |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 32 | echo -n "+ check for build tools" |
Brian Cameron | 1c7d5ad | 2003-05-21 15:16:49 +0000 | [diff] [blame] | 33 | if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi |
David I. Lehn | ea99323 | 2002-11-02 05:37:37 +0000 | [diff] [blame] | 34 | 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] | 35 | "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 |
Michael Smith | dd8f37f | 2006-02-24 17:09:56 +0000 | [diff] [blame] | 36 | version_check "automake" "$AUTOMAKE automake 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] | 37 | "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1 |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 38 | version_check "autopoint" "autopoint" \ |
Thomas Vander Stichele | 96bbb83 | 2004-02-13 16:43:51 +0000 | [diff] [blame] | 39 | "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 11 5 || DIE=1 |
Edward Hervey | f8efd71 | 2006-05-08 11:53:03 +0000 | [diff] [blame] | 40 | version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \ |
Thomas Vander Stichele | 147a44c | 2004-02-29 08:35:55 +0000 | [diff] [blame] | 41 | "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] | 42 | version_check "pkg-config" "" \ |
| 43 | "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 44 | |
Thomas Vander Stichele | 16facd5 | 2002-05-18 22:45:56 +0000 | [diff] [blame] | 45 | die_check $DIE |
| 46 | |
David Schleef | 4088af9 | 2003-04-13 20:13:58 +0000 | [diff] [blame] | 47 | autoconf_2_52d_check || DIE=1 |
Thomas Vander Stichele | 05489e6 | 2002-04-18 21:57:05 +0000 | [diff] [blame] | 48 | aclocal_check || DIE=1 |
Thomas Vander Stichele | bc465f1 | 2002-05-27 14:01:51 +0000 | [diff] [blame] | 49 | autoheader_check || DIE=1 |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 50 | |
Thomas Vander Stichele | 16facd5 | 2002-05-18 22:45:56 +0000 | [diff] [blame] | 51 | die_check $DIE |
| 52 | |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 53 | # if no arguments specified then this will be printed |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 54 | if test -z "$*"; then |
Thomas Vander Stichele | 77b3751 | 2002-02-07 14:30:20 +0000 | [diff] [blame] | 55 | echo "+ checking for autogen.sh options" |
| 56 | echo " This autogen script will automatically run ./configure as:" |
| 57 | echo " ./configure $CONFIGURE_DEF_OPT" |
| 58 | echo " To pass any additional options, please specify them on the $0" |
| 59 | echo " command line." |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 60 | fi |
| 61 | |
| 62 | toplevel_check $srcfile |
| 63 | |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 64 | # autopoint |
| 65 | # older autopoint (< 0.12) has a tendency to complain about mkinstalldirs |
Benjamin Otte | dba7257 | 2004-02-22 15:59:08 +0000 | [diff] [blame] | 66 | if test -x mkinstalldirs; then rm mkinstalldirs; fi |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 67 | # first remove patch if necessary, then run autopoint, then reapply |
Andy Wingo | 266b874 | 2005-07-08 10:47:30 +0000 | [diff] [blame] | 68 | if test -f po/Makefile.in.in; |
| 69 | then |
| 70 | patch -p0 -R < common/gettext.patch |
| 71 | fi |
| 72 | tool_run "$autopoint --force" |
| 73 | patch -p0 < common/gettext.patch |
Thomas Vander Stichele | 469936a | 2004-01-19 15:45:55 +0000 | [diff] [blame] | 74 | |
Benjamin Otte | 27a875e | 2004-05-17 00:38:59 +0000 | [diff] [blame] | 75 | tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" |
David Schleef | 95c7066 | 2003-08-17 23:35:38 +0000 | [diff] [blame] | 76 | tool_run "$libtoolize" "--copy --force" |
Thomas Vander Stichele | bc465f1 | 2002-05-27 14:01:51 +0000 | [diff] [blame] | 77 | tool_run "$autoheader" |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 78 | |
| 79 | # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo |
| 80 | echo timestamp > stamp-h.in 2> /dev/null |
| 81 | |
Thomas Vander Stichele | 3a6a66c | 2002-03-02 12:03:23 +0000 | [diff] [blame] | 82 | tool_run "$autoconf" |
| 83 | tool_run "$automake" "-a -c" |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 84 | |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 85 | # if enable exists, add an -enable option for each of the lines in that file |
| 86 | if test -f enable; then |
| 87 | for a in `cat enable`; do |
Thomas Vander Stichele | 453d871 | 2003-05-12 15:08:49 +0000 | [diff] [blame] | 88 | CONFIGURE_FILE_OPT="--enable-$a" |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 89 | done |
| 90 | fi |
| 91 | |
| 92 | # if disable exists, add an -disable option for each of the lines in that file |
| 93 | if test -f disable; then |
| 94 | for a in `cat disable`; do |
Thomas Vander Stichele | 453d871 | 2003-05-12 15:08:49 +0000 | [diff] [blame] | 95 | CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a" |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 96 | done |
| 97 | fi |
| 98 | |
Andy Wingo | 6da1174 | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 99 | test -n "$NOCONFIGURE" && { |
Thomas Vander Stichele | 77b3751 | 2002-02-07 14:30:20 +0000 | [diff] [blame] | 100 | echo "+ skipping configure stage for package $package, as requested." |
| 101 | echo "+ autogen.sh done." |
| 102 | exit 0 |
Andy Wingo | 6da1174 | 2001-12-22 01:59:48 +0000 | [diff] [blame] | 103 | } |
Thomas Vander Stichele | 7b80374 | 2001-12-20 23:13:50 +0000 | [diff] [blame] | 104 | |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 105 | echo "+ running configure ... " |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 106 | test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" |
| 107 | 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] | 108 | 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] | 109 | echo |
| 110 | |
Thomas Vander Stichele | 453d871 | 2003-05-12 15:08:49 +0000 | [diff] [blame] | 111 | ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || { |
Thomas Vander Stichele | 7a4a13a | 2002-02-06 18:18:16 +0000 | [diff] [blame] | 112 | echo " configure failed" |
| 113 | exit 1 |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 114 | } |
| 115 | |
Thomas Vander Stichele | 754313a | 2001-12-17 18:37:01 +0000 | [diff] [blame] | 116 | echo "Now type 'make' to compile $package." |