autogen.sh 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #!/bin/sh
  2. # Run this to generate all the initial makefiles,
  3. # etc. just after a checkout.
  4. DIE=0
  5. if ${MAKE:-gmake} -q -C . autogen.sh 2> /dev/null
  6. then
  7. alias make=${MAKE:-gmake}
  8. fi
  9. srcdir="`/bin/pwd`"
  10. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  11. echo
  12. echo "**Error**: You must have \`autoconf' installed to compile tinc."
  13. echo "Download the appropriate package for your distribution,"
  14. echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  15. DIE=1
  16. }
  17. (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
  18. (libtool --version) < /dev/null > /dev/null 2>&1 || {
  19. echo
  20. echo "**Error**: You must have \`libtool' installed to compile tinc."
  21. echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
  22. echo "(or a newer version if it is available)"
  23. DIE=1
  24. }
  25. }
  26. grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
  27. grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
  28. (gettext --version) < /dev/null > /dev/null 2>&1 || {
  29. echo
  30. echo "**Error**: You must have \`gettext' installed to compile tinc."
  31. echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
  32. echo "(or a newer version if it is available)"
  33. DIE=1
  34. }
  35. }
  36. grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
  37. grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
  38. (gettext --version) < /dev/null > /dev/null 2>&1 || {
  39. echo
  40. echo "**Error**: You must have \`gettext' installed to compile tinc."
  41. echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
  42. echo "(or a newer version if it is available)"
  43. DIE=1
  44. }
  45. }
  46. (automake --version) < /dev/null > /dev/null 2>&1 || {
  47. echo
  48. echo "**Error**: You must have \`automake' installed to compile tinc."
  49. echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  50. echo "(or a newer version if it is available)"
  51. DIE=1
  52. NO_AUTOMAKE=yes
  53. }
  54. # if no automake, don't bother testing for aclocal
  55. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  56. echo
  57. echo "**Error**: Missing \`aclocal'. The version of \`automake'"
  58. echo "installed doesn't appear recent enough."
  59. echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  60. echo "(or a newer version if it is available)"
  61. DIE=1
  62. }
  63. if test "$DIE" -eq 1; then
  64. exit 1
  65. fi
  66. if test -z "$*"; then
  67. echo "**Warning**: I am going to run \`configure' with no arguments."
  68. echo "If you wish to pass any to it, please specify them on the"
  69. echo \`$0\'" command line."
  70. echo
  71. fi
  72. case $CC in
  73. xlc )
  74. am_opt=--include-deps;;
  75. esac
  76. for coin in `find $srcdir -name configure.in -print`
  77. do
  78. dr=`dirname $coin`
  79. if test -f $dr/NO-AUTO-GEN; then
  80. echo skipping $dr -- flagged as no auto-gen
  81. else
  82. echo processing $dr
  83. macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
  84. ( cd $dr
  85. if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
  86. if grep "sed.*POTFILES" configure.in >/dev/null; then
  87. : do nothing -- we still have an old unmodified configure.in
  88. else
  89. echo "Creating $dr/aclocal.m4 ..."
  90. test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
  91. echo "Running autopoint..."
  92. autopoint --force
  93. echo "Making $dr/aclocal.m4 writable ..."
  94. test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
  95. fi
  96. fi
  97. if grep "^AM_GNOME_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 autopoint..."
  101. autopoint --force
  102. echo "Making $dr/aclocal.m4 writable ..."
  103. test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
  104. fi
  105. if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
  106. echo "Running libtoolize..."
  107. libtoolize --force --copy
  108. fi
  109. aclocalinclude="$ACLOCAL_FLAGS"
  110. for k in $macrodirs; do
  111. if test -d $k; then
  112. if test -f $k/Makefile.am.in; then
  113. make -C $k -f Makefile.am.in Makefile.am
  114. fi
  115. aclocalinclude="$aclocalinclude -I $k"
  116. ##else
  117. ## echo "**Warning**: No such directory \`$k'. Ignored."
  118. fi
  119. done
  120. touch ChangeLog
  121. echo "Running aclocal $aclocalinclude ..."
  122. aclocal $aclocalinclude
  123. if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
  124. echo "Running autoheader..."
  125. autoheader
  126. fi
  127. echo "Running automake --gnu $am_opt ..."
  128. automake --add-missing --gnu $am_opt
  129. echo "Running autoconf ..."
  130. autoconf
  131. )
  132. fi
  133. done
  134. conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
  135. if test x$NOCONFIGURE = x; then
  136. echo Running $srcdir/configure $conf_flags "$@" ...
  137. $srcdir/configure $conf_flags "$@" \
  138. && echo Now type \`make\' to compile $PKG_NAME || exit 1
  139. else
  140. echo Skipping configure process.
  141. fi