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