config.m4 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. dnl Gearman PHP Extension
  2. dnl
  3. dnl Copyright (C) 2008 James M. Luedke <contact@jamesluedke.com>,
  4. dnl Eric Day <eday@oddments.org>
  5. dnl All rights reserved.
  6. dnl
  7. dnl Use and distribution licensed under the PHP license. See
  8. dnl the LICENSE file in this directory for full text.
  9. CFLAGS="$CFLAGS -Wall"
  10. PHP_ARG_WITH(gearman, whether to enable gearman support,
  11. [[ --with-gearman[=PATH] Include gearman support]])
  12. if test "$PHP_GEARMAN" != "no"; then
  13. for i in $PHP_GEARMAN /usr/local /usr /opt/local; do
  14. if test -r $i/include/libgearman-1.0/gearman.h; then
  15. GEARMAN_LIB_DIR=$i/$PHP_LIBDIR
  16. GEARMAN_INC_DIR=$i/include
  17. AC_MSG_RESULT([found in $i])
  18. break
  19. fi
  20. done
  21. if test -z "$GEARMAN_LIB_DIR" -o -z "$GEARMAN_INC_DIR"; then
  22. AC_MSG_RESULT([not found])
  23. AC_MSG_ERROR([Please install libgearman])
  24. fi
  25. PHP_CHECK_LIBRARY(gearman, gearman_client_set_context,
  26. [
  27. PHP_ADD_LIBRARY_WITH_PATH(gearman, $GEARMAN_LIB_DIR, GEARMAN_SHARED_LIBADD)
  28. AC_DEFINE(HAVE_GEARMAN, 1, [Whether you have gearman])
  29. ],[
  30. AC_MSG_ERROR([libgearman version 0.10 or later required])
  31. ],[
  32. -L$GEARMAN_LIB_DIR -R$GEARMAN_LIB_DIR
  33. ])
  34. PHP_CHECK_LIBRARY(gearman, gearman_worker_set_server_option,
  35. [
  36. PHP_ADD_LIBRARY_WITH_PATH(gearman, $GEARMAN_LIB_DIR, GEARMAN_SHARED_LIBADD)
  37. AC_DEFINE(HAVE_GEARMAN, 1, [Whether you have gearman])
  38. ],[
  39. AC_MSG_ERROR([libgearman version 0.21 or later required])
  40. ],[
  41. -L$GEARMAN_LIB_DIR -R$GEARMAN_LIB_DIR
  42. ])
  43. PHP_CHECK_LIBRARY(gearman, gearman_job_error,
  44. [
  45. PHP_ADD_LIBRARY_WITH_PATH(gearman, $GEARMAN_LIB_DIR, GEARMAN_SHARED_LIBADD)
  46. AC_DEFINE(HAVE_GEARMAN, 1, [Whether you have gearman])
  47. ],[
  48. AC_MSG_ERROR([libgearman version 1.1.0 or later required])
  49. ],[
  50. -L$GEARMAN_LIB_DIR -R$GEARMAN_LIB_DIR
  51. ])
  52. PHP_CHECK_LIBRARY(gearman, gearman_client_unique_status,
  53. [
  54. PHP_ADD_LIBRARY_WITH_PATH(gearman, $GEARMAN_LIB_DIR, GEARMAN_SHARED_LIBADD)
  55. AC_DEFINE(HAVE_GEARMAN, 1, [Whether you have gearman])
  56. ],[
  57. AC_MSG_ERROR([libgearman version 1.1.0 or later required])
  58. ],[
  59. -L$GEARMAN_LIB_DIR -R$GEARMAN_LIB_DIR
  60. ])
  61. PHP_SUBST(GEARMAN_SHARED_LIBADD)
  62. PHP_ADD_INCLUDE($GEARMAN_INC_DIR)
  63. PHP_NEW_EXTENSION(gearman, php_gearman.c php_gearman_client.c php_gearman_worker.c php_gearman_job.c php_gearman_task.c, $ext_shared)
  64. fi