note 56861 added to zend.creating

From: Date: Sat, 17 Sep 2005 07:53:33 +0000
Subject: note 56861 added to zend.creating
Groups: php.notes 
Request: Send a blank email to php-notes+get-95321@lists.php.net to get a copy of this message
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" ---- Manual Page -- http://www.php.net/manual/en/zend.creating.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56861 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56861&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56861&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56861&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56861&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56861&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+56861&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56861&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56861&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95321) next »