| 1 |
#!/bin/sh |
| 2 |
# Run this to generate all the initial makefiles, etc. |
| 3 |
|
| 4 |
DIE=0 |
| 5 |
package=gst-plugins-good |
| 6 |
srcfile=gst/law/alaw.c |
| 7 |
|
| 8 |
# Make sure we have common |
| 9 |
if test ! -f common/gst-autogen.sh; |
| 10 |
then |
| 11 |
echo "+ Setting up common submodule" |
| 12 |
git submodule init |
| 13 |
fi |
| 14 |
git submodule update |
| 15 |
|
| 16 |
# source helper functions |
| 17 |
if test ! -f common/gst-autogen.sh; |
| 18 |
then |
| 19 |
echo There is something wrong with your source tree. |
| 20 |
echo You are missing common/gst-autogen.sh |
| 21 |
exit 1 |
| 22 |
fi |
| 23 |
. common/gst-autogen.sh |
| 24 |
|
| 25 |
# install pre-commit hook for doing clean commits |
| 26 |
if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); |
| 27 |
then |
| 28 |
rm -f .git/hooks/pre-commit |
| 29 |
ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit |
| 30 |
fi |
| 31 |
|
| 32 |
|
| 33 |
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc --enable-plugin-docs' |
| 34 |
|
| 35 |
autogen_options $@ |
| 36 |
|
| 37 |
printf "+ check for build tools" |
| 38 |
if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi |
| 39 |
version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \ |
| 40 |
"ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 |
| 41 |
version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10 automake-1.9 automake-1.7 automake-1.6 automake-1.5" \ |
| 42 |
"ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1 |
| 43 |
version_check "autopoint" "autopoint" \ |
| 44 |
"ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1 |
| 45 |
version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \ |
| 46 |
"ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 |
| 47 |
version_check "pkg-config" "" \ |
| 48 |
"http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 |
| 49 |
|
| 50 |
die_check $DIE |
| 51 |
|
| 52 |
autoconf_2_52d_check || DIE=1 |
| 53 |
aclocal_check || DIE=1 |
| 54 |
autoheader_check || DIE=1 |
| 55 |
|
| 56 |
die_check $DIE |
| 57 |
|
| 58 |
# if no arguments specified then this will be printed |
| 59 |
if test -z "$*"; then |
| 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." |
| 65 |
fi |
| 66 |
|
| 67 |
toplevel_check $srcfile |
| 68 |
|
| 69 |
# autopoint |
| 70 |
# older autopoint (< 0.12) has a tendency to complain about mkinstalldirs |
| 71 |
if test -x mkinstalldirs; then rm mkinstalldirs; fi |
| 72 |
# first remove patch if necessary, then run autopoint, then reapply |
| 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 |
| 79 |
|
| 80 |
tool_run "$libtoolize" "--copy --force" |
| 81 |
tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" |
| 82 |
tool_run "$autoheader" |
| 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 |
|
| 87 |
tool_run "$autoconf" |
| 88 |
tool_run "$automake" "-a -c" |
| 89 |
|
| 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 |
| 93 |
CONFIGURE_FILE_OPT="--enable-$a" |
| 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 |
| 100 |
CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a" |
| 101 |
done |
| 102 |
fi |
| 103 |
|
| 104 |
test -n "$NOCONFIGURE" && { |
| 105 |
echo "+ skipping configure stage for package $package, as requested." |
| 106 |
echo "+ autogen.sh done." |
| 107 |
exit 0 |
| 108 |
} |
| 109 |
|
| 110 |
echo "+ running configure ... " |
| 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" |
| 113 |
test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT" |
| 114 |
echo |
| 115 |
|
| 116 |
./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || { |
| 117 |
echo " configure failed" |
| 118 |
exit 1 |
| 119 |
} |
| 120 |
|
| 121 |
echo "Now type 'make' to compile $package." |