blob: 77a69e7aaed059658056c47bb884bb452efe939a [file] [log] [blame]
David Schleefd271f132003-05-09 08:09:38 +00001#!/bin/sh
Thomas Vander Stichele754313a2001-12-17 18:37:01 +00002# Run this to generate all the initial makefiles, etc.
3
4DIE=0
Andy Wingo55826652005-09-12 16:14:48 +00005package=gst-plugins-good
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +00006srcfile=gst/law/alaw.c
Andy Wingo6da11742001-12-22 01:59:48 +00007
Edward Hervey6d325c22009-01-21 04:31:58 +01008# Make sure we have common
9if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele5cfcaf52005-09-06 14:05:33 +000010then
Edward Hervey6d325c22009-01-21 04:31:58 +010011 echo "+ Setting up common submodule"
12 git submodule init
Thomas Vander Stichele8999b722002-02-06 18:46:39 +000013fi
Edward Hervey6d325c22009-01-21 04:31:58 +010014git submodule update
Thomas Vander Stichele8999b722002-02-06 18:46:39 +000015
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000016# source helper functions
David Schleefd271f132003-05-09 08:09:38 +000017if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000018then
19 echo There is something wrong with your source tree.
20 echo You are missing common/gst-autogen.sh
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000021 exit 1
22fi
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000023. common/gst-autogen.sh
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000024
Edward Hervey4e3472a2009-01-22 06:05:26 +010025# install pre-commit hook for doing clean commits
Edward Herveycd906c22009-01-30 08:53:06 +010026if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
Edward Hervey4e3472a2009-01-22 06:05:26 +010027then
Edward Herveycd906c22009-01-30 08:53:06 +010028 rm -f .git/hooks/pre-commit
29 ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
Edward Hervey4e3472a2009-01-22 06:05:26 +010030fi
31
32
Tim-Philipp Müller16e1c0a2006-06-16 10:56:24 +000033CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc --enable-plugin-docs'
Thomas Vander Stichelebc465f12002-05-27 14:01:51 +000034
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000035autogen_options $@
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000036
Jan Schmidt9ab7cfd2009-06-26 15:00:14 +010037printf "+ check for build tools"
Brian Cameron1c7d5ad2003-05-21 15:16:49 +000038if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
David I. Lehnea993232002-11-02 05:37:37 +000039version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \
Thomas Vander Stichele579f0d02002-09-30 07:20:35 +000040 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
Jan Schmidt234f34c2009-06-26 14:40:14 +010041version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10 automake-1.9 automake-1.7 automake-1.6 automake-1.5" \
Thomas Vander Stichele5a027ff2006-06-11 13:57:19 +000042 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000043version_check "autopoint" "autopoint" \
Sebastian Dröge2cb242b2008-11-29 13:31:55 +000044 "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
Edward Herveyf8efd712006-05-08 11:53:03 +000045version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
Thomas Vander Stichele147a44c2004-02-29 08:35:55 +000046 "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
Thomas Vander Stichele579f0d02002-09-30 07:20:35 +000047version_check "pkg-config" "" \
48 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000049
Thomas Vander Stichele16facd52002-05-18 22:45:56 +000050die_check $DIE
51
David Schleef4088af92003-04-13 20:13:58 +000052autoconf_2_52d_check || DIE=1
Thomas Vander Stichele05489e62002-04-18 21:57:05 +000053aclocal_check || DIE=1
Thomas Vander Stichelebc465f12002-05-27 14:01:51 +000054autoheader_check || DIE=1
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000055
Thomas Vander Stichele16facd52002-05-18 22:45:56 +000056die_check $DIE
57
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000058# if no arguments specified then this will be printed
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000059if test -z "$*"; then
Thomas Vander Stichele77b37512002-02-07 14:30:20 +000060 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 Stichele7a4a13a2002-02-06 18:18:16 +000065fi
66
67toplevel_check $srcfile
68
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000069# autopoint
70# older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
Benjamin Ottedba72572004-02-22 15:59:08 +000071if test -x mkinstalldirs; then rm mkinstalldirs; fi
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000072# first remove patch if necessary, then run autopoint, then reapply
Andy Wingo266b8742005-07-08 10:47:30 +000073if test -f po/Makefile.in.in;
74then
75 patch -p0 -R < common/gettext.patch
76fi
77tool_run "$autopoint --force"
78patch -p0 < common/gettext.patch
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000079
David Schleef95c70662003-08-17 23:35:38 +000080tool_run "$libtoolize" "--copy --force"
Marc-Andre Lureau49335fa2009-05-10 11:17:23 +020081tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
Thomas Vander Stichelebc465f12002-05-27 14:01:51 +000082tool_run "$autoheader"
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000083
84# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
85echo timestamp > stamp-h.in 2> /dev/null
86
Thomas Vander Stichele3a6a66c2002-03-02 12:03:23 +000087tool_run "$autoconf"
Tim-Philipp Müllerfac09922009-05-22 01:12:35 +010088tool_run "$automake" "-a -c"
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000089
Thomas Vander Stichele7b803742001-12-20 23:13:50 +000090# if enable exists, add an -enable option for each of the lines in that file
91if test -f enable; then
92 for a in `cat enable`; do
Thomas Vander Stichele453d8712003-05-12 15:08:49 +000093 CONFIGURE_FILE_OPT="--enable-$a"
Thomas Vander Stichele7b803742001-12-20 23:13:50 +000094 done
95fi
96
97# if disable exists, add an -disable option for each of the lines in that file
98if test -f disable; then
99 for a in `cat disable`; do
Thomas Vander Stichele453d8712003-05-12 15:08:49 +0000100 CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
Thomas Vander Stichele7b803742001-12-20 23:13:50 +0000101 done
102fi
103
Andy Wingo6da11742001-12-22 01:59:48 +0000104test -n "$NOCONFIGURE" && {
Thomas Vander Stichele77b37512002-02-07 14:30:20 +0000105 echo "+ skipping configure stage for package $package, as requested."
106 echo "+ autogen.sh done."
107 exit 0
Andy Wingo6da11742001-12-22 01:59:48 +0000108}
Thomas Vander Stichele7b803742001-12-20 23:13:50 +0000109
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000110echo "+ running configure ... "
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +0000111test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
112test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
Thomas Vander Stichele453d8712003-05-12 15:08:49 +0000113test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000114echo
115
Thomas Vander Stichele453d8712003-05-12 15:08:49 +0000116./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +0000117 echo " configure failed"
118 exit 1
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000119}
120
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000121echo "Now type 'make' to compile $package."