note 56861 deleted from internals2.ze1.zendapi by cmb

From: Date: Sun, 10 Jan 2021 13:25:47 +0000
Subject: note 56861 deleted from internals2.ze1.zendapi by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-216124@lists.php.net to get a copy of this message
Note Submitter: vijay at planetbazaar dot com ---- Notes for Windows PHP5 extension developers: First, two great articles at http://www.zend.com/php/internals/index.php are in the must read category. Unfortunately an article on building extensions on Windows is yet to arrive at this time. So one gets stuck at section 'Building Your Extension' in the first article - because there is no 'phpize' for Windows to the best of my knowledge. First point of curiosity is how the extensions that are available for Windows appear in the output of "cscript /nologo configure.js --help". Turns out the magic happens by executing "buildconf.bat". To cut a long story short, it turns out that for Windows, the build system looks for config.w32 in each extension directory instead of config.m4; config.w32 is actually a javascript (from what I gather reading the "vim:ft=javascript" comment at the top of the files). To get going with the "hello world" sample in the article mentioned above here is the config.w32 to replace config.m4; --- begin file: config.w32 --- // hello world module configuration // vim:ft=javascript ARG_ENABLE("hello", "hello Enable Hello World support", "no"); if (PHP_HELLO == "yes") { EXTENSION("hello", "hello.c", null, "-Iext/hello"); AC_DEFINE('HAVE_HELLO', 1, 'Whether you ave Hello World'); } --- end file: config.w32 --- And just to compare, here is the config.m4 --- begin file: config.m4 --- dnl vim:ft=m4 dnl hello world module configuration PHP_ARG_ENABLE(hello, whether to enable Hellow World support, [ --enable-hello Enable Hello World support]) if test "$PHP_HELLO" = "yes"; then AC_DEFINE(HAVE_HELLO, 1 [Whether you have Hello World]) PHP_NEW_EXTENSION(hello, hello.c, $ext_shared) fi --- end file: config.m4 --- And finally the key step is to execute 'buildconf.bat'; after this step: cscript /nologo configure.js | find "hello" should show something like: "--enable-hello hello Enable Hello World support"

« previous php.notes (#216124) next »