Skip to content

Commit 3fd323f

Browse files
committed
Update docs
1 parent 3797b09 commit 3fd323f

File tree

2 files changed

+50
-13
lines changed

2 files changed

+50
-13
lines changed

docs/cross-compiling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ programs with build system run checks isn't always feasible or guaranteed.
2020
## 2. Cross-compilation with CMake
2121

2222
CMake has `try_run()`, `check_source_runs()`, and
23-
`check_<LANG>_source_runs()` to check whether a test program compiles and runs
24-
as expected.
23+
`check_<LANG>_source_runs()` commands to check whether a test program compiles
24+
and runs as expected.
2525

2626
A minimum simplistic example:
2727

@@ -47,7 +47,7 @@ check_source_runs(C [[
4747
Setting target system name puts CMake in the cross-compilation mode:
4848

4949
```sh
50-
cmake . -DCMAKE_SYSTEM_NAME=Linux
50+
cmake -DCMAKE_SYSTEM_NAME=Linux -S . -B build
5151
```
5252

5353
CMake will emit error indicating that cache variable `HAVE_HELLO_WORLD_EXITCODE`
@@ -71,7 +71,7 @@ When certain check result is known for the target system, the cache variables
7171
can be set manually. For example:
7272

7373
```sh
74-
cmake . -DCMAKE_SYSTEM_NAME=Linux -DHAVE_HELLO_WORLD_EXITCODE=0
74+
cmake -DCMAKE_SYSTEM_NAME=Linux -DHAVE_HELLO_WORLD_EXITCODE=0 -S . -B build
7575
```
7676

7777
### 2.2. CMAKE_CROSSCOMPILING variable
@@ -101,7 +101,7 @@ then run with provided emulator as they were running on the targeted system if
101101
such emulator exists on the host system.
102102

103103
```sh
104-
cmake . -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/env
104+
cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/env -S . -B build
105105
```
106106

107107
Example, how to use the cross-compiling emulator with the run check:

docs/php-installation.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
> **Before running the `make install` or `cmake --install` command, be aware
55
> that files will be copied outside of your current build directory.**
66
7-
## Introduction
7+
## Index
8+
9+
* [1. Introduction](#1-introduction)
10+
* [2. Autotools-based build system](#2-autotools-based-build-system)
11+
* [3. JScript-based Windows build system](#3-jscript-based-windows-build-system)
12+
* [4. CMake-based build system](#4-cmake-based-build-system)
13+
* [4.1. Installation directory structure](#41-installation-directory-structure)
14+
15+
## 1. Introduction
816

917
When we think about installing software, we often imagine downloading a package
1018
and setting it up on the system, ready for immediate use.
@@ -24,12 +32,12 @@ predefined directory structure. Some files may also be generated or modified
2432
according to the final installation location, known as the
2533
*installation prefix*.
2634

27-
It's important to note that this type of PHP installations are usually managed
28-
by package managers, which handle this process through automated scripts.
35+
It's important to note that this type of PHP installation is usually managed by
36+
package managers, that handle this process through automated scripts.
2937
Additionally, applying patches to tailor the PHP package to suit the specific
30-
requirements of the target system is common practice.
38+
requirements of the target system is a common practice.
3139

32-
## Installing PHP with Autotools-based build system
40+
## 2. Autotools-based build system
3341

3442
The default way to install PHP using Autotools across the system directories can
3543
be done like this:
@@ -214,9 +222,38 @@ and the `share` directory being named `php`:
214222
└─📂 temp
215223
```
216224

217-
## Installing PHP with CMake
225+
## 3. JScript-based Windows build system
226+
227+
Inside a Windows PowerShell:
228+
229+
```sh
230+
# Clone SDK binary tools Git repository
231+
git clone https://github.com/php/php-sdk-binary-tools C:\php-sdk
232+
cd C:\php-sdk
233+
234+
.\phpsdk-vs17-x64.bat
235+
phpsdk_buildtree phpmaster
236+
237+
git clone https://github.com/php/php-src
238+
cd php-src
239+
phpsdk_deps --update --branch master
240+
241+
# Create Windows configure.bat script
242+
.\buildconf.bat
243+
244+
# Configure PHP build and create Makefile
245+
.\configure.bat --with-prefix=<installation-prefix>
246+
247+
# Build PHP
248+
nmake
249+
250+
# Install built files
251+
nmake install
252+
```
253+
254+
## 4. CMake-based build system
218255

219-
In this repository, installing PHP with CMake can be done in a similar way:
256+
Installing PHP with CMake can be done in a similar way:
220257

221258
```sh
222259
# Configuration and generation of build system files:
@@ -301,7 +338,7 @@ PHP CMake-based build system specific installation cache variables:
301338
`20230901-zts-debug` for thread-safe debug build, or `20230901` for
302339
non-thread-safe build
303340

304-
### Installation directory structure
341+
### 4.1. Installation directory structure
305342

306343
PHP installation directory structure when using CMake:
307344

0 commit comments

Comments
 (0)