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-22 01:58:59 +00:00
|
|
|
|
2002-02-06 22:28:25 +00:00
|
|
|
if test ! -d common; then
|
|
|
|
echo "+ getting common from cvs"; cvs co common
|
|
|
|
fi
|
|
|
|
if test ! -d libs/ext/cothreads; then
|
|
|
|
echo "+ getting cothreads from cvs"; cd libs/ext; cvs co cothreads
|
|
|
|
fi
|
2002-02-06 21:35:37 +00:00
|
|
|
|
2002-01-23 00:04:33 +00:00
|
|
|
CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir'
|
|
|
|
|
2001-12-22 01:58:59 +00:00
|
|
|
for i in $@; do
|
|
|
|
if test "$i" = "--autogen-noconfigure"; then
|
|
|
|
NOCONFIGURE=defined
|
|
|
|
echo "+ configure run disabled"
|
|
|
|
elif test "$i" = "--autogen-nocheck"; then
|
|
|
|
NOCHECK=defined
|
|
|
|
echo "+ autotools version check disabled"
|
|
|
|
elif test "$i" = "--autogen-debug"; then
|
|
|
|
DEBUG=defined
|
|
|
|
echo "+ debug output enabled"
|
|
|
|
elif test "$i" = "--help"; then
|
|
|
|
echo "autogen.sh help options: "
|
|
|
|
echo " --autogen-noconfigure don't run the configure script"
|
|
|
|
echo " --autogen-nocheck don't do version checks"
|
|
|
|
echo " --autogen-debug debug the autogen process"
|
|
|
|
echo "continuing with the autogen in order to get configure help messages..."
|
|
|
|
fi
|
|
|
|
done
|
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-22 01:58:59 +00:00
|
|
|
|
|
|
|
test -z "$NOCHECK" && {
|
|
|
|
echo -n "+ checking for $1 >= $VERSION ... "
|
|
|
|
} || {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
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"
|
|
|
|
|
2002-02-06 12:53:15 +00:00
|
|
|
if [ ! "$pkg_major" -gt "$MAJOR" ]; then
|
|
|
|
debug "$pkg_major -le $MAJOR"
|
|
|
|
if [ "$pkg_major" -lt "$MAJOR" ]; then
|
2001-12-09 14:28:04 +00:00
|
|
|
WRONG=1
|
2002-02-06 12:53:15 +00:00
|
|
|
elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
|
|
|
|
if [ "$pkg_minor" -lt "$MINOR" ]; then
|
2001-12-09 14:28:04 +00:00
|
|
|
WRONG=1
|
2002-02-06 12:53:15 +00:00
|
|
|
elif [ "$pkg_micro" -lt "$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
|
|
|
|
|
|
|
|
|
2002-01-23 00:04:33 +00:00
|
|
|
if test -z "$*"; then
|
|
|
|
echo "This autogen script will automatically run ./configure as:"
|
|
|
|
echo "./configure $CONFIGURE_OPT"
|
|
|
|
echo "To pass any other options, please specify them on the $0"
|
|
|
|
echo "command line."
|
|
|
|
echo
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2001-12-10 14:05:50 +00:00
|
|
|
echo "+ running aclocal ..."
|
2002-02-04 21:24:08 +00:00
|
|
|
cat m4/*.m4 >acinclude.m4;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 ?
|
2002-01-07 18:24:56 +00:00
|
|
|
echo "+ not running libtoolize until libtool fix has flown downstream"
|
2002-01-12 01:24:32 +00:00
|
|
|
#echo "+ running libtoolize ..."
|
|
|
|
#libtoolize --copy --force || {
|
|
|
|
# echo
|
|
|
|
# echo "libtoolize failed"
|
|
|
|
# exit 1
|
|
|
|
#}
|
2001-12-14 11:30:50 +00:00
|
|
|
|
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-20 01:20:22 +00:00
|
|
|
# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
|
|
|
|
echo timestamp > stamp-h.in 2> /dev/null
|
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
|
|
|
|
2002-02-06 13:36:22 +00:00
|
|
|
dnl echo
|
|
|
|
dnl echo "+ running autogen.sh in libs/ext/cothreads..."
|
|
|
|
dnl pushd libs/ext/cothreads > /dev/null
|
|
|
|
dnl echo
|
|
|
|
dnl ./autogen.sh --autogen-noconfigure --autogen-nocheck
|
|
|
|
dnl popd > /dev/null
|
|
|
|
dnl echo
|
2001-05-25 21:13:05 +00:00
|
|
|
|
2001-12-22 01:58:59 +00:00
|
|
|
test -n "$NOCONFIGURE" && {
|
|
|
|
echo "skipping configure stage for package $package, as requested."
|
|
|
|
echo "autogen.sh done."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
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."
|