2 # Run this to generate all the initial makefiles, etc.
6 srcfile=gst/gstobject.h
9 CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir'
12 if test "$i" = "--autogen-noconfigure"; then
14 echo "+ configure run disabled"
15 elif test "$i" = "--autogen-nocheck"; then
17 echo "+ autotools version check disabled"
18 elif test "$i" = "--autogen-debug"; then
20 echo "+ debug output enabled"
21 elif test "$i" = "--help"; then
22 echo "autogen.sh help options: "
23 echo " --autogen-noconfigure don't run the configure script"
24 echo " --autogen-nocheck don't do version checks"
25 echo " --autogen-debug debug the autogen process"
26 echo "continuing with the autogen in order to get configure help messages..."
31 # print out a debug message if DEBUG is a defined variable
40 # check the version of a package
41 # first argument : package name (executable)
42 # second argument : source download url
43 # rest of arguments : major, minor, micro version
53 debug "major $MAJOR minor $MINOR micro $MICRO"
55 if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
56 if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
58 debug "major $MAJOR minor $MINOR micro $MICRO"
60 test -z "$NOCHECK" && {
61 echo -n "+ checking for $1 >= $VERSION ... "
66 ($PACKAGE --version) < /dev/null > /dev/null 2>&1 ||
69 echo "You must have $PACKAGE installed to compile $package."
70 echo "Download the appropriate package for your distribution,"
71 echo "or get the source tarball at $URL"
74 # the following line is carefully crafted sed magic
75 pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
76 debug "pkg_version $pkg_version"
77 pkg_major=`echo $pkg_version | cut -d. -f1`
78 pkg_minor=`echo $pkg_version | cut -d. -f2`
79 pkg_micro=`echo $pkg_version | cut -d. -f3`
80 test -z "$pkg_minor" && pkg_minor=0
81 test -z "$pkg_micro" && pkg_micro=0
83 debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
85 #start checking the version
88 if [ ! "$pkg_major" -gt "$MAJOR" ]; then
89 debug "$pkg_major -le $MAJOR"
90 if [ "$pkg_major" -lt "$MAJOR" ]; then
92 elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
93 if [ "$pkg_minor" -lt "$MINOR" ]; then
95 elif [ "$pkg_micro" -lt "$MICRO" ]; then
101 if test ! -z "$WRONG"; then
102 echo "found $pkg_version, not ok !"
104 echo "You must have $PACKAGE $VERSION or greater to compile $package."
105 echo "Get the latest version from $URL"
108 echo "found $pkg_version, ok."
112 # autoconf 2.52d has a weird issue involving a yes:no error
113 # so don't allow it's use
114 ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
115 if test "$ac_version" = "2.52d"; then
116 echo "autoconf 2.52d has an issue with our current build."
117 echo "We don't know who's to blame however. So until we do, get a"
118 echo "regular version. RPM's of a working version are on the gstreamer site."
123 if test -z "$*"; then
124 echo "This autogen script will automatically run ./configure as:"
125 echo "./configure $CONFIGURE_OPT"
126 echo "To pass any other options, please specify them on the $0"
131 version_check "autoconf" "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
132 version_check "automake" "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1
133 version_check "libtool" "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
134 version_check "pkg-config" "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
136 if test "$DIE" -eq 1; then
140 test -f $srcfile || {
141 echo "You must run this script in the top-level $package directory"
145 echo "+ running aclocal ..."
146 cat m4/*.m4 >acinclude.m4;aclocal $ACLOCAL_FLAGS || {
148 echo "aclocal failed - check that all needed development files are present on system"
152 # FIXME : why does libtoolize keep complaining about aclocal ?
153 echo "+ not running libtoolize until libtool fix has flown downstream"
154 #echo "+ running libtoolize ..."
155 #libtoolize --copy --force || {
157 # echo "libtoolize failed"
161 echo "+ running autoheader ... "
164 echo "autoheader failed"
167 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
168 echo timestamp > stamp-h.in 2> /dev/null
169 echo "+ running autoconf ... "
172 echo "autoconf failed"
175 echo "+ running automake ... "
178 echo "automake failed"
183 dnl echo "+ running autogen.sh in libs/ext/cothreads..."
184 dnl pushd libs/ext/cothreads > /dev/null
186 dnl ./autogen.sh --autogen-noconfigure --autogen-nocheck
190 test -n "$NOCONFIGURE" && {
191 echo "skipping configure stage for package $package, as requested."
192 echo "autogen.sh done."
196 echo "+ running configure ... "
197 echo "./configure default flags: $CONFIGURE_OPT"
198 echo "using: $CONFIGURE_OPT $@"
201 ./configure $CONFIGURE_OPT "$@" || {
203 echo "configure failed"
208 echo "Now type 'make' to compile $package."