-
Notifications
You must be signed in to change notification settings - Fork 8.1k
[FrankenPHP] Make php-cli functionality available in embed build #21385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
fd4288f
4c9ed26
c361a66
eda7f37
f48cf3e
eef8e9c
a15294c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,7 @@ | ||
| #define PHP_CLI_WIN32_NO_CONSOLE 1 | ||
| #include "php_cli.c" | ||
|
|
||
| int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) | ||
| { | ||
| return do_php_cli(__argc, __argv); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| +----------------------------------------------------------------------+ | ||
| | Copyright © The PHP Group and Contributors. | | ||
| +----------------------------------------------------------------------+ | ||
| | This source file is subject to the Modified BSD License that is | | ||
| | bundled with this package in the file LICENSE, and is available | | ||
| | through the World Wide Web at <https://www.php.net/license/>. | | ||
| | | | ||
| | SPDX-License-Identifier: BSD-3-Clause | | ||
| +----------------------------------------------------------------------+ | ||
| */ | ||
|
|
||
| #include "php.h" | ||
| #include "cli.h" | ||
|
|
||
| int main(int argc, char *argv[]) | ||
| { | ||
| return do_php_cli(argc, argv); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,3 @@ | ||
| PHP_ARG_ENABLE([embed],, | ||
| [AS_HELP_STRING([[--enable-embed[=TYPE]]], | ||
| [Enable building of embedded SAPI library TYPE is either | ||
| 'shared' or 'static'. [TYPE=shared]])], | ||
| [no], | ||
| [no]) | ||
|
|
||
| AC_MSG_CHECKING([for embedded SAPI library support]) | ||
|
|
||
| if test "$PHP_EMBED" != "no"; then | ||
|
|
@@ -33,6 +26,13 @@ if test "$PHP_EMBED" != "no"; then | |
| [php_embed.c], | ||
| [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1]) | ||
| PHP_INSTALL_HEADERS([sapi/embed], [php_embed.h]) | ||
|
|
||
| dnl Include CLI sources for do_php_cli() in libphp. | ||
| dnl We rebuild them here because cli isn't guaranteed to compile with -fPIC | ||
| PHP_ADD_SOURCES([sapi/cli], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When building with
I'm not a build system expert, but I believe that our system uses libtool to deal with this: libtool builds everything in both PIC and non-PIC mode by default (e.g.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I linked the wrong objects in then. Should be an easy fix tomorrow, thank you. |
||
| [php_cli.c php_http_parser.c php_cli_server.c ps_title.c php_cli_process_title.c], | ||
| [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1], | ||
| [sapi]) | ||
| ]) | ||
| else | ||
| AC_MSG_RESULT([no]) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| PHP_ARG_ENABLE([embed],, | ||
| [AS_HELP_STRING([[--enable-embed[=TYPE]]], | ||
| [Enable building of embedded SAPI library TYPE is either | ||
| 'shared' or 'static'. [TYPE=shared]])], | ||
| [no], | ||
| [no]) |
Uh oh!
There was an error while loading. Please reload this page.