.gitignore: add binary files and libtool stuff
[gst-aubio.git] / autogen.sh
1 #!/bin/sh
2 # you can either set the environment variables AUTOCONF and AUTOMAKE
3 # to the right versions, or leave them unset and get the RedHat 7.3 defaults
4
5 DIE=0
6 package=gst-plugin
7 srcfile=src/main.c
8
9 # autogen.sh helper functions (copied from GStreamer's common/ CVS module)
10 if test ! -f ./gst-autogen.sh;
11 then
12   echo There is something wrong with your source tree.
13   echo You are either missing ./gst-autogen.sh or not
14   echo running autogen.sh from the top-level source
15   echo directory.
16   exit 1
17 fi
18 . ./gst-autogen.sh
19
20 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-debug'
21
22 autogen_options $@
23
24 echo -n "+ check for build tools"
25 if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
26 version_check "autoconf" "$AUTOCONF autoconf autoconf259 autoconf257 autoconf-2.54 autoconf-2.53 autoconf-2.52" \
27               "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
28 version_check "automake" "$AUTOMAKE automake automake-1.9 automake19 automake-1.7 automake-1.6 automake-1.5" \
29               "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1
30 ###version_check "autopoint" "autopoint" \
31 ###              "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 11 5 || DIE=1
32 version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
33               "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
34 version_check "pkg-config" "" \
35               "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
36
37 die_check $DIE
38
39 autoconf_2_52d_check || DIE=1
40 aclocal_check || DIE=1
41 autoheader_check || DIE=1
42
43 die_check $DIE
44
45 # if no arguments specified then this will be printed
46 if test -z "$*"; then
47   echo "+ checking for autogen.sh options"
48   echo "  This autogen script will automatically run ./configure as:"
49   echo "  ./configure $CONFIGURE_DEF_OPT"
50   echo "  To pass any additional options, please specify them on the $0"
51   echo "  command line."
52 fi
53
54 tool_run "$aclocal" "-I m4/ $ACLOCAL_FLAGS"
55 tool_run "$libtoolize" "--copy --force"
56 tool_run "$autoheader"
57 tool_run "$autoconf"
58 tool_run "$automake" "-a -c"
59
60 # if enable exists, add an -enable option for each of the lines in that file
61 if test -f enable; then
62   for a in `cat enable`; do
63     CONFIGURE_FILE_OPT="--enable-$a"
64   done
65 fi
66
67 # if disable exists, add an -disable option for each of the lines in that file
68 if test -f disable; then
69   for a in `cat disable`; do
70     CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
71   done
72 fi
73
74 test -n "$NOCONFIGURE" && {
75   echo "+ skipping configure stage for package $package, as requested."
76   echo "+ autogen.sh done."
77   exit 0
78 }
79
80 echo "+ running configure ... "
81 test ! -z "$CONFIGURE_DEF_OPT" && echo "  ./configure default flags: $CONFIGURE_DEF_OPT"
82 test ! -z "$CONFIGURE_EXT_OPT" && echo "  ./configure external flags: $CONFIGURE_EXT_OPT"
83 test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
84 echo
85
86 ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
87         echo "  configure failed"
88         exit 1
89 }
90
91 echo "Now type 'make' to compile $package."