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