autogen.sh 3.62 KB
Newer Older
David Schleef's avatar
David Schleef committed
1
#!/bin/sh
2 3 4
# Run this to generate all the initial makefiles, etc.

DIE=0
Christian Schaller's avatar
Christian Schaller committed
5
package=gst-plugins-bad
6
srcfile=gst/speed/gstspeed.c
7

8 9
# Make sure we have common
if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
10
then
11 12
  echo "+ Setting up common submodule"
  git submodule init
13
fi
14
git submodule update
15

16
# source helper functions
David Schleef's avatar
David Schleef committed
17
if test ! -f common/gst-autogen.sh;
18 19 20
then
  echo There is something wrong with your source tree.
  echo You are missing common/gst-autogen.sh
21 22
  exit 1
fi
23
. common/gst-autogen.sh
24

25
# install pre-commit hook for doing clean commits
26
if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
27
then
28 29
    rm -f .git/hooks/pre-commit
    ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
30 31
fi

32
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
33

34
autogen_options $@
35

36
echo -n "+ check for build tools"
37
if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
38
version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \
39
              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
40
version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.7 automake-1.6 automake-1.5" \
41
              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1
42
version_check "autopoint" "autopoint" \
43
              "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
44
version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
45
              "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
46 47
version_check "pkg-config" "" \
              "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
48

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
49 50
die_check $DIE

51
autoconf_2_52d_check || DIE=1
52
aclocal_check || DIE=1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
53
autoheader_check || DIE=1
54

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
55 56
die_check $DIE

57
# if no arguments specified then this will be printed
58
if test -z "$*"; then
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
59 60 61 62 63
  echo "+ checking for autogen.sh options"
  echo "  This autogen script will automatically run ./configure as:"
  echo "  ./configure $CONFIGURE_DEF_OPT"
  echo "  To pass any additional options, please specify them on the $0"
  echo "  command line."
64 65
fi

66 67
toplevel_check $srcfile

68 69
# autopoint
#    older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
70
if test -x mkinstalldirs; then rm mkinstalldirs; fi
71
#    first remove patch if necessary, then run autopoint, then reapply
72 73 74 75 76 77
if test -f po/Makefile.in.in;
then
  patch -p0 -R < common/gettext.patch
fi
tool_run "$autopoint --force"
patch -p0 < common/gettext.patch
78

79
tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
80
tool_run "$libtoolize" "--copy --force"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
81
tool_run "$autoheader"
82

83 84
# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
echo timestamp > stamp-h.in 2> /dev/null
85

86
tool_run "$autoconf"
87
tool_run "$automake" "-a -c -Wno-portability"
88

89 90 91
# if enable exists, add an -enable option for each of the lines in that file
if test -f enable; then
  for a in `cat enable`; do
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
92
    CONFIGURE_FILE_OPT="--enable-$a"
93 94 95 96 97 98
  done
fi

# if disable exists, add an -disable option for each of the lines in that file
if test -f disable; then
  for a in `cat disable`; do
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
99
    CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
100 101 102
  done
fi

103
test -n "$NOCONFIGURE" && {
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
104 105 106
  echo "+ skipping configure stage for package $package, as requested."
  echo "+ autogen.sh done."
  exit 0
107
}
108

109
echo "+ running configure ... "
110 111
test ! -z "$CONFIGURE_DEF_OPT" && echo "  ./configure default flags: $CONFIGURE_DEF_OPT"
test ! -z "$CONFIGURE_EXT_OPT" && echo "  ./configure external flags: $CONFIGURE_EXT_OPT"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
112
test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
113 114
echo

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
115
./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
116 117
        echo "  configure failed"
        exit 1
118 119 120
}

echo "Now type 'make' to compile $package."