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.

80 lines
2.3 KiB

24 years ago
24 years ago
23 years ago
24 years ago
  1. #! /bin/sh
  2. prefix='@prefix@'
  3. phpdir="$prefix/lib/php/build"
  4. includedir="$prefix/include/php"
  5. builddir="`pwd`"
  6. FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool"
  7. FILES="acinclude.m4 Makefile.global"
  8. CLEAN_FILES="$FILES *.lo *.la *.o .deps .libs/ build/ include/ modules/ install-sh \
  9. mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
  10. aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache \
  11. config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h"
  12. case "$1" in
  13. # Cleanup
  14. --clean)
  15. if test -r config.m4; then
  16. echo "Cleaning.."
  17. for i in $CLEAN_FILES; do
  18. test -e $i && rm -rf $i
  19. done
  20. exit 0
  21. else
  22. echo "Cannot find config.m4. "
  23. echo "Make sure that you run '$0 --clean' in the top level source directory of the module"
  24. echo
  25. exit 1
  26. fi
  27. ;;
  28. # Usage
  29. --help)
  30. echo "Usage: $0 [--clean|--help]"
  31. exit 1
  32. ;;
  33. *)
  34. if test ! -r config.m4; then
  35. echo "Cannot find config.m4. "
  36. echo "Make sure that you run '$0' in the top level source directory of the module"
  37. echo
  38. exit 1
  39. fi
  40. ;;
  41. esac
  42. test -d build || mkdir build
  43. (cd $phpdir && cp $FILES_BUILD "$builddir"/build)
  44. (cd $phpdir && cp $FILES "$builddir")
  45. sed \
  46. -e "s#@prefix@#$prefix#" \
  47. < $phpdir/phpize.m4 > configure.in
  48. touch install-sh mkinstalldirs missing
  49. aclocal || exit 1
  50. autoconf || exit 1
  51. autoheader || exit 1
  52. test -x $builddir/build/shtool || chmod +x $builddir/build/shtool
  53. if test ! -x $builddir/build/shtool; then
  54. echo "shtool at '$builddir/build/shtool' not executable. "
  55. echo "Make sure that the file exists and is executable and then rerun this script. "
  56. echo
  57. exit 1
  58. fi
  59. libtoolize=`$builddir/build/shtool path glibtoolize libtoolize`
  60. $libtoolize -f -c || exit 1
  61. # dumping API NOs:
  62. PHP_API_VERSION=`egrep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'`
  63. ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO//'`
  64. ZEND_EXTENSION_API_NO=`egrep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|sed 's/#define ZEND_EXTENSION_API_NO//'`
  65. echo "Configuring for:"
  66. echo " PHP Api Version: "$PHP_API_VERSION
  67. echo " Zend Module Api No: "$ZEND_MODULE_API_NO
  68. echo " Zend Extension Api No: "$ZEND_EXTENSION_API_NO
  69. exit 0