| 1 |
#!/bin/sh |
| 2 |
# Run this to generate all the initial makefiles, etc. |
| 3 |
|
| 4 |
DIE=0 |
| 5 |
package=gstreamer |
| 6 |
srcfile=gst/gst.c |
| 7 |
|
| 8 |
# source helper functions |
| 9 |
if test ! -f common/gst-autogen.sh; |
| 10 |
then |
| 11 |
echo There is something wrong with your source tree. |
| 12 |
echo You are missing common/gst-autogen.sh |
| 13 |
exit 1 |
| 14 |
fi |
| 15 |
. common/gst-autogen.sh |
| 16 |
|
| 17 |
# install pre-commit hook for doing clean commits |
| 18 |
if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); |
| 19 |
then |
| 20 |
rm -f .git/hooks/pre-commit |
| 21 |
ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit |
| 22 |
fi |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-failing-tests --enable-poisoning --enable-gtk-doc --enable-docbook' |
| 27 |
|
| 28 |
autogen_options $@ |
| 29 |
|
| 30 |
printf "+ check for build tools" |
| 31 |
if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi |
| 32 |
version_check "autoconf" "$AUTOCONF autoconf autoconf259 autoconf257 autoconf-2.54 autoconf-2.53 autoconf253 autoconf-2.52 autoconf252" \ |
| 33 |
"ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 |
| 34 |
version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10 automake-1.9 automake19 automake-1.8 automake18 automake-1.7 automake17 automake-1.6 automake16" \ |
| 35 |
"ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1 |
| 36 |
version_check "autopoint" "autopoint" \ |
| 37 |
"ftp://ftp.gnu.org/pub/gnu/gettext/" 0 14 || DIE=1 |
| 38 |
version_check "libtoolize" "libtoolize libtoolize15 glibtoolize" \ |
| 39 |
"ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 |
| 40 |
version_check "pkg-config" "" \ |
| 41 |
"http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 |
| 42 |
|
| 43 |
die_check $DIE |
| 44 |
|
| 45 |
autoconf_2_52d_check || DIE=1 |
| 46 |
aclocal_check || DIE=1 |
| 47 |
autoheader_check || DIE=1 |
| 48 |
|
| 49 |
die_check $DIE |
| 50 |
|
| 51 |
# if no arguments specified then this will be printed |
| 52 |
if test -z "$*"; then |
| 53 |
echo "+ checking for autogen.sh options" |
| 54 |
echo " This autogen script will automatically run ./configure as:" |
| 55 |
echo " ./configure $CONFIGURE_DEF_OPT" |
| 56 |
echo " To pass any additional options, please specify them on the $0" |
| 57 |
echo " command line." |
| 58 |
fi |
| 59 |
|
| 60 |
toplevel_check $srcfile |
| 61 |
|
| 62 |
# autopoint |
| 63 |
# older autopoint (< 0.12) has a tendency to complain about mkinstalldirs |
| 64 |
if test -x mkinstalldirs; then rm mkinstalldirs; fi |
| 65 |
# first remove patch if necessary, then run autopoint, then reapply |
| 66 |
if test -f po/Makefile.in.in; |
| 67 |
then |
| 68 |
patch -p0 -R --forward < common/gettext.patch |
| 69 |
fi |
| 70 |
tool_run "$autopoint" "--force" "patch -p0 < common/gettext.patch" |
| 71 |
patch -p0 < common/gettext.patch |
| 72 |
|
| 73 |
# aclocal |
| 74 |
if test -f acinclude.m4; then rm acinclude.m4; fi |
| 75 |
|
| 76 |
tool_run "$libtoolize" "--copy --force" |
| 77 |
tool_run "$aclocal" "-I common/m4 -I . $ACLOCAL_FLAGS" |
| 78 |
tool_run "$autoheader" |
| 79 |
|
| 80 |
# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo |
| 81 |
echo timestamp > stamp-h.in 2> /dev/null |
| 82 |
|
| 83 |
tool_run "$autoconf" |
| 84 |
debug "automake: $automake" |
| 85 |
tool_run "$automake" "--add-missing --copy" |
| 86 |
|
| 87 |
test -n "$NOCONFIGURE" && { |
| 88 |
echo "skipping configure stage for package $package, as requested." |
| 89 |
echo "autogen.sh done." |
| 90 |
exit 0 |
| 91 |
} |
| 92 |
|
| 93 |
echo "+ running configure ... " |
| 94 |
test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" |
| 95 |
test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" |
| 96 |
echo |
| 97 |
|
| 98 |
echo ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT |
| 99 |
./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { |
| 100 |
echo " configure failed" |
| 101 |
exit 1 |
| 102 |
} |
| 103 |
|
| 104 |
echo "Now type 'make' to compile $package." |