Skip to content

Commit 9bae4d6

Browse files
committed
Disable man documentation on Windows
1 parent 7c499f7 commit 9bae4d6

File tree

6 files changed

+122
-65
lines changed

6 files changed

+122
-65
lines changed

cmake/ext/phar/CMakeLists.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,25 @@ add_dependencies(php_ext_phar php_ext_hash php_ext_spl)
9797
include(cmake/GenerateGrammar.cmake)
9898

9999
################################################################################
100-
# Man documentation.
100+
# Configure man documentation.
101101
################################################################################
102102

103-
configure_file(phar.1.in phar.1 @ONLY)
104-
configure_file(phar.phar.1.in phar.phar.1 @ONLY)
103+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
104+
configure_file(phar.1.in phar.1 @ONLY)
105+
configure_file(phar.phar.1.in phar.phar.1 @ONLY)
105106

106-
install(
107-
FILES ${CMAKE_CURRENT_BINARY_DIR}/phar.1
108-
RENAME ${PHP_PROGRAM_PREFIX}phar${PHP_PROGRAM_SUFFIX}.1
109-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
110-
)
107+
install(
108+
FILES ${CMAKE_CURRENT_BINARY_DIR}/phar.1
109+
RENAME ${PHP_PROGRAM_PREFIX}phar${PHP_PROGRAM_SUFFIX}.1
110+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
111+
)
111112

112-
install(
113-
FILES ${CMAKE_CURRENT_BINARY_DIR}/phar.phar.1
114-
RENAME ${PHP_PROGRAM_PREFIX}phar${PHP_PROGRAM_SUFFIX}.phar.1
115-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
116-
)
113+
install(
114+
FILES ${CMAKE_CURRENT_BINARY_DIR}/phar.phar.1
115+
RENAME ${PHP_PROGRAM_PREFIX}phar${PHP_PROGRAM_SUFFIX}.phar.1
116+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
117+
)
118+
endif()
117119

118120
################################################################################
119121
# The phar command-line script.

cmake/sapi/cgi/CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,27 @@ else()
7171
message(CHECK_FAIL "no")
7272
endif()
7373

74-
# Man documentation.
75-
configure_file(php-cgi.1.in php-cgi.1 @ONLY)
76-
7774
install(
7875
TARGETS php_sapi_cgi
7976
RUNTIME
8077
DESTINATION ${CMAKE_INSTALL_BINDIR}
8178
)
8279

83-
install(
84-
FILES ${CMAKE_CURRENT_BINARY_DIR}/php-cgi.1
85-
RENAME ${PHP_PROGRAM_PREFIX}php-cgi${PHP_PROGRAM_SUFFIX}.1
86-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
87-
)
80+
################################################################################
81+
# Configure man documentation.
82+
################################################################################
83+
84+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
85+
configure_file(php-cgi.1.in php-cgi.1 @ONLY)
86+
install(
87+
FILES ${CMAKE_CURRENT_BINARY_DIR}/php-cgi.1
88+
RENAME ${PHP_PROGRAM_PREFIX}php-cgi${PHP_PROGRAM_SUFFIX}.1
89+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
90+
)
91+
endif()
92+
93+
################################################################################
94+
# Configuration header.
95+
################################################################################
8896

8997
configure_file(cmake/config.h.in config.h)

cmake/sapi/cli/CMakeLists.txt

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
144144
endif()
145145
endif()
146146

147-
# Man documentation.
148-
block()
149-
set(program_prefix "${PHP_PROGRAM_PREFIX}")
150-
configure_file(php.1.in php.1 @ONLY)
151-
endblock()
152-
153147
install(
154148
TARGETS php_sapi_cli
155149
RUNTIME
@@ -158,12 +152,6 @@ install(
158152
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/sapi/cli
159153
)
160154

161-
install(
162-
FILES ${CMAKE_CURRENT_BINARY_DIR}/php.1
163-
RENAME ${PHP_PROGRAM_PREFIX}php${PHP_PROGRAM_SUFFIX}.1
164-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
165-
)
166-
167155
################################################################################
168156
# The cli SAPI without console on Windows.
169157
################################################################################
@@ -207,4 +195,24 @@ if(PHP_SAPI_CLI_WIN_NO_CONSOLE)
207195
)
208196
endif()
209197

198+
################################################################################
199+
# Configure man documentation.
200+
################################################################################
201+
202+
block()
203+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
204+
set(program_prefix "${PHP_PROGRAM_PREFIX}")
205+
configure_file(php.1.in php.1 @ONLY)
206+
install(
207+
FILES ${CMAKE_CURRENT_BINARY_DIR}/php.1
208+
RENAME ${PHP_PROGRAM_PREFIX}php${PHP_PROGRAM_SUFFIX}.1
209+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
210+
)
211+
endif()
212+
endblock()
213+
214+
################################################################################
215+
# Configuration header.
216+
################################################################################
217+
210218
configure_file(cmake/config.h.in config.h)

cmake/sapi/fpm/CMakeLists.txt

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,9 @@ if(PHP_SAPI_FPM_SELINUX)
535535
endif()
536536

537537
################################################################################
538-
# Install files.
538+
# Configure man documentation.
539539
################################################################################
540540

541-
# Configure man documentation.
542541
block()
543542
# Replace the hardcoded runstatedir with a template placeholder.
544543
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/php-fpm.8.in" content)
@@ -549,7 +548,11 @@ block()
549548
content
550549
"${content}"
551550
)
552-
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/PHP/php-fpm.8.in" "${content}")
551+
file(
552+
WRITE
553+
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/PHP/php-fpm.8.in"
554+
"${content}"
555+
)
553556

554557
string(CONFIGURE [[
555558
set(php_fpm_localstatedir "$<PATH:ABSOLUTE_PATH,NORMALIZE,@CMAKE_INSTALL_LOCALSTATEDIR@,${CMAKE_INSTALL_PREFIX}>")
@@ -582,7 +585,10 @@ block()
582585
)
583586
endblock()
584587

588+
################################################################################
585589
# Configure php-fpm.conf.
590+
################################################################################
591+
586592
block()
587593
string(CONFIGURE [[
588594
set(prefix "${CMAKE_INSTALL_PREFIX}")
@@ -608,7 +614,10 @@ block()
608614
install(CODE "${code}")
609615
endblock()
610616

617+
################################################################################
611618
# Configure www.conf.
619+
################################################################################
620+
612621
block()
613622
string(CONFIGURE [[
614623
set(prefix "${CMAKE_INSTALL_PREFIX}")
@@ -636,7 +645,10 @@ block()
636645
install(CODE "${code}")
637646
endblock()
638647

648+
################################################################################
639649
# Configure init.d.php-fpm.
650+
################################################################################
651+
640652
block()
641653
# Replace the hardcoded runstatedir with a template placeholder.
642654
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/init.d.php-fpm.in" content)
@@ -677,7 +689,10 @@ block()
677689
install(CODE "${code}")
678690
endblock()
679691

692+
################################################################################
680693
# Configure init.d.php-fpm.
694+
################################################################################
695+
681696
block()
682697
# Replace the hardcoded runstatedir with a template placeholder.
683698
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/php-fpm.service.in" content)
@@ -717,6 +732,10 @@ block()
717732
install(CODE "${code}")
718733
endblock()
719734

735+
################################################################################
736+
# Installation.
737+
################################################################################
738+
720739
install(TARGETS php_sapi_fpm RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
721740

722741
php_install(CODE "
@@ -758,7 +777,10 @@ php_install(CODE "
758777
endif()
759778
")
760779

780+
################################################################################
761781
# FPM info status HTML page.
782+
################################################################################
783+
762784
configure_file(status.html.in status.html @ONLY)
763785

764786
install(
@@ -767,4 +789,8 @@ install(
767789
DESTINATION ${CMAKE_INSTALL_DATADIR}/fpm
768790
)
769791

792+
################################################################################
793+
# Configuration header.
794+
################################################################################
795+
770796
configure_file(cmake/config.h.in config.h)

cmake/sapi/phpdbg/CMakeLists.txt

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,24 +268,12 @@ endif()
268268
# Installation.
269269
################################################################################
270270

271-
# Man documentation.
272-
block()
273-
set(program_prefix "${PHP_PROGRAM_PREFIX}")
274-
configure_file(phpdbg.1.in phpdbg.1 @ONLY)
275-
endblock()
276-
277271
install(
278272
TARGETS php_sapi_phpdbg
279273
RUNTIME
280274
DESTINATION ${CMAKE_INSTALL_BINDIR}
281275
)
282276

283-
install(
284-
FILES ${CMAKE_CURRENT_BINARY_DIR}/phpdbg.1
285-
RENAME ${PHP_PROGRAM_PREFIX}phpdbg${PHP_PROGRAM_SUFFIX}.1
286-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
287-
)
288-
289277
# Create log and run directories on installation.
290278
php_install(CODE "
291279
file(
@@ -333,4 +321,24 @@ if(TARGET php_sapi_phpdbg_shared)
333321
)
334322
endif()
335323

324+
################################################################################
325+
# Configure man documentation.
326+
################################################################################
327+
328+
block()
329+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
330+
set(program_prefix "${PHP_PROGRAM_PREFIX}")
331+
configure_file(phpdbg.1.in phpdbg.1 @ONLY)
332+
install(
333+
FILES ${CMAKE_CURRENT_BINARY_DIR}/phpdbg.1
334+
RENAME ${PHP_PROGRAM_PREFIX}phpdbg${PHP_PROGRAM_SUFFIX}.1
335+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
336+
)
337+
endif()
338+
endblock()
339+
340+
################################################################################
341+
# Configuration header.
342+
################################################################################
343+
336344
configure_file(cmake/config.h.in config.h)

cmake/scripts/CMakeLists.txt

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
# Man documentation.
2-
block()
3-
set(program_prefix "${PHP_PROGRAM_PREFIX}")
1+
##############################################################################
2+
# Configure man documentation.
3+
##############################################################################
44

5-
message(STATUS "Creating scripts/man1/php-config.1")
6-
configure_file(man1/php-config.1.in man1/php-config.1 @ONLY)
7-
install(
8-
FILES ${PROJECT_BINARY_DIR}/scripts/man1/php-config.1
9-
RENAME ${PHP_PROGRAM_PREFIX}php-config${PHP_PROGRAM_SUFFIX}.1
10-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
11-
)
5+
block()
6+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
7+
set(program_prefix "${PHP_PROGRAM_PREFIX}")
8+
9+
message(STATUS "Creating scripts/man1/php-config.1")
10+
configure_file(man1/php-config.1.in man1/php-config.1 @ONLY)
11+
install(
12+
FILES ${PROJECT_BINARY_DIR}/scripts/man1/php-config.1
13+
RENAME ${PHP_PROGRAM_PREFIX}php-config${PHP_PROGRAM_SUFFIX}.1
14+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
15+
)
1216

13-
message(STATUS "Creating scripts/man1/phpize.1")
14-
configure_file(man1/phpize.1.in man1/phpize.1 @ONLY)
15-
install(
16-
FILES ${PROJECT_BINARY_DIR}/scripts/man1/phpize.1
17-
RENAME ${PHP_PROGRAM_PREFIX}phpize${PHP_PROGRAM_SUFFIX}.1
18-
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
19-
)
17+
message(STATUS "Creating scripts/man1/phpize.1")
18+
configure_file(man1/phpize.1.in man1/phpize.1 @ONLY)
19+
install(
20+
FILES ${PROJECT_BINARY_DIR}/scripts/man1/phpize.1
21+
RENAME ${PHP_PROGRAM_PREFIX}phpize${PHP_PROGRAM_SUFFIX}.1
22+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
23+
)
24+
endif()
2025
endblock()
2126

2227
# The php-config and phpize scripts.

0 commit comments

Comments
 (0)