Blame autogen.sh

Packit a6ee4b
#!/bin/sh
Packit a6ee4b
#
Packit a6ee4b
# gstreamer autogen.sh
Packit a6ee4b
#
Packit a6ee4b
# Run this to generate all the initial makefiles, etc.
Packit a6ee4b
#
Packit a6ee4b
# This file has been generated from common/autogen.sh.in via common/update-autogen
Packit a6ee4b
Packit a6ee4b
Packit a6ee4b
test -n "$srcdir" || srcdir=`dirname "$0"`
Packit a6ee4b
test -n "$srcdir" || srcdir=.
Packit a6ee4b
Packit a6ee4b
olddir=`pwd`
Packit a6ee4b
cd "$srcdir"
Packit a6ee4b
Packit a6ee4b
package=gstreamer
Packit a6ee4b
srcfile=gstreamer.doap
Packit a6ee4b
Packit a6ee4b
# Make sure we have common
Packit a6ee4b
if test ! -f common/gst-autogen.sh;
Packit a6ee4b
then
Packit a6ee4b
  echo "+ Setting up common submodule"
Packit a6ee4b
  git submodule init
Packit a6ee4b
fi
Packit a6ee4b
git submodule update
Packit a6ee4b
Packit a6ee4b
# source helper functions
Packit a6ee4b
if test ! -f common/gst-autogen.sh;
Packit a6ee4b
then
Packit a6ee4b
  echo There is something wrong with your source tree.
Packit a6ee4b
  echo You are missing common/gst-autogen.sh
Packit a6ee4b
  exit 1
Packit a6ee4b
fi
Packit a6ee4b
. common/gst-autogen.sh
Packit a6ee4b
Packit a6ee4b
# install pre-commit hook for doing clean commits
Packit a6ee4b
if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
Packit a6ee4b
then
Packit a6ee4b
    rm -f .git/hooks/pre-commit
Packit a6ee4b
    if ! ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit 2> /dev/null
Packit a6ee4b
    then
Packit a6ee4b
        echo "Failed to create commit hook symlink, copying instead ..."
Packit a6ee4b
        cp common/hooks/pre-commit.hook .git/hooks/pre-commit
Packit a6ee4b
    fi
Packit a6ee4b
fi
Packit a6ee4b
Packit a6ee4b
# GNU gettext automake support doesn't get along with git.
Packit a6ee4b
# https://bugzilla.gnome.org/show_bug.cgi?id=661128
Packit a6ee4b
if test -d po ; then
Packit a6ee4b
  touch -t 200001010000 po/gstreamer-1.0.pot
Packit a6ee4b
fi
Packit a6ee4b
Packit a6ee4b
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
Packit a6ee4b
Packit a6ee4b
if test "x$package" = "xgstreamer"; then
Packit a6ee4b
  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-failing-tests --enable-poisoning"
Packit a6ee4b
elif test "x$package" = "xgst-plugins-bad"; then
Packit a6ee4b
  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-player-tests"
Packit a6ee4b
fi
Packit a6ee4b
Packit a6ee4b
autogen_options $@
Packit a6ee4b
Packit a6ee4b
printf "+ check for build tools"
Packit a6ee4b
if test -z "$NOCHECK"; then
Packit a6ee4b
  echo
Packit a6ee4b
Packit a6ee4b
  printf "  checking for autoreconf ... "
Packit a6ee4b
  echo
Packit a6ee4b
  which "autoreconf" 2>/dev/null || {
Packit a6ee4b
    echo "not found! Please install the autoconf package."
Packit a6ee4b
    exit 1
Packit a6ee4b
  }
Packit a6ee4b
Packit a6ee4b
  printf "  checking for pkg-config ... "
Packit a6ee4b
  echo
Packit a6ee4b
  which "pkg-config" 2>/dev/null || {
Packit a6ee4b
    echo "not found! Please install pkg-config."
Packit a6ee4b
    exit 1
Packit a6ee4b
  }
Packit a6ee4b
else
Packit a6ee4b
  echo ": skipped version checks"
Packit a6ee4b
fi
Packit a6ee4b
Packit a6ee4b
# if no arguments specified then this will be printed
Packit a6ee4b
if test -z "$*" && test -z "$NOCONFIGURE"; then
Packit a6ee4b
  echo "+ checking for autogen.sh options"
Packit a6ee4b
  echo "  This autogen script will automatically run ./configure as:"
Packit a6ee4b
  echo "  ./configure $CONFIGURE_DEF_OPT"
Packit a6ee4b
  echo "  To pass any additional options, please specify them on the $0"
Packit a6ee4b
  echo "  command line."
Packit a6ee4b
fi
Packit a6ee4b
Packit a6ee4b
toplevel_check $srcfile
Packit a6ee4b
Packit a6ee4b
# autopoint
Packit a6ee4b
if test -d po && grep ^AM_GNU_GETTEXT_VERSION configure.ac >/dev/null ; then
Packit a6ee4b
  tool_run "autopoint" "--force"
Packit a6ee4b
fi
Packit a6ee4b
Packit a6ee4b
# aclocal
Packit a6ee4b
if test -f acinclude.m4; then rm acinclude.m4; fi
Packit a6ee4b
Packit a6ee4b
autoreconf --force --install || exit 1
Packit a6ee4b
Packit a6ee4b
test -n "$NOCONFIGURE" && {
Packit a6ee4b
  echo "+ skipping configure stage for package $package, as requested."
Packit a6ee4b
  echo "+ autogen.sh done."
Packit a6ee4b
  exit 0
Packit a6ee4b
}
Packit a6ee4b
Packit a6ee4b
cd "$olddir"
Packit a6ee4b
Packit a6ee4b
echo "+ running configure ... "
Packit a6ee4b
test ! -z "$CONFIGURE_DEF_OPT" && echo "  default flags:  $CONFIGURE_DEF_OPT"
Packit a6ee4b
test ! -z "$CONFIGURE_EXT_OPT" && echo "  external flags: $CONFIGURE_EXT_OPT"
Packit a6ee4b
echo
Packit a6ee4b
Packit a6ee4b
echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
Packit a6ee4b
"$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
Packit a6ee4b
        echo "  configure failed"
Packit a6ee4b
        exit 1
Packit a6ee4b
}
Packit a6ee4b
Packit a6ee4b
echo "Now type 'make' to compile $package."