FindPHP4.cmake 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #
  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 object.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
  29. NAMES php4 php
  30. PATHS
  31. /usr/bin
  32. /usr/local/bin
  33. )
  34. MARK_AS_ADVANCED(
  35. PHP4_EXECUTABLE
  36. PHP4_FOUND_INCLUDE_PATH
  37. )
  38. IF(APPLE)
  39. # this is a hack for now
  40. SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
  41. "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace")
  42. FOREACH(symbol
  43. __efree
  44. __emalloc
  45. __estrdup
  46. __object_init_ex
  47. __zend_get_parameters_array_ex
  48. __zend_list_find
  49. __zval_copy_ctor
  50. _add_property_zval_ex
  51. _alloc_globals
  52. _compiler_globals
  53. _convert_to_double
  54. _convert_to_long
  55. _zend_error
  56. _zend_hash_find
  57. _zend_register_internal_class_ex
  58. _zend_register_list_destructors_ex
  59. _zend_register_resource
  60. _zend_rsrc_list_get_rsrc_type
  61. _zend_wrong_param_count
  62. _zval_used_for_init
  63. )
  64. SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
  65. "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
  66. ENDFOREACH(symbol)
  67. ENDIF(APPLE)