You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.m4 3.0 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. dnl $Id$
  2. dnl config.m4 for extension snowdrift
  3. dnl Comments in this file start with the string 'dnl'.
  4. dnl Remove where necessary. This file will not work
  5. dnl without editing.
  6. dnl If your extension references something external, use with:
  7. dnl PHP_ARG_WITH(snowdrift, for snowdrift support,
  8. dnl Make sure that the comment is aligned:
  9. dnl [ --with-snowdrift Include snowdrift support])
  10. dnl Otherwise use enable:
  11. PHP_ARG_ENABLE(snowdrift, whether to enable snowdrift support,
  12. dnl Make sure that the comment is aligned:
  13. [ --enable-snowdrift Enable snowdrift support])
  14. if test "$PHP_SNOWDRIFT" != "no"; then
  15. dnl Write more examples of tests here...
  16. dnl # get library FOO build options from pkg-config output
  17. dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  18. dnl AC_MSG_CHECKING(for libfoo)
  19. dnl if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists foo; then
  20. dnl if $PKG_CONFIG foo --atleast-version 1.2.3; then
  21. dnl LIBFOO_CFLAGS=`$PKG_CONFIG foo --cflags`
  22. dnl LIBFOO_LIBDIR=`$PKG_CONFIG foo --libs`
  23. dnl LIBFOO_VERSON=`$PKG_CONFIG foo --modversion`
  24. dnl AC_MSG_RESULT(from pkgconfig: version $LIBFOO_VERSON)
  25. dnl else
  26. dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required)
  27. dnl fi
  28. dnl else
  29. dnl AC_MSG_ERROR(pkg-config not found)
  30. dnl fi
  31. dnl PHP_EVAL_LIBLINE($LIBFOO_LIBDIR, SNOWDRIFT_SHARED_LIBADD)
  32. dnl PHP_EVAL_INCLINE($LIBFOO_CFLAGS)
  33. dnl # --with-snowdrift -> check with-path
  34. dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
  35. dnl SEARCH_FOR="/include/snowdrift.h" # you most likely want to change this
  36. dnl if test -r $PHP_SNOWDRIFT/$SEARCH_FOR; then # path given as parameter
  37. dnl SNOWDRIFT_DIR=$PHP_SNOWDRIFT
  38. dnl else # search default path list
  39. dnl AC_MSG_CHECKING([for snowdrift files in default path])
  40. dnl for i in $SEARCH_PATH ; do
  41. dnl if test -r $i/$SEARCH_FOR; then
  42. dnl SNOWDRIFT_DIR=$i
  43. dnl AC_MSG_RESULT(found in $i)
  44. dnl fi
  45. dnl done
  46. dnl fi
  47. dnl
  48. dnl if test -z "$SNOWDRIFT_DIR"; then
  49. dnl AC_MSG_RESULT([not found])
  50. dnl AC_MSG_ERROR([Please reinstall the snowdrift distribution])
  51. dnl fi
  52. dnl # --with-snowdrift -> add include path
  53. dnl PHP_ADD_INCLUDE($SNOWDRIFT_DIR/include)
  54. dnl # --with-snowdrift -> check for lib and symbol presence
  55. dnl LIBNAME=snowdrift # you may want to change this
  56. dnl LIBSYMBOL=snowdrift # you most likely want to change this
  57. dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
  58. dnl [
  59. dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SNOWDRIFT_DIR/$PHP_LIBDIR, SNOWDRIFT_SHARED_LIBADD)
  60. dnl AC_DEFINE(HAVE_SNOWDRIFTLIB,1,[ ])
  61. dnl ],[
  62. dnl AC_MSG_ERROR([wrong snowdrift lib version or lib not found])
  63. dnl ],[
  64. dnl -L$SNOWDRIFT_DIR/$PHP_LIBDIR -lm
  65. dnl ])
  66. dnl
  67. dnl PHP_SUBST(SNOWDRIFT_SHARED_LIBADD)
  68. snowdrift_source_file="snowdrift.c\
  69. src/snowflake/snowflake.c\
  70. src/snowflake/shm.c\
  71. src/snowflake/spinlock.c
  72. "
  73. PHP_NEW_EXTENSION(snowdrift, $snowdrift_source_file, $ext_shared)
  74. fi