autogen.sh 3.74 KB
Newer Older
David Schleef's avatar
David Schleef committed
1
#!/bin/sh
2 3 4
#
# gst-plugins-base autogen.sh
#
5
# Run this to generate all the initial makefiles, etc.
6 7 8
#
# This file has been generated from common/autogen.sh.in via common/update-autogen

9

10 11 12 13 14 15
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.

olddir=`pwd`
cd "$srcdir"

16
DIE=0
17
package=gst-plugins-base
18
srcfile=gst-plugins-base.doap
19

20 21
# Make sure we have common
if test ! -f common/gst-autogen.sh;
22
then
23 24
  echo "+ Setting up common submodule"
  git submodule init
25
fi
26
git submodule update
27

28
# source helper functions
David Schleef's avatar
David Schleef committed
29
if test ! -f common/gst-autogen.sh;
30 31 32
then
  echo There is something wrong with your source tree.
  echo You are missing common/gst-autogen.sh
33 34
  exit 1
fi
35
. common/gst-autogen.sh
36

37
# install pre-commit hook for doing clean commits
38
if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
39
then
40 41
    rm -f .git/hooks/pre-commit
    ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
42 43
fi

44 45
# GNU gettext automake support doesn't get along with git.
# https://bugzilla.gnome.org/show_bug.cgi?id=661128
46 47 48
if test -d po ; then
  touch -t 200001010000 po/gst-plugins-base-1.0.pot
fi
49

50
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
51

52 53 54 55
if test "x$package" = "xgstreamer"; then
  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-docbook --enable-failing-tests --enable-poisoning"
fi

56
autogen_options $@
57

58
printf "+ check for build tools"
59 60 61
if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else  echo; fi
version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 " \
              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 68 || DIE=1
62 63
version_check "automake" "$AUTOMAKE automake automake-1.11" \
              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1
64
version_check "autopoint" "autopoint" \
65
              "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
66
version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
67
              "ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1
68 69
version_check "pkg-config" "" \
              "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
70

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
71 72
die_check $DIE

73
aclocal_check || DIE=1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
74
autoheader_check || DIE=1
75

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
76 77
die_check $DIE

78
# if no arguments specified then this will be printed
79
if test -z "$*" && test -z "$NOCONFIGURE"; then
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
80 81 82 83 84
  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."
85 86
fi

87 88
toplevel_check $srcfile

89 90
# autopoint
#    first remove patch if necessary, then run autopoint, then reapply
91 92 93 94 95 96 97
if test -d po ; then
  if test -f po/Makefile.in.in;
  then
    patch -p0 -R --forward < common/gettext.patch
  fi
  tool_run "$autopoint" "--force" "patch -p0 < common/gettext.patch"
  patch -p0 < common/gettext.patch
98 99
fi

100 101 102
# aclocal
if test -f acinclude.m4; then rm acinclude.m4; fi

103
tool_run "$libtoolize" "--copy --force"
104
tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
105
tool_run "$autoheader"
106

107
# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode
108
echo timestamp > stamp-h.in 2> /dev/null
109

110
tool_run "$autoconf"
111 112
debug "automake: $automake"
tool_run "$automake" "--add-missing --copy"
113

114
test -n "$NOCONFIGURE" && {
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
115 116 117
  echo "+ skipping configure stage for package $package, as requested."
  echo "+ autogen.sh done."
  exit 0
118
}
119

120 121
cd "$olddir"

122
echo "+ running configure ... "
123 124
test ! -z "$CONFIGURE_DEF_OPT" && echo "  default flags:  $CONFIGURE_DEF_OPT"
test ! -z "$CONFIGURE_EXT_OPT" && echo "  external flags: $CONFIGURE_EXT_OPT"
125 126
echo

127 128
echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
129 130
        echo "  configure failed"
        exit 1
131 132 133
}

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