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.

135 lines
4.1 KiB

27 years ago
27 years ago
27 years ago
27 years ago
  1. #!/bin/sh
  2. supplied_flag=$1
  3. # do some version checking for the tools we use
  4. if test "$1" = "--force"; then
  5. shift
  6. # this is a posix correct "test -nt"
  7. elif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then
  8. :
  9. else
  10. echo "buildconf: checking installation..."
  11. # autoconf 2.13 or newer
  12. ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
  13. if test "$ac_version" = ""; then
  14. echo "buildconf: autoconf not found."
  15. echo " You need autoconf version 2.13 or newer installed"
  16. echo " to build PHP from CVS."
  17. exit 1
  18. fi
  19. IFS=.; set $ac_version; IFS=' '
  20. if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
  21. echo "buildconf: autoconf version $ac_version found."
  22. echo " You need autoconf version 2.13 or newer installed"
  23. echo " to build PHP from CVS."
  24. exit 1
  25. else
  26. echo "buildconf: autoconf version $ac_version (ok)"
  27. fi
  28. # automake 1.4 or newer
  29. am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
  30. if test "$am_version" = ""; then
  31. echo "buildconf: automake not found."
  32. echo " You need automake version 1.4 or newer installed"
  33. echo " to build PHP from CVS."
  34. exit 1
  35. fi
  36. IFS=.; set $am_version; IFS=' '
  37. if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
  38. echo "buildconf: automake version $am_version found."
  39. echo " You need automake version 1.4 or newer installed"
  40. echo " to build PHP from CVS."
  41. exit 1
  42. else
  43. echo "buildconf: automake version $am_version (ok)"
  44. fi
  45. # libtool 1.2f or newer
  46. lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/ .*//'`
  47. if test "$lt_pversion" = ""; then
  48. echo "buildconf: libtool not found."
  49. echo " You need libtool version 1.3 or newer installed"
  50. echo " to build PHP from CVS."
  51. exit 1
  52. fi
  53. lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
  54. IFS=.; set $lt_version; IFS=' '
  55. if test "$1" -gt "1" || test "$2" -ge "3" || test "$2" = "2" -a "$3" = "f"
  56. then
  57. echo "buildconf: libtool version $lt_pversion (ok)"
  58. else
  59. echo "buildconf: libtool version $lt_pversion found."
  60. echo " You need libtool version 1.2f or newer installed"
  61. echo " to build PHP from CVS."
  62. exit 1
  63. fi
  64. touch buildconf.stamp
  65. fi
  66. if test "$supplied_flag" = "--copy"; then
  67. automake_flags=--copy
  68. fi
  69. if test ! -d libzend; then
  70. if test -d ../libzend; then
  71. echo "buildconf: linking ../libzend to ./libzend"
  72. ln -s ../libzend .
  73. else
  74. echo "buildconf: can not find libzend"
  75. echo " libzend should be installed in . or .., how to fetch:"
  76. echo ""
  77. echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository login"
  78. echo " (password \"zend\")"
  79. echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository co libzend"
  80. echo ""
  81. exit 1
  82. fi
  83. fi
  84. if test ! -d TSRM; then
  85. if test -d ../TSRM; then
  86. echo "buildconf: linking ../TSRM to ./TSRM"
  87. ln -s ../TSRM .
  88. else
  89. echo "buildconf: can not find TSRM"
  90. echo " TSRM should be installed in . or .., how to fetch:"
  91. echo ""
  92. echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository login"
  93. echo " (password \"zend\")"
  94. echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository co TSRM"
  95. echo ""
  96. exit 1
  97. fi
  98. fi
  99. ./scripts/preconfig
  100. libtoolize --automake $automake_flags --force
  101. mv aclocal.m4 aclocal.m4.old 2>/dev/null
  102. aclocal
  103. if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
  104. echo "buildconf: keeping aclocal.m4"
  105. mv aclocal.m4.old aclocal.m4
  106. else
  107. echo "buildconf: created or modified aclocal.m4"
  108. fi
  109. autoheader
  110. automake --add-missing --include-deps $automake_flags
  111. mv configure configure.old 2>/dev/null
  112. autoconf
  113. if cmp configure.old configure > /dev/null 2>&1; then
  114. echo "buildconf: keeping configure"
  115. mv configure.old configure
  116. else
  117. echo "buildconf: created or modified configure"
  118. fi
  119. (cd libzend; ./buildconf libzend/)
  120. (cd TSRM; ./buildconf TSRM/)