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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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.6 --version) < /dev/null > /dev/null 2>&1; then
  57. AUTOMAKE=automake-1.6
  58. ACLOCAL=aclocal-1.6
  59. else
  60. echo
  61. echo " You must have automake 1.6 or newer installed to compile $PROJECT."
  62. echo " Download the appropriate package for your distribution,"
  63. echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
  64. DIE=1
  65. fi
  66. if test x$AUTOMAKE != x; then
  67. VER=`$AUTOMAKE --version \
  68. | grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
  69. check_version $VER $AUTOMAKE_REQUIRED_VERSION
  70. fi
  71. echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
  72. if (libtoolize --version) < /dev/null > /dev/null 2>&1; then
  73. VER=`libtoolize --version \
  74. | grep libtoolize | sed "s/.* \([0-9.]*\)/\1/"`
  75. check_version $VER $LIBTOOL_REQUIRED_VERSION
  76. else
  77. echo
  78. echo " You must have libtool installed to compile $PROJECT."
  79. echo " Get the latest version from"
  80. echo " ???"
  81. DIE=1
  82. fi
  83. if test "$DIE" -eq 1; then
  84. echo
  85. echo "Please install/upgrade the missing tools and call me again."
  86. echo
  87. exit 1
  88. fi
  89. test $TEST_TYPE $FILE || {
  90. echo
  91. echo "You must run this script in the top-level $PROJECT directory."
  92. echo
  93. exit 1
  94. }
  95. echo
  96. echo "I am going to run ./configure with the following arguments:"
  97. echo
  98. echo " --enable-maintainer-mode --prefix=/usr $AUTOGEN_CONFIGURE_ARGS $@"
  99. echo
  100. if test -z "$*"; then
  101. echo "If you wish to pass additional arguments, please specify them "
  102. echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
  103. echo "environment variable."
  104. echo
  105. fi
  106. if test -z "$ACLOCAL_FLAGS"; then
  107. acdir=`$ACLOCAL --print-ac-dir`
  108. m4list="glib-gettext.m4 intltool.m4"
  109. for file in $m4list
  110. do
  111. if [ ! -f "$acdir/$file" ]; then
  112. echo
  113. echo "WARNING: aclocal's directory is $acdir, but..."
  114. echo " no file $acdir/$file"
  115. echo " You may see fatal macro warnings below."
  116. echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
  117. echo " environment variable to \"-I /some/dir\", or install"
  118. echo " $acdir/$file."
  119. echo
  120. fi
  121. done
  122. fi
  123. rm -rf autom4te.cache
  124. $ACLOCAL $ACLOCAL_FLAGS
  125. RC=$?
  126. if test $RC -ne 0; then
  127. echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
  128. exit 1
  129. fi
  130. # optionally feature autoheader
  131. (autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader || exit 1
  132. $AUTOMAKE --add-missing --copy || exit 1
  133. autoconf || exit 1
  134. libtoolize --force --copy || exit 1
  135. cd $ORIGDIR
  136. $srcdir/configure --enable-maintainer-mode --prefix=/usr $AUTOGEN_CONFIGURE_ARGS "$@"
  137. RC=$?
  138. if test $RC -ne 0; then
  139. echo
  140. echo "Configure failed or did not finish!"
  141. exit $RC
  142. fi
  143. echo
  144. echo "Now type 'make' to compile $PROJECT."