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