2 # Run this to generate all the initial makefiles, etc.
6 srcfile=gst/gstobject.h
9 for a in common libs/ext/cothreads; do
12 echo "+ getting $a from cvs"
17 CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir'
20 if test "$i" = "--autogen-noconfigure"; then
22 echo "+ configure run disabled"
23 elif test "$i" = "--autogen-nocheck"; then
25 echo "+ autotools version check disabled"
26 elif test "$i" = "--autogen-debug"; then
28 echo "+ debug output enabled"
29 elif test "$i" = "--help"; then
30 echo "autogen.sh help options: "
31 echo " --autogen-noconfigure don't run the configure script"
32 echo " --autogen-nocheck don't do version checks"
33 echo " --autogen-debug debug the autogen process"
34 echo "continuing with the autogen in order to get configure help messages..."
39 # print out a debug message if DEBUG is a defined variable
48 # check the version of a package
49 # first argument : package name (executable)
50 # second argument : source download url
51 # rest of arguments : major, minor, micro version
61 debug "major $MAJOR minor $MINOR micro $MICRO"
63 if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
64 if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
66 debug "major $MAJOR minor $MINOR micro $MICRO"
68 test -z "$NOCHECK" && {
69 echo -n "+ checking for $1 >= $VERSION ... "
74 ($PACKAGE --version) < /dev/null > /dev/null 2>&1 ||
77 echo "You must have $PACKAGE installed to compile $package."
78 echo "Download the appropriate package for your distribution,"
79 echo "or get the source tarball at $URL"
82 # the following line is carefully crafted sed magic
83 pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
84 debug "pkg_version $pkg_version"
85 pkg_major=`echo $pkg_version | cut -d. -f1`
86 pkg_minor=`echo $pkg_version | cut -d. -f2`
87 pkg_micro=`echo $pkg_version | cut -d. -f3`
88 test -z "$pkg_minor" && pkg_minor=0
89 test -z "$pkg_micro" && pkg_micro=0
91 debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
93 #start checking the version
96 if [ ! "$pkg_major" -gt "$MAJOR" ]; then
97 debug "$pkg_major -le $MAJOR"
98 if [ "$pkg_major" -lt "$MAJOR" ]; then
100 elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
101 if [ "$pkg_minor" -lt "$MINOR" ]; then
103 elif [ "$pkg_micro" -lt "$MICRO" ]; then
109 if test ! -z "$WRONG"; then
110 echo "found $pkg_version, not ok !"
112 echo "You must have $PACKAGE $VERSION or greater to compile $package."
113 echo "Get the latest version from $URL"
116 echo "found $pkg_version, ok."
120 # autoconf 2.52d has a weird issue involving a yes:no error
121 # so don't allow it's use
122 ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
123 if test "$ac_version" = "2.52d"; then
124 echo "autoconf 2.52d has an issue with our current build."
125 echo "We don't know who's to blame however. So until we do, get a"
126 echo "regular version. RPM's of a working version are on the gstreamer site."
131 if test -z "$*"; then
132 echo "This autogen script will automatically run ./configure as:"
133 echo "./configure $CONFIGURE_OPT"
134 echo "To pass any other options, please specify them on the $0"
139 version_check "autoconf" "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
140 version_check "automake" "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1
141 version_check "libtool" "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
142 version_check "pkg-config" "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
144 if test "$DIE" -eq 1; then
148 test -f $srcfile || {
149 echo "You must run this script in the top-level $package directory"
153 echo "+ running aclocal ..."
154 cat m4/*.m4 >acinclude.m4;aclocal $ACLOCAL_FLAGS || {
156 echo "aclocal failed - check that all needed development files are present on system"
160 # FIXME : why does libtoolize keep complaining about aclocal ?
161 echo "+ not running libtoolize until libtool fix has flown downstream"
162 #echo "+ running libtoolize ..."
163 #libtoolize --copy --force || {
165 # echo "libtoolize failed"
169 echo "+ running autoheader ... "
172 echo "autoheader failed"
175 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
176 echo timestamp > stamp-h.in 2> /dev/null
177 echo "+ running autoconf ... "
180 echo "autoconf failed"
183 echo "+ running automake ... "
186 echo "automake failed"
191 dnl echo "+ running autogen.sh in libs/ext/cothreads..."
192 dnl pushd libs/ext/cothreads > /dev/null
194 dnl ./autogen.sh --autogen-noconfigure --autogen-nocheck
198 test -n "$NOCONFIGURE" && {
199 echo "skipping configure stage for package $package, as requested."
200 echo "autogen.sh done."
204 echo "+ running configure ... "
205 echo "./configure default flags: $CONFIGURE_OPT"
206 echo "using: $CONFIGURE_OPT $@"
209 ./configure $CONFIGURE_OPT "$@" || {
211 echo "configure failed"
216 echo "Now type 'make' to compile $package."