Skip to content

Commit eb5aaa5

Browse files
committed
Update docs
1 parent 7496e48 commit eb5aaa5

File tree

5 files changed

+97
-69
lines changed

5 files changed

+97
-69
lines changed

docs/autotools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ PHP build system is a collection of various files across the php-src repository:
116116
├─ scripts/
117117
└─ TSRM/
118118
├─ threads.m4 # Autoconf macros for pthreads
119-
└─ tsrm.m4 # Autoconf macros for TSRM directory
119+
└─ tsrm.m4 # Autoconf macros for TSRM
120120
└─ Zend/
121121
├─ Makefile.frag # Makefile fragment for Zend engine
122-
└─ Zend.m4 # Autoconf macros for Zend directory
122+
└─ Zend.m4 # Autoconf macros for Zend engine
123123
├─ buildconf # Wrapper for autoconf and autoheader tools
124124
└─ configure.ac # Autoconf main input file for creating configure script
125125
```

docs/cmake-code-style.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,15 @@ that context.
314314
set(_temporary_variable <value>)
315315
```
316316

317-
Variables named `_` can be used for values that are not important for code:
318-
319-
```cmake
320-
# For example, here only the matched value of CMAKE_MATCH_1 is important.
321-
string(REGEX MATCH "foo\\(([0-9]+)\\)" _ "${content}")
322-
message(STATUS "${CMAKE_MATCH_1}")
323-
```
317+
> [!TIP]
318+
> Variables named `_` can be used for values that are not important for code.
319+
> For example, here only the matched value of variable `CMAKE_MATCH_1` is
320+
> important:
321+
>
322+
> ```cmake
323+
> string(REGEX MATCH "foo\\(([0-9]+)\\)" _ "${content}")
324+
> message(STATUS "${CMAKE_MATCH_1}")
325+
> ```
324326
325327
## 4. Modules
326328

docs/cmake.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ works and how it can be used.
2323
* [11. Parser and lexer files](#11-parser-and-lexer-files)
2424
* [12. Performance](#12-performance)
2525
* [13. Testing](#13-testing)
26+
* [14. Windows notes](#14-windows-notes)
27+
* [14.1. Module-definition (.def) files](#141-module-definition-def-files)
2628

2729
## 1. Directory structure
2830

@@ -43,6 +45,9 @@ repository:
4345
└─ ext/
4446
└─ date/
4547
└─ CMakeLists.txt # Extension's CMake file
48+
└─ iconv/
49+
├─ CMakeLists.txt
50+
└─ php_iconv.def # Module-definition file for linker when building DLL
4651
└─ main/
4752
├─ CMakeLists.txt # CMake file for main binding
4853
├─ config.w32.cmake.h.in # Windows configuration header template
@@ -540,3 +545,16 @@ using the `CMakePresets.json` file and its `testPresets` field.
540545
```sh
541546
ctest --preset all-enabled
542547
```
548+
549+
## 14. Windows notes
550+
551+
### 14.1. Module-definition (.def) files
552+
553+
[Module-definition (.def) files](https://learn.microsoft.com/en-us/cpp/build/reference/module-definition-dot-def-files)
554+
are added to certain php-src folders where linker needs them when building DLL.
555+
556+
In CMake they can be simply added to the target sources:
557+
558+
```cmake
559+
target_sources(php_extension_name php_extension_name.def)
560+
```

docs/configuration.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,19 +1252,19 @@ A list of Autoconf `configure` command-line configuration options, Windows
12521252
</tr>
12531253
<tr>
12541254
<td>--enable-dom</td>
1255-
<td></td>
1255+
<td>--enable-dom</td>
12561256
<td>EXT_DOM=ON</td>
12571257
<td>default</td>
12581258
</tr>
12591259
<tr>
12601260
<td>&emsp;--enable-dom=shared</td>
1261-
<td></td>
1261+
<td>--enable-dom=shared</td>
12621262
<td>EXT_DOM_SHARED=ON</td>
12631263
<td></td>
12641264
</tr>
12651265
<tr>
12661266
<td>&emsp;--disable-dom</td>
1267-
<td></td>
1267+
<td>--disable-dom</td>
12681268
<td>EXT_DOM=OFF</td>
12691269
<td></td>
12701270
</tr>
@@ -1315,7 +1315,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
13151315
</tr>
13161316
<tr>
13171317
<td>--without-ffi</td>
1318-
<td></td>
1318+
<td>--without-ffi</td>
13191319
<td>EXT_FFI=OFF</td>
13201320
<td>default</td>
13211321
</tr>
@@ -1325,7 +1325,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
13251325
&emsp;[FFI_CFLAGS=...]<br>
13261326
&emsp;[FFI_LIBS=...]
13271327
</td>
1328-
<td></td>
1328+
<td>--with-ffi</td>
13291329
<td>
13301330
EXT_FFI=ON<br>
13311331
[FFI_ROOT=DIR]
@@ -1334,7 +1334,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
13341334
</tr>
13351335
<tr>
13361336
<td>&emsp;--with-ffi=shared</td>
1337-
<td></td>
1337+
<td>--with-ffi=shared</td>
13381338
<td>EXT_FFI_SHARED=ON</td>
13391339
<td></td>
13401340
</tr>
@@ -1707,7 +1707,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
17071707
[LIBXML_CFLAGS=...]<br>
17081708
[LIBXML_LIBS=...]
17091709
</td>
1710-
<td></td>
1710+
<td>--with-libxml</td>
17111711
<td>
17121712
EXT_LIBXML=ON<br>
17131713
[LibXml2_ROOT=DIR]
@@ -1716,7 +1716,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
17161716
</tr>
17171717
<tr>
17181718
<td>&emsp;--without-libxml</td>
1719-
<td></td>
1719+
<td>--without-libxml</td>
17201720
<td>EXT_LIBXML=OFF</td>
17211721
<td></td>
17221722
</tr>
@@ -2533,19 +2533,19 @@ A list of Autoconf `configure` command-line configuration options, Windows
25332533
</tr>
25342534
<tr>
25352535
<td>--enable-session</td>
2536-
<td></td>
2536+
<td>--enable-session</td>
25372537
<td>EXT_SESSION=ON</td>
25382538
<td>default</td>
25392539
</tr>
25402540
<tr>
25412541
<td>&emsp;--enable-session=shared</td>
2542-
<td></td>
2542+
<td>N/A</td>
25432543
<td>EXT_SESSION_SHARED=ON</td>
25442544
<td></td>
25452545
</tr>
25462546
<tr>
25472547
<td>&emsp;--disable-session</td>
2548-
<td></td>
2548+
<td>--disable-session</td>
25492549
<td>EXT_SESSION=OFF</td>
25502550
<td></td>
25512551
</tr>
@@ -2584,19 +2584,19 @@ A list of Autoconf `configure` command-line configuration options, Windows
25842584
</tr>
25852585
<tr>
25862586
<td>--enable-simplexml</td>
2587-
<td></td>
2587+
<td>--enable-simplexml</td>
25882588
<td>EXT_SIMPLEXML=ON</td>
25892589
<td>default</td>
25902590
</tr>
25912591
<tr>
25922592
<td>&emsp;--enable-simplexml=shared</td>
2593-
<td></td>
2593+
<td>--enable-simplexml=shared</td>
25942594
<td>EXT_SIMPLEXML_SHARED=ON</td>
25952595
<td></td>
25962596
</tr>
25972597
<tr>
25982598
<td>&emsp;--disable-simplexml</td>
2599-
<td></td>
2599+
<td>--disable-simplexml</td>
26002600
<td>EXT_SIMPLEXML=OFF</td>
26012601
<td></td>
26022602
</tr>
@@ -2623,37 +2623,37 @@ A list of Autoconf `configure` command-line configuration options, Windows
26232623
</tr>
26242624
<tr>
26252625
<td>--disable-soap</td>
2626-
<td></td>
2626+
<td>--disable-soap</td>
26272627
<td>EXT_SOAP=OFF</td>
26282628
<td>default</td>
26292629
</tr>
26302630
<tr>
26312631
<td>&emsp;--enable-soap</td>
2632-
<td></td>
2632+
<td>--enable-soap</td>
26332633
<td>EXT_SOAP=ON</td>
26342634
<td></td>
26352635
</tr>
26362636
<tr>
26372637
<td>&emsp;--enable-soap=shared</td>
2638-
<td></td>
2638+
<td>--enable-soap=shared</td>
26392639
<td>EXT_SOAP_SHARED=ON</td>
26402640
<td></td>
26412641
</tr>
26422642
<tr>
26432643
<td>--disable-sockets</td>
2644-
<td></td>
2644+
<td>--disable-sockets</td>
26452645
<td>EXT_SOCKETS=OFF</td>
26462646
<td>default</td>
26472647
</tr>
26482648
<tr>
26492649
<td>&emsp;--enable-sockets</td>
2650-
<td></td>
2650+
<td>--enable-sockets</td>
26512651
<td>EXT_SOCKETS=ON</td>
26522652
<td></td>
26532653
</tr>
26542654
<tr>
26552655
<td>&emsp;--enable-sockets=shared</td>
2656-
<td></td>
2656+
<td>--enable-sockets=shared</td>
26572657
<td>EXT_SOCKETS_SHARED=ON</td>
26582658
<td></td>
26592659
</tr>
@@ -2833,19 +2833,19 @@ A list of Autoconf `configure` command-line configuration options, Windows
28332833
</tr>
28342834
<tr>
28352835
<td>--enable-xml</td>
2836-
<td></td>
2836+
<td>--enable-xml</td>
28372837
<td>EXT_XML=ON</td>
28382838
<td>default</td>
28392839
</tr>
28402840
<tr>
28412841
<td>&emsp;--enable-xml=shared</td>
2842-
<td></td>
2842+
<td>--enable-xml=shared</td>
28432843
<td>EXT_XML_SHARED=ON</td>
28442844
<td></td>
28452845
</tr>
28462846
<tr>
28472847
<td>&emsp;--disable-xml</td>
2848-
<td></td>
2848+
<td>--disable-xml</td>
28492849
<td>EXT_XML=OFF</td>
28502850
<td></td>
28512851
</tr>
@@ -2868,70 +2868,70 @@ A list of Autoconf `configure` command-line configuration options, Windows
28682868
</td>
28692869
<td></td>
28702870
</tr>
2871-
<tr>
2872-
<td>--without-xsl</td>
2873-
<td></td>
2874-
<td>EXT_XSL=OFF</td>
2875-
<td>default</td>
2876-
</tr>
2877-
<tr>
2878-
<td>
2879-
&emsp;--with-xsl<br>
2880-
&emsp;[XSL_CFLAGS=...]<br>
2881-
&emsp;[XSL_LIBS=...]<br>
2882-
&emsp;[EXSLT_CFLAGS=...]<br>
2883-
&emsp;[EXSLT_LIBS=...]
2884-
</td>
2885-
<td></td>
2886-
<td>
2887-
EXT_XSL=ON<br>
2888-
[LibXslt_ROOT=DIR]<br>
2889-
[CMAKE_PREFIX_PATH=DIR]
2890-
</td>
2891-
<td></td>
2892-
</tr>
2893-
<tr>
2894-
<td>&emsp;--with-xsl=shared</td>
2895-
<td></td>
2896-
<td>EXT_XSL_SHARED=ON</td>
2897-
<td></td>
2898-
</tr>
28992871
<tr>
29002872
<td>--enable-xmlreader</td>
2901-
<td></td>
2873+
<td>--enable-xmlreader</td>
29022874
<td>EXT_XMLREADER=ON</td>
29032875
<td>default</td>
29042876
</tr>
29052877
<tr>
29062878
<td>&emsp;--enable-xmlreader=shared</td>
2907-
<td></td>
2879+
<td>--enable-xmlreader=shared</td>
29082880
<td>EXT_XMLREADER_SHARED=ON</td>
29092881
<td></td>
29102882
</tr>
29112883
<tr>
29122884
<td>&emsp;--disable-xmlreader</td>
2913-
<td></td>
2885+
<td>--disable-xmlreader</td>
29142886
<td>EXT_XMLREADER=OFF</td>
29152887
<td></td>
29162888
</tr>
29172889
<tr>
29182890
<td>--enable-xmlwriter</td>
2919-
<td></td>
2891+
<td>--enable-xmlwriter</td>
29202892
<td>EXT_XMLWRITER=ON</td>
29212893
<td>default</td>
29222894
</tr>
29232895
<tr>
29242896
<td>&emsp;--enable-xmlwriter=shared</td>
2925-
<td></td>
2897+
<td>--enable-xmlwriter=shared</td>
29262898
<td>EXT_XMLWRITER_SHARED=ON</td>
29272899
<td></td>
29282900
</tr>
29292901
<tr>
29302902
<td>&emsp;--disable-xmlwriter</td>
2931-
<td></td>
2903+
<td>--disable-xmlwriter</td>
29322904
<td>EXT_XMLWRITER=OFF</td>
29332905
<td></td>
29342906
</tr>
2907+
<tr>
2908+
<td>--without-xsl</td>
2909+
<td></td>
2910+
<td>EXT_XSL=OFF</td>
2911+
<td>default</td>
2912+
</tr>
2913+
<tr>
2914+
<td>
2915+
&emsp;--with-xsl<br>
2916+
&emsp;[XSL_CFLAGS=...]<br>
2917+
&emsp;[XSL_LIBS=...]<br>
2918+
&emsp;[EXSLT_CFLAGS=...]<br>
2919+
&emsp;[EXSLT_LIBS=...]
2920+
</td>
2921+
<td></td>
2922+
<td>
2923+
EXT_XSL=ON<br>
2924+
[LibXslt_ROOT=DIR]<br>
2925+
[CMAKE_PREFIX_PATH=DIR]
2926+
</td>
2927+
<td></td>
2928+
</tr>
2929+
<tr>
2930+
<td>&emsp;--with-xsl=shared</td>
2931+
<td></td>
2932+
<td>EXT_XSL_SHARED=ON</td>
2933+
<td></td>
2934+
</tr>
29352935
<tr>
29362936
<td>--disable-zend-test</td>
29372937
<td>--disable-zend-test</td>

docs/windows.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
* [2. Windows prerequisites](#2-windows-prerequisites)
77
* [3. Building PHP on Windows](#3-building-php-on-windows)
88
* [4. The configure.bat command-line options](#4-the-configurebat-command-line-options)
9-
* [5. See more](#5-see-more)
9+
* [5. Dependencies](#5-dependencies)
10+
* [6. See more](#6-see-more)
1011

1112
Windows build system in PHP is a separate collection of
1213
[JScript](https://en.wikipedia.org/wiki/JScript) files and command-line scripts.
@@ -38,12 +39,14 @@ Directory structure from the Windows build system perspective looks like this:
3839
└─ config.w32 # Windows build system item file for CLI SAPI
3940
└─ win32/ # Windows build system and adjusted files
4041
└─ build/ # Windows build system configuration and scripts
42+
├─ config.w32 # Main configuration file to create configure.js
4143
├─ config.w32.h.in # Windows configuration header template
44+
├─ confutils.js # The configure script utilities
4245
└─ Makefile # Windows build system Makefile template
4346
└─ TSRM/
4447
└─ config.w32 # Windows build system script item
4548
└─ Zend/
46-
└─ zend_config.w32.h # Windows configuration header for Zend directory
49+
└─ zend_config.w32.h # Windows configuration header for Zend engine
4750
└─ buildconf.bat # Windows build system configuration builder
4851
```
4952

@@ -127,6 +130,11 @@ Some common arguments can be passed to command-line options:
127130

128131
* To build extension as shared: `--enable-EXT=shared` or `--with-EXT=shared`.
129132

130-
## 5. See more
133+
## 5. Dependencies
134+
135+
PHP Windows build uses forks for some dependencies. Sources are available at
136+
[github.com/winlibs](https://github.com/winlibs).
137+
138+
## 6. See more
131139

132140
* [PHP Wiki: Build PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2)

0 commit comments

Comments
 (0)