You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

autogen.sh 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. #!/bin/sh
  2. # This script does all the magic calls to automake/autoconf and
  3. # friends that are needed to configure a cvs checkout. You need a
  4. # couple of extra tools to run this script successfully.
  5. #
  6. # If you are compiling from a released tarball you don't need these
  7. # tools and you shouldn't use this script. Just call ./configure
  8. # directly.
  9. PROJECT="LiquidRescale library"
  10. TEST_TYPE=-f
  11. FILE=lqr/lqr_carver.c
  12. AUTOCONF_REQUIRED_VERSION=2.54
  13. AUTOMAKE_REQUIRED_VERSION=1.6
  14. GLIB_REQUIRED_VERSION=2.0.0
  15. LIBTOOL_REQUIRED_VERSION=1.5.24
  16. srcdir=`dirname $0`
  17. test -z "$srcdir" && srcdir=.
  18. ORIGDIR=`pwd`
  19. cd $srcdir
  20. check_version ()
  21. {
  22. if expr $1 \>= $2 > /dev/null; then
  23. echo "yes (version $1)"
  24. else
  25. echo "Too old (found version $1)!"
  26. DIE=1
  27. fi
  28. }
  29. echo
  30. echo "I am testing that you have the required versions of autoconf,"
  31. echo "automake and libtoolize..."
  32. echo
  33. DIE=0
  34. echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
  35. if (autoconf --version) < /dev/null > /dev/null 2>&1; then
  36. VER=`autoconf --version \
  37. | grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
  38. check_version $VER $AUTOCONF_REQUIRED_VERSION
  39. else
  40. echo
  41. echo " You must have autoconf installed to compile $PROJECT."
  42. echo " Download the appropriate package for your distribution,"
  43. echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  44. DIE=1;
  45. fi
  46. echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
  47. if (automake-1.7 --version) < /dev/null > /dev/null 2>&1; then
  48. AUTOMAKE=automake-1.7
  49. ACLOCAL=aclocal-1.7
  50. elif (automake-1.8 --version) < /dev/null > /dev/null 2>&1; then
  51. AUTOMAKE=automake-1.8
  52. ACLOCAL=aclocal-1.8
  53. elif (automake-1.9 --version) < /dev/null > /dev/null 2>&1; then
  54. AUTOMAKE=automake-1.9
  55. ACLOCAL=aclocal-1.9
  56. elif (automake-1.10 --version) < /dev/null > /dev/null 2>&1; then
  57. AUTOMAKE=automake-1.10
  58. ACLOCAL=aclocal-1.10
  59. elif (automake-1.6 --version) < /dev/null > /dev/null 2>&1; then
  60. AUTOMAKE=automake-1.6
  61. ACLOCAL=aclocal-1.6
  62. else
  63. echo
  64. echo " You must have automake 1.6 or newer installed to compile $PROJECT."
  65. echo " Download the appropriate package for your distribution,"
  66. echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
  67. DIE=1
  68. fi
  69. if test x$AUTOMAKE != x; then
  70. VER=`$AUTOMAKE --version \
  71. | grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
  72. check_version $VER $AUTOMAKE_REQUIRED_VERSION
  73. fi
  74. echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
  75. if (libtoolize --version) < /dev/null > /dev/null 2>&1; then
  76. VER=`libtoolize --version \
  77. | grep libtoolize | sed "s/.* \([0-9.]*\)/\1/"`
  78. check_version $VER $LIBTOOL_REQUIRED_VERSION
  79. else
  80. echo
  81. echo " You must have libtool installed to compile $PROJECT."
  82. echo " Get the latest version from"
  83. echo " ???"
  84. DIE=1
  85. fi
  86. if test "$DIE" -eq 1; then
  87. echo
  88. echo "Please install/upgrade the missing tools and call me again."
  89. echo
  90. exit 1
  91. fi
  92. test $TEST_TYPE $FILE || {
  93. echo
  94. echo "You must run this script in the top-level $PROJECT directory."
  95. echo
  96. exit 1
  97. }
  98. echo
  99. echo "I am going to run ./configure with the following arguments:"
  100. echo
  101. echo " --enable-maintainer-mode --enable-install-man $AUTOGEN_CONFIGURE_ARGS $@"
  102. echo
  103. if test -z "$*"; then
  104. echo "If you wish to pass additional arguments, please specify them "
  105. echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
  106. echo "environment variable."
  107. echo
  108. fi
  109. if test -z "$ACLOCAL_FLAGS"; then
  110. acdir=`$ACLOCAL --print-ac-dir`
  111. m4list="glib-gettext.m4 intltool.m4"
  112. for file in $m4list
  113. do
  114. if [ ! -f "$acdir/$file" ]; then
  115. echo
  116. echo "WARNING: aclocal's directory is $acdir, but..."
  117. echo " no file $acdir/$file"
  118. echo " You may see fatal macro warnings below."
  119. echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
  120. echo " environment variable to \"-I /some/dir\", or install"
  121. echo " $acdir/$file."
  122. echo
  123. fi
  124. done
  125. fi
  126. rm -rf autom4te.cache
  127. $ACLOCAL $ACLOCAL_FLAGS
  128. RC=$?
  129. if test $RC -ne 0; then
  130. echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
  131. exit 1
  132. fi
  133. # optionally feature autoheader
  134. (autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader || exit 1
  135. $AUTOMAKE --add-missing --copy || exit 1
  136. autoconf || exit 1
  137. libtoolize --force --copy --install || exit 1
  138. cd $ORIGDIR
  139. $srcdir/configure --enable-maintainer-mode --enable-install-man $AUTOGEN_CONFIGURE_ARGS "$@"
  140. RC=$?
  141. if test $RC -ne 0; then
  142. echo
  143. echo "Configure failed or did not finish!"
  144. exit $RC
  145. fi
  146. echo
  147. echo "Now type 'make' to compile $PROJECT."