您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

166 行
4.4 KiB

  1. #! /bin/sh
  2. # bootstrap: generic bootstrap/autogen.sh script for autotools projects
  3. #
  4. # Copyright (c) 2002-2010 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://www.wtfpl.net/ 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. # LolEngine specific:
  17. sed -ne '/AC_CONFIG_FILES/,$p' configure.ac \
  18. | sed -ne 's@[^a-z]*\(.*/.*\)[^a-z]*@\1@p' | while read p; do
  19. case "$p" in
  20. "")
  21. continue
  22. ;;
  23. *Makefile)
  24. required="${p}.am"
  25. ;;
  26. *)
  27. required="${p}.in"
  28. ;;
  29. esac
  30. if [ ! -f "${required}" ]; then
  31. echo "bootstrap: ${required} does not exist -- creating stub"
  32. case "$p" in
  33. */*)
  34. mkdir -p "${p%/*}"
  35. ;;
  36. esac
  37. echo '# Stub created by bootstrap' > "${required}"
  38. echo 'include $(top_srcdir)/build/autotools/common.am' >> "${required}"
  39. fi
  40. done
  41. # Guess whether we are using configure.ac or configure.in
  42. if test -f configure.ac; then
  43. conffile="configure.ac"
  44. elif test -f configure.in; then
  45. conffile="configure.in"
  46. else
  47. echo "$0: could not find configure.ac or configure.in"
  48. exit 1
  49. fi
  50. # Check for needed features
  51. auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *([[ ]*\([^] )]*\).*/\1/p' $conffile`"
  52. pkgconfig="`grep '^[ \t]*PKG_PROG_PKG_CONFIG' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  53. libtool="`grep '^[ \t]*A._PROG_LIBTOOL' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  54. header="`grep '^[ \t]*A._CONFIG_HEADER' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  55. makefile="`[ -f Makefile.am ] && echo yes || echo no`"
  56. aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am 2>/dev/null || :`"
  57. # Check for automake
  58. amvers="no"
  59. for v in "" "-1.15" "-1.14" "-1.13" "-1.12" "-1.11"; do
  60. if automake${v} --version > /dev/null 2>&1; then
  61. amvers=${v}
  62. break
  63. fi
  64. done
  65. if test "$amvers" = "no"; then
  66. echo "$0: automake not found"
  67. exit 1
  68. fi
  69. # Check for autoconf
  70. acvers="no"
  71. for v in "" "259" "253"; do
  72. if autoconf${v} --version >/dev/null 2>&1; then
  73. acvers="${v}"
  74. break
  75. fi
  76. done
  77. if test "$acvers" = "no"; then
  78. echo "$0: autoconf not found"
  79. exit 1
  80. fi
  81. # Check for libtool
  82. if test "$libtool" = "yes"; then
  83. libtoolize="no"
  84. if glibtoolize --version >/dev/null 2>&1; then
  85. libtoolize="glibtoolize"
  86. else
  87. for v in "16" "15" "" "14"; do
  88. if libtoolize${v} --version >/dev/null 2>&1; then
  89. libtoolize="libtoolize${v}"
  90. break
  91. fi
  92. done
  93. fi
  94. if test "$libtoolize" = "no"; then
  95. echo "$0: libtool not found"
  96. exit 1
  97. fi
  98. fi
  99. # Check for pkg-config
  100. if test "$pkgconfig" = "yes"; then
  101. if ! pkg-config --version >/dev/null 2>&1; then
  102. echo "$0: pkg-config not found"
  103. exit 1
  104. fi
  105. fi
  106. # Remove old cruft
  107. 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
  108. rm -Rf autom4te.cache
  109. if test -n "$auxdir"; then
  110. if test ! -d "$auxdir"; then
  111. mkdir "$auxdir"
  112. fi
  113. aclocalflags="-I $auxdir -I . ${aclocalflags}"
  114. fi
  115. # Honour M4PATH because sometimes M4 doesn't
  116. save_IFS=$IFS
  117. IFS=:
  118. tmp="$M4PATH"
  119. for x in $tmp; do
  120. if test -n "$x"; then
  121. aclocalflags="-I $x ${aclocalflags}"
  122. fi
  123. done
  124. IFS=$save_IFS
  125. # Explain what we are doing from now
  126. set -x
  127. # Bootstrap package
  128. if test "$libtool" = "yes"; then
  129. ${libtoolize} --copy --force
  130. if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then
  131. echo "$0: working around a minor libtool issue"
  132. mv ltmain.sh "$auxdir/"
  133. fi
  134. fi
  135. aclocal${amvers} ${aclocalflags}
  136. autoconf${acvers}
  137. if test "$header" = "yes"; then
  138. autoheader${acvers}
  139. fi
  140. if test "$makefile" = "yes"; then
  141. #add --include-deps if you want to bootstrap with any other compiler than gcc
  142. #automake${amvers} --add-missing --copy --include-deps
  143. automake${amvers} --foreign --add-missing --copy
  144. fi
  145. # Remove cruft that we no longer want
  146. rm -Rf autom4te.cache