瀏覽代碼

* httpd moved, splitted, decapitated and rejoined

git-svn-id: trunk@10061 -
marco 17 年之前
父節點
當前提交
934d1a9217
共有 100 個文件被更改,包括 5067 次插入548 次删除
  1. 143 134
      .gitattributes
  2. 0 14
      packages/base/httpd/Makefile.fpc
  3. 0 22
      packages/base/httpd/httpd-2.0/Makefile.fpc
  4. 0 22
      packages/base/httpd/httpd-2.2/Makefile.fpc
  5. 323 5
      packages/httpd13/Makefile
  6. 7 3
      packages/httpd13/Makefile.fpc
  7. 48 0
      packages/httpd13/fpmake.pp
  8. 0 0
      packages/httpd13/src/ap.inc
  9. 0 0
      packages/httpd13/src/ap_alloc.inc
  10. 0 0
      packages/httpd13/src/ap_config.inc
  11. 0 0
      packages/httpd13/src/ap_mmn.inc
  12. 0 0
      packages/httpd13/src/buff.inc
  13. 0 0
      packages/httpd13/src/hsregex.inc
  14. 0 0
      packages/httpd13/src/http_config.inc
  15. 0 0
      packages/httpd13/src/http_core.inc
  16. 0 0
      packages/httpd13/src/http_log.inc
  17. 0 0
      packages/httpd13/src/http_main.inc
  18. 0 0
      packages/httpd13/src/http_protocol.inc
  19. 0 0
      packages/httpd13/src/http_request.inc
  20. 0 0
      packages/httpd13/src/http_vhost.inc
  21. 0 0
      packages/httpd13/src/httpd.inc
  22. 0 0
      packages/httpd13/src/httpd.pas
  23. 77 77
      packages/httpd13/src/readdir.inc
  24. 0 0
      packages/httpd13/src/util_uri.inc
  25. 0 0
      packages/httpd13/src/win32_os.inc
  26. 837 56
      packages/httpd20/Makefile
  27. 27 0
      packages/httpd20/Makefile.fpc
  28. 3 3
      packages/httpd20/examples/Makefile
  29. 2 2
      packages/httpd20/examples/Makefile.fpc
  30. 0 0
      packages/httpd20/examples/define.inc
  31. 0 0
      packages/httpd20/examples/minimain.pas
  32. 0 0
      packages/httpd20/examples/mod_example.pp
  33. 0 0
      packages/httpd20/examples/mod_hello.pp
  34. 0 0
      packages/httpd20/examples/mod_spelling.pp
  35. 0 0
      packages/httpd20/examples/testmodule.pp
  36. 94 0
      packages/httpd20/fpmake.pp
  37. 0 0
      packages/httpd20/src/ap_config.inc
  38. 0 0
      packages/httpd20/src/ap_mmn.inc
  39. 0 0
      packages/httpd20/src/ap_mpm.inc
  40. 0 0
      packages/httpd20/src/ap_provider.inc
  41. 0 0
      packages/httpd20/src/ap_release.inc
  42. 0 0
      packages/httpd20/src/apr/apr.pas
  43. 0 0
      packages/httpd20/src/apr/apr_allocator.inc
  44. 0 0
      packages/httpd20/src/apr/apr_buckets.inc
  45. 0 0
      packages/httpd20/src/apr/apr_dso.inc
  46. 0 0
      packages/httpd20/src/apr/apr_errno.inc
  47. 0 0
      packages/httpd20/src/apr/apr_file_info.inc
  48. 0 0
      packages/httpd20/src/apr/apr_file_io.inc
  49. 0 0
      packages/httpd20/src/apr/apr_general.inc
  50. 0 0
      packages/httpd20/src/apr/apr_hash.inc
  51. 0 0
      packages/httpd20/src/apr/apr_lib.inc
  52. 0 0
      packages/httpd20/src/apr/apr_network_io.inc
  53. 0 0
      packages/httpd20/src/apr/apr_poll.inc
  54. 0 0
      packages/httpd20/src/apr/apr_pools.inc
  55. 0 0
      packages/httpd20/src/apr/apr_portable.inc
  56. 0 0
      packages/httpd20/src/apr/apr_signal.inc
  57. 0 0
      packages/httpd20/src/apr/apr_strings.inc
  58. 0 0
      packages/httpd20/src/apr/apr_tables.inc
  59. 0 0
      packages/httpd20/src/apr/apr_thread_proc.inc
  60. 0 0
      packages/httpd20/src/apr/apr_time.inc
  61. 0 0
      packages/httpd20/src/apr/apr_user.inc
  62. 0 0
      packages/httpd20/src/apr/apr_version.inc
  63. 0 0
      packages/httpd20/src/apriconv/api_version.inc
  64. 0 0
      packages/httpd20/src/apriconv/apr_iconv.inc
  65. 0 0
      packages/httpd20/src/apriconv/apriconv.pas
  66. 0 0
      packages/httpd20/src/aprutil/apr_md5.inc
  67. 0 0
      packages/httpd20/src/aprutil/apr_uri.inc
  68. 0 0
      packages/httpd20/src/aprutil/apr_xlate.inc
  69. 0 0
      packages/httpd20/src/aprutil/apr_xml.inc
  70. 0 0
      packages/httpd20/src/aprutil/aprutil.pas
  71. 0 0
      packages/httpd20/src/http_config.inc
  72. 0 0
      packages/httpd20/src/http_connection.inc
  73. 0 0
      packages/httpd20/src/http_core.inc
  74. 0 0
      packages/httpd20/src/http_log.inc
  75. 0 0
      packages/httpd20/src/http_main.inc
  76. 0 0
      packages/httpd20/src/http_protocol.inc
  77. 0 0
      packages/httpd20/src/http_request.inc
  78. 0 0
      packages/httpd20/src/http_vhost.inc
  79. 0 0
      packages/httpd20/src/httpd.inc
  80. 0 0
      packages/httpd20/src/httpd.pas
  81. 0 0
      packages/httpd20/src/pcreposix.inc
  82. 0 0
      packages/httpd20/src/util_cfgtree.inc
  83. 0 0
      packages/httpd20/src/util_filter.inc
  84. 0 0
      packages/httpd20/src/util_md5.inc
  85. 0 0
      packages/httpd20/src/util_script.inc
  86. 0 0
      packages/httpd20/src/util_time.inc
  87. 759 60
      packages/httpd22/Makefile
  88. 27 0
      packages/httpd22/Makefile.fpc
  89. 317 150
      packages/httpd22/examples/Makefile
  90. 19 0
      packages/httpd22/examples/Makefile.fpc
  91. 42 0
      packages/httpd22/examples/define.inc
  92. 66 0
      packages/httpd22/examples/minimain.pas
  93. 1343 0
      packages/httpd22/examples/mod_example.pp
  94. 143 0
      packages/httpd22/examples/mod_hello.pp
  95. 654 0
      packages/httpd22/examples/mod_spelling.pp
  96. 42 0
      packages/httpd22/examples/testmodule.pp
  97. 94 0
      packages/httpd22/fpmake.pp
  98. 0 0
      packages/httpd22/src/ap_config.inc
  99. 0 0
      packages/httpd22/src/ap_mmn.inc
  100. 0 0
      packages/httpd22/src/ap_mpm.inc

+ 143 - 134
.gitattributes

@@ -870,140 +870,6 @@ packages/aspell/src/aspell.pp svneol=native#text/plain
 packages/aspell/src/scheck.pp svneol=native#text/plain
 packages/aspell/src/scheck.pp svneol=native#text/plain
 packages/base/Makefile svneol=native#text/plain
 packages/base/Makefile svneol=native#text/plain
 packages/base/Makefile.fpc svneol=native#text/plain
 packages/base/Makefile.fpc svneol=native#text/plain
-packages/base/httpd/Makefile svneol=native#text/plain
-packages/base/httpd/Makefile.fpc svneol=native#text/plain
-packages/base/httpd/examples/Makefile svneol=native#text/plain
-packages/base/httpd/examples/Makefile.fpc svneol=native#text/plain
-packages/base/httpd/examples/define.inc svneol=native#text/plain
-packages/base/httpd/examples/minimain.pas svneol=native#text/plain
-packages/base/httpd/examples/mod_example.pp svneol=native#text/plain
-packages/base/httpd/examples/mod_hello.pp svneol=native#text/plain
-packages/base/httpd/examples/mod_spelling.pp svneol=native#text/plain
-packages/base/httpd/examples/testmodule.pp svneol=native#text/plain
-packages/base/httpd/httpd-1.3/Makefile svneol=native#text/plain
-packages/base/httpd/httpd-1.3/Makefile.fpc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/ap.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/ap_alloc.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/ap_config.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/ap_mmn.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/buff.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/hsregex.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/http_config.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/http_core.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/http_log.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/http_main.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/http_protocol.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/http_request.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/http_vhost.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/httpd.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/httpd.pas svneol=native#text/plain
-packages/base/httpd/httpd-1.3/readdir.inc -text
-packages/base/httpd/httpd-1.3/util_uri.inc svneol=native#text/plain
-packages/base/httpd/httpd-1.3/win32_os.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/Makefile svneol=native#text/plain
-packages/base/httpd/httpd-2.0/Makefile.fpc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/ap_config.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/ap_mmn.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/ap_mpm.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/ap_provider.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/ap_release.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_allocator.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_buckets.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_dso.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_errno.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_file_info.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_file_io.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_general.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_hash.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_lib.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_network_io.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_poll.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_pools.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_portable.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_signal.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_strings.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_tables.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_thread_proc.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_time.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_user.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apr/apr_version.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apriconv/api_version.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apriconv/apr_iconv.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/apriconv/apriconv.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.0/aprutil/apr_md5.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/aprutil/apr_uri.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/aprutil/apr_xlate.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/aprutil/apr_xml.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/aprutil/aprutil.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_config.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_connection.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_core.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_log.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_main.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_protocol.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_request.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/http_vhost.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/httpd.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/httpd.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.0/pcreposix.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/util_cfgtree.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/util_filter.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/util_md5.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/util_script.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.0/util_time.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/Makefile svneol=native#text/plain
-packages/base/httpd/httpd-2.2/Makefile.fpc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/ap_config.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/ap_mmn.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/ap_mpm.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/ap_provider.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/ap_regex.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/ap_release.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_allocator.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_buckets.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_dso.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_errno.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_file_info.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_file_io.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_general.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_hash.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_lib.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_network_io.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_poll.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_pools.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_portable.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_signal.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_strings.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_tables.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_thread_proc.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_time.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_user.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apr/apr_version.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apriconv/api_version.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apriconv/apr_iconv.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/apriconv/apriconv.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.2/aprutil/apr_md5.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/aprutil/apr_uri.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/aprutil/apr_xlate.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/aprutil/apr_xml.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/aprutil/aprutil.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_config.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_connection.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_core.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_log.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_main.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_protocol.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_request.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/http_vhost.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/httpd.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/httpd.pas svneol=native#text/plain
-packages/base/httpd/httpd-2.2/util_cfgtree.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/util_filter.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/util_md5.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/util_script.inc svneol=native#text/plain
-packages/base/httpd/httpd-2.2/util_time.inc svneol=native#text/plain
 packages/base/mysql/ver322/mysql.pp svneol=native#text/plain
 packages/base/mysql/ver322/mysql.pp svneol=native#text/plain
 packages/base/mysql/ver322/mysql_com.pp svneol=native#text/plain
 packages/base/mysql/ver322/mysql_com.pp svneol=native#text/plain
 packages/base/mysql/ver322/mysql_version.pp svneol=native#text/plain
 packages/base/mysql/ver322/mysql_version.pp svneol=native#text/plain
@@ -2565,6 +2431,149 @@ packages/hermes/src/p_i8.inc svneol=native#text/plain
 packages/hermes/src/p_muhmu.inc svneol=native#text/plain
 packages/hermes/src/p_muhmu.inc svneol=native#text/plain
 packages/hermes/src/palette.inc svneol=native#text/plain
 packages/hermes/src/palette.inc svneol=native#text/plain
 packages/hermes/src/utility.inc svneol=native#text/plain
 packages/hermes/src/utility.inc svneol=native#text/plain
+packages/httpd13/Makefile svneol=native#text/plain
+packages/httpd13/Makefile.fpc svneol=native#text/plain
+packages/httpd13/fpmake.pp svneol=native#text/plain
+packages/httpd13/src/ap.inc svneol=native#text/plain
+packages/httpd13/src/ap_alloc.inc svneol=native#text/plain
+packages/httpd13/src/ap_config.inc svneol=native#text/plain
+packages/httpd13/src/ap_mmn.inc svneol=native#text/plain
+packages/httpd13/src/buff.inc svneol=native#text/plain
+packages/httpd13/src/hsregex.inc svneol=native#text/plain
+packages/httpd13/src/http_config.inc svneol=native#text/plain
+packages/httpd13/src/http_core.inc svneol=native#text/plain
+packages/httpd13/src/http_log.inc svneol=native#text/plain
+packages/httpd13/src/http_main.inc svneol=native#text/plain
+packages/httpd13/src/http_protocol.inc svneol=native#text/plain
+packages/httpd13/src/http_request.inc svneol=native#text/plain
+packages/httpd13/src/http_vhost.inc svneol=native#text/plain
+packages/httpd13/src/httpd.inc svneol=native#text/plain
+packages/httpd13/src/httpd.pas svneol=native#text/plain
+packages/httpd13/src/readdir.inc svneol=native#text/plain
+packages/httpd13/src/util_uri.inc svneol=native#text/plain
+packages/httpd13/src/win32_os.inc svneol=native#text/plain
+packages/httpd20/Makefile svneol=native#text/plain
+packages/httpd20/Makefile.fpc svneol=native#text/plain
+packages/httpd20/examples/Makefile svneol=native#text/plain
+packages/httpd20/examples/Makefile.fpc svneol=native#text/plain
+packages/httpd20/examples/define.inc svneol=native#text/plain
+packages/httpd20/examples/minimain.pas svneol=native#text/plain
+packages/httpd20/examples/mod_example.pp svneol=native#text/plain
+packages/httpd20/examples/mod_hello.pp svneol=native#text/plain
+packages/httpd20/examples/mod_spelling.pp svneol=native#text/plain
+packages/httpd20/examples/testmodule.pp svneol=native#text/plain
+packages/httpd20/fpmake.pp svneol=native#text/plain
+packages/httpd20/src/ap_config.inc svneol=native#text/plain
+packages/httpd20/src/ap_mmn.inc svneol=native#text/plain
+packages/httpd20/src/ap_mpm.inc svneol=native#text/plain
+packages/httpd20/src/ap_provider.inc svneol=native#text/plain
+packages/httpd20/src/ap_release.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr.pas svneol=native#text/plain
+packages/httpd20/src/apr/apr_allocator.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_buckets.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_dso.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_errno.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_file_info.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_file_io.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_general.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_hash.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_lib.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_network_io.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_poll.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_pools.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_portable.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_signal.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_strings.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_tables.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_thread_proc.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_time.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_user.inc svneol=native#text/plain
+packages/httpd20/src/apr/apr_version.inc svneol=native#text/plain
+packages/httpd20/src/apriconv/api_version.inc svneol=native#text/plain
+packages/httpd20/src/apriconv/apr_iconv.inc svneol=native#text/plain
+packages/httpd20/src/apriconv/apriconv.pas svneol=native#text/plain
+packages/httpd20/src/aprutil/apr_md5.inc svneol=native#text/plain
+packages/httpd20/src/aprutil/apr_uri.inc svneol=native#text/plain
+packages/httpd20/src/aprutil/apr_xlate.inc svneol=native#text/plain
+packages/httpd20/src/aprutil/apr_xml.inc svneol=native#text/plain
+packages/httpd20/src/aprutil/aprutil.pas svneol=native#text/plain
+packages/httpd20/src/http_config.inc svneol=native#text/plain
+packages/httpd20/src/http_connection.inc svneol=native#text/plain
+packages/httpd20/src/http_core.inc svneol=native#text/plain
+packages/httpd20/src/http_log.inc svneol=native#text/plain
+packages/httpd20/src/http_main.inc svneol=native#text/plain
+packages/httpd20/src/http_protocol.inc svneol=native#text/plain
+packages/httpd20/src/http_request.inc svneol=native#text/plain
+packages/httpd20/src/http_vhost.inc svneol=native#text/plain
+packages/httpd20/src/httpd.inc svneol=native#text/plain
+packages/httpd20/src/httpd.pas svneol=native#text/plain
+packages/httpd20/src/pcreposix.inc svneol=native#text/plain
+packages/httpd20/src/util_cfgtree.inc svneol=native#text/plain
+packages/httpd20/src/util_filter.inc svneol=native#text/plain
+packages/httpd20/src/util_md5.inc svneol=native#text/plain
+packages/httpd20/src/util_script.inc svneol=native#text/plain
+packages/httpd20/src/util_time.inc svneol=native#text/plain
+packages/httpd22/Makefile svneol=native#text/plain
+packages/httpd22/Makefile.fpc svneol=native#text/plain
+packages/httpd22/examples/Makefile svneol=native#text/plain
+packages/httpd22/examples/Makefile.fpc svneol=native#text/plain
+packages/httpd22/examples/define.inc svneol=native#text/plain
+packages/httpd22/examples/minimain.pas svneol=native#text/plain
+packages/httpd22/examples/mod_example.pp svneol=native#text/plain
+packages/httpd22/examples/mod_hello.pp svneol=native#text/plain
+packages/httpd22/examples/mod_spelling.pp svneol=native#text/plain
+packages/httpd22/examples/testmodule.pp svneol=native#text/plain
+packages/httpd22/fpmake.pp svneol=native#text/plain
+packages/httpd22/src/ap_config.inc svneol=native#text/plain
+packages/httpd22/src/ap_mmn.inc svneol=native#text/plain
+packages/httpd22/src/ap_mpm.inc svneol=native#text/plain
+packages/httpd22/src/ap_provider.inc svneol=native#text/plain
+packages/httpd22/src/ap_regex.inc svneol=native#text/plain
+packages/httpd22/src/ap_release.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr.pas svneol=native#text/plain
+packages/httpd22/src/apr/apr_allocator.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_buckets.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_dso.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_errno.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_file_info.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_file_io.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_general.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_hash.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_lib.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_network_io.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_poll.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_pools.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_portable.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_signal.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_strings.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_tables.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_thread_proc.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_time.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_user.inc svneol=native#text/plain
+packages/httpd22/src/apr/apr_version.inc svneol=native#text/plain
+packages/httpd22/src/apriconv/api_version.inc svneol=native#text/plain
+packages/httpd22/src/apriconv/apr_iconv.inc svneol=native#text/plain
+packages/httpd22/src/apriconv/apriconv.pas svneol=native#text/plain
+packages/httpd22/src/aprutil/apr_md5.inc svneol=native#text/plain
+packages/httpd22/src/aprutil/apr_uri.inc svneol=native#text/plain
+packages/httpd22/src/aprutil/apr_xlate.inc svneol=native#text/plain
+packages/httpd22/src/aprutil/apr_xml.inc svneol=native#text/plain
+packages/httpd22/src/aprutil/aprutil.pas svneol=native#text/plain
+packages/httpd22/src/http_config.inc svneol=native#text/plain
+packages/httpd22/src/http_connection.inc svneol=native#text/plain
+packages/httpd22/src/http_core.inc svneol=native#text/plain
+packages/httpd22/src/http_log.inc svneol=native#text/plain
+packages/httpd22/src/http_main.inc svneol=native#text/plain
+packages/httpd22/src/http_protocol.inc svneol=native#text/plain
+packages/httpd22/src/http_request.inc svneol=native#text/plain
+packages/httpd22/src/http_vhost.inc svneol=native#text/plain
+packages/httpd22/src/httpd.inc svneol=native#text/plain
+packages/httpd22/src/httpd.pas svneol=native#text/plain
+packages/httpd22/src/util_cfgtree.inc svneol=native#text/plain
+packages/httpd22/src/util_filter.inc svneol=native#text/plain
+packages/httpd22/src/util_md5.inc svneol=native#text/plain
+packages/httpd22/src/util_script.inc svneol=native#text/plain
+packages/httpd22/src/util_time.inc svneol=native#text/plain
 packages/ibase/Makefile svneol=native#text/plain
 packages/ibase/Makefile svneol=native#text/plain
 packages/ibase/Makefile.fpc svneol=native#text/plain
 packages/ibase/Makefile.fpc svneol=native#text/plain
 packages/ibase/README svneol=native#text/plain
 packages/ibase/README svneol=native#text/plain

+ 0 - 14
packages/base/httpd/Makefile.fpc

@@ -1,14 +0,0 @@
-#
-#   Makefile.fpc for Free Pascal Packages
-#
-
-[target]
-dirs=httpd-1.3 httpd-2.0 httpd-2.2
-exampledirs=examples
-
-[install]
-fpcpackage=y
-fpcsubdir=packages/base/httpd
-
-[default]
-fpcdir=../../..

+ 0 - 22
packages/base/httpd/httpd-2.0/Makefile.fpc

@@ -1,22 +0,0 @@
-#
-#  Makefile.fpc for httpd 1.3 unit
-#
-
-[package]
-name=httpd-2.0
-version=2.0.4
-
-[target]
-units=apr/apr apriconv/apriconv aprutil/aprutil httpd
-
-[require]
-libc=y
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=../../../..
-
-[rules]
-.NOTPARALLEL:

+ 0 - 22
packages/base/httpd/httpd-2.2/Makefile.fpc

@@ -1,22 +0,0 @@
-#
-#  Makefile.fpc for httpd 2.2 unit
-#
-
-[package]
-name=httpd-2.2
-version=2.0.4
-
-[target]
-units=apr/apr apriconv/apriconv aprutil/aprutil httpd
-
-[require]
-libc=y
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=../../../..
-
-[rules]
-.NOTPARALLEL:

+ 323 - 5
packages/base/httpd/httpd-1.3/Makefile → packages/httpd13/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/26]
 #
 #
 default: all
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -98,7 +98,7 @@ endif
 endif
 endif
 export ECHO
 export ECHO
 endif
 endif
-override DEFAULT_FPCDIR=../../../..
+override DEFAULT_FPCDIR=../..
 ifndef FPC
 ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
@@ -240,8 +240,8 @@ ifeq ($(UNITSDIR),)
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
-override PACKAGE_NAME=httpd-1.3
-override PACKAGE_VERSION=2.0.4
+override PACKAGE_NAME=httpd13
+override PACKAGE_VERSION=2.2.0
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_UNITS+=httpd
 override TARGET_UNITS+=httpd
 endif
 endif
@@ -402,6 +402,324 @@ ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_UNITS+=httpd
 override TARGET_UNITS+=httpd
 endif
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=src tests
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_SOURCEDIR+=src tests
+endif
 ifdef REQUIRE_UNITSDIR
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
 endif
@@ -1526,7 +1844,7 @@ endif
 endif
 endif
 endif
 endif
 .PHONY: fpc_units
 .PHONY: fpc_units
-ifneq ($(TARGET_UNITS),)
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
 override ALLTARGET+=fpc_units
 override ALLTARGET+=fpc_units
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))

+ 7 - 3
packages/base/httpd/httpd-1.3/Makefile.fpc → packages/httpd13/Makefile.fpc

@@ -3,8 +3,8 @@
 #
 #
 
 
 [package]
 [package]
-name=httpd-1.3
-version=2.0.4
+name=httpd13
+version=2.2.0
 
 
 [target]
 [target]
 units=httpd
 units=httpd
@@ -15,8 +15,12 @@ libc=y
 [install]
 [install]
 fpcpackage=y
 fpcpackage=y
 
 
+[compiler]
+includedir=src
+sourcedir=src tests
+
 [default]
 [default]
-fpcdir=../../../..
+fpcdir=../..
 
 
 [rules]
 [rules]
 .NOTPARALLEL:
 .NOTPARALLEL:

+ 48 - 0
packages/httpd13/fpmake.pp

@@ -0,0 +1,48 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+  P : TPackage;
+  T : TTarget;
+begin
+  With Installer do
+    begin
+{$endif ALLPACKAGES}
+
+    P:=AddPackage('httpd13');
+{$ifdef ALLPACKAGES}
+    P.Directory:='httpd13';
+{$endif ALLPACKAGES}
+    P.Version:='2.2.0';
+    P.SourcePath.Add('src');
+//    P.Dependencies.Add('x11');
+
+    T:=P.Targets.AddUnit('httpd.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('httpd.inc');
+          AddInclude('ap_config.inc');
+          AddInclude('ap_mmn.inc');
+          AddInclude('hsregex.inc');
+          AddInclude('ap_alloc.inc');
+          AddInclude('readdir.inc');
+          AddInclude('buff.inc');
+          AddInclude('ap.inc');
+          AddInclude('util_uri.inc');
+          AddInclude('http_config.inc');
+          AddInclude('http_core.inc');
+          AddInclude('http_log.inc');
+          AddInclude('http_main.inc');
+          AddInclude('http_protocol.inc');
+          AddInclude('http_request.inc');
+          AddInclude('http_vhost.inc');
+        end;
+
+{$ifndef ALLPACKAGES}
+    Run;
+    end;
+end.
+{$endif ALLPACKAGES}

+ 0 - 0
packages/base/httpd/httpd-1.3/ap.inc → packages/httpd13/src/ap.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/ap_alloc.inc → packages/httpd13/src/ap_alloc.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/ap_config.inc → packages/httpd13/src/ap_config.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/ap_mmn.inc → packages/httpd13/src/ap_mmn.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/buff.inc → packages/httpd13/src/buff.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/hsregex.inc → packages/httpd13/src/hsregex.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/http_config.inc → packages/httpd13/src/http_config.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/http_core.inc → packages/httpd13/src/http_core.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/http_log.inc → packages/httpd13/src/http_log.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/http_main.inc → packages/httpd13/src/http_main.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/http_protocol.inc → packages/httpd13/src/http_protocol.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/http_request.inc → packages/httpd13/src/http_request.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/http_vhost.inc → packages/httpd13/src/http_vhost.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/httpd.inc → packages/httpd13/src/httpd.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/httpd.pas → packages/httpd13/src/httpd.pas


+ 77 - 77
packages/base/httpd/httpd-1.3/readdir.inc → packages/httpd13/src/readdir.inc

@@ -1,77 +1,77 @@
-{ Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- }
-
-{
- * Structures and types used to implement opendir/readdir/closedir
- * on Windows 95/NT.
- }
-
-{$ifdef WINDOWS}
-
-{#include <io.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-
-#ifndef API_EXPORT
-# define API_EXPORT(type)    __declspec(dllexport) type __stdcall
-#endif}
-
-{ struct dirent - same as Unix }
-
-const
-  _MAX_FNAME = 256;
-  
-type
-  dirent = record
-    d_ino: clong;                         { inode (always 1 in WIN32) }
-    d_off: off_t;                         { offset to this dirent }
-    d_reclen: cushort;                    { length of d_name }
-    d_name: array[0.._MAX_FNAME] of Char;    { filename (null terminated) }
-  end;
-
-{ typedef DIR - not the same as Unix }
-  DIR = record
-    handle: clong;                 { _findfirst/_findnext handle }
-    offset: cshort;                { offset into directory }
-    finished: cshort;              { 1 if there are not more files }
-//    struct _finddata_t fileinfo; { from _findfirst/_findnext }
-    fileinfo: Pointer;             { from _findfirst/_findnext }
-    dir: PChar;                    { the dir we are reading }
-    dent: dirent;                  { the dirent to return }
-  end;
-
-  PDIR = ^DIR;
-  
-{ Function prototypes }
-{API_EXPORT(DIR *) opendir(const char *);
-API_EXPORT(struct dirent *) readdir(DIR *);
-API_EXPORT(int) closedir(DIR *);}
-
-  va_list = Pointer;
-
-{
- * Simplified declarations for other platforms
- }
-
-{$else}
-
-  PDIR = Pointer;
-
-  va_list = Pointer;
-
-{$endif} { WINDOWS }
-
+{ Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ }
+
+{
+ * Structures and types used to implement opendir/readdir/closedir
+ * on Windows 95/NT.
+ }
+
+{$ifdef WINDOWS}
+
+{#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+#ifndef API_EXPORT
+# define API_EXPORT(type)    __declspec(dllexport) type __stdcall
+#endif}
+
+{ struct dirent - same as Unix }
+
+const
+  _MAX_FNAME = 256;
+  
+type
+  dirent = record
+    d_ino: clong;                         { inode (always 1 in WIN32) }
+    d_off: off_t;                         { offset to this dirent }
+    d_reclen: cushort;                    { length of d_name }
+    d_name: array[0.._MAX_FNAME] of Char;    { filename (null terminated) }
+  end;
+
+{ typedef DIR - not the same as Unix }
+  DIR = record
+    handle: clong;                 { _findfirst/_findnext handle }
+    offset: cshort;                { offset into directory }
+    finished: cshort;              { 1 if there are not more files }
+//    struct _finddata_t fileinfo; { from _findfirst/_findnext }
+    fileinfo: Pointer;             { from _findfirst/_findnext }
+    dir: PChar;                    { the dir we are reading }
+    dent: dirent;                  { the dirent to return }
+  end;
+
+  PDIR = ^DIR;
+  
+{ Function prototypes }
+{API_EXPORT(DIR *) opendir(const char *);
+API_EXPORT(struct dirent *) readdir(DIR *);
+API_EXPORT(int) closedir(DIR *);}
+
+  va_list = Pointer;
+
+{
+ * Simplified declarations for other platforms
+ }
+
+{$else}
+
+  PDIR = Pointer;
+
+  va_list = Pointer;
+
+{$endif} { WINDOWS }
+

+ 0 - 0
packages/base/httpd/httpd-1.3/util_uri.inc → packages/httpd13/src/util_uri.inc


+ 0 - 0
packages/base/httpd/httpd-1.3/win32_os.inc → packages/httpd13/src/win32_os.inc


文件差異過大導致無法顯示
+ 837 - 56
packages/httpd20/Makefile


+ 27 - 0
packages/httpd20/Makefile.fpc

@@ -0,0 +1,27 @@
+#
+#  Makefile.fpc for httpd 2.0 unit
+#
+
+[package]
+name=httpd20
+version=2.2.0
+
+[target]
+units=apr apriconv aprutil httpd
+exampledirs=examples
+
+[require]
+libc=y
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../../
+
+[compiler]
+includedir=src src/apr src/apriconv src/aprutil
+sourcedir=src tests src/apr src/apriconv src/aprutil
+
+[rules]
+.NOTPARALLEL:

+ 3 - 3
packages/base/httpd/examples/Makefile → packages/httpd20/examples/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/26]
 #
 #
 default: all
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -98,7 +98,7 @@ endif
 endif
 endif
 export ECHO
 export ECHO
 endif
 endif
-override DEFAULT_FPCDIR=../../../..
+override DEFAULT_FPCDIR=../../..
 ifndef FPC
 ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
@@ -1762,7 +1762,7 @@ endif
 endif
 endif
 endif
 endif
 .PHONY: fpc_units
 .PHONY: fpc_units
-ifneq ($(TARGET_UNITS),)
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
 override ALLTARGET+=fpc_units
 override ALLTARGET+=fpc_units
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))

+ 2 - 2
packages/base/httpd/examples/Makefile.fpc → packages/httpd20/examples/Makefile.fpc

@@ -1,5 +1,5 @@
 #
 #
-#  Makefile.fpc for dbus units example
+#  Makefile.fpc for apache2.0 units example
 #
 #
 
 
 [target]
 [target]
@@ -13,7 +13,7 @@ packages=httpd/httpd-2.2
 fpcpackage=y
 fpcpackage=y
 
 
 [default]
 [default]
-fpcdir=../../../..
+fpcdir=../../..
 
 
 [rules]
 [rules]
 .NOTPARALLEL:
 .NOTPARALLEL:

+ 0 - 0
packages/base/httpd/examples/define.inc → packages/httpd20/examples/define.inc


+ 0 - 0
packages/base/httpd/examples/minimain.pas → packages/httpd20/examples/minimain.pas


+ 0 - 0
packages/base/httpd/examples/mod_example.pp → packages/httpd20/examples/mod_example.pp


+ 0 - 0
packages/base/httpd/examples/mod_hello.pp → packages/httpd20/examples/mod_hello.pp


+ 0 - 0
packages/base/httpd/examples/mod_spelling.pp → packages/httpd20/examples/mod_spelling.pp


+ 0 - 0
packages/base/httpd/examples/testmodule.pp → packages/httpd20/examples/testmodule.pp


+ 94 - 0
packages/httpd20/fpmake.pp

@@ -0,0 +1,94 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+  P : TPackage;
+  T : TTarget;
+begin
+  With Installer do
+    begin
+{$endif ALLPACKAGES}
+
+    P:=AddPackage('httpd20');
+{$ifdef ALLPACKAGES}
+    P.Directory:='httpd20';
+{$endif ALLPACKAGES}
+    P.Version:='2.2.0';
+    P.SourcePath.Add('src');
+//    P.Dependencies.Add('x11');
+
+    T:=P.Targets.AddUnit('apriconv.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('apr_iconv.inc');
+          AddInclude('api_version.inc');
+          AddUnit('apr');
+        end;
+    T:=P.Targets.AddUnit('apr.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('apr_errno.inc');
+          AddInclude('apr_pools.inc');
+          AddInclude('apr_allocator.inc');
+          AddInclude('apr_general.inc');
+          AddInclude('apr_dso.inc');
+          AddInclude('apr_user.inc');
+          AddInclude('apr_time.inc');
+          AddInclude('apr_tables.inc');
+          AddInclude('apr_file_info.inc');
+          AddInclude('apr_file_io.inc');
+          AddInclude('apr_strings.inc');
+          AddInclude('apr_lib.inc');
+          AddInclude('apr_signal.inc');
+          AddInclude('apr_network_io.inc');
+          AddInclude('apr_thread_proc.inc');
+          AddInclude('apr_version.inc');
+          AddInclude('apr_poll.inc');
+        end;
+    T:=P.Targets.AddUnit('aprutil.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('apr_xml.inc');
+          AddInclude('apr_uri.inc');
+          AddInclude('apr_md5.inc');
+          AddInclude('apr_xlate.inc');
+          AddUnit('apr');
+        end;
+    T:=P.Targets.AddUnit('httpd.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('ap_provider.inc');
+          AddInclude('util_cfgtree.inc');
+          AddInclude('httpd.inc');
+          AddInclude('ap_config.inc');
+          AddInclude('ap_mmn.inc');
+          AddInclude('ap_release.inc');
+          AddInclude('apr_buckets.inc');
+          AddInclude('pcreposix.inc');
+          AddInclude('http_config.inc');
+          AddInclude('http_core.inc');
+          AddInclude('apr_hash.inc');
+          AddInclude('util_filter.inc');
+          AddInclude('http_log.inc');
+          AddInclude('http_main.inc');
+          AddInclude('http_protocol.inc');
+          AddInclude('http_request.inc');
+          AddInclude('http_connection.inc');
+          AddInclude('http_vhost.inc');
+          AddInclude('util_script.inc');
+          AddInclude('util_time.inc');
+          AddInclude('util_md5.inc');
+          AddInclude('ap_mpm.inc');
+          AddUnit('apr');
+          AddUnit('aprutil');
+        end;
+
+
+{$ifndef ALLPACKAGES}
+    Run;
+    end;
+end.
+{$endif ALLPACKAGES}

+ 0 - 0
packages/base/httpd/httpd-2.0/ap_config.inc → packages/httpd20/src/ap_config.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/ap_mmn.inc → packages/httpd20/src/ap_mmn.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/ap_mpm.inc → packages/httpd20/src/ap_mpm.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/ap_provider.inc → packages/httpd20/src/ap_provider.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/ap_release.inc → packages/httpd20/src/ap_release.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr.pas → packages/httpd20/src/apr/apr.pas


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_allocator.inc → packages/httpd20/src/apr/apr_allocator.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_buckets.inc → packages/httpd20/src/apr/apr_buckets.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_dso.inc → packages/httpd20/src/apr/apr_dso.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_errno.inc → packages/httpd20/src/apr/apr_errno.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_file_info.inc → packages/httpd20/src/apr/apr_file_info.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_file_io.inc → packages/httpd20/src/apr/apr_file_io.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_general.inc → packages/httpd20/src/apr/apr_general.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_hash.inc → packages/httpd20/src/apr/apr_hash.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_lib.inc → packages/httpd20/src/apr/apr_lib.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_network_io.inc → packages/httpd20/src/apr/apr_network_io.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_poll.inc → packages/httpd20/src/apr/apr_poll.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_pools.inc → packages/httpd20/src/apr/apr_pools.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_portable.inc → packages/httpd20/src/apr/apr_portable.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_signal.inc → packages/httpd20/src/apr/apr_signal.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_strings.inc → packages/httpd20/src/apr/apr_strings.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_tables.inc → packages/httpd20/src/apr/apr_tables.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_thread_proc.inc → packages/httpd20/src/apr/apr_thread_proc.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_time.inc → packages/httpd20/src/apr/apr_time.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_user.inc → packages/httpd20/src/apr/apr_user.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apr/apr_version.inc → packages/httpd20/src/apr/apr_version.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apriconv/api_version.inc → packages/httpd20/src/apriconv/api_version.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apriconv/apr_iconv.inc → packages/httpd20/src/apriconv/apr_iconv.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/apriconv/apriconv.pas → packages/httpd20/src/apriconv/apriconv.pas


+ 0 - 0
packages/base/httpd/httpd-2.0/aprutil/apr_md5.inc → packages/httpd20/src/aprutil/apr_md5.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/aprutil/apr_uri.inc → packages/httpd20/src/aprutil/apr_uri.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/aprutil/apr_xlate.inc → packages/httpd20/src/aprutil/apr_xlate.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/aprutil/apr_xml.inc → packages/httpd20/src/aprutil/apr_xml.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/aprutil/aprutil.pas → packages/httpd20/src/aprutil/aprutil.pas


+ 0 - 0
packages/base/httpd/httpd-2.0/http_config.inc → packages/httpd20/src/http_config.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/http_connection.inc → packages/httpd20/src/http_connection.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/http_core.inc → packages/httpd20/src/http_core.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/http_log.inc → packages/httpd20/src/http_log.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/http_main.inc → packages/httpd20/src/http_main.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/http_protocol.inc → packages/httpd20/src/http_protocol.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/http_request.inc → packages/httpd20/src/http_request.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/http_vhost.inc → packages/httpd20/src/http_vhost.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/httpd.inc → packages/httpd20/src/httpd.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/httpd.pas → packages/httpd20/src/httpd.pas


+ 0 - 0
packages/base/httpd/httpd-2.0/pcreposix.inc → packages/httpd20/src/pcreposix.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/util_cfgtree.inc → packages/httpd20/src/util_cfgtree.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/util_filter.inc → packages/httpd20/src/util_filter.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/util_md5.inc → packages/httpd20/src/util_md5.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/util_script.inc → packages/httpd20/src/util_script.inc


+ 0 - 0
packages/base/httpd/httpd-2.0/util_time.inc → packages/httpd20/src/util_time.inc


+ 759 - 60
packages/base/httpd/httpd-2.0/Makefile → packages/httpd22/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/26]
 #
 #
 default: all
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -98,7 +98,7 @@ endif
 endif
 endif
 export ECHO
 export ECHO
 endif
 endif
-override DEFAULT_FPCDIR=../../../..
+override DEFAULT_FPCDIR=../../
 ifndef FPC
 ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
@@ -240,168 +240,645 @@ ifeq ($(UNITSDIR),)
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
-override PACKAGE_NAME=httpd-2.0
-override PACKAGE_VERSION=2.0.4
+override PACKAGE_NAME=httpd22
+override PACKAGE_VERSION=2.2.0
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),arm-nds)
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_UNITS+=apr apriconv aprutil httpd
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_EXAMPLEDIRS+=examples
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_EXAMPLEDIRS+=examples
 endif
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_INCLUDEDIR+=src src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_SOURCEDIR+=src tests src/apr src/apriconv src/aprutil
+endif
 ifdef REQUIRE_UNITSDIR
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
 endif
@@ -1526,7 +2003,7 @@ endif
 endif
 endif
 endif
 endif
 .PHONY: fpc_units
 .PHONY: fpc_units
-ifneq ($(TARGET_UNITS),)
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
 override ALLTARGET+=fpc_units
 override ALLTARGET+=fpc_units
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
@@ -1538,6 +2015,24 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
+.PHONY: fpc_examples
+ifneq ($(TARGET_EXAMPLES),)
+HASEXAMPLES=1
+override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)) $(addsuffix .lpr,$(TARGET_EXAMPLES)) $(addsuffix .dpr,$(TARGET_EXAMPLES)))
+override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))
+override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
+override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
+ifeq ($(OS_TARGET),os2)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
+endif
+ifeq ($(OS_TARGET),emx)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
+endif
+endif
+ifneq ($(TARGET_EXAMPLEDIRS),)
+HASEXAMPLES=1
+endif
+fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
 .PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
 .PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
 $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
 $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
@@ -1941,12 +2436,216 @@ endif
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
+ifeq ($(FULL_TARGET),i386-linux)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
+ifdef TARGET_EXAMPLEDIRS_EXAMPLES
+examples_all:
+	$(MAKE) -C examples all
+examples_debug:
+	$(MAKE) -C examples debug
+examples_smart:
+	$(MAKE) -C examples smart
+examples_release:
+	$(MAKE) -C examples release
+examples_units:
+	$(MAKE) -C examples units
+examples_examples:
+	$(MAKE) -C examples examples
+examples_shared:
+	$(MAKE) -C examples shared
+examples_install:
+	$(MAKE) -C examples install
+examples_sourceinstall:
+	$(MAKE) -C examples sourceinstall
+examples_exampleinstall:
+	$(MAKE) -C examples exampleinstall
+examples_distinstall:
+	$(MAKE) -C examples distinstall
+examples_zipinstall:
+	$(MAKE) -C examples zipinstall
+examples_zipsourceinstall:
+	$(MAKE) -C examples zipsourceinstall
+examples_zipexampleinstall:
+	$(MAKE) -C examples zipexampleinstall
+examples_zipdistinstall:
+	$(MAKE) -C examples zipdistinstall
+examples_clean:
+	$(MAKE) -C examples clean
+examples_distclean:
+	$(MAKE) -C examples distclean
+examples_cleanall:
+	$(MAKE) -C examples cleanall
+examples_info:
+	$(MAKE) -C examples info
+examples_makefiles:
+	$(MAKE) -C examples makefiles
+examples:
+	$(MAKE) -C examples all
+.PHONY: examples_all examples_debug examples_smart examples_release examples_units examples_examples examples_shared examples_install examples_sourceinstall examples_exampleinstall examples_distinstall examples_zipinstall examples_zipsourceinstall examples_zipexampleinstall examples_zipdistinstall examples_clean examples_distclean examples_cleanall examples_info examples_makefiles examples
+endif
 all: fpc_all
 all: fpc_all
 debug: fpc_debug
 debug: fpc_debug
 smart: fpc_smart
 smart: fpc_smart
 release: fpc_release
 release: fpc_release
 units: fpc_units
 units: fpc_units
-examples:
+examples: fpc_examples
 shared: fpc_shared
 shared: fpc_shared
 install: fpc_install
 install: fpc_install
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
@@ -1956,7 +2655,7 @@ zipinstall: fpc_zipinstall
 zipsourceinstall: fpc_zipsourceinstall
 zipsourceinstall: fpc_zipsourceinstall
 zipexampleinstall: fpc_zipexampleinstall
 zipexampleinstall: fpc_zipexampleinstall
 zipdistinstall: fpc_zipdistinstall
 zipdistinstall: fpc_zipdistinstall
-clean: fpc_clean
+clean: fpc_clean $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall
 info: fpc_info
 info: fpc_info

+ 27 - 0
packages/httpd22/Makefile.fpc

@@ -0,0 +1,27 @@
+#
+#  Makefile.fpc for httpd 2.2 unit
+#
+
+[package]
+name=httpd22
+version=2.2.0
+
+[target]
+units=apr apriconv aprutil httpd
+exampledirs=examples
+
+[require]
+libc=y
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../../
+
+[compiler]
+includedir=src src/apr src/apriconv src/aprutil
+sourcedir=src tests src/apr src/apriconv src/aprutil
+
+[rules]
+.NOTPARALLEL:

+ 317 - 150
packages/base/httpd/httpd-2.2/Makefile → packages/httpd22/examples/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/26]
 #
 #
 default: all
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -98,7 +98,7 @@ endif
 endif
 endif
 export ECHO
 export ECHO
 endif
 endif
-override DEFAULT_FPCDIR=../../../..
+override DEFAULT_FPCDIR=../../..
 ifndef FPC
 ifndef FPC
 ifdef PP
 ifdef PP
 FPC=$(PP)
 FPC=$(PP)
@@ -240,166 +240,323 @@ ifeq ($(UNITSDIR),)
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
-override PACKAGE_NAME=httpd-2.2
-override PACKAGE_VERSION=2.0.4
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),arm-nds)
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=apr/apr apriconv/apriconv aprutil/aprutil httpd
+override TARGET_PROGRAMS+=mod_example  mod_hello  mod_spelling  testmodule
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_UNITS+=minimain
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_UNITS+=minimain
 endif
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCPACKAGE=y
 ifdef REQUIRE_UNITSDIR
 ifdef REQUIRE_UNITSDIR
@@ -1180,165 +1337,218 @@ else
 TAROPT=vz
 TAROPT=vz
 TAREXT=.tar.gz
 TAREXT=.tar.gz
 endif
 endif
-override REQUIRE_PACKAGES=rtl 
+override REQUIRE_PACKAGES=rtl httpd/httpd-2.2
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 ifeq ($(FULL_TARGET),i386-go32v2)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 ifeq ($(FULL_TARGET),i386-win32)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 ifeq ($(FULL_TARGET),i386-os2)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 ifeq ($(FULL_TARGET),i386-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 ifeq ($(FULL_TARGET),i386-beos)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 ifeq ($(FULL_TARGET),i386-netbsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 ifeq ($(FULL_TARGET),i386-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 ifeq ($(FULL_TARGET),i386-qnx)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 ifeq ($(FULL_TARGET),i386-netware)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 ifeq ($(FULL_TARGET),i386-openbsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
 ifeq ($(FULL_TARGET),i386-darwin)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 ifeq ($(FULL_TARGET),i386-watcom)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 ifeq ($(FULL_TARGET),i386-netwlibc)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 ifeq ($(FULL_TARGET),i386-wince)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 ifeq ($(FULL_TARGET),m68k-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 ifeq ($(FULL_TARGET),m68k-netbsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 ifeq ($(FULL_TARGET),m68k-amiga)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 ifeq ($(FULL_TARGET),m68k-atari)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 ifeq ($(FULL_TARGET),m68k-openbsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 ifeq ($(FULL_TARGET),m68k-palmos)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
 ifeq ($(FULL_TARGET),m68k-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 ifeq ($(FULL_TARGET),powerpc-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 ifeq ($(FULL_TARGET),powerpc-amiga)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 ifeq ($(FULL_TARGET),powerpc-macos)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 ifeq ($(FULL_TARGET),powerpc-darwin)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 ifeq ($(FULL_TARGET),powerpc-morphos)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 ifeq ($(FULL_TARGET),powerpc-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 ifeq ($(FULL_TARGET),sparc-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 ifeq ($(FULL_TARGET),sparc-netbsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 ifeq ($(FULL_TARGET),sparc-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 ifeq ($(FULL_TARGET),sparc-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 ifeq ($(FULL_TARGET),x86_64-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 ifeq ($(FULL_TARGET),x86_64-darwin)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 ifeq ($(FULL_TARGET),x86_64-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 ifeq ($(FULL_TARGET),arm-palmos)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 ifeq ($(FULL_TARGET),arm-gba)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),arm-nds)
 ifeq ($(FULL_TARGET),arm-nds)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
 ifeq ($(FULL_TARGET),arm-symbian)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_HTTPD/HTTPD-2.2=1
 endif
 endif
 ifdef REQUIRE_PACKAGES_RTL
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
@@ -1366,6 +1576,32 @@ ifdef UNITDIR_RTL
 override COMPILER_UNITDIR+=$(UNITDIR_RTL)
 override COMPILER_UNITDIR+=$(UNITDIR_RTL)
 endif
 endif
 endif
 endif
+ifdef REQUIRE_PACKAGES_HTTPD/HTTPD-2.2
+PACKAGEDIR_HTTPD/HTTPD-2.2:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /httpd/httpd-2.2/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_HTTPD/HTTPD-2.2),)
+ifneq ($(wildcard $(PACKAGEDIR_HTTPD/HTTPD-2.2)/units/$(TARGETSUFFIX)),)
+UNITDIR_HTTPD/HTTPD-2.2=$(PACKAGEDIR_HTTPD/HTTPD-2.2)/units/$(TARGETSUFFIX)
+else
+UNITDIR_HTTPD/HTTPD-2.2=$(PACKAGEDIR_HTTPD/HTTPD-2.2)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_HTTPD/HTTPD-2.2)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_HTTPD/HTTPD-2.2) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_HTTPD/HTTPD-2.2)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_HTTPD/HTTPD-2.2=
+UNITDIR_HTTPD/HTTPD-2.2:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /httpd/httpd-2.2/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_HTTPD/HTTPD-2.2),)
+UNITDIR_HTTPD/HTTPD-2.2:=$(firstword $(UNITDIR_HTTPD/HTTPD-2.2))
+else
+UNITDIR_HTTPD/HTTPD-2.2=
+endif
+endif
+ifdef UNITDIR_HTTPD/HTTPD-2.2
+override COMPILER_UNITDIR+=$(UNITDIR_HTTPD/HTTPD-2.2)
+endif
+endif
 ifndef NOCPUDEF
 ifndef NOCPUDEF
 override FPCOPTDEF=$(CPU_TARGET)
 override FPCOPTDEF=$(CPU_TARGET)
 endif
 endif
@@ -1526,7 +1762,7 @@ endif
 endif
 endif
 endif
 endif
 .PHONY: fpc_units
 .PHONY: fpc_units
-ifneq ($(TARGET_UNITS),)
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
 override ALLTARGET+=fpc_units
 override ALLTARGET+=fpc_units
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
@@ -1534,6 +1770,23 @@ override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
 override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
 override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
 endif
 endif
 fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
 fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
+.PHONY: fpc_exes
+ifndef CROSSINSTALL
+ifneq ($(TARGET_PROGRAMS),)
+override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
+override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
+ifeq ($(OS_TARGET),os2)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+ifeq ($(OS_TARGET),emx)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+endif
+endif
+fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
 ifdef TARGET_RSTS
 ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
@@ -1682,92 +1935,6 @@ endif
 ifdef TARGET_EXAMPLEDIRS
 ifdef TARGET_EXAMPLEDIRS
 	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
 	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
 endif
 endif
-.PHONY: fpc_distinstall
-fpc_distinstall: install exampleinstall
-.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
-ifndef PACKDIR
-ifndef inUnix
-PACKDIR=$(BASEDIR)/../fpc-pack
-else
-PACKDIR=/tmp/fpc-pack
-endif
-endif
-ifndef ZIPNAME
-ifdef DIST_ZIPNAME
-ZIPNAME=$(DIST_ZIPNAME)
-else
-ZIPNAME=$(PACKAGE_NAME)
-endif
-endif
-ifndef FULLZIPNAME
-FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
-endif
-ifndef ZIPTARGET
-ifdef DIST_ZIPTARGET
-ZIPTARGET=DIST_ZIPTARGET
-else
-ZIPTARGET=install
-endif
-endif
-ifndef USEZIP
-ifdef inUnix
-USETAR=1
-endif
-endif
-ifndef inUnix
-USEZIPWRAPPER=1
-endif
-ifdef USEZIPWRAPPER
-ZIPPATHSEP=$(PATHSEP)
-ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
-else
-ZIPPATHSEP=/
-endif
-ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
-ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
-ifdef USETAR
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
-ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
-else
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
-ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
-endif
-fpc_zipinstall:
-	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
-	$(MKDIR) $(DIST_DESTDIR)
-	$(DEL) $(ZIPDESTFILE)
-ifdef USEZIPWRAPPER
-ifneq ($(ECHOREDIR),echo)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
-else
-	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
-	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
-	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
-endif
-ifdef inUnix
-	/bin/sh $(ZIPWRAPPER)
-else
-ifdef RUNBATCH
-	$(RUNBATCH) (ZIPWRAPPER)
-else
-	$(ZIPWRAPPER)
-endif
-endif
-	$(DEL) $(ZIPWRAPPER)
-else
-	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
-endif
-	$(DELTREE) $(PACKDIR)
-fpc_zipsourceinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
-fpc_zipexampleinstall:
-ifdef HASEXAMPLES
-	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
-endif
-fpc_zipdistinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
 .PHONY: fpc_clean fpc_cleanall fpc_distclean
 .PHONY: fpc_clean fpc_cleanall fpc_distclean
 ifdef EXEFILES
 ifdef EXEFILES
 override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
 override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
@@ -1951,11 +2118,11 @@ shared: fpc_shared
 install: fpc_install
 install: fpc_install
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall
 exampleinstall: fpc_exampleinstall
-distinstall: fpc_distinstall
-zipinstall: fpc_zipinstall
-zipsourceinstall: fpc_zipsourceinstall
-zipexampleinstall: fpc_zipexampleinstall
-zipdistinstall: fpc_zipdistinstall
+distinstall:
+zipinstall:
+zipsourceinstall:
+zipexampleinstall:
+zipdistinstall:
 clean: fpc_clean
 clean: fpc_clean
 distclean: fpc_distclean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 cleanall: fpc_cleanall

+ 19 - 0
packages/httpd22/examples/Makefile.fpc

@@ -0,0 +1,19 @@
+#
+#  Makefile.fpc for apache2.0 units example
+#
+
+[target]
+units=minimain
+programs=mod_example  mod_hello  mod_spelling  testmodule
+
+[require]
+packages=httpd/httpd-2.2
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../../..
+
+[rules]
+.NOTPARALLEL:

+ 42 - 0
packages/httpd22/examples/define.inc

@@ -0,0 +1,42 @@
+{ **********************************************************************
+  Define one of the following versions. Default 2.0 will be taken if none
+  is defined  
+  **********************************************************************}
+
+{ $define apache1_3}
+{ $define apache2_0}
+{ $define apache2_2}
+
+{ *********************************************************************
+  No need to edit below this line.
+  *********************************************************************}
+
+{ *********************************************************************
+  The mode must be objfpc on this unit because the unix code uses
+  some extensions introduced on Free Pascal
+  *********************************************************************}
+
+{$ifdef fpc}
+  {$mode objfpc}{$H+}
+{$endif}
+
+{$IFNDEF FPC}
+  {$DEFINE WINDOWS}
+{$ENDIF}
+
+{$IFDEF WIN32}
+  {$DEFINE WINDOWS}
+{$ENDIF}
+
+{ Set at least one define. Default to 2.0 for now}
+
+{$ifndef apache1_3}
+{$ifndef apache2_0}
+{$ifndef apache2_2}
+
+{ Default 2.0 }
+{$define apache2_0}
+
+{$endif}
+{$endif}
+{$endif}

+ 66 - 0
packages/httpd22/examples/minimain.pas

@@ -0,0 +1,66 @@
+unit minimain; 
+ 
+interface 
+
+{$mode delphi}{$H+}
+ 
+uses 
+  SysUtils, Classes, httpd, apr;
+
+procedure RegisterHooks(p: Papr_pool_t); cdecl; 
+ 
+implementation 
+ 
+function DefaultHandler(r: Prequest_rec): Integer; cdecl;
+var
+  RequestedHandler: string;
+begin 
+  RequestedHandler := r^.handler;
+
+  { We decline to handle a request if hello-handler is not the value of r->handler }
+  if not SameText(RequestedHandler, 'testapache-handler') then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { The following line just prints a message to the errorlog }
+  ap_log_error('me',1, APLOG_NOERRNO or APLOG_NOTICE, 0, r^.server,
+   'mod_hello: %s', ['Before content is output']);
+
+  { We set the content type before doing anything else }
+  ap_set_content_type(r, 'text/html');
+
+  { If the request is for a header only, and not a request for
+   the whole content, then return OK now. We don't have to do
+   anything else. }
+  if (r^.header_only <> 0) then
+  begin
+    Result := OK;
+    Exit;
+  end;
+
+  { Now we just print the contents of the document using the
+   ap_rputs and ap_rprintf functions. More information about
+   the use of these can be found in http_protocol.h }
+  ap_rputs('<HTML>' + LineEnding, r);
+  ap_rputs('<HEAD>' + LineEnding, r);
+  ap_rputs('<TITLE>Hello There</TITLE>' + LineEnding, r);
+  ap_rputs('</HEAD>' + LineEnding, r);
+  ap_rputs('<BODY BGCOLOR="#FFFFFF">' + LineEnding ,r);
+  ap_rputs('<H1>Hello world</H1>' + LineEnding, r);
+  ap_rputs('This is the first Apache Module working with the new binding from Free Pascal' + LineEnding, r);
+  ap_rprintf(r, '<br>A sample line generated by ap_rprintf<br>\n', []);
+  ap_rputs('</BODY></HTML>' + LineEnding, r);
+
+  { We can either return OK or DECLINED at this point. If we return
+         * OK, then no other modules will attempt to process this request }
+  Result := OK;
+end;
+ 
+procedure RegisterHooks(p: Papr_pool_t); cdecl; 
+begin 
+  ap_hook_handler(DefaultHandler,nil,nil,APR_HOOK_MIDDLE); 
+end; 
+ 
+end. 

+ 1343 - 0
packages/httpd22/examples/mod_example.pp

@@ -0,0 +1,1343 @@
+{ Copyright 1999-2005 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ }
+
+{
+ * Apache example module.  Provide demonstrations of how modules do things.
+ * It is not meant to be used in a production server.  Since it participates
+ * in all of the processing phases, it could conceivable interfere with
+ * the proper operation of other modules -- particularly the ones related
+ * to security.
+ *
+ * In the interest of brevity, all functions and structures internal to
+ * this module, but which may have counterparts in *real* modules, are
+ * prefixed with 'x_' instead of 'example_'.
+ }
+library mod_example;
+
+{$i define.inc}
+
+uses
+  Classes, SysUtils, httpd, apr, aprutil;
+
+var
+ example_module: module; {$ifdef Unix} public name 'example_module'; {$endif}
+ default_module_ptr: Pmodule;
+
+{$ifdef WINDOWS}
+exports
+ example_module name 'example_module';
+{$endif}
+
+const
+  MODULE_NAME = 'mod_example.so';
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ Data declarations.                                                       }
+{                                                                          }
+{ Here are the static cells and structure declarations private to our      }
+{ module.                                                                  }
+{                                                                          }
+{--------------------------------------------------------------------------}
+
+{
+ * Sample configuration record.  Used for both per-directory and per-server
+ * configuration data.
+ *
+ * It's perfectly reasonable to have two different structures for the two
+ * different environments.  The same command handlers will be called for
+ * both, though, so the handlers need to be able to tell them apart.  One
+ * possibility is for both structures to start with an int which is 0 for
+ * one and 1 for the other.
+ *
+ * Note that while the per-directory and per-server configuration records are
+ * available to most of the module handlers, they should be treated as
+ * READ-ONLY by all except the command and merge handlers.  Sometimes handlers
+ * are handed a record that applies to the current location by implication or
+ * inheritance, and modifying it will change the rules for other locations.
+ }
+const
+  CONFIG_MODE_SERVER = 1;
+  CONFIG_MODE_DIRECTORY = 2;
+  CONFIG_MODE_COMBO = 3;     { Shouldn't ever happen. }
+
+type
+  x_cfg = record
+    cmode: Integer;              { Environment to which record applies
+                                 * (directory, server, or combination).
+                                 }
+    local: Integer;                  { Boolean: "Example" directive declared
+                                 * here?
+                                 }
+    congenital: Integer;             { Boolean: did we inherit an "Example"? }
+    trace: PChar;                { Pointer to trace string. }
+    loc: PChar;                  { Location to which this record applies. }
+  end;
+
+  Px_cfg = ^x_cfg;
+
+{
+ * Let's set up a module-local static cell to point to the accreting callback
+ * trace.  As each API callback is made to us, we'll tack on the particulars
+ * to whatever we've already recorded.  To avoid massive memory bloat as
+ * directories are walked again and again, we record the routine/environment
+ * the first time (non-request context only), and ignore subsequent calls for
+ * the same routine/environment.
+ }
+var
+  trace: PChar = nil;
+  static_calls_made: Papr_table_t = nil;
+
+{
+ * To avoid leaking memory from pools other than the per-request one, we
+ * allocate a module-private pool, and then use a sub-pool of that which gets
+ * freed each time we modify the trace.  That way previous layers of trace
+ * data don't get lost.
+ }
+  x_pool: Papr_pool_t = nil;
+  x_subpool: Papr_pool_t = nil;
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ The following pseudo-prototype declarations illustrate the parameters    }
+{ passed to command handlers for the different types of directive          }
+{ syntax.  If an argument was specified in the directive definition        }
+{ (look for "command_rec" below), it's available to the command handler    }
+{ via the (void *) info field in the cmd_parms argument passed to the      }
+{ handler (cmd->info for the examples below).                              }
+{                                                                          }
+{--------------------------------------------------------------------------}
+
+{
+ * Command handler for a NO_ARGS directive.  Declared in the command_rec
+ * list with
+ *   AP_INIT_NO_ARGS("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_NO_ARGS(cmd_parms *cmd, void *mconfig);
+ }
+
+{
+ * Command handler for a RAW_ARGS directive.  The "args" argument is the text
+ * of the commandline following the directive itself.  Declared in the
+ * command_rec list with
+ *   AP_INIT_RAW_ARGS("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_RAW_ARGS(cmd_parms *cmd, void *mconfig,
+ *                                    const char *args);
+ }
+
+{
+ * Command handler for a FLAG directive.  The single parameter is passed in
+ * "bool", which is either zero or not for Off or On respectively.
+ * Declared in the command_rec list with
+ *   AP_INIT_FLAG("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_FLAG(cmd_parms *cmd, void *mconfig, int bool);
+ }
+
+{
+ * Command handler for a TAKE1 directive.  The single parameter is passed in
+ * "word1".  Declared in the command_rec list with
+ *   AP_INIT_TAKE1("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_TAKE1(cmd_parms *cmd, void *mconfig,
+ *                                 char *word1);
+ }
+
+{
+ * Command handler for a TAKE2 directive.  TAKE2 commands must always have
+ * exactly two arguments.  Declared in the command_rec list with
+ *   AP_INIT_TAKE2("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_TAKE2(cmd_parms *cmd, void *mconfig,
+ *                                 char *word1, char *word2);
+ }
+
+{
+ * Command handler for a TAKE3 directive.  Like TAKE2, these must have exactly
+ * three arguments, or the parser complains and doesn't bother calling us.
+ * Declared in the command_rec list with
+ *   AP_INIT_TAKE3("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_TAKE3(cmd_parms *cmd, void *mconfig,
+ *                                 char *word1, char *word2, char *word3);
+ }
+
+{
+ * Command handler for a TAKE12 directive.  These can take either one or two
+ * arguments.
+ * - word2 is a NULL pointer if no second argument was specified.
+ * Declared in the command_rec list with
+ *   AP_INIT_TAKE12("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_TAKE12(cmd_parms *cmd, void *mconfig,
+ *                                  char *word1, char *word2);
+ }
+
+{
+ * Command handler for a TAKE123 directive.  A TAKE123 directive can be given,
+ * as might be expected, one, two, or three arguments.
+ * - word2 is a NULL pointer if no second argument was specified.
+ * - word3 is a NULL pointer if no third argument was specified.
+ * Declared in the command_rec list with
+ *   AP_INIT_TAKE123("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_TAKE123(cmd_parms *cmd, void *mconfig,
+ *                                   char *word1, char *word2, char *word3);
+ }
+
+{
+ * Command handler for a TAKE13 directive.  Either one or three arguments are
+ * permitted - no two-parameters-only syntax is allowed.
+ * - word2 and word3 are NULL pointers if only one argument was specified.
+ * Declared in the command_rec list with
+ *   AP_INIT_TAKE13("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_TAKE13(cmd_parms *cmd, void *mconfig,
+ *                                  char *word1, char *word2, char *word3);
+ }
+
+{
+ * Command handler for a TAKE23 directive.  At least two and as many as three
+ * arguments must be specified.
+ * - word3 is a NULL pointer if no third argument was specified.
+ * Declared in the command_rec list with
+ *   AP_INIT_TAKE23("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_TAKE23(cmd_parms *cmd, void *mconfig,
+ *                                  char *word1, char *word2, char *word3);
+ }
+
+{
+ * Command handler for a ITERATE directive.
+ * - Handler is called once for each of n arguments given to the directive.
+ * - word1 points to each argument in turn.
+ * Declared in the command_rec list with
+ *   AP_INIT_ITERATE("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_ITERATE(cmd_parms *cmd, void *mconfig,
+ *                                   char *word1);
+ }
+
+{
+ * Command handler for a ITERATE2 directive.
+ * - Handler is called once for each of the second and subsequent arguments
+ *   given to the directive.
+ * - word1 is the same for each call for a particular directive instance (the
+ *   first argument).
+ * - word2 points to each of the second and subsequent arguments in turn.
+ * Declared in the command_rec list with
+ *   AP_INIT_ITERATE2("directive", function, mconfig, where, help)
+ *
+ * static const char *handle_ITERATE2(cmd_parms *cmd, void *mconfig,
+ *                                    char *word1, char *word2);
+ }
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ These routines are strictly internal to this module, and support its     }
+{ operation.  They are not referenced by any external portion of the       }
+{ server.                                                                  }
+{                                                                          }
+{--------------------------------------------------------------------------}
+
+{
+ * Locate our directory configuration record for the current request.
+ }
+function our_dconfig(const r: Prequest_rec): Px_cfg; cdecl;
+begin
+  Result := Px_cfg(ap_get_module_config(r^.per_dir_config, @example_module));
+end;
+
+//#if 0
+{
+ * Locate our server configuration record for the specified server.
+ }
+function our_sconfig(const s: Pserver_rec): Px_cfg; cdecl;
+begin
+  Result := Px_cfg(ap_get_module_config(s^.module_config, @example_module));
+end;
+
+{
+ * Likewise for our configuration record for the specified request.
+ }
+function our_rconfig(const r: Prequest_rec): Px_cfg; cdecl;
+begin
+  Result := Px_cfg(ap_get_module_config(r^.request_config, @example_module));
+end;
+//#endif
+
+{
+ * Likewise for our configuration record for a connection.
+ }
+function our_cconfig(const c: Pconn_rec): Px_cfg; cdecl;
+begin
+  Result := Px_cfg(ap_get_module_config(c^.conn_config, @example_module));
+end;
+
+{
+ * This routine sets up some module-wide cells if they haven't been already.
+ }
+procedure setup_module_cells; cdecl;
+begin
+    {
+     * If we haven't already allocated our module-private pool, do so now.
+     }
+    if (x_pool = nil) then apr_pool_create(@x_pool, nil);
+
+    {
+     * Likewise for the table of routine/environment pairs we visit outside of
+     * request context.
+     }
+    if (static_calls_made = nil) then static_calls_made := apr_table_make(x_pool, 16);
+end;
+
+{
+ * This routine is used to add a trace of a callback to the list.  We're
+ * passed the server record (if available), the request record (if available),
+ * a pointer to our private configuration record (if available) for the
+ * environment to which the callback is supposed to apply, and some text.  We
+ * turn this into a textual representation and add it to the tail of the list.
+ * The list can be displayed by the x_handler() routine.
+ *
+ * If the call occurs within a request context (i.e., we're passed a request
+ * record), we put the trace into the request apr_pool_t and attach it to the
+ * request via the notes mechanism.  Otherwise, the trace gets added
+ * to the static (non-request-specific) list.
+ *
+ * Note that the r^.notes table is only for storing strings; if you need to
+ * maintain per-request data of any other type, you need to use another
+ * mechanism.
+ }
+
+const
+  TRACE_NOTE = 'example-trace';
+
+  EXAMPLE_LOG_EACH = 0;
+
+procedure trace_add(s: Pserver_rec; r: Prequest_rec; mconfig: Px_cfg; const note: PChar); cdecl;
+var
+  sofar, addon, where, trace_copy, key: PChar;
+  p: Papr_pool_t;
+begin
+    {
+     * Make sure our pools and tables are set up - we need 'em.
+     }
+    setup_module_cells();
+    {
+     * Now, if we're in request-context, we use the request pool.
+     }
+    if (r <> nil) then
+    begin
+        p := r^.pool;
+        trace_copy := apr_table_get(r^.notes, TRACE_NOTE);
+        if (trace_copy = nil) then trace_copy := '';
+    end
+    else
+    begin
+        {
+         * We're not in request context, so the trace gets attached to our
+         * module-wide pool.  We do the create/destroy every time we're called
+         * in non-request context; this avoids leaking memory in some of
+         * the subsequent calls that allocate memory only once (such as the
+         * key formation below).
+         *
+         * Make a new sub-pool and copy any existing trace to it.  Point the
+         * trace cell at the copied value.
+         }
+        apr_pool_create(@p, x_pool);
+        if (trace <> nil) then trace := apr_pstrdup(p, trace);
+
+        {
+         * Now, if we have a sub-pool from before, nuke it and replace with
+         * the one we just allocated.
+         }
+        if (x_subpool <> nil) then apr_pool_destroy(x_subpool);
+
+        x_subpool := p;
+        trace_copy := trace;
+    end;
+    {
+     * If we weren't passed a configuration record, we can't figure out to
+     * what location this call applies.  This only happens for co-routines
+     * that don't operate in a particular directory or server context.  If we
+     * got a valid record, extract the location (directory or server) to which
+     * it applies.
+     }
+    {
+       Translation note. The part bellow is commented because there is an unidentified
+      problem with it.
+     }
+    {if (mconfig <> nil) then where := mconfig^.loc
+    else} where := 'nowhere';
+    if (where = nil) then where := '';
+    {
+     * Now, if we're not in request context, see if we've been called with
+     * this particular combination before.  The apr_table_t is allocated in the
+     * module's private pool, which doesn't get destroyed.
+     }
+    if (r = nil) then
+    begin
+        key := apr_pstrcat(p, [note, PChar(':'), where, nil]);
+
+        if (apr_table_get(static_calls_made, key) <> nil) then
+            {
+             * Been here, done this.
+             }
+            Exit
+        else
+            {
+             * First time for this combination of routine and environment -
+             * log it so we don't do it again.
+             }
+            apr_table_set(static_calls_made, key, 'been here');
+    end;
+    addon := apr_pstrcat(p, [
+                        PChar('   <li>' + LineEnding +
+                        '    <dl>' + LineEnding +
+                        '     <dt><samp>'), note, PChar('</samp></dt>' + LineEnding +
+                        '     <dd><samp>['), where, PChar(']</samp></dd>' + LineEnding +
+                        '    </dl>' + LineEnding +
+                        '   </li>' + LineEnding),
+                        nil]);
+
+    if (trace_copy = nil) then sofar := '' else sofar := trace_copy;
+    
+    trace_copy := apr_pstrcat(p, [sofar, addon, nil]);
+    if (r <> nil) then apr_table_set(r^.notes, TRACE_NOTE, trace_copy)
+    else trace := trace_copy;
+
+    {
+     * You *could* change the following if you wanted to see the calling
+     * sequence reported in the server's error_log, but beware - almost all of
+     * these co-routines are called for every single request, and the impact
+     * on the size (and readability) of the error_log is considerable.
+     }
+    if ((EXAMPLE_LOG_EACH = 0) and (s <> nil)) then
+      ap_log_error(MODULE_NAME, 438, APLOG_DEBUG, 0, s, 'mod_example: ', [note]);
+end;
+
+{--------------------------------------------------------------------------}
+{ We prototyped the various syntax for command handlers (routines that     }
+{ are called when the configuration parser detects a directive declared    }
+{ by our module) earlier.  Now we actually declare a "real" routine that   }
+{ will be invoked by the parser when our "real" directive is               }
+{ encountered.                                                             }
+{                                                                          }
+{ If a command handler encounters a problem processing the directive, it   }
+{ signals this fact by returning a non-NULL pointer to a string            }
+{ describing the problem.                                                  }
+{                                                                          }
+{ The magic return value DECLINE_CMD is used to deal with directives       }
+{ that might be declared by multiple modules.  If the command handler      }
+{ returns NULL, the directive was processed; if it returns DECLINE_CMD,    }
+{ the next module (if any) that declares the directive is given a chance   }
+{ at it.  If it returns any other value, it's treated as the text of an    }
+{ error message.                                                           }
+{--------------------------------------------------------------------------}
+{
+ * Command handler for the NO_ARGS "Example" directive.  All we do is mark the
+ * call in the trace log, and flag the applicability of the directive to the
+ * current location in that location's configuration record.
+ }
+function cmd_example(cmd: Pcmd_parms; mconfig: Pointer): PChar; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := Px_cfg(mconfig);
+
+  { "Example Wuz Here" }
+  cfg^.local := 1;
+  trace_add(cmd^.server, nil, cfg, 'cmd_example()');
+  Result := nil;
+end;
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ Now we declare our content handlers, which are invoked when the server   }
+{ encounters a document which our module is supposed to have a chance to   }
+{ see.  (See mod_mime's SetHandler and AddHandler directives, and the      }
+{ mod_info and mod_status examples, for more details.)                     }
+{                                                                          }
+{ Since content handlers are dumping data directly into the connection     }
+{ (using the r*() routines, such as rputs() and rprintf()) without         }
+{ intervention by other parts of the server, they need to make             }
+{ sure any accumulated HTTP headers are sent first.  This is done by       }
+{ calling send_http_header().  Otherwise, no header will be sent at all,   }
+{ and the output sent to the client will actually be HTTP-uncompliant.     }
+{--------------------------------------------------------------------------}
+{
+ * Sample content handler.  All this does is display the call list that has
+ * been built up so far.
+ *
+ * The return value instructs the caller concerning what happened and what to
+ * do next:
+ *  OK ("we did our thing")
+ *  DECLINED ("this isn't something with which we want to get involved")
+ *  HTTP_mumble ("an error status should be reported")
+ }
+function x_handler(r: Prequest_rec): Integer; cdecl;
+var
+  dcfg: Px_cfg;
+  tempstr: PChar;
+begin
+    tempstr := 'Undefined';
+
+    if not SameText(r^.handler, 'example-handler') then
+    begin
+      Result := DECLINED;
+      Exit;
+    end;
+
+    dcfg := our_dconfig(r);
+//    trace_add(r^.server, r, dcfg, 'x_handler()');
+    {
+     * We're about to start sending content, so we need to force the HTTP
+     * headers to be sent at this point.  Otherwise, no headers will be sent
+     * at all.  We can set any we like first, of course.  **NOTE** Here's
+     * where you set the "Content-type" header, and you do so by putting it in
+     * r^.content_type, *not* r^.headers_out("Content-type").  If you don't
+     * set it, it will be filled in with the server's default type (typically
+     * "text/plain").  You *must* also ensure that r^.content_type is lower
+     * case.
+     *
+     * We also need to start a timer so the server can know if the connexion
+     * is broken.
+     }
+    ap_set_content_type(r, 'text/html');
+    {
+     * If we're only supposed to send header information (HEAD request), we're
+     * already there.
+     }
+    if (r^.header_only <> 0) then
+    begin
+      Result := OK;
+      Exit;
+    end;
+
+    {
+     * Now send our actual output.  Since we tagged this as being
+     * "text/html", we need to embed any HTML.
+     }
+    ap_rputs(DOCTYPE_HTML_3_2, r);
+    ap_rputs('<HTML>' + LineEnding, r);
+    ap_rputs(' <HEAD>' + LineEnding, r);
+    ap_rputs('  <TITLE>mod_example Module Content-Handler Output' + LineEnding, r);
+    ap_rputs('  </TITLE>' + LineEnding, r);
+    ap_rputs(' </HEAD>' + LineEnding, r);
+    ap_rputs(' <BODY>' + LineEnding, r);
+    ap_rputs('  <H1><SAMP>mod_example</SAMP> Module Content-Handler Output' + LineEnding, r);
+    ap_rputs('  </H1>' + LineEnding, r);
+    ap_rputs('  <P>' + LineEnding, r);
+    ap_rprintf(r, '  Apache HTTP Server version: "%s"' + LineEnding, [ap_get_server_version()]);
+    ap_rputs('  <BR>' + LineEnding, r);
+    ap_rprintf(r, '  Server built: "%s"' + LineEnding, [ap_get_server_built()]);
+    ap_rputs('  </P>' + LineEnding, r);;
+    ap_rputs('  <P>' + LineEnding, r);
+    ap_rputs('  The format for the callback trace is:' + LineEnding, r);
+    ap_rputs('  </P>' + LineEnding, r);
+    ap_rputs('  <DL>' + LineEnding, r);
+    ap_rputs('   <DT><EM>n</EM>.<SAMP>&lt;routine-name&gt;', r);
+    ap_rputs('(&lt;routine-data&gt;)</SAMP>' + LineEnding, r);
+    ap_rputs('   </DT>' + LineEnding, r);
+    ap_rputs('   <DD><SAMP>[&lt;applies-to&gt;]</SAMP>' + LineEnding, r);
+    ap_rputs('   </DD>' + LineEnding, r);
+    ap_rputs('  </DL>' + LineEnding, r);
+    ap_rputs('  <P>' + LineEnding, r);
+    ap_rputs('  The <SAMP>&lt;routine-data&gt;</SAMP> is supplied by' + LineEnding, r);
+    ap_rputs('  the routine when it requests the trace,' + LineEnding, r);
+    ap_rputs('  and the <SAMP>&lt;applies-to&gt;</SAMP> is extracted' + LineEnding, r);
+    ap_rputs('  from the configuration record at the time of the trace.' + LineEnding, r);
+    ap_rputs('  <STRONG>SVR()</STRONG> indicates a server environment' + LineEnding, r);
+    ap_rputs('  (blank means the main or default server, otherwise it''s' + LineEnding, r);
+    ap_rputs('  the name of the VirtualHost); <STRONG>DIR()</STRONG>' + LineEnding, r);
+    ap_rputs('  indicates a location in the URL or filesystem' + LineEnding, r);
+    ap_rputs('  namespace.' + LineEnding, r);
+    ap_rputs('  </P>' + LineEnding, r);
+    ap_rprintf(r, '  <H2>Static callbacks so far:</H2>' + LineEnding +
+     '  <OL>' + LineEnding + '%s  </OL>' + LineEnding, [trace]);
+    ap_rputs('  <H2>Request-specific callbacks so far:</H2>' + LineEnding, r);
+    ap_rprintf(r, '  <OL>' + LineEnding + '%s  </OL>' + LineEnding, [apr_table_get(r^.notes, TRACE_NOTE)]);
+    ap_rputs('  <H2>Environment for <EM>this</EM> call:</H2>' + LineEnding, r);
+    ap_rputs('  <UL>' + LineEnding, r);
+//    ap_rprintf(r, '   <LI>Applies-to: <SAMP>%s</SAMP>' + LineEnding + '   </LI>' + LineEnding, [dcfg^.loc]);
+
+//    if dcfg^.local = 0 then tempstr := 'NO' else tempstr := 'Yes';
+
+    ap_rprintf(r, '   <LI>"Example" directive declared here: %s' + LineEnding + '   </LI>' + LineEnding,
+     [tempstr]);
+
+//    if dcfg^.congenital = 0 then tempstr := 'NO' else tempstr := 'Yes';
+
+    ap_rprintf(r, '   <LI>"Example" inherited: %s' + LineEnding + '   </LI>' + LineEnding, [tempstr]);
+    ap_rputs('  </UL>' + LineEnding, r);
+    ap_rputs(' </BODY>' + LineEnding, r);
+    ap_rputs('</HTML>' + LineEnding, r);
+    {
+     * We're all done, so cancel the timeout we set.  Since this is probably
+     * the end of the request we *could* assume this would be done during
+     * post-processing - but it's possible that another handler might be
+     * called and inherit our outstanding timer.  Not good; to each its own.
+     }
+    {
+     * We did what we wanted to do, so tell the rest of the server we
+     * succeeded.
+     }
+    Result := OK;
+end;
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ Now let's declare routines for each of the callback phase in order.      }
+{ (That's the order in which they're listed in the callback list, *not     }
+{ the order in which the server calls them!  See the command_rec           }
+{ declaration near the bottom of this file.)  Note that these may be       }
+{ called for situations that don't relate primarily to our function - in   }
+{ other words, the fixup handler shouldn't assume that the request has     }
+{ to do with "example" stuff.                                              }
+{                                                                          }
+{ With the exception of the content handler, all of our routines will be   }
+{ called for each request, unless an earlier handler from another module   }
+{ aborted the sequence.                                                    }
+{                                                                          }
+{ Handlers that are declared as "int" can return the following:            }
+{                                                                          }
+{  OK          Handler accepted the request and did its thing with it.     }
+{  DECLINED    Handler took no action.                                     }
+{  HTTP_mumble Handler looked at request and found it wanting.             }
+{                                                                          }
+{ What the server does after calling a module handler depends upon the     }
+{ handler's return value.  In all cases, if the handler returns            }
+{ DECLINED, the server will continue to the next module with an handler    }
+{ for the current phase.  However, if the handler return a non-OK,         }
+{ non-DECLINED status, the server aborts the request right there.  If      }
+{ the handler returns OK, the server's next action is phase-specific;      }
+{ see the individual handler comments below for details.                   }
+{                                                                          }
+{--------------------------------------------------------------------------}
+{
+ * This function is called during server initialisation.  Any information
+ * that needs to be recorded must be in static cells, since there's no
+ * configuration record.
+ *
+ * There is no return value.
+ }
+
+{
+ * This function is called when an heavy-weight process (such as a child) is
+ * being run down or destroyed.  As with the child initialisation function,
+ * any information that needs to be recorded must be in static cells, since
+ * there's no configuration record.
+ *
+ * There is no return value.
+ }
+
+{
+ * This function is called during server initialisation when an heavy-weight
+ * process (such as a child) is being initialised.  As with the
+ * module initialisation function, any information that needs to be recorded
+ * must be in static cells, since there's no configuration record.
+ *
+ * There is no return value.
+ }
+
+{
+ * This function gets called to create a per-directory configuration
+ * record.  This will be called for the "default" server environment, and for
+ * each directory for which the parser finds any of our directives applicable.
+ * If a directory doesn't have any of our directives involved (i.e., they
+ * aren't in the .htaccess file, or a <Location>, <Directory>, or related
+ * block), this routine will *not* be called - the configuration for the
+ * closest ancestor is used.
+ *
+ * The return value is a pointer to the created module-specific
+ * structure.
+ }
+function x_create_dir_config(p: Papr_pool_t; dirspec: PChar): Pointer; cdecl;
+var
+  cfg: Px_cfg;
+  dname: PChar;
+begin
+  dname := dirspec;
+
+    {
+     * Allocate the space for our record from the pool supplied.
+     }
+    cfg := Px_cfg(apr_pcalloc(p, sizeof(x_cfg)));
+    {
+     * Now fill in the defaults.  If there are any `parent' configuration
+     * records, they'll get merged as part of a separate callback.
+     }
+    cfg^.local := 0;
+    cfg^.congenital := 0;
+    cfg^.cmode := CONFIG_MODE_DIRECTORY;
+    {
+     * Finally, add our trace to the callback list.
+     }
+    if dname = nil then dname := '';
+    cfg^.loc := apr_pstrcat(p, [PChar('DIR('), dname, PChar(')'), nil]);
+    trace_add(nil, nil, cfg, 'x_create_dir_config()');
+    Result := Pointer(cfg);
+end;
+
+{
+ * This function gets called to merge two per-directory configuration
+ * records.  This is typically done to cope with things like .htaccess files
+ * or <Location> directives for directories that are beneath one for which a
+ * configuration record was already created.  The routine has the
+ * responsibility of creating a new record and merging the contents of the
+ * other two into it appropriately.  If the module doesn't declare a merge
+ * routine, the record for the closest ancestor location (that has one) is
+ * used exclusively.
+ *
+ * The routine MUST NOT modify any of its arguments!
+ *
+ * The return value is a pointer to the created module-specific structure
+ * containing the merged values.
+ }
+function x_merge_dir_config(p: Papr_pool_t;
+ parent_conf, newloc_conf: Pointer): Pointer; cdecl;
+var
+  merged_config, pconf, nconf: Px_cfg;
+  note: PChar;
+begin
+    merged_config := Px_cfg(apr_pcalloc(p, sizeof(x_cfg)));
+    pconf := Px_cfg(parent_conf);
+    nconf := Px_cfg(newloc_conf);
+
+    {
+     * Some things get copied directly from the more-specific record, rather
+     * than getting merged.
+     }
+    merged_config^.local := nconf^.local;
+    merged_config^.loc := apr_pstrdup(p, nconf^.loc);
+    {
+     * Others, like the setting of the `congenital' flag, get ORed in.  The
+     * setting of that particular flag, for instance, is TRUE if it was ever
+     * true anywhere in the upstream configuration.
+     }
+    merged_config^.congenital := (pconf^.congenital or pconf^.local);
+    {
+     * If we're merging records for two different types of environment (server
+     * and directory), mark the new record appropriately.  Otherwise, inherit
+     * the current value.
+     }
+    if pconf^.cmode = nconf^.cmode then
+     merged_config^.cmode := pconf^.cmode
+    else merged_config^.cmode := CONFIG_MODE_COMBO;
+    {
+     * Now just record our being called in the trace list.  Include the
+     * locations we were asked to merge.
+     }
+    note := apr_pstrcat(p, [PChar('x_merge_dir_config("'), pconf^.loc, PChar('","'),
+     nconf^.loc, PChar('")'), nil]);
+    trace_add(nil, nil, merged_config, note);
+    Result := Pointer(merged_config);
+end;
+
+{
+ * This function gets called to create a per-server configuration
+ * record.  It will always be called for the "default" server.
+ *
+ * The return value is a pointer to the created module-specific
+ * structure.
+ }
+function x_create_server_config(p: Papr_pool_t; s: Pserver_rec): Pointer; cdecl;
+var
+  cfg: Px_cfg;
+  sname: PChar;
+begin
+    sname := s^.server_hostname;
+
+    {
+     * As with the x_create_dir_config() reoutine, we allocate and fill
+     * in an empty record.
+     }
+    cfg := Px_cfg(apr_pcalloc(p, sizeof(x_cfg)));
+    cfg^.local := 0;
+    cfg^.congenital := 0;
+    cfg^.cmode := CONFIG_MODE_SERVER;
+    {
+     * Note that we were called in the trace list.
+     }
+    if sname = nil then sname := '';
+    cfg^.loc := apr_pstrcat(p, [PChar('SVR('), sname, PChar(')'), nil]);
+    trace_add(s, nil, cfg, 'x_create_server_config()');
+    Result := Pointer(cfg);
+end;
+
+{
+ * This function gets called to merge two per-server configuration
+ * records.  This is typically done to cope with things like virtual hosts and
+ * the default server configuration  The routine has the responsibility of
+ * creating a new record and merging the contents of the other two into it
+ * appropriately.  If the module doesn't declare a merge routine, the more
+ * specific existing record is used exclusively.
+ *
+ * The routine MUST NOT modify any of its arguments!
+ *
+ * The return value is a pointer to the created module-specific structure
+ * containing the merged values.
+ }
+function x_merge_server_config(p: Papr_pool_t;
+ server1_conf, server2_conf: Pointer): Pointer; cdecl;
+var
+  merged_config, s1conf, s2conf: Px_cfg;
+  note: PChar;
+begin
+    merged_config := Px_cfg(apr_pcalloc(p, sizeof(x_cfg)));
+    s1conf := Px_cfg(server1_conf);
+    s2conf := Px_cfg(server2_conf);
+
+    {
+     * Our inheritance rules are our own, and part of our module's semantics.
+     * Basically, just note whence we came.
+     }
+    if s1conf^.cmode = s2conf^.cmode then
+     merged_config^.cmode := s1conf^.cmode
+    else merged_config^.cmode := CONFIG_MODE_COMBO;
+    
+    merged_config^.local := s2conf^.local;
+    merged_config^.congenital := (s1conf^.congenital or s1conf^.local);
+    merged_config^.loc := apr_pstrdup(p, s2conf^.loc);
+    {
+     * Trace our call, including what we were asked to merge.
+     }
+    note := apr_pstrcat(p, [PChar('x_merge_server_config("'), s1conf^.loc, PChar('","'),
+     s2conf^.loc, PChar('")'), nil]);
+    trace_add(nil, nil, merged_config, note);
+    Result := Pointer(merged_config);
+end;
+
+{
+ * This routine is called before the server processes the configuration
+ * files.  There is no return value.
+ }
+function x_pre_config(pconf, plog, ptemp: Papr_pool_t): Integer; cdecl;
+begin
+    {
+     * Log the call and exit.
+     }
+    trace_add(nil, nil, nil, 'x_pre_config()');
+
+    Result := OK;
+end;
+
+{
+ * This routine is called to perform any module-specific fixing of header
+ * fields, et cetera.  It is invoked just before any content-handler.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+function x_post_config(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Integer; cdecl;
+begin
+    {
+     * Log the call and exit.
+     }
+    trace_add(nil, nil, nil, 'x_post_config()');
+    Result := OK;
+end;
+
+{
+ * This routine is called to perform any module-specific log file
+ * openings. It is invoked just before the post_config phase
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+function x_open_logs(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Integer; cdecl;
+begin
+    {
+     * Log the call and exit.
+     }
+    trace_add(s, nil, nil, 'x_open_logs()');
+    Result := OK;
+end;
+
+{
+ * All our process-death routine does is add its trace to the log.
+ }
+function x_child_exit(data: Pointer): apr_status_t; cdecl;
+var
+  note, sname: PChar;
+  s: Pserver_rec;
+begin
+    s := data;
+    sname := s^.server_hostname;
+
+    {
+     * The arbitrary text we add to our trace entry indicates for which server
+     * we're being called.
+     }
+    if sname = nil then sname := '';
+    note := apr_pstrcat(s^.process^.pool, [PChar('x_child_exit('), sname, PChar(')'), nil]);
+    trace_add(s, nil, nil, note);
+    Result := APR_SUCCESS;
+end;
+
+{
+ * All our process initialiser does is add its trace to the log.
+ }
+procedure x_child_init(p: Papr_pool_t; s: Pserver_rec); cdecl;
+var
+  note, sname: PChar;
+begin
+  sname := s^.server_hostname;
+
+    {
+     * Set up any module cells that ought to be initialised.
+     }
+    setup_module_cells();
+    {
+     * The arbitrary text we add to our trace entry indicates for which server
+     * we're being called.
+     }
+    if sname = nil then sname := '';
+    note := apr_pstrcat(p, [PChar('x_child_init('), sname, PChar(')'), nil]);
+    trace_add(s, nil, nil, note);
+
+    apr_pool_cleanup_register(p, s, @x_child_exit, @x_child_exit);
+end;
+
+{
+ * XXX: This routine is called XXX
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+//#if 0
+function x_http_method(const r: Prequest_rec): PChar; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+
+  // Log the call and exit.
+
+  trace_add(r^.server, nil, cfg, 'x_http_method()');
+  Result := 'foo';
+end;
+
+{
+ * XXX: This routine is called XXX
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+function x_default_port(const r: Prequest_rec): apr_port_t; cdecl;
+var
+  cfg: Px_cfg;
+begin
+    cfg := our_dconfig(r);
+    {
+     * Log the call and exit.
+     }
+    trace_add(r^.server, nil, cfg, 'x_default_port()');
+  Result := 80;
+end;
+//#endif {0}
+
+{
+ * XXX: This routine is called XXX
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+procedure x_insert_filter(r: Prequest_rec); cdecl;
+var
+  cfg: Px_cfg;
+begin
+    cfg := our_dconfig(r);
+    {
+     * Log the call and exit.
+     }
+    trace_add(r^.server, nil, cfg, 'x_insert_filter()');
+end;
+
+{
+ * XXX: This routine is called XXX
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+function x_quick_handler(r: Prequest_rec; lookup_uri: Integer): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+  
+  { Log the call and exit. }
+  
+  trace_add(r^.server, nil, cfg, 'x_post_config()');
+    
+  Result := DECLINED;
+end;
+
+{
+ * This routine is called just after the server accepts the connection,
+ * but before it is handed off to a protocol module to be served.  The point
+ * of this hook is to allow modules an opportunity to modify the connection
+ * as soon as possible. The core server uses this phase to setup the
+ * connection record based on the type of connection that is being used.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+function x_pre_connection(c: Pconn_rec; csd: Pointer): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_cconfig(c);
+
+{$ifdef 0}
+  {
+   * Log the call and exit.
+   }
+  trace_add(r^.server, nil, cfg, 'x_post_config()');
+{$endif}
+
+  Result := OK;
+end;
+
+{ This routine is used to actually process the connection that was received.
+ * Only protocol modules should implement this hook, as it gives them an
+ * opportunity to replace the standard HTTP processing with processing for
+ * some other protocol.  Both echo and POP3 modules are available as
+ * examples.
+ *
+ * The return VALUE is OK, DECLINED, or HTTP_mumble.  If we return OK, no
+ * further modules are called for this phase.
+ }
+function x_process_connection(c: Pconn_rec): Integer; cdecl;
+begin
+  Result := DECLINED;
+end;
+
+{
+ * This routine is called after the request has been read but before any other
+ * phases have been processed.  This allows us to make decisions based upon
+ * the input header fields.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, no
+ * further modules are called for this phase.
+ }
+function x_post_read_request(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+  {
+   * We don't actually *do* anything here, except note the fact that we were
+   * called.
+   }
+  trace_add(r^.server, r, cfg, 'x_post_read_request()');
+  Result := DECLINED;
+end;
+
+{
+ * This routine gives our module an opportunity to translate the URI into an
+ * actual filename.  If we don't do anything special, the server's default
+ * rules (Alias directives and the like) will continue to be followed.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, no
+ * further modules are called for this phase.
+ }
+function x_translate_handler(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+  {
+   * We don't actually *do* anything here, except note the fact that we were
+   * called.
+   }
+  trace_add(r^.server, r, cfg, 'x_translate_handler()');
+    
+  Result := DECLINED;
+end;
+
+{
+ * this routine gives our module another chance to examine the request
+ * headers and to take special action. This is the first phase whose
+ * hooks' configuration directives can appear inside the <Directory>
+ * and similar sections, because at this stage the URI has been mapped
+ * to the filename. For example this phase can be used to block evil
+ * clients, while little resources were wasted on these.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK,
+ * the server will still call any remaining modules with an handler
+ * for this phase.
+ }
+function x_header_parser_handler(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+  {
+   * We don't actually *do* anything here, except note the fact that we were
+   * called.
+   }
+  trace_add(r^.server, r, cfg, 'header_parser_handler()');
+  
+  Result := DECLINED;
+end;
+
+
+{
+ * This routine is called to check the authentication information sent with
+ * the request (such as looking up the user in a database and verifying that
+ * the [encrypted] password sent matches the one in the database).
+ *
+ * The return value is OK, DECLINED, or some HTTP_mumble error (typically
+ * HTTP_UNAUTHORIZED).  If we return OK, no other modules are given a chance
+ * at the request during this phase.
+ }
+function x_check_user_id(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+
+  { Don't do anything except log the call. }
+  
+  trace_add(r^.server, r, cfg, 'x_check_user_id()');
+
+  Result := DECLINED;
+end;
+
+{
+ * This routine is called to check to see if the resource being requested
+ * requires authorisation.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, no
+ * other modules are called during this phase.
+ *
+ * If *all* modules return DECLINED, the request is aborted with a server
+ * error.
+ }
+function x_auth_checker(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+    
+  { * Log the call and return OK, or access will be denied (even though we
+    * didn't actually do anything). }
+      
+  trace_add(r^.server, r, cfg, 'x_auth_checker()');
+  
+  Result := DECLINED;
+end;
+
+{
+ * This routine is called to check for any module-specific restrictions placed
+ * upon the requested resource.  (See the mod_access module for an example.)
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  All modules with an
+ * handler for this phase are called regardless of whether their predecessors
+ * return OK or DECLINED.  The first one to return any other status, however,
+ * will abort the sequence (and the request) as usual.
+ }
+function x_access_checker(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+  trace_add(r^.server, r, cfg, 'x_access_checker()');
+    
+  Result := DECLINED;
+end;
+
+{
+ * This routine is called to determine and/or set the various document type
+ * information bits, like Content-type (via r^.content_type), language, et
+ * cetera.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, no
+ * further modules are given a chance at the request for this phase.
+ }
+function x_type_checker(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+
+  {  * Log the call, but don't do anything else - and report truthfully that
+     * we didn't do anything. }
+     
+  trace_add(r^.server, r, cfg, 'x_type_checker()');
+    
+  Result := DECLINED;
+end;
+
+{
+ * This routine is called to perform any module-specific fixing of header
+ * fields, et cetera.  It is invoked just before any content-handler.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
+ * server will still call any remaining modules with an handler for this
+ * phase.
+ }
+function x_fixer_upper(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+
+  { Log the call and exit. }
+
+  trace_add(r^.server, r, cfg, 'x_fixer_upper()');
+    
+  Result := OK;
+end;
+
+{
+ * This routine is called to perform any module-specific logging activities
+ * over and above the normal server things.
+ *
+ * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, any
+ * remaining modules with an handler for this phase will still be called.
+ }
+function x_logger(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Px_cfg;
+begin
+  cfg := our_dconfig(r);
+  trace_add(r^.server, r, cfg, 'x_logger()');
+  Result := DECLINED;
+end;
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ Which functions are responsible for which hooks in the server.           }
+{                                                                          }
+{--------------------------------------------------------------------------}
+{
+ * Each function our module provides to handle a particular hook is
+ * specified here.  The functions are registered using
+ * ap_hook_foo(name, predecessors, successors, position)
+ * where foo is the name of the hook.
+ *
+ * The args are as follows:
+ * name         ^. the name of the function to call.
+ * predecessors ^. a list of modules whose calls to this hook must be
+ *                 invoked before this module.
+ * successors   ^. a list of modules whose calls to this hook must be
+ *                 invoked after this module.
+ * position     ^. The relative position of this module.  One of
+ *                 APR_HOOK_FIRST, APR_HOOK_MIDDLE, or APR_HOOK_LAST.
+ *                 Most modules will use APR_HOOK_MIDDLE.  If multiple
+ *                 modules use the same relative position, Apache will
+ *                 determine which to call first.
+ *                 If your module relies on another module to run first,
+ *                 or another module running after yours, use the
+ *                 predecessors and/or successors.
+ *
+ * The number in brackets indicates the order in which the routine is called
+ * during request processing.  Note that not all routines are necessarily
+ * called (such as if a resource doesn't have access restrictions).
+ * The actual delivery of content to the browser [9] is not handled by
+ * a hook; see the handler declarations below.
+ }
+procedure x_register_hooks(p: Papr_pool_t); cdecl;
+begin
+    ap_hook_pre_config(@x_pre_config, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_post_config(@x_post_config, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_open_logs(@x_open_logs, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_child_init(@x_child_init, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_handler(@x_handler, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_quick_handler(@x_quick_handler, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_pre_connection(@x_pre_connection, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_process_connection(@x_process_connection, nil, nil, APR_HOOK_MIDDLE);
+    { [1] post read_request handling }
+    ap_hook_post_read_request(@x_post_read_request, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_log_transaction(@x_logger, nil, nil, APR_HOOK_MIDDLE);
+{$ifdef 0}
+    ap_hook_http_method(x_http_method, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_default_port(x_default_port, nil, nil, APR_HOOK_MIDDLE);
+{$endif}
+    ap_hook_translate_name(@x_translate_handler, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_header_parser(@x_header_parser_handler, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_check_user_id(@x_check_user_id, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_fixups(@x_fixer_upper, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_type_checker(@x_type_checker, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_access_checker(@x_access_checker, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_auth_checker(@x_auth_checker, nil, nil, APR_HOOK_MIDDLE);
+    ap_hook_insert_filter(@x_insert_filter, nil, nil, APR_HOOK_MIDDLE);
+end;
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ All of the routines have been declared now.  Here's the list of          }
+{ directives specific to our module, and information about where they      }
+{ may appear and how the command parser should pass them to us for         }
+{ processing.  Note that care must be taken to ensure that there are NO    }
+{ collisions of directive names between modules.                           }
+{                                                                          }
+{--------------------------------------------------------------------------}
+var
+  x_cmds: command_rec;
+
+{--------------------------------------------------------------------------}
+{                                                                          }
+{ Finally, the list of callback routines and data structures that provide  }
+{ the static hooks into our module from the other parts of the server.     }
+{                                                                          }
+{--------------------------------------------------------------------------}
+{
+ * Module definition for configuration.  If a particular callback is not
+ * needed, replace its routine name below with the word NULL.
+ }
+
+begin
+  default_module_ptr := @example_module;
+  FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0);
+  
+  STANDARD20_MODULE_STUFF(default_module_ptr^);
+  
+  { List of directives specific to our module. }
+  
+  with x_cmds do
+  begin
+    name := 'Example';
+    func.func_no_args := @cmd_example;
+    cmd_data := nil;
+    req_override := OR_OPTIONS;
+    args_how := NO_ARGS; // Or RAW_ARGS ?
+    errmsg := 'Example directive - no arguments';
+  end;
+
+  with example_module do
+  begin
+    name := MODULE_NAME;
+    magic := MODULE_MAGIC_COOKIE;
+    create_dir_config := @x_create_dir_config;      { per-directory config creator }
+    merge_dir_config := @x_merge_dir_config;        { dir config merger }
+    create_server_config := @x_create_server_config;{ server config creator }
+    merge_server_config := @x_merge_server_config;  { server config merger }
+    cmds := @x_cmds;                                { command table }
+    register_hooks := @x_register_hooks;            { set up other request processing hooks }
+  end;
+end.
+

+ 143 - 0
packages/httpd22/examples/mod_hello.pp

@@ -0,0 +1,143 @@
+{*******************************************************************
+*  Test library of the Apache Pascal Headers
+*******************************************************************}
+library mod_hello;
+
+{*******************************************************************
+*  The mode must be objfpc on this unit because the unix code uses
+* some extensions introduced on Free Pascal
+*******************************************************************}
+{$ifdef fpc}
+  {$mode objfpc}{$H+}
+{$endif}
+
+{$IFDEF WIN32}
+  {$DEFINE WINDOWS}
+{$ENDIF}
+
+{$define Apache2_2}
+
+uses SysUtils, httpd {$ifndef Apache1_3}, apr{$endif};
+
+var
+ test_module: module; public name 'hello_module';
+ default_module_ptr: Pmodule;
+
+const
+  MODULE_NAME = 'mod_hello.so';
+  
+{*******************************************************************
+*  Free Pascal only supports exporting variables on Windows
+*******************************************************************}
+{$ifdef WINDOWS}
+exports
+ test_module name 'test_module';
+{$endif}
+
+{*******************************************************************
+*  Handles apache requests
+*******************************************************************}
+function DefaultHandler(r: Prequest_rec): Integer; cdecl;
+var
+  RequestedHandler: string;
+  
+begin
+  RequestedHandler := r^.handler;
+
+  { We decline to handle a request if hello-handler is not the value of r->handler }
+  if not SameText(RequestedHandler, 'testapache-handler') then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { The following line just prints a message to the errorlog }
+  ap_log_error(MODULE_NAME, 54, APLOG_NOERRNO or APLOG_NOTICE,
+   {$ifndef Apache1_3}0,{$endif} r^.server,
+   'mod_hello: %s', [PChar('Before content is output')]);
+
+  { We set the content type before doing anything else }
+  {$ifdef Apache1_3}
+    r^.content_type := 'text/html';
+//    ap_send_http_header(r);
+  {$else}
+    ap_set_content_type(r, 'text/html');
+  {$endif}
+  
+  { If the request is for a header only, and not a request for
+   the whole content, then return OK now. We don't have to do
+   anything else. }
+  if (r^.header_only <> 0) then
+  begin
+    Result := OK;
+    Exit;
+  end;
+
+  { Now we just print the contents of the document using the
+   ap_rputs and ap_rprintf functions. More information about
+   the use of these can be found in http_protocol.inc }
+  ap_rputs('<HTML>' + LineEnding, r);
+  ap_rputs('<HEAD>' + LineEnding, r);
+  ap_rputs('<TITLE>Hello There</TITLE>' + LineEnding, r);
+  ap_rputs('</HEAD>' + LineEnding, r);
+  ap_rputs('<BODY BGCOLOR="#FFFFFF">' + LineEnding ,r);
+  ap_rputs('<H1>Hello world</H1>' + LineEnding, r);
+  ap_rputs('This is the first Apache Module working with the new binding from Free Pascal' + LineEnding, r);
+//  ap_rprintf(r, '<br>A sample line generated by ap_rprintf<br>' + LineEnding, []);
+  ap_rputs('</BODY></HTML>' + LineEnding, r);
+
+  { We can either return OK or DECLINED at this point. If we return
+         * OK, then no other modules will attempt to process this request }
+  Result := OK;
+end;
+
+{*******************************************************************
+*  Registers the hooks
+*******************************************************************}
+{$ifdef apache1_3}
+
+procedure hw_init(s: PServer_rec; p: PPool); cdecl;
+begin
+end;
+
+var
+  hw_handlers: array[0..0] of handler_rec =
+  (
+    (content_type: 'hw_app'; handler: @DefaultHandler)
+  );
+
+{$else}
+
+procedure RegisterHooks(p: Papr_pool_t); cdecl;
+begin
+  ap_hook_handler(@DefaultHandler, nil, nil, APR_HOOK_MIDDLE);
+end;
+
+{$endif}
+
+{*******************************************************************
+*  Library initialization code
+*******************************************************************}
+
+begin
+  default_module_ptr := @test_module;
+  FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0);
+  {$ifdef apache1_3}
+    STANDARD_MODULE_STUFF(test_module);
+
+    with test_module do
+    begin
+      name := MODULE_NAME;
+      init := @hw_init;
+      handlers := hw_handlers;
+    end;
+  {$else}
+    STANDARD20_MODULE_STUFF(test_module);
+
+    with test_module do
+    begin
+      name := MODULE_NAME;
+      register_hooks := @RegisterHooks;
+    end;
+  {$endif}
+end.

+ 654 - 0
packages/httpd22/examples/mod_spelling.pp

@@ -0,0 +1,654 @@
+{* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *}
+library mod_spelling;
+
+{$i define.inc}
+
+uses SysUtils, Classes, httpd, apr;
+
+var
+  speling_module: module; {$ifdef Unix} cvar; public; {$endif}
+  default_module_ptr: Pmodule;
+
+const
+  MODULE_NAME = 'mod_speling.so';
+
+{*******************************************************************
+*  Free Pascal only supports exporting variables on Windows
+*******************************************************************}
+{$ifdef WINDOWS}
+exports
+  speling_module name 'spelling_module';
+{$endif}
+
+{#include "apr.h"
+#include "apr_file_io.h"
+#include "apr_strings.h"
+#include "apr_lib.h"
+
+#define APR_WANT_STRFUNC
+#include "apr_want.h"
+
+#define WANT_BASENAME_MATCH
+
+#include "httpd.h"
+#include "http_core.h"
+#include "http_config.h"
+#include "http_request.h"
+#include "http_log.h" }
+
+{* mod_speling.c - by Alexei Kosut <[email protected]> June, 1996
+ *
+ * Translated to pascal by Felipe Monteiro de Carvalho - July, 2006
+ *
+ * This module is transparent, and simple. It attempts to correct
+ * misspellings of URLs that users might have entered, namely by checking
+ * capitalizations. If it finds a match, it sends a redirect.
+ *
+ * 08-Aug-1997 <[email protected]>
+ * o Upgraded module interface to apache_1.3a2-dev API (more NULL's in
+ *   speling_module).
+ * o Integrated tcsh's "spelling correction" routine which allows one
+ *   misspelling (character insertion/omission/typo/transposition).
+ *   Rewrote it to ignore case as well. This ought to catch the majority
+ *   of misspelled requests.
+ * o Commented out the second pass where files' suffixes are stripped.
+ *   Given the better hit rate of the first pass, this rather ugly
+ *   (request index.html, receive index.db ?!?!) solution can be
+ *   omitted.
+ * o wrote a "kind of" html page for mod_speling
+ *
+ * Activate it with "CheckSpelling On"
+ }
+
+type
+  spconfig = record
+    enabled: Integer;
+  end;
+  
+  Pspconfig = ^spconfig;
+
+{
+ * Create a configuration specific to this module for a server or directory
+ * location, and fill it with the default settings.
+ *
+ * The API says that in the absence of a merge function, the record for the
+ * closest ancestor is used exclusively.  That's what we want, so we don't
+ * bother to have such a function.
+ }
+
+function mkconfig(p: Papr_pool_t): Pointer;
+var
+  cfg: Pspconfig;
+begin
+  cfg := apr_pcalloc(p, sizeof(spconfig));
+  cfg^.enabled := 0;
+  Result := cfg;
+end;
+
+{
+ * Respond to a callback to create configuration record for a server or
+ * vhost environment.
+ }
+function create_mconfig_for_server(p: Papr_pool_t; s: Pserver_rec): Pointer; cdecl;
+begin
+  Result := mkconfig(p);
+end;
+
+{
+ * Respond to a callback to create a config record for a specific directory.
+ }
+function create_mconfig_for_directory(p: Papr_pool_t; dir: PChar): Pointer; cdecl;
+begin
+  Result := mkconfig(p);
+end;
+
+{
+ * Handler for the CheckSpelling directive, which is FLAG.
+ }
+function set_speling(cmd: Pcmd_parms; mconfig: Pointer; arg: Integer): PChar; cdecl;
+var
+  cfg: Pspconfig;
+begin
+  cfg := Pspconfig(mconfig);
+  cfg^.enabled := arg;
+  Result := nil;
+end;
+
+  {* Define the directives specific to this module.  This structure is referenced
+   * later by the 'module' structure. }
+
+var
+  speling_cmds: command_rec;
+
+type
+  sp_reason = (
+    SP_IDENTICAL = 0,
+    SP_MISCAPITALIZED = 1,
+    SP_TRANSPOSITION = 2,
+    SP_MISSINGCHAR = 3,
+    SP_EXTRACHAR = 4,
+    SP_SIMPLETYPO = 5,
+    SP_VERYDIFFERENT = 6
+  );
+
+const
+  sp_reason_str: array [0..7] of PChar =
+  (
+    'identical',
+    'miscapitalized',
+    'transposed characters',
+    'character missing',
+    'extra character',
+    'mistyped character',
+    'common basename',
+    nil
+  );
+
+type
+  misspelled_file = record
+    name: PChar;
+    quality: sp_reason;
+  end;
+  
+  Pmisspelled_file = ^misspelled_file;
+
+{
+ * spdist() is taken from Kernighan & Pike,
+ *  _The_UNIX_Programming_Environment_
+ * and adapted somewhat to correspond better to psychological reality.
+ * (Note the changes to the return values)
+ *
+ * According to Pollock and Zamora, CACM April 1984 (V. 27, No. 4),
+ * page 363, the correct order for this is:
+ * OMISSION = TRANSPOSITION > INSERTION > SUBSTITUTION
+ * thus, it was exactly backwards in the old version. -- PWP
+ *
+ * This routine was taken out of tcsh's spelling correction code
+ * (tcsh-6.07.04) and re-converted to apache data types ("char" type
+ * instead of tcsh's NLS'ed "Char"). Plus it now ignores the case
+ * during comparisons, so is a "approximate strcasecmp()".
+ * NOTE that is still allows only _one_ real "typo",
+ * it does NOT try to correct multiple errors.
+ }
+{
+  Extra notes about how this function works:
+  
+  * s and t are supposed different
+  
+  * s
+}
+function spdist(const cs, ct: PChar): sp_reason;
+var
+  s, t, i, j: PChar;
+begin
+  s := cs;
+  t := ct;
+
+  while apr_tolower(s^) = apr_tolower(t^) do
+  begin
+    if t^ = #0 then
+    begin
+      Result := SP_MISCAPITALIZED;   { exact match (sans case) }
+      Exit;
+    end;
+
+    Inc(s);
+    Inc(t);
+  end;
+
+  if s^ <> #0 then
+  begin
+    if t^ <> #0 then
+    begin
+      i := s;
+      Inc(i);
+      j := t;
+      Inc(j);
+    
+      if Integer(i^) and Integer(j^) <> 0 then
+       if (apr_tolower(s^) = apr_tolower(j^)) and (apr_tolower(t^) = apr_tolower(i^)) then
+       begin
+         Inc(i);
+         Inc(j);
+        
+         if stricomp(i, j) = 0 then
+         begin
+           Result := SP_TRANSPOSITION;        { transposition }
+           Exit;
+         end;
+       end;
+      
+      Dec(i);
+      Dec(j);
+      
+      if (stricomp(i, j) = 0) then
+      begin
+        Result := SP_SIMPLETYPO;   { 1 char mismatch }
+        Exit;
+      end;
+    end;
+    
+    
+    if (stricomp(i, t) = 0) then
+    begin
+      Result := SP_EXTRACHAR;        { extra character }
+      Exit;
+    end;
+  end;
+
+  if (t^ <> #0) and (stricomp(s, t + 1) = 0) then
+  begin
+    Result := SP_MISSINGCHAR;  { missing character }
+    Exit;
+  end;
+
+  Result := SP_VERYDIFFERENT;    { distance too large to fix. }
+end;
+
+function sort_by_quality(left, rite: Pointer): Integer;
+begin
+  Result := Integer(Pmisspelled_file(left)^.quality) - Integer(Pmisspelled_file(rite)^.quality);
+end;
+
+function check_speling(r: Prequest_rec): Integer; cdecl;
+var
+  cfg: Pspconfig;
+  good, bad, postgood, url: PChar;
+  dirent: apr_finfo_t;
+  filoc, dotloc, urlen, pglen: Integer;
+  candidates: Papr_array_header_t = nil;
+  dir: Papr_dir_t;
+  q: sp_reason;
+  sp_new, variant_, nvariant_: Pmisspelled_file;
+  nuri, ref, vuri, reason: PChar;
+  i, entloc: Integer;
+  p, sub_pool: Papr_pool_t;
+  notes: Papr_table_t;
+  t, v: Papr_array_header_t;
+  List: TList;
+  plist: Pointer;
+begin
+  cfg := Pspconfig(ap_get_module_config(r^.per_dir_config, @speling_module));
+  if (cfg^ .enabled = 0) then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { We only want to worry about GETs }
+  if (r^.method_number <> M_GET) then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { We've already got a file of some kind or another }
+  if (Integer(r^.finfo.filetype) <> 0) then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { Not a file request }
+  if (r^.proxyreq>0) or not assigned(r^.filename) then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { This is a sub request - don't mess with it }
+  if (r^.main <> nil) then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  {
+   * The request should end up looking like this:
+   * r->uri: /correct-url/mispelling/more
+   * r->filename: /correct-file/mispelling r->path_info: /more
+   *
+   * So we do this in steps. First break r->filename into two pieces
+   }
+
+  filoc := ap_rind(r^.filename, '/');
+  {
+   * Don't do anything if the request doesn't contain a slash, or
+   * requests "/"
+   }
+  if (filoc = -1) or (strcomp(r^.uri, '/') = 0) then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { good = /correct-file }
+  good := apr_pstrndup(r^.pool, r^.filename, filoc);
+  { bad = mispelling }
+  bad := apr_pstrdup(r^.pool, r^.filename + filoc + 1);
+  { postgood = mispelling/more }
+  postgood := apr_pstrcat(r^.pool, [bad, r^.path_info, nil]);
+
+  urlen := strlen(r^.uri);
+  pglen := strlen(postgood);
+
+  { Check to see if the URL pieces add up }
+  if (strcomp(postgood, r^.uri + (urlen - pglen))) <> 0 then
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  { url = /correct-url }
+  url := apr_pstrndup(r^.pool, r^.uri, (urlen - pglen));
+
+  { Now open the directory and do ourselves a check... }
+  if (apr_dir_open(@dir, good, r^.pool) <> APR_SUCCESS) then
+      { Oops, not a directory... }
+  begin
+    Result := DECLINED;
+    Exit;
+  end;
+
+  candidates := apr_array_make(r^.pool, 2, sizeof(misspelled_file));
+
+  dotloc := ap_ind(bad, '.');
+
+  if (dotloc = -1) then dotloc := strlen(bad);
+
+  while (apr_dir_read(@dirent, APR_FINFO_DIRENT, dir) = APR_SUCCESS) do
+  begin
+    {
+     * If we end up with a "fixed" URL which is identical to the
+     * requested one, we must have found a broken symlink or some such.
+     * Do _not_ try to redirect this, it causes a loop!
+     }
+    if (strcomp(bad, dirent.name) = 0) then
+    begin
+      apr_dir_close(dir);
+      Result := OK;
+    end
+
+    {
+     * miscapitalization errors are checked first (like, e.g., lower case
+     * file, upper case request)
+     }
+    else if (stricomp(bad, dirent.name) = 0) then
+    begin
+      sp_new := Pmisspelled_file(apr_array_push(candidates));
+      sp_new^.name := apr_pstrdup(r^.pool, dirent.name);
+      sp_new^.quality := SP_MISCAPITALIZED;
+    end
+
+    {
+     * simple typing errors are checked next (like, e.g.,
+     * missing/extra/transposed char)
+     }
+    else if (spdist(bad, dirent.name) <> SP_VERYDIFFERENT) then
+    begin
+      q := spdist(bad, dirent.name);
+        
+      sp_new := Pmisspelled_file(apr_array_push(candidates));
+      sp_new^.name := apr_pstrdup(r^.pool, dirent.name);
+      sp_new^.quality := q;
+    end
+
+    {
+     * The spdist() should have found the majority of the misspelled
+     * requests.  It is of questionable use to continue looking for
+     * files with the same base name, but potentially of totally wrong
+     * type (index.html <-> index.db).
+     * I would propose to not set the WANT_BASENAME_MATCH define.
+     *      08-Aug-1997 <[email protected]>
+     *
+     * However, Alexei replied giving some reasons to add it anyway:
+     * > Oh, by the way, I remembered why having the
+     * > extension-stripping-and-matching stuff is a good idea:
+     * >
+     * > If you're using MultiViews, and have a file named foobar.html,
+     * > which you refer to as "foobar", and someone tried to access
+     * > "Foobar", mod_speling won't find it, because it won't find
+     * > anything matching that spelling. With the extension-munging,
+     * > it would locate "foobar.html". Not perfect, but I ran into
+     * > that problem when I first wrote the module.
+     }
+    else
+    begin
+{$ifdef WANT_BASENAME_MATCH}
+      {
+       * Okay... we didn't find anything. Now we take out the hard-core
+       * power tools. There are several cases here. Someone might have
+       * entered a wrong extension (.htm instead of .html or vice
+       * versa) or the document could be negotiated. At any rate, now
+       * we just compare stuff before the first dot. If it matches, we
+       * figure we got us a match. This can result in wrong things if
+       * there are files of different content types but the same prefix
+       * (e.g. foo.gif and foo.html) This code will pick the first one
+       * it finds. Better than a Not Found, though.
+       }
+      entloc := ap_ind(dirent.name, '.');
+      if (entloc = -1) then entloc := strlen(dirent.name);
+
+      if ((dotloc = entloc) and not strncasecmp(bad, dirent.name, dotloc)) then
+      begin
+	sp_new := Pmisspelled_file(apr_array_push(candidates));
+        sp_new^.name := apr_pstrdup(r^.pool, dirent.name);
+        sp_new^.quality := SP_VERYDIFFERENT;
+      end;
+{$endif}
+    end;
+  end;
+    
+  apr_dir_close(dir);
+
+  if (candidates^.nelts <> 0) then
+  begin
+    { Wow... we found us a mispelling. Construct a fixed url }
+    variant_ := Pmisspelled_file(candidates^.elts);
+
+    ref := apr_table_get(r^.headers_in, 'Referer');
+
+    List := TList.Create;
+    
+    try
+      for i := 0 to candidates^.nelts - 1 do
+      begin
+        plist := Pointer(candidates^.elts);
+        Inc(plist, sizeof(misspelled_file));
+        List.Add(plist);
+      end;
+
+      List.Sort(@sort_by_quality);
+    finally
+      List.Free;
+    end;
+
+    {
+     * Conditions for immediate redirection:
+     *     a) the first candidate was not found by stripping the suffix
+     * AND b) there exists only one candidate OR the best match is not
+     *         ambiguous
+     * then return a redirection right away.
+     }
+    nvariant_ := variant_;
+    Inc(nvariant_, sizeof(misspelled_file));
+     
+    if (variant_^.quality <> SP_VERYDIFFERENT) and ( (candidates^.nelts = 1)
+     or (Integer(variant_^.quality) <> Integer(nvariant_^.quality))) then
+    begin
+      nuri := ap_escape_uri(r^.pool, apr_pstrcat(r^.pool, [url,
+						     variant_^.name,
+						     r^.path_info, nil]));
+      if (r^.parsed_uri.query^ <> #0) then
+       nuri := apr_pstrcat(r^.pool, [nuri, PChar('?'), r^.parsed_uri.query, nil]);
+
+      apr_table_setn(r^.headers_out, 'Location',
+			  ap_construct_url(r^.pool, nuri, r));
+
+      if ref^ <> #0 then
+       ap_log_rerror(MODULE_NAME, 506, APLOG_INFO, APR_SUCCESS,
+        r, 'Fixed spelling: %s to %s from %s',  [r^.uri, nuri, ref])
+      else
+       ap_log_rerror(MODULE_NAME, 506, APLOG_INFO, APR_SUCCESS,
+        r, 'Fixed spelling: %s to %s',  [r^.uri, nuri, ref]);
+
+      Result := HTTP_MOVED_PERMANENTLY;
+      Exit;
+    end
+    {
+     * Otherwise, a "[300] Multiple Choices" list with the variants is
+     * returned.
+     }
+    else
+    begin
+      if (r^.main = nil) then
+      begin
+        p := r^.pool;
+        notes := r^.notes;
+      end
+      else
+      begin
+        p := r^.main^.pool;
+        notes := r^.main^.notes;
+      end;
+
+      if (apr_pool_create(@sub_pool, p) <> APR_SUCCESS) then
+      begin
+        Result := DECLINED;
+        Exit;
+      end;
+          
+      t := apr_array_make(sub_pool, candidates^.nelts * 8 + 8, sizeof(PChar));
+      v := apr_array_make(sub_pool, candidates^.nelts * 5, sizeof(PChar));
+
+       { Generate the response text. }
+
+      PPChar(apr_array_push(t))^ := 'The document name you requested (<code>';
+      PPChar(apr_array_push(t))^ := ap_escape_html(sub_pool, r^.uri);
+      PPChar(apr_array_push(t))^ :=
+		   '</code>) could not be found on this server.' + LineEnding +
+		   'However, we found documents with names similar ' +
+		   'to the one you requested.<p>' +
+		   'Available documents:' + LineEnding + '<ul>' + LineEnding;
+
+            for i := 0 to candidates^.nelts -1 do
+            begin
+		reason := sp_reason_str[Integer(variant_[i].quality)];
+                { The format isn't very neat... }
+                if r^.parsed_uri.query <> nil then
+                 vuri := apr_pstrcat(sub_pool, [url, variant_[i].name, r^.path_info,
+                  '?', r^.parsed_uri.query, nil])
+                else vuri := apr_pstrcat(sub_pool, [url, variant_[i].name, r^.path_info,
+		 PChar(''), PChar(''), nil]);
+   
+		PPChar(apr_array_push(v))^ := '"';
+		PPChar(apr_array_push(v))^ := ap_escape_uri(sub_pool, vuri);
+		PPChar(apr_array_push(v))^ := '";"';
+		PPChar(apr_array_push(v))^ := reason;
+		PPChar(apr_array_push(v))^ := '"';
+
+		PPChar(apr_array_push(t))^ := '<li><a href="';
+		PPChar(apr_array_push(t))^ := ap_escape_uri(sub_pool, vuri);
+		PPChar(apr_array_push(t))^ := '">';
+		PPChar(apr_array_push(t))^ := ap_escape_html(sub_pool, vuri);
+		PPChar(apr_array_push(t))^ := '</a> (';
+		PPChar(apr_array_push(t))^ := reason;
+		PPChar(apr_array_push(t))^ := ')' + LineEnding;
+
+                {
+                 * when we have printed the "close matches" and there are
+                 * more "distant matches" (matched by stripping the suffix),
+                 * then we insert an additional separator text to suggest
+                 * that the user LOOK CLOSELY whether these are really the
+                 * files she wanted.
+                 }
+                if (i > 0) and (i < candidates^.nelts - 1)
+                    and (variant_[i].quality <> SP_VERYDIFFERENT)
+                    and (variant_[i + 1].quality = SP_VERYDIFFERENT) then
+                 PPChar(apr_array_push(t))^ :=
+		  '</ul>' + LineEnding + 'Furthermore, the following related ' +
+                  'documents were found:' + LineEnding + '<ul>' + LineEnding;
+            end;
+            
+	    PPChar(apr_array_push(t))^ := '</ul>' + LineEnding;
+
+            { If we know there was a referring page, add a note: }
+            if (ref <> nil) then
+            begin
+              PPChar(apr_array_push(t))^ :=
+	       'Please consider informing the owner of the <a href="';
+	      PPChar(apr_array_push(t))^ := ap_escape_uri(sub_pool, ref);
+              PPChar(apr_array_push(t))^ := '">referring page</a> about the broken link.' + LineEnding;
+            end;
+
+            { Pass our apr_table_t to http_protocol.c (see mod_negotiation): }
+            apr_table_setn(notes, 'variant-list', apr_array_pstrcat(p, t, #0));
+
+	    apr_table_mergen(r^.subprocess_env, 'VARIANTS', apr_array_pstrcat(p, v, ','));
+
+	    apr_pool_destroy(sub_pool);
+
+            if ref <> '' then
+             ap_log_rerror(MODULE_NAME, 609, APLOG_INFO, 0, r,
+	      'Spelling fix: %s: %d candidates from %s', [r^.uri, candidates^.nelts, ref])
+            else ap_log_rerror(MODULE_NAME, 609, APLOG_INFO, 0, r,
+	      'Spelling fix: %s: %d candidates', [r^.uri, candidates^.nelts, ref]);
+
+            Result := HTTP_MULTIPLE_CHOICES;
+        end;
+    end;
+
+    Result := OK;
+end;
+
+procedure register_hooks_(p: Papr_pool_t); cdecl;
+begin
+  ap_hook_fixups(@check_speling, nil, nil, APR_HOOK_LAST);
+end;
+
+begin
+  default_module_ptr := @speling_module;
+  FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0);
+
+  STANDARD20_MODULE_STUFF(default_module_ptr^);
+
+  {* Define the directives specific to this module.  This structure is referenced
+   * later by the 'module' structure. }
+   
+  with speling_cmds do
+  begin
+    name := 'CheckSpelling';
+    func := cmd_func(@set_speling);
+    cmd_data := nil;
+    req_override := OR_OPTIONS;
+    args_how := FLAG;
+    errmsg := 'whether or not to fix miscapitalized/misspelled requests';
+  end;
+
+  with speling_module do
+  begin
+    name := MODULE_NAME;
+    magic := MODULE_MAGIC_COOKIE;
+    create_dir_config := @create_mconfig_for_directory;    { per-directory config creator }
+    merge_dir_config := nil;     { dir config merger }
+    create_server_config := @create_mconfig_for_server; { server config creator }
+    merge_server_config := nil;  { server config merger }
+    cmds := @speling_cmds;                 { command table }
+    register_hooks := @register_hooks_; { set up other request processing hooks }
+  end;
+end.
+

+ 42 - 0
packages/httpd22/examples/testmodule.pp

@@ -0,0 +1,42 @@
+{*******************************************************************
+*  Test library of the Apache Pascal Headers
+*******************************************************************}
+library testmodule;
+
+{$i define.inc}
+
+{*******************************************************************
+*  Assembler code to export variables on UNIXes
+*******************************************************************}
+uses
+ httpd,
+ minimain in 'minimain.pas';
+
+var
+ test_module: module; {$ifdef Unix} public name 'test_module'; {$endif}
+ default_module_ptr: Pmodule;
+
+{*******************************************************************
+*  Free Pascal only supports exporting variables on Windows
+*******************************************************************}
+{$ifdef WINDOWS}
+exports
+ test_module name 'test_module';
+{$endif}
+
+{*******************************************************************
+*  Library initialization code
+*******************************************************************}
+begin
+  default_module_ptr := @test_module;
+  FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0);
+  with default_module_ptr^ do begin
+    version := MODULE_MAGIC_NUMBER_MAJOR;
+    minor_version := MODULE_MAGIC_NUMBER_MINOR;
+    module_index := -1;
+    name := 'testmodule.so';
+    magic := MODULE_MAGIC_COOKIE;
+    register_hooks := @RegisterHooks;
+  end;
+end.
+

+ 94 - 0
packages/httpd22/fpmake.pp

@@ -0,0 +1,94 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+  P : TPackage;
+  T : TTarget;
+begin
+  With Installer do
+    begin
+{$endif ALLPACKAGES}
+
+    P:=AddPackage('httpd22');
+{$ifdef ALLPACKAGES}
+    P.Directory:='httpd22';
+{$endif ALLPACKAGES}
+    P.Version:='2.0.0';
+    P.SourcePath.Add('src');
+//    P.Dependencies.Add('x11');
+
+    T:=P.Targets.AddUnit('apriconv.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('apr_iconv.inc');
+          AddInclude('api_version.inc');
+          AddUnit('apr');
+        end;
+    T:=P.Targets.AddUnit('apr.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('apr_errno.inc');
+          AddInclude('apr_pools.inc');
+          AddInclude('apr_allocator.inc');
+          AddInclude('apr_general.inc');
+          AddInclude('apr_dso.inc');
+          AddInclude('apr_user.inc');
+          AddInclude('apr_time.inc');
+          AddInclude('apr_tables.inc');
+          AddInclude('apr_file_info.inc');
+          AddInclude('apr_file_io.inc');
+          AddInclude('apr_strings.inc');
+          AddInclude('apr_lib.inc');
+          AddInclude('apr_signal.inc');
+          AddInclude('apr_network_io.inc');
+          AddInclude('apr_thread_proc.inc');
+          AddInclude('apr_version.inc');
+          AddInclude('apr_poll.inc');
+        end;
+    T:=P.Targets.AddUnit('aprutil.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('apr_xml.inc');
+          AddInclude('apr_uri.inc');
+          AddInclude('apr_md5.inc');
+          AddInclude('apr_xlate.inc');
+          AddUnit('apr');
+        end;
+    T:=P.Targets.AddUnit('httpd.pas');
+      with T.Dependencies do
+        begin
+          AddInclude('ap_provider.inc');
+          AddInclude('util_cfgtree.inc');
+          AddInclude('httpd.inc');
+          AddInclude('ap_config.inc');
+          AddInclude('ap_mmn.inc');
+          AddInclude('ap_release.inc');
+          AddInclude('apr_buckets.inc');
+          AddInclude('ap_regex.inc');
+          AddInclude('http_config.inc');
+          AddInclude('http_core.inc');
+          AddInclude('apr_hash.inc');
+          AddInclude('util_filter.inc');
+          AddInclude('http_log.inc');
+          AddInclude('http_main.inc');
+          AddInclude('http_protocol.inc');
+          AddInclude('http_request.inc');
+          AddInclude('http_connection.inc');
+          AddInclude('http_vhost.inc');
+          AddInclude('util_script.inc');
+          AddInclude('util_time.inc');
+          AddInclude('util_md5.inc');
+          AddInclude('ap_mpm.inc');
+          AddUnit('apr');
+          AddUnit('aprutil');
+        end;
+
+
+{$ifndef ALLPACKAGES}
+    Run;
+    end;
+end.
+{$endif ALLPACKAGES}

+ 0 - 0
packages/base/httpd/httpd-2.2/ap_config.inc → packages/httpd22/src/ap_config.inc


+ 0 - 0
packages/base/httpd/httpd-2.2/ap_mmn.inc → packages/httpd22/src/ap_mmn.inc


+ 0 - 0
packages/base/httpd/httpd-2.2/ap_mpm.inc → packages/httpd22/src/ap_mpm.inc


部分文件因文件數量過多而無法顯示