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