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