2 # Run this to generate all the initial makefiles, etc.
6 srcfile=gst/gstobject.h
8 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
10 echo "You must have autoconf installed to compile $package."
11 echo "Download the appropriate package for your distribution,"
12 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/"
16 (automake --version) < /dev/null > /dev/null 2>&1 || {
18 echo "You must have automake installed to compile $package."
19 echo "Download the appropriate package for your distribution,"
20 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
23 automakevermin=`(automake --version|head -n 1|sed 's/^.* //;s/\./ /g;';echo "1 4")|sort -n|head -n 1`
24 automakevergood=`(automake --version|head -n 1|sed 's/^.* //;s/\./ /g;';echo "1 4f")|sort -n|head -n 1`
25 if test "x$automakevermin" != "x1 4"; then
26 # version is less than 1.4, the minimum suitable version
28 echo "You must have automake version 1.4 or greater installed."
29 echo "Download the appropriate package for your distribution,"
30 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
33 if test "x$automakevergood" != "x1 4f"; then
34 echo -n "Checking for patched automake..."
35 # version is less than 1.4f, the version with the patch applied
36 # check that patch is applied
37 cat > autogen.patch.tmp <<EOF
41 # to all possible directories, and use it. If DIST_SUBDIRS is
42 # defined, just use it.
43 local (\$dist_subdir_name);
44 - if (&variable_defined ('DIST_SUBDIRS')
45 - || &variable_conditions ('SUBDIRS'))
46 + if (&variable_conditions ('SUBDIRS')
47 + || &variable_defined ('DIST_SUBDIRS'))
49 \$dist_subdir_name = 'DIST_SUBDIRS';
50 if (! &variable_defined ('DIST_SUBDIRS'))
52 if patch -s -f --dry-run `which automake` <autogen.patch.tmp >/dev/null 2>&1;
54 # Patch succeeded: appropriately patched.
57 # Patch failed: either unpatched or incompatibly patched.
58 if patch -R -s -f --dry-run `which automake` <autogen.patch.tmp >/dev/null 2>&1;
60 # Reversed patch succeeded: not patched.
63 echo "Detected automake version 1.4 (or near) without patch."
64 echo "Your version of automake needs a patch applied in order to operate correctly."
66 patchedfile="`pwd`/automake"
67 if test -e $patchedfile; then
70 echo "making a patched version..."
71 patch -R -s -f `which automake` <autogen.patch.tmp -o $patchedfile;
72 chmod +x $patchedfile;
76 echo "***************************************************************************"
77 if test -e $patchedfile; then
78 if test "x$PATCHED" == "x1"; then
79 echo "A patched version of automake is available at:"
81 echo "You should put this in an appropriate place, or modify $PATH, so that it is"
82 echo "used in preference to this installed version of automake."
85 echo "You should abort the build now. Read the README file for an explanation."
86 echo "***************************************************************************"
88 # Give user time to respond
90 echo "Continuing anyway: I recommend keeping a check on the amount of memory used"
91 echo "while running automake - it is likely to grow extremely large."
94 # Reversed patch failed: incompatibly patched.
97 echo "Unable to check whether automake is appropriately patched."
98 echo "Your version of automake may need to have a patch applied."
99 echo "Read the README file for more explanation."
109 (libtool --version) < /dev/null > /dev/null 2>&1 || {
111 echo "You must have libtool installed to compile $package."
112 echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
116 libtool_version=`libtool --version | sed 's/^.* \([0-9\.]*\) .*$/\1/'`
117 libtool_major=`echo $libtool_version | cut -d. -f1`
118 libtool_minor=`echo $libtool_version | cut -d. -f2`
119 libtool_micro=`echo $libtool_version | cut -d. -f3`
120 if [ x$libtool_micro = x ]; then
123 if [ $libtool_major -le 1 ]; then
124 if [ $libtool_major -lt 1 ]; then
126 echo "You must have libtool 1.3.5 or greater to compile $package."
127 echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
129 elif [ $libtool_minor -le 3 ]; then
130 if [ $libtool_minor -lt 3 ]; then
132 echo "You must have libtool 1.3.5 or greater to compile $package."
133 echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
135 elif [ $libtool_micro -lt 5 ]; then
137 echo "You must have libtool 1.3.5 or greater to compile $package."
138 echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
144 if test "$DIE" -eq 1; then
148 test -f $srcfile || {
149 echo "You must run this script in the top-level $package directory"
153 if test -z "$*"; then
154 echo "I am going to run ./configure with no arguments - if you wish "
155 echo "to pass any to it, please specify them on the $0 command line."
159 # Generate configure.in and configure.ac
160 sed <configure.base >configure.in '/^SUBSTFOR configure.ac:.*/d;s/^SUBSTFOR configure.in://g'
161 sed <configure.base >configure.ac '/^SUBSTFOR configure.in:.*/d;s/^SUBSTFOR configure.ac://g'
163 libtoolize --copy --force
164 aclocal $ACLOCAL_FLAGS || {
166 echo "aclocal failed - check that all needed development files are present on system"
171 echo "autoheader failed"
176 echo "autoconf failed"
179 automake --add-missing || {
181 echo "automake failed"
185 # now remove the cache, because it can be considered dangerous in this case
188 # The new configure options for busy application developers (Hadess)
189 #./configure --enable-maintainer-mode --enable-debug --enable-debug-verbose
191 ./configure --enable-maintainer-mode --enable-plugin-srcdir --enable-debug --enable-debug-verbose "$@" || {
193 echo "configure failed"
198 echo "Now type 'make' to compile $package."