autogen.sh 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/bin/sh
  2. # Run this to generate all the initial makefiles, etc.
  3. srcdir=`dirname $0`
  4. test -z "$srcdir" && srcdir=.
  5. DIE=0
  6. if [ -n "$GNOME2_DIR" ]; then
  7. ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
  8. LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
  9. PATH="$GNOME2_DIR/bin:$PATH"
  10. export PATH
  11. export LD_LIBRARY_PATH
  12. fi
  13. (test -f $srcdir/configure.in) || {
  14. echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
  15. echo " top-level package directory"
  16. exit 1
  17. }
  18. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  19. echo
  20. echo "**Error**: You must have \`autoconf' installed."
  21. echo "Download the appropriate package for your distribution,"
  22. echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  23. DIE=1
  24. }
  25. (grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && {
  26. (intltoolize --version) < /dev/null > /dev/null 2>&1 || {
  27. echo
  28. echo "**Error**: You must have \`intltool' installed."
  29. echo "You can get it from:"
  30. echo " ftp://ftp.gnome.org/pub/GNOME/"
  31. DIE=1
  32. }
  33. }
  34. (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && {
  35. (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
  36. echo
  37. echo "**Error**: You must have \`xml-i18n-toolize' installed."
  38. echo "You can get it from:"
  39. echo " ftp://ftp.gnome.org/pub/GNOME/"
  40. DIE=1
  41. }
  42. }
  43. (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
  44. (libtool --version) < /dev/null > /dev/null 2>&1 || {
  45. echo
  46. echo "**Error**: You must have \`libtool' installed."
  47. echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
  48. DIE=1
  49. }
  50. }
  51. (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && {
  52. (grep "sed.*POTFILES" $srcdir/configure.in) > /dev/null || \
  53. (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
  54. echo
  55. echo "**Error**: You must have \`glib' installed."
  56. echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
  57. DIE=1
  58. }
  59. }
  60. (automake --version) < /dev/null > /dev/null 2>&1 || {
  61. echo
  62. echo "**Error**: You must have \`automake' installed."
  63. echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
  64. DIE=1
  65. NO_AUTOMAKE=yes
  66. }
  67. # if no automake, don't bother testing for aclocal
  68. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  69. echo
  70. echo "**Error**: Missing \`aclocal'. The version of \`automake'"
  71. echo "installed doesn't appear recent enough."
  72. echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
  73. DIE=1
  74. }
  75. if test "$DIE" -eq 1; then
  76. exit 1
  77. fi
  78. if test -z "$*"; then
  79. echo "**Warning**: I am going to run \`configure' with no arguments."
  80. echo "If you wish to pass any to it, please specify them on the"
  81. echo \`$0\'" command line."
  82. echo
  83. fi
  84. case $CC in
  85. xlc )
  86. am_opt=--include-deps;;
  87. esac
  88. for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.in -print`
  89. do
  90. dr=`dirname $coin`
  91. if test -f $dr/NO-AUTO-GEN; then
  92. echo skipping $dr -- flagged as no auto-gen
  93. else
  94. echo processing $dr
  95. ( cd $dr
  96. aclocalinclude="$ACLOCAL_FLAGS"
  97. if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
  98. echo "Creating $dr/aclocal.m4 ..."
  99. test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
  100. echo "Running glib-gettextize... Ignore non-fatal messages."
  101. echo "no" | glib-gettextize --force --copy
  102. echo "Making $dr/aclocal.m4 writable ..."
  103. test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
  104. fi
  105. if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then
  106. echo "Running intltoolize..."
  107. intltoolize --copy --force --automake
  108. fi
  109. if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then
  110. echo "Running xml-i18n-toolize..."
  111. xml-i18n-toolize --copy --force --automake
  112. fi
  113. if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
  114. if test -z "$NO_LIBTOOLIZE" ; then
  115. echo "Running libtoolize..."
  116. libtoolize --force --copy
  117. fi
  118. fi
  119. echo "Running aclocal $aclocalinclude ..."
  120. aclocal $aclocalinclude
  121. if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
  122. echo "Running autoheader..."
  123. autoheader
  124. fi
  125. echo "Running automake --gnu $am_opt ..."
  126. automake --add-missing --gnu $am_opt
  127. echo "Running autoconf ..."
  128. autoconf
  129. )
  130. fi
  131. done
  132. conf_flags="--enable-maintainer-mode"
  133. if test x$NOCONFIGURE = x; then
  134. echo Running $srcdir/configure $conf_flags "$@" ...
  135. $srcdir/configure $conf_flags "$@" \
  136. && echo Now type \`make\' to compile. || exit 1
  137. else
  138. echo Skipping configure process.
  139. fi