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.
 
 
 
 
 
 

126 lines
3.0 KiB

  1. #!/bin/sh
  2. #
  3. # Helps generate autoconf/automake stuff, when code is checked out from SCM.
  4. #
  5. # Copyright (C) 2006-2010 - Karel Zak <kzak@redhat.com>
  6. #
  7. srcdir=`dirname $0`
  8. test -z "$srcdir" && srcdir=.
  9. THEDIR=`pwd`
  10. cd $srcdir
  11. DIE=0
  12. # provide simple gettext backward compatibility
  13. autopoint_fun ()
  14. {
  15. # we have to deal with set -e ...
  16. ret="0"
  17. # check against this hardcoded set of alternative gettext versions
  18. gt_ver=`gettext --version |\
  19. sed -n -e 's/.* \(0\.18\|0\.18\.[1-2]\)$/\1/p'`
  20. if [ -n "$gt_ver" ]; then
  21. echo "warning: forcing autopoint to use old gettext $gt_ver"
  22. rm -f configure.ac.autogenbak
  23. sed -i.autogenbak configure.ac \
  24. -e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$gt_ver])/"
  25. fi
  26. autopoint "$@" || ret=$?
  27. if [ -n "$gt_ver" ]; then
  28. mv configure.ac.autogenbak configure.ac
  29. fi
  30. return $ret
  31. }
  32. test -f sys-utils/mount.c || {
  33. echo
  34. echo "You must run this script in the top-level util-linux directory."
  35. echo
  36. DIE=1
  37. }
  38. (autopoint --version) < /dev/null > /dev/null 2>&1 || {
  39. echo
  40. echo "You must have autopoint installed to generate the util-linux build system."
  41. echo "The autopoint command is part of the GNU gettext package."
  42. echo
  43. DIE=1
  44. }
  45. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  46. echo
  47. echo "You must have autoconf installed to generate the util-linux build system."
  48. echo
  49. DIE=1
  50. }
  51. (autoheader --version) < /dev/null > /dev/null 2>&1 || {
  52. echo
  53. echo "You must have autoheader installed to generate the util-linux build system."
  54. echo "The autoheader command is part of the GNU autoconf package."
  55. echo
  56. DIE=1
  57. }
  58. (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
  59. echo
  60. echo "You must have libtool-2 installed to generate the util-linux build system."
  61. echo
  62. DIE=1
  63. }
  64. (automake --version) < /dev/null > /dev/null 2>&1 || {
  65. echo
  66. echo "You must have automake installed to generate the util-linux build system."
  67. echo
  68. DIE=1
  69. }
  70. ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
  71. ltver=${ltver:-"none"}
  72. test ${ltver##2.} = "$ltver" && {
  73. echo "You must have libtool version >= 2.x.x, but you have $ltver."
  74. DIE=1
  75. }
  76. if test "$DIE" -eq 1; then
  77. exit 1
  78. fi
  79. echo
  80. echo "Generating build-system with:"
  81. echo " autopoint: $(autopoint --version | head -1)"
  82. echo " aclocal: $(aclocal --version | head -1)"
  83. echo " autoconf: $(autoconf --version | head -1)"
  84. echo " autoheader: $(autoheader --version | head -1)"
  85. echo " automake: $(automake --version | head -1)"
  86. echo " libtoolize: $(libtoolize --version | head -1)"
  87. rm -rf autom4te.cache
  88. set -e
  89. po/update-potfiles
  90. autopoint_fun --force $AP_OPTS
  91. if ! grep -q datarootdir po/Makefile.in.in; then
  92. echo autopoint does not honor dataroot variable, patching.
  93. sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
  94. datadir = @datadir@/g' po/Makefile.in.in
  95. fi
  96. libtoolize --force $LT_OPTS
  97. aclocal -I m4 $AL_OPTS
  98. autoconf $AC_OPTS
  99. autoheader $AH_OPTS
  100. automake --add-missing $AM_OPTS
  101. cd $THEDIR
  102. echo
  103. echo "Now type '$srcdir/configure' and 'make' to compile."
  104. echo