put meson.build.pw in php-source directory


Definitions:
pwphpbytecode: complete php source are compiled to bytecode and runned in zend engine
embed: only function calls are runned in zend engine - .php is transpiled to vala
native: without zend engine
both: first native runtime modules, then embed fallback


   native is the best idea for best performance, but if function-calls missing use...
...embed, its calls the functions against the zend-routine, but functions/classes/methods are mapped in vala, but if you use special php language constructs use...
...pwphp, it only compiles to bytecode and run the complete code in zend-vm - for example composer packages







possible lines:


######### Build machinecode files over C

# Build a native VALAPHP library from PHP source. (use never libphp.so)
# Generates valaphp-libpwexample.so, valaphp-libpwexample.vapi,
# valaphp-libpwexample.h, valaphp-libpwexample.deps and
# /usr/share/valaphp/valaphp-libpwexample/valaphp-libpwexample.stub.php.
vlib-native = example.php -> valaphp-libpwexample (valaphp-runtime-core,valaphp-runtime-std)

# Build an embed VALAPHP library from PHP source. (use libphp.so)
vlib-embed = example.php -> valaphp-libpwexample (valaphp-runtime-core,valaphp-runtime-embed)

# Build an embed VALAPHP library which may call pwphpbytecode classes. (use libphp.so and libphp.so over pwphpbytecode.so)
# valaphp-runtime-embed-pwphpbytecode is added automatically.
vlib-pwphp = example.php -> valaphp-libpwexample (valaphp-runtime-core,valaphp-runtime-embed)

# Build both/native/embed/pwphp binaries from PHP source.
# A dependency named libpwexample is resolved as pkg-config package valaphp-libpwexample.
# A dependency named pwgeneral is resolved as C library pwgeneral-<phpslot>-<abiver>.
# A dependency named std/json/etc is resolved to valaphp-runtime-std/json/etc
# when such a pkg-config package exists.
vbin = example.php -> example
vbin-native = example.php -> example (valaphp-runtime-core,valaphp-runtime-std,libpwexample)
vbin-embed = example.php -> example (valaphp-runtime-core,valaphp-runtime-embed,libpwexample)
vbin-pwphp = example.php -> example (valaphp-runtime-core,valaphp-runtime-embed,libpwexample,pwgeneral)
vbin = example.php -> example [opt=4]
vlib = example.php -> valaphp-libpwexample (std,json) [opt=3]

# vlib/vbin without suffix use php2vala --both-runtimes and add native+embed
# runtime dependencies automatically.
vlib = example.php -> valaphp-libpwexample

The VALAPHP syntax defaults to php2vala optimizer stage 4 (--optimize-cross-file-func-vars).
Use optional [opt=1..4] to override per vbin/vlib rule:
opt=1 uses --no-optimize-local-vars, opt=2 uses --optimize-local-vars,
opt=3 uses --optimize-file-func-vars, opt=4 uses --optimize-cross-file-func-vars.
pkg-config descriptions are read from the

Example root meson.build:
project('valaphp-libpwexample', ['vala', 'c'], version: '0.01')
project_description = 'Example VALAPHP library from php-source'
php_api_version = '8.3'
abi_implement_version = '3'
run_command(find_program('pw-build-meson'), 'src', php_api_version, abi_implement_version, check: true)
subdir('src')




######### Build Bytecode files over pwphpbytecode


# Standalone Application without dependencies
bin = show_mem_usage.php -> show_mem_usage

# Application with library binding
bin = show_mem_usage.php -> show_mem_usage (library1:class1,library2:class2)

# Application with JIT-enabled (only for code, not for libraries) library binding
bin-jit = show_mem_usage.php -> show_mem_usage

# Bin File (insert into folder) - File will be executable
bin(/folder) = asd.php -> asd



# Library with dependency from class2 on class1
class = class1.php -> class1 (externlib:classname)
class = class2.php -> class2 (class1)
lib = class1,class2 -> library

# Class with JIT execution
class-jit = class2.php -> class2



################ Create a php opcode file - File will not be executable # NOT USED ANYMORE? CAN BE DELETED?
opcode(/usr/path...) = server.php -> server.phpop




################# Create _raw files for webextension (OBSOLET)

# Create Extension for PHP-FPM (class pw_diffget_server (from same project)
class = diffget_server_src.php -> pw_diffget_server (pwgeneral:pwgeneralcopyright)
lib = pw_diffget_server -> pw_diffget_server_lib
fpmext = pw_diffget_server_lib:pw_diffget_server -> diffget_server






################# Create etc config maintainer
etc(/etc/php/fpm-php*/php.ini)=php_fpm-php_phpini.php->php_fpm-php_phpini (libpwgeneral:pwetc)





################# Create stripped files which must use php-cli as interpreter

# Strip File (insert to /bin/exe) (Plain PHP Execute)
strip = code.php -> exe

# Strip File (insert to /usr/share/php/diffget/diffget_server.php) - File will not be executable!
strip(/usr/share/php/diffget) = diffget_server.php -> diffget_server.php
