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

122 行
3.2 KiB

  1. #! /bin/sh
  2. # bootstrap: the ultimate bootstrap/autogen.sh script for autotools projects
  3. # Copyright (c) 2002, 2003, 2004, 2005, 2006 Sam Hocevar <sam@zoy.org>
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the Do What The Fuck You Want To
  7. # Public License, Version 2, as published by Sam Hocevar. See
  8. # http://sam.zoy.org/wtfpl/COPYING for more details.
  9. #
  10. # The latest version of this script can be found at the following place:
  11. # http://sam.zoy.org/autotools/
  12. # Die if an error occurs
  13. set -e
  14. # Guess whether we are using configure.ac or configure.in
  15. if test -f configure.ac; then
  16. conffile="configure.ac"
  17. elif test -f configure.in; then
  18. conffile="configure.in"
  19. else
  20. echo "$0: could not find configure.ac or configure.in"
  21. exit 1
  22. fi
  23. # Check for needed features
  24. auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $conffile`"
  25. libtool="`grep -q '^[ \t]*A._PROG_LIBTOOL' $conffile && echo yes || echo no`"
  26. header="`grep -q '^[ \t]*A._CONFIG_HEADER' $conffile && echo yes || echo no`"
  27. # Check for automake
  28. amvers="no"
  29. for v in "-1.9" "19" "-1.8" "18" "-1.7" "17" "-1.6" "16" "-1.5" "15"; do
  30. if automake${v} --version >/dev/null 2>&1; then
  31. amvers="${v}"
  32. break
  33. fi
  34. done
  35. if test "${amvers}" = "no" && automake --version > /dev/null 2>&1; then
  36. amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`"
  37. if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then
  38. amvers="no"
  39. else
  40. amvers=""
  41. fi
  42. fi
  43. if test "$amvers" = "no"; then
  44. echo "$0: you need automake version 1.5 or later"
  45. exit 1
  46. fi
  47. # Check for autoconf
  48. acvers="no"
  49. for v in "" "259" "253"; do
  50. if autoconf${v} --version >/dev/null 2>&1; then
  51. acvers="${v}"
  52. break
  53. fi
  54. done
  55. if test "$acvers" = "no"; then
  56. echo "$0: you need autoconf"
  57. exit 1
  58. fi
  59. # Check for libtool
  60. if test "$libtool" = "yes"; then
  61. libtoolize="no"
  62. if glibtoolize --version >/dev/null 2>&1; then
  63. libtoolize="glibtoolize"
  64. else
  65. for v in "16" "15" "" "14"; do
  66. if libtoolize${v} --version >/dev/null 2>&1; then
  67. libtoolize="libtoolize${v}"
  68. break
  69. fi
  70. done
  71. fi
  72. if test "$libtoolize" = "no"; then
  73. echo "$0: you need libtool"
  74. exit 1
  75. fi
  76. fi
  77. # Remove old cruft
  78. 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
  79. rm -Rf autom4te.cache
  80. if test -n "$auxdir" -a ! -d "$auxdir"; then mkdir "$auxdir"; fi
  81. # Explain what we are doing from now
  82. set -x
  83. # Bootstrap package
  84. if test "$libtool" = "yes"; then
  85. ${libtoolize} --copy --force
  86. if test -n "$auxdir" -a -f "ltmain.sh"; then
  87. echo "$0: working around a minor libtool issue"
  88. mv ltmain.sh "$auxdir/"
  89. fi
  90. fi
  91. if test -n "$auxdir"; then
  92. aclocal${amvers} -I autotools
  93. else
  94. aclocal${amvers}
  95. fi
  96. autoconf${acvers}
  97. if test "$header" = "yes"; then
  98. autoheader${acvers}
  99. fi
  100. #add --include-deps if you want to bootstrap with any other compiler than gcc
  101. #automake${amvers} --add-missing --copy --include-deps
  102. automake${amvers} --foreign --add-missing --copy
  103. # Remove cruft that we no longer want
  104. rm -Rf autom4te.cache