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