autogen.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/sh
  2. #
  3. # Run this script to generate aclocal.m4, config.h.in,
  4. # Makefile.in's, and ./configure...
  5. #
  6. # To specify extra flags to aclocal (include dirs for example),
  7. # set ACLOCAL_FLAGS
  8. #
  9. DIE=0
  10. # minimum required versions of autoconf/automake/libtool:
  11. ACMAJOR=2
  12. ACMINOR=59
  13. AMMAJOR=1
  14. AMMINOR=10
  15. AMPATCH=2
  16. LTMAJOR=1
  17. LTMINOR=5
  18. LTPATCH=8
  19. (autoconf --version 2>&1 | \
  20. perl -n0e "(/(\d+)\.(\d+)/ && \$1>=$ACMAJOR && \$2>=$ACMINOR) || exit 1") || {
  21. echo
  22. echo "Error: You must have 'autoconf' version $ACMAJOR.$ACMINOR or greater"
  23. echo "installed to run $0. Get the latest version from"
  24. echo "ftp://ftp.gnu.org/pub/gnu/autoconf/"
  25. echo
  26. NO_AUTOCONF=yes
  27. DIE=1
  28. }
  29. amtest="
  30. if (/(\d+)\.(\d+)((-p|\.)(\d+))*/) {
  31. exit 1 if (\$1 < $AMMAJOR || \$2 < $AMMINOR);
  32. exit 0 if (\$2 > $AMMINOR);
  33. exit 1 if (\$5 < $AMPATCH);
  34. }"
  35. (automake --version 2>&1 | perl -n0e "$amtest" ) || {
  36. echo
  37. echo "Error: You must have 'automake' version $AMMAJOR.$AMMINOR.$AMPATCH or greater"
  38. echo "installed to run $0. Get the latest version from"
  39. echo "ftp://ftp.gnu.org/pub/gnu/automake/"
  40. echo
  41. NO_AUTOCONF=yes
  42. DIE=1
  43. }
  44. lttest="
  45. if (/(\d+)\.(\d+)((-p|\.)(\d+))*/) {
  46. exit 1 if (\$1 < $LTMAJOR);
  47. exit 1 if (\$1 == $LTMAJOR && \$2 < $LTMINOR);
  48. exit 1 if (\$1 == $LTMAJOR && \$2 == $LTMINOR && \$5 < $LTPATCH);
  49. }"
  50. (libtool --version 2>&1 | perl -n0e "$lttest" ) || {
  51. echo
  52. echo "Error: You must have 'libtool' version $LTMAJOR.$LTMINOR.$LTPATCH or greater"
  53. echo "installed to run $0. Get the latest version from"
  54. echo "ftp://ftp.gnu.org/pub/gnu/libtool/"
  55. echo
  56. DIE=1
  57. }
  58. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  59. echo
  60. echo "Error: \`aclocal' appears to be missing. The installed version of"
  61. echo "\`automake' may be too old. Get the most recent version from"
  62. echo "ftp://ftp.gnu.org/pub/gnu/automake/"
  63. NO_ACLOCAL=yes
  64. DIE=1
  65. }
  66. if test $DIE -eq 1; then
  67. exit 1
  68. fi
  69. # make sure that auxdir exists
  70. mkdir auxdir 2>/dev/null
  71. # Remove config.h.in to make sure it is rebuilt
  72. rm -f config.h.in
  73. set -x
  74. rm -fr autom4te*.cache
  75. ${ACLOCAL:-aclocal} -I auxdir $ACLOCAL_FLAGS || exit 1
  76. ${LIBTOOLIZE:-libtoolize} --automake --copy --force || exit 1
  77. ${AUTOHEADER:-autoheader} || exit 1
  78. ${AUTOMAKE:-automake} --add-missing --copy --force-missing || exit 1
  79. #${AUTOCONF:-autoconf} --force --warnings=all || exit 1
  80. ${AUTOCONF:-autoconf} --force --warnings=no-obsolete || exit 1
  81. set +x
  82. if [ -e config.status ]; then
  83. echo "removing stale config.status."
  84. rm -f config.status
  85. fi
  86. if [ -e config.log ]; then
  87. echo "removing old config.log."
  88. rm -f config.log
  89. fi
  90. echo "now run ./configure to configure slurm for your environment."
  91. echo
  92. echo "NOTE: This script has most likely just modified files that are under"
  93. echo " version control. Make sure that you really want these changes"
  94. echo " applied to the repository before you run \"git commit\"."