config.m4 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. dnl
  2. dnl $Id$
  3. dnl
  4. PHP_ARG_WITH(thttpd,,
  5. [ --with-thttpd=SRCDIR Build PHP as thttpd module], no, no)
  6. AC_MSG_CHECKING([for thttpd])
  7. if test "$PHP_THTTPD" != "no"; then
  8. if test ! -d $PHP_THTTPD; then
  9. AC_MSG_RESULT(thttpd directory does not exist ($PHP_THTTPD))
  10. fi
  11. PHP_EXPAND_PATH($PHP_THTTPD, THTTPD)
  12. if grep thttpd.2.21b $PHP_THTTPD/version.h >/dev/null; then
  13. patch="test -f $THTTPD/php_patched || \
  14. (cd $THTTPD && patch -p1 < $abs_srcdir/sapi/thttpd/thttpd_patch && touch php_patched)"
  15. elif grep Premium $PHP_THTTPD/version.h >/dev/null; then
  16. patch=
  17. else
  18. AC_MSG_ERROR([This version only supports thttpd-2.21b and Premium thttpd])
  19. fi
  20. PHP_TARGET_RDYNAMIC
  21. INSTALL_IT="\
  22. echo 'PHP_LIBS = -L. -lphp5 \$(PHP_LIBS) \$(EXTRA_LIBS)' > $THTTPD/php_makefile; \
  23. echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $THTTPD/php_makefile; \
  24. echo 'PHP_CFLAGS = \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(CPPFLAGS) \$(EXTRA_CFLAGS)' >> $THTTPD/php_makefile; \
  25. rm -f $THTTPD/php_thttpd.c $THTTPD/php_thttpd.h $THTTPD/libphp5.a; \
  26. \$(LN_S) $abs_srcdir/sapi/thttpd/thttpd.c $THTTPD/php_thttpd.c; \
  27. \$(LN_S) $abs_srcdir/sapi/thttpd/php_thttpd.h $abs_builddir/$SAPI_STATIC $THTTPD/;\
  28. $patch"
  29. PHP_THTTPD="yes, using $THTTPD"
  30. PHP_ADD_INCLUDE($THTTPD)
  31. PHP_SELECT_SAPI(thttpd, static)
  32. fi
  33. AC_MSG_RESULT($PHP_THTTPD)