gmyth-stream/libgnomevfs2/autogen.sh
author morphbr
Thu May 31 19:55:43 2007 +0100 (2007-05-31)
branchtrunk
changeset 729 8ef808220720
permissions -rw-r--r--
[svn r735] * GMyth-Streamer
- bug fix in log
morphbr@534
     1
#!/bin/sh
morphbr@534
     2
# Run this to generate all the initial makefiles, etc.
morphbr@534
     3
morphbr@534
     4
DIE=0
morphbr@534
     5
package=libgnomevfs2-mythtv
morphbr@534
     6
srcfile=configure.ac
morphbr@534
     7
morphbr@534
     8
# a quick cvs co if necessary to alleviate the pain - may remove this
morphbr@534
     9
# when developers get a clue ;)
morphbr@534
    10
if test ! -d common; 
morphbr@534
    11
then 
morphbr@534
    12
  echo "+ getting common/ from cvs"
morphbr@534
    13
  cvs co common 
morphbr@534
    14
fi
morphbr@534
    15
morphbr@534
    16
# source helper functions
morphbr@534
    17
if test ! -f common/autogen-helper.sh;
morphbr@534
    18
then
morphbr@534
    19
  echo There is something wrong with your source tree.
morphbr@534
    20
  echo You are missing common/autogen-helper.sh
morphbr@534
    21
  exit 1
morphbr@534
    22
fi
morphbr@534
    23
. common/autogen-helper.sh
morphbr@534
    24
morphbr@534
    25
CONFIGURE_DEF_OPT='--enable-maintainer-mode'
morphbr@534
    26
morphbr@534
    27
autogen_options $*
morphbr@534
    28
morphbr@534
    29
echo -n "+ check for build tools"
morphbr@534
    30
if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
morphbr@534
    31
version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53" \
morphbr@534
    32
              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 53 || DIE=1
morphbr@534
    33
version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.8 automake-1.7 automake-1.6" \
morphbr@534
    34
              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
morphbr@534
    35
version_check "libtoolize" "$LIBTOOLIZE libtoolize" \
morphbr@534
    36
              "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
morphbr@534
    37
version_check "pkg-config" "" \
morphbr@534
    38
              "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
morphbr@534
    39
morphbr@534
    40
die_check $DIE
morphbr@534
    41
morphbr@534
    42
aclocal_check || DIE=1
morphbr@534
    43
autoheader_check || DIE=1
morphbr@534
    44
morphbr@534
    45
die_check $DIE
morphbr@534
    46
morphbr@534
    47
# if no arguments specified then this will be printed
morphbr@534
    48
if test -z "$*"; then
morphbr@534
    49
  echo "+ checking for autogen.sh options"
morphbr@534
    50
  echo "  This autogen script will automatically run ./configure as:"
morphbr@534
    51
  echo "  ./configure $CONFIGURE_DEF_OPT"
morphbr@534
    52
  echo "  To pass any additional options, please specify them on the $0"
morphbr@534
    53
  echo "  command line."
morphbr@534
    54
fi
morphbr@534
    55
morphbr@534
    56
toplevel_check $srcfile
morphbr@534
    57
morphbr@534
    58
tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS"
morphbr@534
    59
tool_run "$libtoolize" "--copy --force"
morphbr@534
    60
tool_run "$autoheader"
morphbr@534
    61
morphbr@534
    62
# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
morphbr@534
    63
echo timestamp > stamp-h.in 2> /dev/null
morphbr@534
    64
morphbr@534
    65
tool_run "$autoconf"
morphbr@534
    66
tool_run "$automake" "-a -c"
morphbr@534
    67
morphbr@534
    68
# if enable exists, add an -enable option for each of the lines in that file
morphbr@534
    69
if test -f enable; then
morphbr@534
    70
  for a in `cat enable`; do
morphbr@534
    71
    CONFIGURE_FILE_OPT="--enable-$a"
morphbr@534
    72
  done
morphbr@534
    73
fi
morphbr@534
    74
morphbr@534
    75
# if disable exists, add an -disable option for each of the lines in that file
morphbr@534
    76
if test -f disable; then
morphbr@534
    77
  for a in `cat disable`; do
morphbr@534
    78
    CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
morphbr@534
    79
  done
morphbr@534
    80
fi
morphbr@534
    81
morphbr@534
    82
test -n "$NOCONFIGURE" && {
morphbr@534
    83
  echo "+ skipping configure stage for package $package, as requested."
morphbr@534
    84
  echo "+ autogen.sh done."
morphbr@534
    85
  exit 0
morphbr@534
    86
}
morphbr@534
    87
morphbr@534
    88
echo "+ running configure ... "
morphbr@534
    89
test ! -z "$CONFIGURE_DEF_OPT" && echo "  ./configure default flags: $CONFIGURE_DEF_OPT"
morphbr@534
    90
test ! -z "$CONFIGURE_EXT_OPT" && echo "  ./configure external flags: $CONFIGURE_EXT_OPT"
morphbr@534
    91
test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
morphbr@534
    92
echo
morphbr@534
    93
morphbr@534
    94
./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
morphbr@534
    95
        echo "  configure failed"
morphbr@534
    96
        exit 1
morphbr@534
    97
}
morphbr@534
    98
morphbr@534
    99
echo "Now type 'make' to compile $package."