PageRenderTime 68ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/autogen.sh

#
Shell | 109 lines | 79 code | 11 blank | 19 comment | 12 complexity | 6d616afc3349c09c811d0d32a08f8f36 MD5 | raw file
Possible License(s): GPL-2.0
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2004 Rizoma Tecnologia Limitada <info@rizoma.cl>
  4. #
  5. # This file is part of rizoma.
  6. #
  7. # Rizoma is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. if [ "$1" = "--help" ]; then
  21. echo "Usage: autogen.sh [options]"
  22. echo "Options:"
  23. echo "--help : Display this help message"
  24. echo "--with-errors : Show verbose information"
  25. echo ""
  26. exit;
  27. fi
  28. if [ "$1" = "--with-errors" ]; then
  29. ERROR="YES"
  30. else
  31. ERROR="NO"
  32. fi
  33. if autoconf --version > /dev/null 2>&1; then
  34. if autoconf --version | egrep -e '2.([5670]|[123456789][0-9]+)' > /dev/null>&1; then
  35. echo "autoconf ... yes"
  36. else
  37. echo "autoconf ... no"
  38. echo "Error: You must have installed a version >= 2.5"
  39. exit;
  40. fi
  41. else
  42. echo "Error: You must have autoconf installed"
  43. exit;
  44. fi
  45. if automake --version > /dev/null 2>&1; then
  46. if automake --version | grep '1.[567890]*' > /dev/null>&1; then
  47. echo "automake ... yes"
  48. else
  49. echo "automake ... no"
  50. echo "Error: You must have installed a version >= 1.5"
  51. exit;
  52. fi
  53. else
  54. echo "Error: You must have automake installed"
  55. exit;
  56. fi
  57. if aclocal --version > /dev/null 2>&1; then
  58. if aclocal --version | grep '1.[567890]*' > /dev/null>&1; then
  59. echo "aclocal ... yes"
  60. else
  61. echo "aclocal ... no"
  62. echo "Error: You must have installed a version >= 1.5"
  63. exit;
  64. fi
  65. else
  66. echo "Error: You must have aclocal installed"
  67. exit;
  68. fi
  69. if autoheader --version> /dev/null 2>&1; then
  70. if autoheader --version | egrep -e '2.([5670]|[123456789][0-9]+)' > /dev/null>&1; then
  71. echo "autoheader ... yes"
  72. else
  73. echo "autoheader ... no"
  74. echo "Error: You must have installed a version >= 2.5"
  75. exit;
  76. fi
  77. else
  78. echo "Error: You must have autoheader installed"
  79. exit;
  80. fi
  81. echo "Creating aclocal.m4"
  82. aclocal -I m4/
  83. echo "Creating config.h.in"
  84. autoheader
  85. echo "Adding missing standards files to package"
  86. if [ "$ERROR" = "YES" ]; then
  87. automake --add-missing --copy
  88. else
  89. automake --add-missing --copy > /dev/null 2>&1;
  90. fi
  91. echo "Creating configure file"
  92. if [ "$ERROR" = "YES" ]; then
  93. autoconf
  94. else
  95. autoconf > /dev/null 2>&1;
  96. fi
  97. echo "Now we going to run the configure script"
  98. ./configure $@