2001-12-10 13:41:59 +00:00
|
|
|
#!/bin/bash
|
2000-01-30 09:03:00 +00:00
|
|
|
# Run this to generate all the initial makefiles, etc.
|
|
|
|
|
|
|
|
DIE=0
|
2001-01-02 12:04:46 +00:00
|
|
|
package=GStreamer
|
2000-01-30 09:03:00 +00:00
|
|
|
srcfile=gst/gstobject.h
|
2001-12-09 14:28:04 +00:00
|
|
|
#DEBUG=defined
|
2001-12-10 14:05:50 +00:00
|
|
|
if test "x$1" = "x-d"; then echo "+ debug output enabled"; DEBUG=defined; fi
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2001-12-09 14:28:04 +00:00
|
|
|
debug ()
|
|
|
|
# print out a debug message if DEBUG is a defined variable
|
|
|
|
{
|
2001-12-10 13:26:31 +00:00
|
|
|
if test ! -z "$DEBUG"
|
2001-12-09 14:28:04 +00:00
|
|
|
then
|
|
|
|
echo "DEBUG: $1"
|
|
|
|
fi
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|
|
|
|
|
2001-12-09 14:28:04 +00:00
|
|
|
version_check ()
|
|
|
|
# check the version of a package
|
|
|
|
# first argument : package name (executable)
|
|
|
|
# second argument : source download url
|
|
|
|
# rest of arguments : major, minor, micro version
|
|
|
|
{
|
|
|
|
PACKAGE=$1
|
|
|
|
URL=$2
|
|
|
|
MAJOR=$3
|
|
|
|
MINOR=$4
|
|
|
|
MICRO=$5
|
2001-12-08 23:58:24 +00:00
|
|
|
|
2001-12-15 14:26:44 +00:00
|
|
|
WRONG=
|
2001-12-09 17:00:42 +00:00
|
|
|
|
2001-12-09 14:28:04 +00:00
|
|
|
debug "major $MAJOR minor $MINOR micro $MICRO"
|
|
|
|
VERSION=$MAJOR
|
2001-12-10 13:22:58 +00:00
|
|
|
if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
|
|
|
|
if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
|
2001-12-08 23:58:24 +00:00
|
|
|
|
2001-12-09 14:28:04 +00:00
|
|
|
debug "major $MAJOR minor $MINOR micro $MICRO"
|
2001-12-12 06:08:44 +00:00
|
|
|
echo -n "+ checking for $1 >= $VERSION ... "
|
2001-12-09 14:28:04 +00:00
|
|
|
($PACKAGE --version) < /dev/null > /dev/null 2>&1 ||
|
|
|
|
{
|
2001-01-02 08:13:34 +00:00
|
|
|
echo
|
2001-12-09 14:28:04 +00:00
|
|
|
echo "You must have $PACKAGE installed to compile $package."
|
2001-05-29 16:40:07 +00:00
|
|
|
echo "Download the appropriate package for your distribution,"
|
2001-12-09 14:28:04 +00:00
|
|
|
echo "or get the source tarball at $URL"
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
# the following line is carefully crafted sed magic
|
|
|
|
pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
|
|
|
|
debug "pkg_version $pkg_version"
|
|
|
|
pkg_major=`echo $pkg_version | cut -d. -f1`
|
|
|
|
pkg_minor=`echo $pkg_version | cut -d. -f2`
|
|
|
|
pkg_micro=`echo $pkg_version | cut -d. -f3`
|
2001-12-10 13:26:31 +00:00
|
|
|
test -z "$pkg_minor" && pkg_minor=0
|
|
|
|
test -z "$pkg_micro" && pkg_micro=0
|
2001-05-29 16:40:07 +00:00
|
|
|
|
2001-12-09 14:28:04 +00:00
|
|
|
debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
|
2001-06-25 12:09:31 +00:00
|
|
|
|
2001-12-09 14:28:04 +00:00
|
|
|
#start checking the version
|
2001-12-09 17:00:42 +00:00
|
|
|
debug "version check"
|
|
|
|
|
2001-12-10 13:36:11 +00:00
|
|
|
if [ ! "$pkg_major" \> "$MAJOR" ]; then
|
2001-12-09 17:00:42 +00:00
|
|
|
debug "$pkg_major <= $MAJOR"
|
|
|
|
if [ "$pkg_major" \< "$MAJOR" ]; then
|
2001-12-09 14:28:04 +00:00
|
|
|
WRONG=1
|
2001-12-10 13:36:11 +00:00
|
|
|
elif [ ! "$pkg_minor" \> "$MINOR" ]; then
|
2001-12-09 17:00:42 +00:00
|
|
|
if [ "$pkg_minor" \< "$MINOR" ]; then
|
2001-12-09 14:28:04 +00:00
|
|
|
WRONG=1
|
2001-12-09 17:00:42 +00:00
|
|
|
elif [ "$pkg_micro" \< "$MICRO" ]; then
|
2001-12-09 14:28:04 +00:00
|
|
|
WRONG=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2001-12-10 13:26:31 +00:00
|
|
|
if test ! -z "$WRONG"; then
|
2001-12-11 12:56:37 +00:00
|
|
|
echo "found $pkg_version, not ok !"
|
2001-12-09 14:28:04 +00:00
|
|
|
echo
|
|
|
|
echo "You must have $PACKAGE $VERSION or greater to compile $package."
|
|
|
|
echo "Get the latest version from $URL"
|
|
|
|
return 1
|
2001-12-10 14:05:50 +00:00
|
|
|
else
|
2001-12-11 12:56:37 +00:00
|
|
|
echo "found $pkg_version, ok."
|
2001-12-09 14:28:04 +00:00
|
|
|
fi
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|
|
|
|
|
2001-12-10 17:59:35 +00:00
|
|
|
# autoconf 2.52d has a weird issue involving a yes:no error
|
|
|
|
# so don't allow it's use
|
|
|
|
ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
|
|
|
|
if test "$ac_version" = "2.52d"; then
|
|
|
|
echo "autoconf 2.52d has an issue with our current build."
|
|
|
|
echo "We don't know who's to blame however. So until we do, get a"
|
|
|
|
echo "regular version. RPM's of a working version are on the gstreamer site."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2001-12-09 14:28:04 +00:00
|
|
|
version_check "autoconf" "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
|
|
|
|
version_check "automake" "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1
|
|
|
|
version_check "libtool" "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
|
2001-12-11 22:55:55 +00:00
|
|
|
version_check "pkg-config" "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
if test "$DIE" -eq 1; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
test -f $srcfile || {
|
|
|
|
echo "You must run this script in the top-level $package directory"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
if test -z "$*"; then
|
|
|
|
echo "I am going to run ./configure with no arguments - if you wish "
|
|
|
|
echo "to pass any to it, please specify them on the $0 command line."
|
|
|
|
fi
|
|
|
|
|
2001-12-15 11:18:21 +00:00
|
|
|
echo "+ creating acinclude.m4"
|
|
|
|
cat m4/*.m4 > acinclude.m4
|
|
|
|
|
2001-12-10 14:05:50 +00:00
|
|
|
echo "+ running aclocal ..."
|
2001-05-22 13:48:48 +00:00
|
|
|
aclocal $ACLOCAL_FLAGS || {
|
2001-05-29 16:40:07 +00:00
|
|
|
echo
|
2001-05-22 13:48:48 +00:00
|
|
|
echo "aclocal failed - check that all needed development files are present on system"
|
|
|
|
exit 1
|
|
|
|
}
|
2001-12-14 11:30:50 +00:00
|
|
|
|
|
|
|
# FIXME : why does libtoolize keep complaining about aclocal ?
|
|
|
|
echo "+ running libtoolize ..."
|
|
|
|
libtoolize --copy --force
|
|
|
|
|
2001-12-10 14:05:50 +00:00
|
|
|
echo "+ running autoheader ... "
|
2001-05-29 16:40:07 +00:00
|
|
|
autoheader || {
|
|
|
|
echo
|
|
|
|
echo "autoheader failed"
|
|
|
|
exit 1
|
|
|
|
}
|
2001-12-10 14:05:50 +00:00
|
|
|
echo "+ running autoconf ... "
|
2001-05-29 16:40:07 +00:00
|
|
|
autoconf || {
|
|
|
|
echo
|
|
|
|
echo "autoconf failed"
|
2001-12-14 11:30:50 +00:00
|
|
|
exit 1
|
2001-05-29 16:40:07 +00:00
|
|
|
}
|
2001-12-10 14:05:50 +00:00
|
|
|
echo "+ running automake ... "
|
2001-12-10 23:57:26 +00:00
|
|
|
automake -a -c || {
|
2001-05-29 16:40:07 +00:00
|
|
|
echo
|
|
|
|
echo "automake failed"
|
2001-12-14 11:30:50 +00:00
|
|
|
exit 1
|
2001-05-29 16:40:07 +00:00
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2001-04-23 23:16:12 +00:00
|
|
|
# now remove the cache, because it can be considered dangerous in this case
|
2001-12-13 19:00:58 +00:00
|
|
|
#echo "+ removing config.cache ... "
|
|
|
|
#rm -f config.cache
|
2001-04-23 23:16:12 +00:00
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir --enable-debug --enable-DEBUG'
|
2001-05-25 21:13:05 +00:00
|
|
|
|
2001-12-10 14:05:50 +00:00
|
|
|
echo "+ running configure ... "
|
2001-10-17 10:21:27 +00:00
|
|
|
echo "./configure default flags: $CONFIGURE_OPT"
|
|
|
|
echo "using: $CONFIGURE_OPT $@"
|
|
|
|
echo
|
|
|
|
|
|
|
|
./configure $CONFIGURE_OPT "$@" || {
|
2001-05-29 16:40:07 +00:00
|
|
|
echo
|
|
|
|
echo "configure failed"
|
|
|
|
exit 1
|
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Now type 'make' to compile $package."
|