kvirc
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.

autogen.sh 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #! /bin/bash
  2. ###############################################################################
  3. #
  4. # Run this to generate the Makefile templates, etc.
  5. #
  6. ###############################################################################
  7. THIS_PROGGIE_EXECUTABLE="./autogen.sh"
  8. THIS_PROGGIE_NAME="KVIrc autogen.sh"
  9. THIS_PROGGIE_VERSION="1.0.0"
  10. PKG_NAME="kvirc"
  11. DIE=0
  12. GEN_FILES="configure.in"
  13. USE_BUNDLED_LIBTOOL=0
  14. # Handle arguments
  15. while test "$#" -gt 0
  16. do
  17. arg="$1"
  18. shift
  19. case $arg in
  20. --help)
  21. echo $THIS_PROGGIE_NAME $THIS_PROGGIE_VERSION
  22. echo "Usage:"
  23. echo $THIS_PROGGIE_EXECUTABLE "[options]"
  24. echo "Options:"
  25. echo " --bundled-libtool : use the bundled libtool instead"
  26. echo " of the system one"
  27. exit 0
  28. ;;
  29. --version)
  30. echo $THIS_PROGGIE_NAME $THIS_PROGGIE_VERSION
  31. exit 0
  32. ;;
  33. --bundled-libtool)
  34. USE_BUNDLED_LIBTOOL=1
  35. ;;
  36. *)
  37. echo "Unrecognized option $arg"
  38. echo "See $THIS_PROGGIE_EXECUTABLE --help"
  39. exit -1
  40. ;;
  41. esac
  42. done
  43. set -e
  44. function RUN_TOOL()
  45. {
  46. if [ -z "$*" ]; then return; fi
  47. echo "... Running $*"
  48. $*
  49. }
  50. ###############################################################################
  51. #
  52. #
  53. echo "... Generating build files for $PKG_NAME"
  54. (autoconf --version) < /dev/null > /dev/null 2>&1 || {
  55. echo
  56. echo "**Error**: You must have GNU \`autoconf' installed."
  57. DIE=1
  58. }
  59. (test "$USE_BUNDLED_LIBTOOL" -eq 0) && {
  60. (libtool --version) < /dev/null > /dev/null 2>&1 || {
  61. echo "*Warning*: You don't have GNU \`libtool' installed."
  62. echo "*Warning*: Using the buindled libtool instead."
  63. USE_BUNDLED_LIBTOOL=1
  64. }
  65. }
  66. (automake --version) < /dev/null > /dev/null 2>&1 || {
  67. echo
  68. echo "**Error**: You must have GNU \`automake' installed."
  69. DIE=1
  70. NO_AUTOMAKE=yes
  71. }
  72. # if no automake, do not bother testing for aclocal
  73. test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  74. echo
  75. echo "**Error**: Missing \`aclocal'. The version of \`automake'"
  76. echo "installed does not appear recent enough."
  77. DIE=1
  78. }
  79. if test "$DIE" -eq 1; then
  80. exit 1
  81. fi
  82. case $CC in
  83. xlc)
  84. am_opt=--include-deps;;
  85. esac
  86. for coin in $GEN_FILES
  87. do
  88. dr=`dirname $coin`
  89. if test -f $dr/NO-AUTO-GEN; then
  90. echo "... skipping $dr -- flagged as no auto-gen"
  91. else
  92. echo "... processing \"$dr\""
  93. macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
  94. (
  95. cd $dr
  96. aclocalinclude="$ACLOCAL_FLAGS"
  97. for k in $macrodirs; do
  98. if test -d $k; then
  99. aclocalinclude="$aclocalinclude -I $k"
  100. fi
  101. done
  102. MACRO_FILES="admin/acinclude.m4.in admin/libtool.m4.in"
  103. cat $MACRO_FILES > acinclude.m4
  104. if test "$USE_BUNDLED_LIBTOOL" -eq 0; then
  105. echo "... Using system libtool"
  106. echo "... Re-run with --bundled-libtool to use"
  107. echo "... the libtool shipped with the KVIrc svn"
  108. RUN_TOOL libtoolize --copy --force
  109. else
  110. echo "... Using bundled libtool"
  111. rm -f admin/ltmain.sh
  112. rm -f admin/config.guess
  113. rm -f admin/config.sub
  114. cp admin/libtool/ltmain.sh admin/ltmain.sh
  115. cp admin/libtool/config.guess admin/config.guess
  116. cp admin/libtool/config.sub admin/config.sub
  117. fi
  118. RUN_TOOL aclocal $aclocalinclude
  119. if grep "^AM_CONFIG_HEADER" $coin > /dev/null; then
  120. RUN_TOOL autoheader
  121. fi
  122. RUN_TOOL automake --add-missing --force-missing --copy $am_opt
  123. RUN_TOOL autoconf
  124. touch stamp-h.in
  125. )
  126. fi
  127. done
  128. echo "###"
  129. echo "### Done. The next step is ./configure --help"
  130. echo "### Take a look at the options (eventually read the INSTALL file)"
  131. echo "### and run ./configure <your_options>"
  132. echo "###"
  133. #
  134. ###############################################################################