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

DIE=0
5
package=gst-plugins-good
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
6
srcfile=gst/law/alaw.c
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
7

Edward Hervey's avatar
Edward Hervey committed
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
Edward Hervey's avatar
Edward Hervey committed
11 12
  echo "+ Setting up common submodule"
  git submodule init
13
fi
Edward Hervey's avatar
Edward Hervey committed
14
git submodule update
15

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
16
# source helper functions
David Schleef's avatar
David Schleef committed
17
if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
18 19 20
then
  echo There is something wrong with your source tree.
  echo You are missing common/gst-autogen.sh
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
21 22
  exit 1
fi
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
23
. common/gst-autogen.sh
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
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 32
fi


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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
35
autogen_options $@
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
36

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

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

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

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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
58
# if no arguments specified then this will be printed
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
59
if test -z "$*"; then
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
60 61 62 63 64
  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."
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
65 66
fi

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
67 68
toplevel_check $srcfile

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

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

84 85
# 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
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
86

87
tool_run "$autoconf"
88
tool_run "$automake" "-a -c"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
89

90 91 92
# 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
93
    CONFIGURE_FILE_OPT="--enable-$a"
94 95 96 97 98 99
  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
100
    CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
101 102 103
  done
fi

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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
110
echo "+ running configure ... "
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
111 112
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
113
test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
114 115
echo

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

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