autogen.sh 5.3 KB

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