選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

133 行
3.6 KiB

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