You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

104 lines
3.4 KiB

  1. #!/bin/sh
  2. # set required versions of tools here
  3. # the version is dotted integers like X.Y.Z where
  4. # X, Y, and Z are integers
  5. # comparisons are done using shell -lt, -gt, etc.
  6. # this works if the numbers are zero filled as well
  7. # so 06 == 6
  8. # autoconf version required
  9. # need 2.69 or later
  10. ac_need_maj=2
  11. ac_need_min=69
  12. # automake version required
  13. # need 1.13.4 or later
  14. am_need_maj=1
  15. am_need_min=13
  16. am_need_rev=4
  17. # libtool version required
  18. # need 2.4.2 or later
  19. lt_need_maj=2
  20. lt_need_min=4
  21. lt_need_rev=2
  22. # should never have to touch anything below this line unless there is a bug
  23. ###########################################################################
  24. # input
  25. # arg1 - version string in the form "X.Y[.Z]" - the .Z is optional
  26. # args remaining - the needed X, Y, and Z to match
  27. # output
  28. # return 0 - success - the version string is >= the required X.Y.Z
  29. # return 1 - failure - the version string is < the required X.Y.Z
  30. # NOTE: All input must be integers, otherwise you will see shell errors
  31. checkvers() {
  32. vers="$1"; shift
  33. needmaj="$1"; shift
  34. needmin="$1"; shift
  35. if [ "$#" != "0" ]; then
  36. needrev="$1"; shift
  37. fi
  38. verslist=`echo $vers | tr '.' ' '`
  39. set $verslist
  40. maj=$1; shift
  41. min=$1; shift
  42. if [ "$#" != "0" ]; then
  43. rev=$1; shift
  44. fi
  45. if [ "$maj" -gt "$needmaj" ] ; then return 0; fi
  46. if [ "$maj" -lt "$needmaj" ] ; then return 1; fi
  47. # if we got here, maj == needmaj
  48. if [ -z "$needmin" ] ; then return 0; fi
  49. if [ "$min" -gt "$needmin" ] ; then return 0; fi
  50. if [ "$min" -lt "$needmin" ] ; then return 1; fi
  51. # if we got here, min == needmin
  52. if [ -z "$needrev" ] ; then return 0; fi
  53. if [ "$rev" -gt "$needrev" ] ; then return 0; fi
  54. if [ "$rev" -lt "$needrev" ] ; then return 1; fi
  55. # if we got here, rev == needrev
  56. return 0
  57. }
  58. # We use GNU sed-isms, so if `gsed' exists, use that instead.
  59. sed=sed
  60. if command -v gsed >/dev/null
  61. then
  62. sed=gsed
  63. fi
  64. # Check autoconf version
  65. AC_VERSION=`autoconf --version | $sed '/^autoconf/ {s/^.* \([1-9][0-9.]*\)$/\1/; q}'`
  66. if checkvers "$AC_VERSION" $ac_need_maj $ac_need_min ; then
  67. echo Found valid autoconf version $AC_VERSION
  68. else
  69. echo "You must have autoconf version $ac_need_maj.$ac_need_min or later installed (found version $AC_VERSION)."
  70. exit 1
  71. fi
  72. # Check automake version
  73. AM_VERSION=`automake --version | $sed '/^automake/ {s/^.* \([1-9][0-9.]*\)$/\1/; q}'`
  74. if checkvers "$AM_VERSION" $am_need_maj $am_need_min $am_need_rev ; then
  75. echo Found valid automake version $AM_VERSION
  76. else
  77. echo "You must have automake version $am_need_maj.$am_need_min.$am_need_rev or later installed (found version $AM_VERSION)."
  78. exit 1
  79. fi
  80. # Check libtool version
  81. # NOTE: some libtool versions report a letter at the end e.g. on RHEL6
  82. # the version is 2.2.6b - for comparison purposes, just strip off the
  83. # letter - note that the shell -lt and -gt comparisons will fail with
  84. # test: 6b: integer expression expected if the number to compare
  85. # contains a non-digit
  86. LT_VERSION=`libtool --version | $sed '/GNU libtool/ {s/^.* \([1-9][0-9a-zA-Z.]*\)$/\1/; s/[a-zA-Z]//g; q}'`
  87. if checkvers "$LT_VERSION" $lt_need_maj $lt_need_min $lt_need_rev ; then
  88. echo Found valid libtool version $LT_VERSION
  89. else
  90. echo "You must have libtool version $lt_need_maj.$lt_need_min.$lt_need_rev or later installed (found version $LT_VERSION)."
  91. exit 1
  92. fi
  93. # Run autoreconf
  94. echo "Running autoreconf -fvi"
  95. autoreconf -fvi