autogen.sh 3.39 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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
8 9 10
# a quick cvs co to ease the transition
if test ! -d common;
then
11
  echo "+ getting common/ from cvs"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
12 13 14 15 16
  if test -e CVS/Tag
  then
    TAG="-r `tail -c +2 CVS/Tag`"
  fi
  cvs co $TAG common
17 18
fi

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
19
# source helper functions
David Schleef's avatar
David Schleef committed
20
if test ! -f common/gst-autogen.sh;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
21 22 23
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
24 25
  exit 1
fi
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
26
. common/gst-autogen.sh
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
27

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
28
CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
29

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
30
autogen_options $@
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
31

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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
45 46
die_check $DIE

47
autoconf_2_52d_check || DIE=1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
48
aclocal_check || DIE=1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
49
autoheader_check || DIE=1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
50

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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
53
# if no arguments specified then this will be printed
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
54
if test -z "$*"; then
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
55 56 57 58 59
  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
60 61
fi

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
62 63
toplevel_check $srcfile

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

Benjamin Otte's avatar
Benjamin Otte committed
75
tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
76
tool_run "$libtoolize" "--copy --force"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
77
tool_run "$autoheader"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
78

79 80
# 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
81

82 83
tool_run "$autoconf"
tool_run "$automake" "-a -c"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
84

85 86 87
# 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
88
    CONFIGURE_FILE_OPT="--enable-$a"
89 90 91 92 93 94
  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
95
    CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
96 97 98
  done
fi

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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
105
echo "+ running configure ... "
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
106 107
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
108
test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
109 110
echo

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
111
./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
112 113
        echo "  configure failed"
        exit 1
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
114 115 116
}

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