Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

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