/bootstrap

https://code.google.com/ · Shell · 104 lines · 80 code · 11 blank · 13 comment · 20 complexity · 8eb42b248f482f85a88e9b77fd7debd1 MD5 · raw file

  1. #!/bin/sh
  2. # $Id$
  3. # $Source$
  4. #
  5. # Run this script to generate aclocal.m4, config.h.in,
  6. # Makefile.in's, and ./configure...
  7. #
  8. # To specify extra flags to aclocal (include dirs for example),
  9. # set ACLOCAL_FLAGS
  10. #
  11. DIE=0
  12. # minimum required versions of autoconf/automake:
  13. ACMAJOR=2
  14. ACMINOR=52
  15. AMMAJOR=1
  16. AMMINOR=4
  17. AMPATCH=4
  18. LTLMAJOR=1
  19. LTLMINOR=4
  20. LTLPATCH=3
  21. # auxdir location
  22. AUXDIR=config
  23. (autoconf --version 2>&1 | \
  24. perl -n0e "(/(\d+)\.(\d+)/ && \$1>=$ACMAJOR && \$2>=$ACMINOR) || exit 1") || {
  25. echo
  26. echo "Error: You must have \`autoconf' version $ACMAJOR.$ACMINOR or greater"
  27. echo "installed to run $0. Get the latest version from"
  28. echo "ftp://ftp.gnu.org/pub/gnu/autoconf/"
  29. echo
  30. NO_AUTOCONF=yes
  31. DIE=1
  32. }
  33. versiontest="
  34. if (/(\d+)\.(\d+)((-p|\.)(\d+))*/) {
  35. exit 1 if (\$1 < $AMMAJOR);
  36. exit 1 if (\$1 == $AMMAJOR && \$2 < $AMMINOR);
  37. if (defined(\$5)) {
  38. exit 1 if (\$1 == $AMMAJOR && \$2 == $AMMINOR && \$5 < $AMPATCH);
  39. }
  40. }"
  41. (automake --version 2>&1 | perl -n0e "$versiontest" ) || {
  42. echo
  43. echo "Error: You must have \`automake' version $AMMAJOR.$AMMINOR-p$AMPATCH or greater"
  44. echo "installed to run $0. Get the latest version from"
  45. echo "ftp://ftp.gnu.org/pub/gnu/automake/"
  46. echo
  47. NO_AUTOCONF=yes
  48. DIE=1
  49. }
  50. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  51. echo
  52. echo "Error: \`aclocal' appears to be missing. The installed version of"
  53. echo "\`automake' may be too old. Get the most recent version from"
  54. echo "ftp://ftp.gnu.org/pub/gnu/automake/"
  55. echo
  56. NO_ACLOCAL=yes
  57. DIE=1
  58. }
  59. versiontest="
  60. if ( / (\d+)\.(\d+)\.(\d+)/) {
  61. exit 1 if (\$1 < $LTLMAJOR);
  62. exit 1 if (\$1 == $LTLMAJOR && \$2 < $LTLMINOR);
  63. if (defined(\$3)) {
  64. exit 1 if (\$1 == $LTLMAJOR && \$2 == $LTLMINOR && \$3 < $LTLPATCH);
  65. }
  66. }"
  67. (libtoolize --version 2>&1 | perl -n0e "$versiontest") || {
  68. echo
  69. echo "Warning: On some systems, libtoolize versions < 1.4.3 may not"
  70. echo "install necessary files correctly. Get the most recent"
  71. echo "version of libtool from"
  72. echo "ftp://ftp.gnu.org/gnu/libtool/"
  73. echo
  74. }
  75. if test $DIE -eq 1; then
  76. exit 1
  77. fi
  78. echo "running aclocal $ACLOCAL_FLAGS ... "
  79. aclocal -I $AUXDIR $ACLOCAL_FLAGS
  80. echo "running libtoolize ..."
  81. libtoolize --automake --copy
  82. echo "running autoheader ... "
  83. autoheader
  84. echo "running automake --add-missing ... "
  85. # ensure AUXDIR exists
  86. if test ! -d $AUXDIR; then
  87. mkdir $AUXDIR
  88. fi
  89. automake --copy --add-missing
  90. echo "running autoconf ... "
  91. autoconf --warnings=all