FindPHP4.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # - Find PHP4
  2. # This module finds if PHP4 is installed and determines where the include files
  3. # and libraries are. It also determines what the name of the library is. This
  4. # code sets the following variables:
  5. #
  6. # PHP4_INCLUDE_PATH = path to where php.h can be found
  7. # PHP4_EXECUTABLE = full path to the php4 binary
  8. #
  9. SET(PHP4_POSSIBLE_INCLUDE_PATHS
  10. /usr/include/php4
  11. /usr/local/include/php4
  12. /usr/include/php
  13. /usr/local/include/php
  14. /usr/local/apache/php
  15. )
  16. SET(PHP4_POSSIBLE_LIB_PATHS
  17. /usr/lib
  18. )
  19. FIND_PATH(PHP4_FOUND_INCLUDE_PATH main/php.h
  20. ${PHP4_POSSIBLE_INCLUDE_PATHS})
  21. IF(PHP4_FOUND_INCLUDE_PATH)
  22. SET(php4_paths "${PHP4_POSSIBLE_INCLUDE_PATHS}")
  23. FOREACH(php4_path Zend main TSRM)
  24. SET(php4_paths ${php4_paths} "${PHP4_FOUND_INCLUDE_PATH}/${php4_path}")
  25. ENDFOREACH(php4_path Zend main TSRM)
  26. SET(PHP4_INCLUDE_PATH "${php4_paths}" INTERNAL "PHP4 include paths")
  27. ENDIF(PHP4_FOUND_INCLUDE_PATH)
  28. FIND_PROGRAM(PHP4_EXECUTABLE NAMES php4 php )
  29. MARK_AS_ADVANCED(
  30. PHP4_EXECUTABLE
  31. PHP4_FOUND_INCLUDE_PATH
  32. )
  33. IF(APPLE)
  34. # this is a hack for now
  35. SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
  36. "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
  37. FOREACH(symbol
  38. __efree
  39. __emalloc
  40. __estrdup
  41. __object_init_ex
  42. __zend_get_parameters_array_ex
  43. __zend_list_find
  44. __zval_copy_ctor
  45. _add_property_zval_ex
  46. _alloc_globals
  47. _compiler_globals
  48. _convert_to_double
  49. _convert_to_long
  50. _zend_error
  51. _zend_hash_find
  52. _zend_register_internal_class_ex
  53. _zend_register_list_destructors_ex
  54. _zend_register_resource
  55. _zend_rsrc_list_get_rsrc_type
  56. _zend_wrong_param_count
  57. _zval_used_for_init
  58. )
  59. SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
  60. "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
  61. ENDFOREACH(symbol)
  62. ENDIF(APPLE)