blob: 895531ac070a550176687b446e7527ec41ad4b42 [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
Thomas Vander Stichele5cfcaf52005-09-06 14:05:33 +00008# a quick cvs co to ease the transition
9if test ! -d common;
10then
Thomas Vander Stichele8999b722002-02-06 18:46:39 +000011 echo "+ getting common/ from cvs"
Thomas Vander Stichele5cfcaf52005-09-06 14:05:33 +000012 if test -e CVS/Tag
13 then
14 TAG="-r `tail -c +2 CVS/Tag`"
15 fi
16 cvs co $TAG common
Thomas Vander Stichele8999b722002-02-06 18:46:39 +000017fi
18
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000019# source helper functions
David Schleefd271f132003-05-09 08:09:38 +000020if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000021then
22 echo There is something wrong with your source tree.
23 echo You are missing common/gst-autogen.sh
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000024 exit 1
25fi
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000026. common/gst-autogen.sh
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000027
Tim-Philipp Müller16e1c0a2006-06-16 10:56:24 +000028CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc --enable-plugin-docs'
Thomas Vander Stichelebc465f12002-05-27 14:01:51 +000029
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000030autogen_options $@
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000031
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000032echo -n "+ check for build tools"
Brian Cameron1c7d5ad2003-05-21 15:16:49 +000033if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
David I. Lehnea993232002-11-02 05:37:37 +000034version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \
Thomas Vander Stichele579f0d02002-09-30 07:20:35 +000035 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
Michael Smithdd8f37f2006-02-24 17:09:56 +000036version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.7 automake-1.6 automake-1.5" \
Thomas Vander Stichele5a027ff2006-06-11 13:57:19 +000037 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000038version_check "autopoint" "autopoint" \
Thomas Vander Stichele96bbb832004-02-13 16:43:51 +000039 "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 11 5 || DIE=1
Edward Herveyf8efd712006-05-08 11:53:03 +000040version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
Thomas Vander Stichele147a44c2004-02-29 08:35:55 +000041 "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
Thomas Vander Stichele579f0d02002-09-30 07:20:35 +000042version_check "pkg-config" "" \
43 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000044
Thomas Vander Stichele16facd52002-05-18 22:45:56 +000045die_check $DIE
46
David Schleef4088af92003-04-13 20:13:58 +000047autoconf_2_52d_check || DIE=1
Thomas Vander Stichele05489e62002-04-18 21:57:05 +000048aclocal_check || DIE=1
Thomas Vander Stichelebc465f12002-05-27 14:01:51 +000049autoheader_check || DIE=1
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000050
Thomas Vander Stichele16facd52002-05-18 22:45:56 +000051die_check $DIE
52
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000053# if no arguments specified then this will be printed
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000054if test -z "$*"; then
Thomas Vander Stichele77b37512002-02-07 14:30:20 +000055 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 Stichele7a4a13a2002-02-06 18:18:16 +000060fi
61
62toplevel_check $srcfile
63
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000064# autopoint
65# older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
Benjamin Ottedba72572004-02-22 15:59:08 +000066if test -x mkinstalldirs; then rm mkinstalldirs; fi
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000067# first remove patch if necessary, then run autopoint, then reapply
Andy Wingo266b8742005-07-08 10:47:30 +000068if test -f po/Makefile.in.in;
69then
70 patch -p0 -R < common/gettext.patch
71fi
72tool_run "$autopoint --force"
73patch -p0 < common/gettext.patch
Thomas Vander Stichele469936a2004-01-19 15:45:55 +000074
Benjamin Otte27a875e2004-05-17 00:38:59 +000075tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
David Schleef95c70662003-08-17 23:35:38 +000076tool_run "$libtoolize" "--copy --force"
Thomas Vander Stichelebc465f12002-05-27 14:01:51 +000077tool_run "$autoheader"
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +000078
79# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
80echo timestamp > stamp-h.in 2> /dev/null
81
Thomas Vander Stichele3a6a66c2002-03-02 12:03:23 +000082tool_run "$autoconf"
83tool_run "$automake" "-a -c"
Thomas Vander Stichele754313a2001-12-17 18:37:01 +000084
Thomas Vander Stichele7b803742001-12-20 23:13:50 +000085# if enable exists, add an -enable option for each of the lines in that file
86if test -f enable; then
87 for a in `cat enable`; do
Thomas Vander Stichele453d8712003-05-12 15:08:49 +000088 CONFIGURE_FILE_OPT="--enable-$a"
Thomas Vander Stichele7b803742001-12-20 23:13:50 +000089 done
90fi
91
92# if disable exists, add an -disable option for each of the lines in that file
93if test -f disable; then
94 for a in `cat disable`; do
Thomas Vander Stichele453d8712003-05-12 15:08:49 +000095 CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
Thomas Vander Stichele7b803742001-12-20 23:13:50 +000096 done
97fi
98
Andy Wingo6da11742001-12-22 01:59:48 +000099test -n "$NOCONFIGURE" && {
Thomas Vander Stichele77b37512002-02-07 14:30:20 +0000100 echo "+ skipping configure stage for package $package, as requested."
101 echo "+ autogen.sh done."
102 exit 0
Andy Wingo6da11742001-12-22 01:59:48 +0000103}
Thomas Vander Stichele7b803742001-12-20 23:13:50 +0000104
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000105echo "+ running configure ... "
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +0000106test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
107test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
Thomas Vander Stichele453d8712003-05-12 15:08:49 +0000108test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000109echo
110
Thomas Vander Stichele453d8712003-05-12 15:08:49 +0000111./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
Thomas Vander Stichele7a4a13a2002-02-06 18:18:16 +0000112 echo " configure failed"
113 exit 1
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000114}
115
Thomas Vander Stichele754313a2001-12-17 18:37:01 +0000116echo "Now type 'make' to compile $package."