2 # Run this to generate all the initial makefiles, etc.
6 srcfile=gst/gstobject.h
8 if test "x$1" = "x-d"; then echo "+ debug output enabled"; DEBUG=defined; fi
11 # print out a debug message if DEBUG is a defined variable
20 # check the version of a package
21 # first argument : package name (executable)
22 # second argument : source download url
23 # rest of arguments : major, minor, micro version
32 debug "major $MAJOR minor $MINOR micro $MICRO"
34 if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
35 if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
37 debug "major $MAJOR minor $MINOR micro $MICRO"
38 echo -n "+ checking for $1 > $VERSION ... "
39 ($PACKAGE --version) < /dev/null > /dev/null 2>&1 ||
42 echo "You must have $PACKAGE installed to compile $package."
43 echo "Download the appropriate package for your distribution,"
44 echo "or get the source tarball at $URL"
47 # the following line is carefully crafted sed magic
48 pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
49 debug "pkg_version $pkg_version"
50 pkg_major=`echo $pkg_version | cut -d. -f1`
51 pkg_minor=`echo $pkg_version | cut -d. -f2`
52 pkg_micro=`echo $pkg_version | cut -d. -f3`
53 test -z "$pkg_minor" && pkg_minor=0
54 test -z "$pkg_micro" && pkg_micro=0
56 debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
58 #start checking the version
61 if [ ! "$pkg_major" \> "$MAJOR" ]; then
62 debug "$pkg_major <= $MAJOR"
63 if [ "$pkg_major" \< "$MAJOR" ]; then
65 elif [ ! "$pkg_minor" \> "$MINOR" ]; then
66 if [ "$pkg_minor" \< "$MINOR" ]; then
68 elif [ "$pkg_micro" \< "$MICRO" ]; then
74 if test ! -z "$WRONG"; then
75 echo "found $pkg_version, not ok !"
77 echo "You must have $PACKAGE $VERSION or greater to compile $package."
78 echo "Get the latest version from $URL"
81 echo "found $pkg_version, ok."
85 # autoconf 2.52d has a weird issue involving a yes:no error
86 # so don't allow it's use
87 ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
88 if test "$ac_version" = "2.52d"; then
89 echo "autoconf 2.52d has an issue with our current build."
90 echo "We don't know who's to blame however. So until we do, get a"
91 echo "regular version. RPM's of a working version are on the gstreamer site."
96 version_check "autoconf" "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
97 version_check "automake" "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1
98 version_check "libtool" "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
99 version_check "pkg-config" "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
101 if test "$DIE" -eq 1; then
105 test -f $srcfile || {
106 echo "You must run this script in the top-level $package directory"
110 if test -z "$*"; then
111 echo "I am going to run ./configure with no arguments - if you wish "
112 echo "to pass any to it, please specify them on the $0 command line."
115 # FIXME : why does libtoolize keep complaining about aclocal ?
116 echo "+ running libtoolize ..."
117 libtoolize --copy --force
119 echo "+ running aclocal ..."
120 aclocal $ACLOCAL_FLAGS || {
122 echo "aclocal failed - check that all needed development files are present on system"
125 echo "+ running autoheader ... "
128 echo "autoheader failed"
131 echo "+ running autoconf ... "
134 echo "autoconf failed"
137 echo "+ running automake ... "
140 echo "automake failed"
144 # now remove the cache, because it can be considered dangerous in this case
145 echo "+ removing config.cache ... "
148 CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir --enable-debug --enable-DEBUG'
150 echo "+ running configure ... "
151 echo "./configure default flags: $CONFIGURE_OPT"
152 echo "using: $CONFIGURE_OPT $@"
155 ./configure $CONFIGURE_OPT "$@" || {
157 echo "configure failed"
162 echo "Now type 'make' to compile $package."