1 # helper functions for autogen.sh
4 # print out a debug message if DEBUG is a defined variable
13 # check the version of a package
14 # first argument : package name (executable)
15 # second argument : source download url
16 # rest of arguments : major, minor, micro version
26 debug "major $MAJOR minor $MINOR micro $MICRO"
28 if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
29 if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
31 debug "major $MAJOR minor $MINOR micro $MICRO"
33 test -z "$NOCHECK" && {
34 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 # remove any non-digit characters from the version numbers to permit numeric
52 pkg_major=`echo $pkg_version | cut -d. -f1 | tr -d -c [:digit:]`
53 pkg_minor=`echo $pkg_version | cut -d. -f2 | tr -d -c [:digit:]`
54 pkg_micro=`echo $pkg_version | cut -d. -f3 | tr -d -c [:digit:]`
55 test -z "$pkg_minor" && pkg_minor=0
56 test -z "$pkg_micro" && pkg_micro=0
58 debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
60 #start checking the version
63 if [ ! "$pkg_major" -gt "$MAJOR" ]; then
64 debug "$pkg_major <= $MAJOR"
65 if [ "$pkg_major" -lt "$MAJOR" ]; then
67 elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
68 if [ "$pkg_minor" -lt "$MINOR" ]; then
70 elif [ "$pkg_micro" -lt "$MICRO" ]; then
76 if test ! -z "$WRONG"; then
77 echo "found $pkg_version, not ok !"
79 echo "You must have $PACKAGE $VERSION or greater to compile $package."
80 echo "Get the latest version from $URL"
83 echo "found $pkg_version, ok."
87 autoconf_2.52d_check ()
89 # autoconf 2.52d has a weird issue involving a yes:no error
90 # so don't allow it's use
91 ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
92 if test "$ac_version" = "2.52d"; then
93 echo "autoconf 2.52d has an issue with our current build."
94 echo "We don't know who's to blame however. So until we do, get a"
95 echo "regular version. RPM's of a working version are on the gstreamer site."
103 if test "$i" = "--autogen-noconfigure"; then
105 AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --autogen-noconfigure"
106 echo "+ configure run disabled"
107 elif test "$i" = "--autogen-nocheck"; then
108 AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --autogen-nocheck"
110 echo "+ autotools version check disabled"
111 elif test "$i" = "--autogen-debug"; then
113 echo "+ debug output enabled"
114 AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --autogen-debug"
115 elif test "$i" = "--help"; then
116 echo "autogen.sh help options: "
117 echo " --autogen-noconfigure don't run the configure script"
118 echo " --autogen-nocheck don't do version checks"
119 echo " --autogen-debug debug the autogen process"
122 CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $i"
130 test -f $srcfile || {
131 echo "You must run this script in the top-level $package directory"
141 echo "+ running $tool $options..."