Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

152 řádky
4.0 KiB

  1. #! /bin/sh
  2. # bootstrap: generic bootstrap/autogen.sh script for autotools projects
  3. #
  4. # Copyright (c) 2002-2011 Sam Hocevar <sam@hocevar.net>
  5. #
  6. # This program is free software. It comes without any warranty, to
  7. # the extent permitted by applicable law. You can redistribute it
  8. # and/or modify it under the terms of the Do What The Fuck You Want
  9. # To Public License, Version 2, as published by Sam Hocevar. See
  10. # http://sam.zoy.org/wtfpl/COPYING for more details.
  11. #
  12. # The latest version of this script can be found at the following place:
  13. # http://caca.zoy.org/wiki/build
  14. # Die if an error occurs
  15. set -e
  16. # Guess whether we are using configure.ac or configure.in
  17. if test -f configure.ac; then
  18. conffile="configure.ac"
  19. elif test -f configure.in; then
  20. conffile="configure.in"
  21. else
  22. echo "$0: could not find configure.ac or configure.in"
  23. exit 1
  24. fi
  25. # Check for needed features
  26. auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *([[ ]*\([^] )]*\).*/\1/p' $conffile`"
  27. pkgconfig="`grep '^[ \t]*PKG_PROG_PKG_CONFIG' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  28. libtool="`grep '^[ \t]*A._PROG_LIBTOOL' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  29. header="`grep '^[ \t]*A._CONFIG_HEADER' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  30. makefile="`[ -f Makefile.am ] && echo yes || echo no`"
  31. aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am 2>/dev/null || :`"
  32. # Check for automake
  33. amvers="no"
  34. for v in 13 12 11 10 9 8 7 6 5; do
  35. if automake-1.${v} --version >/dev/null 2>&1; then
  36. amvers="-1.${v}"
  37. break
  38. elif automake1.${v} --version >/dev/null 2>&1; then
  39. amvers="1.${v}"
  40. break
  41. fi
  42. done
  43. if test "${amvers}" = "no" && automake --version > /dev/null 2>&1; then
  44. amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`"
  45. if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then
  46. amvers="no"
  47. else
  48. amvers=""
  49. fi
  50. fi
  51. if test "$amvers" = "no"; then
  52. echo "$0: you need automake version 1.5 or later"
  53. exit 1
  54. fi
  55. # Check for autoconf
  56. acvers="no"
  57. for v in "" "259" "253"; do
  58. if autoconf${v} --version >/dev/null 2>&1; then
  59. acvers="${v}"
  60. break
  61. fi
  62. done
  63. if test "$acvers" = "no"; then
  64. echo "$0: you need autoconf"
  65. exit 1
  66. fi
  67. # Check for libtool
  68. if test "$libtool" = "yes"; then
  69. libtoolize="no"
  70. if glibtoolize --version >/dev/null 2>&1; then
  71. libtoolize="glibtoolize"
  72. else
  73. for v in "16" "15" "" "14"; do
  74. if libtoolize${v} --version >/dev/null 2>&1; then
  75. libtoolize="libtoolize${v}"
  76. break
  77. fi
  78. done
  79. fi
  80. if test "$libtoolize" = "no"; then
  81. echo "$0: you need libtool"
  82. exit 1
  83. fi
  84. fi
  85. # Check for pkg-config
  86. if test "$pkgconfig" = "yes"; then
  87. if ! pkg-config --version >/dev/null 2>&1; then
  88. echo "$0: you need pkg-config"
  89. exit 1
  90. fi
  91. fi
  92. # Remove old cruft
  93. for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; if test -n "$auxdir"; then rm -f "$auxdir/$x"; fi; done
  94. rm -Rf autom4te.cache
  95. if test -n "$auxdir"; then
  96. if test ! -d "$auxdir"; then
  97. mkdir "$auxdir"
  98. fi
  99. aclocalflags="${aclocalflags} -I $auxdir -I ."
  100. fi
  101. # Honour M4PATH because sometimes M4 doesn't
  102. save_IFS=$IFS
  103. IFS=:
  104. tmp="$M4PATH"
  105. for x in $tmp; do
  106. if test -n "$x"; then
  107. aclocalflags="${aclocalflags} -I $x"
  108. fi
  109. done
  110. IFS=$save_IFS
  111. # Explain what we are doing from now
  112. set -x
  113. # Bootstrap package
  114. if test "$libtool" = "yes"; then
  115. ${libtoolize} --copy --force
  116. if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then
  117. echo "$0: working around a minor libtool issue"
  118. mv ltmain.sh "$auxdir/"
  119. fi
  120. fi
  121. aclocal${amvers} ${aclocalflags}
  122. autoconf${acvers}
  123. if test "$header" = "yes"; then
  124. autoheader${acvers}
  125. fi
  126. if test "$makefile" = "yes"; then
  127. #add --include-deps if you want to bootstrap with any other compiler than gcc
  128. #automake${amvers} --add-missing --copy --include-deps
  129. automake${amvers} --foreign --add-missing --copy
  130. fi
  131. # Remove cruft that we no longer want
  132. rm -Rf autom4te.cache