I'm having trouble building v8 and libv8 to use with v8js php library. I'm running gm x64.release on the depot_tools git repo after running fetch v8; cd v8 and the v8 file and g8 file gets created but the problem is that i cannot find the libv8/libnode required to compile v8js using pecl (https://github.com/phpv8/v8js). Here is the tree of the build output: https://pastebin.com/WAfxFegy
I tried installing libv8-dev (on Ubuntu 22 it automatically replaces it with libnode-dev) but still nothing.
How can i solve this? Thanks a lot!
P.S: This is the output i get once i run the pecl install:
sudo pecl install v8js
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading v8js-2.1.2.tgz ...
Starting to download v8js-2.1.2.tgz (102,977 bytes)
........................done: 102,977 bytes
28 source files, building
running: phpize
Configuring for:
PHP Api Version: 20210902
Zend Module Api No: 20210902
Zend Extension Api No: 420210902
configure.ac:22: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
build/php.m4:2111: PHP_CONFIG_NICE is expanded from...
configure.ac:22: the top level
configure.ac:165: warning: The macro `AC_PROG_LIBTOOL` is obsolete.
configure.ac:165: You should run autoupdate.
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:165: the top level
Please provide the installation prefix of libv8 [autodetect] : /home/romeo/v8/out/x64.release
building in /tmp/pear/temp/pear-build-rootfd2rq7/v8js-2.1.2
running: /tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js=/home/romeo/v8/out/x64.release
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20210902
checking for PHP installed headers prefix... /usr/include/php/20210902
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for V8 Javascript Engine... yes, shared
checking for V8 files in default path... not found
configure: error: Please reinstall the v8 distribution
ERROR: `/tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js=/home/romeo/v8/out/x64.release' failed
UPDATE: I finally built it using this tutorial (https://github.com/phpv8/v8js/blob/php8/README.Linux.md) but now when installing with pecl i get another error:
sudo pecl install v8js
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading v8js-2.1.2.tgz ...
Starting to download v8js-2.1.2.tgz (102,977 bytes)
........................done: 102,977 bytes
28 source files, building
running: phpize
Configuring for:
PHP Api Version: 20210902
Zend Module Api No: 20210902
Zend Extension Api No: 420210902
configure.ac:22: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
build/php.m4:2111: PHP_CONFIG_NICE is expanded from...
configure.ac:22: the top level
configure.ac:165: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:165: You should run autoupdate.
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:165: the top level
Please provide the installation prefix of libv8 [autodetect] : /opt/v8
building in /tmp/pear/temp/pear-build-rootfq0tM6/v8js-2.1.2
running: /tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js=/opt/v8
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20210902
checking for PHP installed headers prefix... /usr/include/php/20210902
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for V8 Javascript Engine... yes, shared
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -E
checking for C standard version... c++11
checking how to allow c++11 narrowing... -Wno-narrowing
checking for libv8_libplatform... found
checking for V8 version... NONE
configure: error: could not determine libv8 version
ERROR: `/tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js=/opt/v8' failed
I tried even building manually but i get this error:
/tmp/v8js/v8js_variables.cc:83:37: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, void (&)(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&), NULL, v8::Local<v8::External>, v8::AccessControl, v8::PropertyAttribute)’
83 | php_obj->SetAccessor(V8JS_STRL(ZSTR_VAL(property_name), static_cast<int>(ZSTR_LEN(property_name))), v8js_fetch_php_variable, NULL, v8::External::New(isolate, ctx), v8::DEFAULT, v8::ReadOnly);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~