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.

bootstrap 4.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. makefile="`[ -f Makefile.am ] && echo yes || echo no`"
  55. aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am 2>/dev/null || :`"
  56. # Check for automake
  57. amvers="no"
  58. for v in "" "-1.15" "-1.14" "-1.13" "-1.12" "-1.11"; do
  59. if automake${v} --version > /dev/null 2>&1; then
  60. amvers=${v}
  61. break
  62. fi
  63. done
  64. if test "$amvers" = "no"; then
  65. echo "$0: automake not found"
  66. exit 1
  67. fi
  68. # Check for autoconf
  69. acvers="no"
  70. for v in "" "259" "253"; do
  71. if autoconf${v} --version >/dev/null 2>&1; then
  72. acvers="${v}"
  73. break
  74. fi
  75. done
  76. if test "$acvers" = "no"; then
  77. echo "$0: autoconf not found"
  78. exit 1
  79. fi
  80. # Check for libtool
  81. if test "$libtool" = "yes"; then
  82. libtoolize="no"
  83. if glibtoolize --version >/dev/null 2>&1; then
  84. libtoolize="glibtoolize"
  85. else
  86. for v in "16" "15" "" "14"; do
  87. if libtoolize${v} --version >/dev/null 2>&1; then
  88. libtoolize="libtoolize${v}"
  89. break
  90. fi
  91. done
  92. fi
  93. if test "$libtoolize" = "no"; then
  94. echo "$0: libtool not found"
  95. exit 1
  96. fi
  97. fi
  98. # Check for pkg-config
  99. if test "$pkgconfig" = "yes"; then
  100. if ! pkg-config --version >/dev/null 2>&1; then
  101. echo "$0: pkg-config not found"
  102. exit 1
  103. fi
  104. fi
  105. # Remove old cruft
  106. 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
  107. rm -Rf autom4te.cache
  108. if test -n "$auxdir"; then
  109. if test ! -d "$auxdir"; then
  110. mkdir "$auxdir"
  111. fi
  112. aclocalflags="-I $auxdir -I . ${aclocalflags}"
  113. fi
  114. # Honour M4PATH because sometimes M4 doesn't
  115. save_IFS=$IFS
  116. IFS=:
  117. tmp="$M4PATH"
  118. for x in $tmp; do
  119. if test -n "$x"; then
  120. aclocalflags="-I $x ${aclocalflags}"
  121. fi
  122. done
  123. IFS=$save_IFS
  124. # Explain what we are doing from now
  125. set -x
  126. # Bootstrap package
  127. if test "$libtool" = "yes"; then
  128. ${libtoolize} --copy --force
  129. if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then
  130. echo "$0: working around a minor libtool issue"
  131. mv ltmain.sh "$auxdir/"
  132. fi
  133. fi
  134. aclocal${amvers} ${aclocalflags}
  135. autoconf${acvers}
  136. autoheader${acvers}
  137. if test "$makefile" = "yes"; then
  138. #add --include-deps if you want to bootstrap with any other compiler than gcc
  139. #automake${amvers} --add-missing --copy --include-deps
  140. automake${amvers} --foreign --add-missing --copy
  141. fi
  142. # Remove cruft that we no longer want
  143. rm -Rf autom4te.cache