25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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