2 # Run this to generate all the initial makefiles, etc.
5 package=gstreamer-plugins
6 srcfile=sys/oss/Makefile.am
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
33 debug "major $MAJOR minor $MINOR micro $MICRO"
35 if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
36 if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
38 debug "major $MAJOR minor $MINOR micro $MICRO"
39 echo -n "+ checking for $1 >= $VERSION ... "
40 ($PACKAGE --version) < /dev/null > /dev/null 2>&1 ||
43 echo "You must have $PACKAGE installed to compile $package."
44 echo "Download the appropriate package for your distribution,"
45 echo "or get the source tarball at $URL"
48 # the following line is carefully crafted sed magic
49 pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
50 debug "pkg_version $pkg_version"
51 pkg_major=`echo $pkg_version | cut -d. -f1`
52 pkg_minor=`echo $pkg_version | cut -d. -f2`
53 pkg_micro=`echo $pkg_version | cut -d. -f3`
54 test -z "$pkg_minor" && pkg_minor=0
55 test -z "$pkg_micro" && pkg_micro=0
57 debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
59 #start checking the version
62 if [ ! "$pkg_major" \> "$MAJOR" ]; then
63 debug "$pkg_major <= $MAJOR"
64 if [ "$pkg_major" \< "$MAJOR" ]; then
66 elif [ ! "$pkg_minor" \> "$MINOR" ]; then
67 if [ "$pkg_minor" \< "$MINOR" ]; then
69 elif [ "$pkg_micro" \< "$MICRO" ]; then
75 if test ! -z "$WRONG"; then
76 echo "found $pkg_version, not ok !"
78 echo "You must have $PACKAGE $VERSION or greater to compile $package."
79 echo "Get the latest version from $URL"
82 echo "found $pkg_version, ok."
86 # autoconf 2.52d has a weird issue involving a yes:no error
87 # so don't allow it's use
88 ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
89 if test "$ac_version" = "2.52d"; then
90 echo "autoconf 2.52d has an issue with our current build."
91 echo "We don't know who's to blame however. So until we do, get a"
92 echo "regular version. RPM's of a working version are on the gstreamer site."
97 version_check "autoconf" "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
98 version_check "automake" "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1
99 version_check "libtool" "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
100 version_check "pkg-config" "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
102 if test "$DIE" -eq 1; then
106 test -f $srcfile || {
107 echo "You must run this script in the top-level $package directory"
111 if test -z "$*"; then
112 echo "I am going to run ./configure with no arguments - if you wish "
113 echo "to pass any to it, please specify them on the $0 command line."
116 echo "+ creating acinclude.m4"
117 cat m4/*.m4 > acinclude.m4
119 echo "+ running aclocal ..."
120 aclocal $ACLOCAL_FLAGS || {
122 echo "aclocal failed - check that all needed development files are present on system"
126 # FIXME : why does libtoolize keep complaining about aclocal ?
127 echo "+ running libtoolize ..."
128 libtoolize --copy --force
130 echo "+ running autoheader ... "
133 echo "autoheader failed"
136 echo "+ running autoconf ... "
139 echo "autoconf failed"
142 echo "+ running automake ... "
145 echo "automake failed"
149 # now remove the cache, because it can be considered dangerous in this case
150 #echo "+ removing config.cache ... "
153 CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir --enable-debug --enable-DEBUG'
155 # if enable exists, add an -enable option for each of the lines in that file
156 if test -f enable; then
157 for a in `cat enable`; do
158 CONFIGURE_OPT="$CONFIGURE_OPT --enable-$a"
162 # if disable exists, add an -disable option for each of the lines in that file
163 if test -f disable; then
164 for a in `cat disable`; do
165 CONFIGURE_OPT="$CONFIGURE_OPT --disable-$a"
170 echo "+ running configure ... "
171 echo "./configure default flags: $CONFIGURE_OPT"
172 echo "using: $CONFIGURE_OPT $@"
175 ./configure $CONFIGURE_OPT "$@" || {
177 echo "configure failed"
182 echo "Now type 'make' to compile $package."