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