2 # Run this to generate all the initial makefiles, etc.
6 srcfile=gst/gstobject.h
9 if test ! -d common; then
10 echo "+ getting common from cvs"; cvs co common
12 if test ! -d libs/ext/cothreads; then
13 echo "+ getting cothreads from cvs"; cvs co -d libs/ext cothreads
16 CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir'
19 if test "$i" = "--autogen-noconfigure"; then
21 echo "+ configure run disabled"
22 elif test "$i" = "--autogen-nocheck"; then
24 echo "+ autotools version check disabled"
25 elif test "$i" = "--autogen-debug"; then
27 echo "+ debug output enabled"
28 elif test "$i" = "--help"; then
29 echo "autogen.sh help options: "
30 echo " --autogen-noconfigure don't run the configure script"
31 echo " --autogen-nocheck don't do version checks"
32 echo " --autogen-debug debug the autogen process"
33 echo "continuing with the autogen in order to get configure help messages..."
38 # print out a debug message if DEBUG is a defined variable
47 # check the version of a package
48 # first argument : package name (executable)
49 # second argument : source download url
50 # rest of arguments : major, minor, micro version
60 debug "major $MAJOR minor $MINOR micro $MICRO"
62 if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
63 if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
65 debug "major $MAJOR minor $MINOR micro $MICRO"
67 test -z "$NOCHECK" && {
68 echo -n "+ checking for $1 >= $VERSION ... "
73 ($PACKAGE --version) < /dev/null > /dev/null 2>&1 ||
76 echo "You must have $PACKAGE installed to compile $package."
77 echo "Download the appropriate package for your distribution,"
78 echo "or get the source tarball at $URL"
81 # the following line is carefully crafted sed magic
82 pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
83 debug "pkg_version $pkg_version"
84 pkg_major=`echo $pkg_version | cut -d. -f1`
85 pkg_minor=`echo $pkg_version | cut -d. -f2`
86 pkg_micro=`echo $pkg_version | cut -d. -f3`
87 test -z "$pkg_minor" && pkg_minor=0
88 test -z "$pkg_micro" && pkg_micro=0
90 debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
92 #start checking the version
95 if [ ! "$pkg_major" -gt "$MAJOR" ]; then
96 debug "$pkg_major -le $MAJOR"
97 if [ "$pkg_major" -lt "$MAJOR" ]; then
99 elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
100 if [ "$pkg_minor" -lt "$MINOR" ]; then
102 elif [ "$pkg_micro" -lt "$MICRO" ]; then
108 if test ! -z "$WRONG"; then
109 echo "found $pkg_version, not ok !"
111 echo "You must have $PACKAGE $VERSION or greater to compile $package."
112 echo "Get the latest version from $URL"
115 echo "found $pkg_version, ok."
119 # autoconf 2.52d has a weird issue involving a yes:no error
120 # so don't allow it's use
121 ac_version=`autoconf --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
122 if test "$ac_version" = "2.52d"; then
123 echo "autoconf 2.52d has an issue with our current build."
124 echo "We don't know who's to blame however. So until we do, get a"
125 echo "regular version. RPM's of a working version are on the gstreamer site."
130 if test -z "$*"; then
131 echo "This autogen script will automatically run ./configure as:"
132 echo "./configure $CONFIGURE_OPT"
133 echo "To pass any other options, please specify them on the $0"
138 version_check "autoconf" "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
139 version_check "automake" "ftp://ftp.gnu.org/pub/gnu/automake/" 1 5 || DIE=1
140 version_check "libtool" "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
141 version_check "pkg-config" "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
143 if test "$DIE" -eq 1; then
147 test -f $srcfile || {
148 echo "You must run this script in the top-level $package directory"
152 echo "+ running aclocal ..."
153 cat m4/*.m4 >acinclude.m4;aclocal $ACLOCAL_FLAGS || {
155 echo "aclocal failed - check that all needed development files are present on system"
159 # FIXME : why does libtoolize keep complaining about aclocal ?
160 echo "+ not running libtoolize until libtool fix has flown downstream"
161 #echo "+ running libtoolize ..."
162 #libtoolize --copy --force || {
164 # echo "libtoolize failed"
168 echo "+ running autoheader ... "
171 echo "autoheader failed"
174 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
175 echo timestamp > stamp-h.in 2> /dev/null
176 echo "+ running autoconf ... "
179 echo "autoconf failed"
182 echo "+ running automake ... "
185 echo "automake failed"
190 echo "+ running autogen.sh in libs/ext/cothreads..."
191 pushd libs/ext/cothreads > /dev/null
193 ./autogen.sh --autogen-noconfigure --autogen-nocheck || {
194 echo "autogen in cothreads failed."
200 test -n "$NOCONFIGURE" && {
201 echo "skipping configure stage for package $package, as requested."
202 echo "autogen.sh done."
206 echo "+ running configure ... "
207 echo "./configure default flags: $CONFIGURE_OPT"
208 echo "using: $CONFIGURE_OPT $@"
211 ./configure $CONFIGURE_OPT "$@" || {
213 echo "configure failed"
218 echo "Now type 'make' to compile $package."