melunko@38: #!/bin/sh melunko@38: # Run this to generate all the initial makefiles, etc. melunko@38: melunko@38: DIE=0 melunko@38: package=libgnomevfs2-mythtv melunko@38: srcfile=configure.ac melunko@38: melunko@38: # a quick cvs co if necessary to alleviate the pain - may remove this melunko@38: # when developers get a clue ;) melunko@38: if test ! -d common; melunko@38: then melunko@38: echo "+ getting common/ from cvs" melunko@38: cvs co common melunko@38: fi melunko@38: melunko@38: # source helper functions melunko@38: if test ! -f common/autogen-helper.sh; melunko@38: then melunko@38: echo There is something wrong with your source tree. melunko@38: echo You are missing common/autogen-helper.sh melunko@38: exit 1 melunko@38: fi melunko@38: . common/autogen-helper.sh melunko@38: melunko@38: CONFIGURE_DEF_OPT='--enable-maintainer-mode' melunko@38: melunko@38: autogen_options $* melunko@38: melunko@38: echo -n "+ check for build tools" melunko@38: if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi melunko@38: version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53" \ melunko@38: "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 53 || DIE=1 melunko@38: version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.8 automake-1.7 automake-1.6" \ melunko@38: "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1 melunko@38: version_check "libtoolize" "$LIBTOOLIZE libtoolize" \ melunko@38: "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 melunko@38: version_check "pkg-config" "" \ melunko@38: "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 melunko@38: melunko@38: die_check $DIE melunko@38: melunko@38: aclocal_check || DIE=1 melunko@38: autoheader_check || DIE=1 melunko@38: melunko@38: die_check $DIE melunko@38: melunko@38: # if no arguments specified then this will be printed melunko@38: if test -z "$*"; then melunko@38: echo "+ checking for autogen.sh options" melunko@38: echo " This autogen script will automatically run ./configure as:" melunko@38: echo " ./configure $CONFIGURE_DEF_OPT" melunko@38: echo " To pass any additional options, please specify them on the $0" melunko@38: echo " command line." melunko@38: fi melunko@38: melunko@38: toplevel_check $srcfile melunko@38: melunko@38: tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS" melunko@38: tool_run "$libtoolize" "--copy --force" melunko@38: tool_run "$autoheader" melunko@38: melunko@38: # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo melunko@38: echo timestamp > stamp-h.in 2> /dev/null melunko@38: melunko@38: tool_run "$autoconf" melunko@38: tool_run "$automake" "-a -c" melunko@38: melunko@38: # if enable exists, add an -enable option for each of the lines in that file melunko@38: if test -f enable; then melunko@38: for a in `cat enable`; do melunko@38: CONFIGURE_FILE_OPT="--enable-$a" melunko@38: done melunko@38: fi melunko@38: melunko@38: # if disable exists, add an -disable option for each of the lines in that file melunko@38: if test -f disable; then melunko@38: for a in `cat disable`; do melunko@38: CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a" melunko@38: done melunko@38: fi melunko@38: melunko@38: test -n "$NOCONFIGURE" && { melunko@38: echo "+ skipping configure stage for package $package, as requested." melunko@38: echo "+ autogen.sh done." melunko@38: exit 0 melunko@38: } melunko@38: melunko@38: echo "+ running configure ... " melunko@38: test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" melunko@38: test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" melunko@38: test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT" melunko@38: echo melunko@38: melunko@38: ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || { melunko@38: echo " configure failed" melunko@38: exit 1 melunko@38: } melunko@38: melunko@38: echo "Now type 'make' to compile $package."