Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

140 рядки
3.7 KiB

  1. #! /bin/sh
  2. # bootstrap — generic bootstrap/autogen.sh script for autotools projects
  3. #
  4. # Copyright © 2002—2015 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 the WTFPL Task Force.
  10. # See 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. # Guess whether we are using configure.ac or configure.in
  17. if test -f configure.ac; then
  18. conffile="configure.ac"
  19. elif test -f configure.in; then
  20. conffile="configure.in"
  21. else
  22. echo "$0: could not find configure.ac or configure.in"
  23. exit 1
  24. fi
  25. # Check for needed features
  26. auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *([[ ]*\([^] )]*\).*/\1/p' $conffile`"
  27. pkgconfig="`grep '^[ \t]*PKG_PROG_PKG_CONFIG' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  28. libtool="`grep '^[ \t]*A._PROG_LIBTOOL' $conffile >/dev/null 2>&1 && echo yes || echo no`"
  29. header="`grep '^[ \t]*A._CONFIG_HEADER' $conffile >/dev/null 2>&1 && 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 "" "-1.15" "-1.14" "-1.13" "-1.12" "-1.11"; do
  35. if automake${v} --version > /dev/null 2>&1; then
  36. amvers=${v}
  37. break
  38. fi
  39. done
  40. if test "$amvers" = "no"; then
  41. echo "$0: automake not found"
  42. exit 1
  43. fi
  44. # Check for autoconf
  45. acvers="no"
  46. for v in "" "259" "253"; do
  47. if autoconf${v} --version >/dev/null 2>&1; then
  48. acvers="${v}"
  49. break
  50. fi
  51. done
  52. if test "$acvers" = "no"; then
  53. echo "$0: autoconf not found"
  54. exit 1
  55. fi
  56. # Check for libtool
  57. if test "$libtool" = "yes"; then
  58. libtoolize="no"
  59. if glibtoolize --version >/dev/null 2>&1; then
  60. libtoolize="glibtoolize"
  61. else
  62. for v in "16" "15" "" "14"; do
  63. if libtoolize${v} --version >/dev/null 2>&1; then
  64. libtoolize="libtoolize${v}"
  65. break
  66. fi
  67. done
  68. fi
  69. if test "$libtoolize" = "no"; then
  70. echo "$0: libtool not found"
  71. exit 1
  72. fi
  73. fi
  74. # Check for pkg-config
  75. if test "$pkgconfig" = "yes"; then
  76. if ! pkg-config --version >/dev/null 2>&1; then
  77. echo "$0: pkg-config not found"
  78. exit 1
  79. fi
  80. fi
  81. # Remove old cruft
  82. 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
  83. rm -Rf autom4te.cache
  84. if test -n "$auxdir"; then
  85. if test ! -d "$auxdir"; then
  86. mkdir "$auxdir"
  87. fi
  88. aclocalflags="-I $auxdir -I . ${aclocalflags}"
  89. fi
  90. # Honour M4PATH because sometimes M4 doesn't
  91. save_IFS=$IFS
  92. IFS=:
  93. tmp="$M4PATH"
  94. for x in $tmp; do
  95. if test -n "$x"; then
  96. aclocalflags="-I $x ${aclocalflags}"
  97. fi
  98. done
  99. IFS=$save_IFS
  100. # Explain what we are doing from now
  101. set -x
  102. # Bootstrap package
  103. if test "$libtool" = "yes"; then
  104. ${libtoolize} --copy --force
  105. if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then
  106. echo "$0: working around a minor libtool issue"
  107. mv ltmain.sh "$auxdir/"
  108. fi
  109. fi
  110. aclocal${amvers} ${aclocalflags}
  111. autoconf${acvers}
  112. if test "$header" = "yes"; then
  113. autoheader${acvers}
  114. fi
  115. if test "$makefile" = "yes"; then
  116. #add --include-deps if you want to bootstrap with any other compiler than gcc
  117. #automake${amvers} --add-missing --copy --include-deps
  118. automake${amvers} --foreign --add-missing --copy
  119. fi
  120. # Remove cruft that we no longer want
  121. rm -Rf autom4te.cache