Cómo comenzar a escribir una extensión PHP5 en C ++

Estoy escribiendo una extensión PHP5, y aunque podría escribirla en C, sería más fácil usar C ++ y aprovechar STL y Boost.

El problema es que eltutoriales Solo he visto tratar con C, y estoy buscando un ejemplo básico que use C ++

Esto es lo que he probado hasta ahora:

config.m4
[ --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.cpp, $ext_shared)
fi
php_hello.h

Tenga en cuenta mi intento de declarar los bits con los que PHP interactúa como "C" externa

#ifndef PHP_HELLO_H
#define PHP_HELLO_H 1


extern "C" {

#define PHP_HELLO_WORLD_VERSION "1.0"
#define PHP_HELLO_WORLD_EXTNAME "hello"

PHP_FUNCTION(hello_world);

extern zend_module_entry hello_module_entry;
#define phpext_hello_ptr &hello_module_entry

}
#endif
hola.cpp
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_hello.h"

static function_entry hello_functions[] = {
    PHP_FE(hello_world, NULL)

    {NULL, NULL, NULL}
};

zend_module_entry hello_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
    STANDARD_MODULE_HEADER,
#endif
    PHP_HELLO_WORLD_EXTNAME,
    hello_functions,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
#if ZEND_MODULE_API_NO >= 20010901
    PHP_HELLO_WORLD_VERSION,
#endif
    STANDARD_MODULE_PROPERTIES
};

#ifdef COMPILE_DL_HELLO
ZEND_GET_MODULE(hello)
#endif

PHP_FUNCTION(hello_world)
{
    RETURN_STRING("Hello World", 1);
}
.... y aquí están mis errores de compilación:

Si hago phpize, configuro y hago esto, obtengo lo siguiente (reformateado para mayor claridad)

$ make
/bin/bash /home/paul/php5/php-5.2.8/ext/hello2/libtool 
   --mode=compile  
   -I. 
   -I/home/paul/php5/php-5.2.8/ext/hello2 -DPHP_ATOM_INC 
   -I/home/paul/php5/php-5.2.8/ext/hello2/include 
   -I/home/paul/php5/php-5.2.8/ext/hello2/main 
   -I/home/paul/php5/php-5.2.8/ext/hello2 
   -I/usr/local/include/php 
   -I/usr/local/include/php/main 
   -I/usr/local/include/php/TSRM 
   -I/usr/local/include/php/Zend 
   -I/usr/local/include/php/ext 
   -I/usr/local/include/php/ext/date/lib  
   -DHAVE_CONFIG_H     
   -c /home/paul/php5/php-5.2.8/ext/hello2/hello.cpp 
   -o hello.lo 
libtool: compile: unrecognized option `-I.'
libtool: compile: Try `libtool --help' for more information.
make: *** [hello.lo] Error 1

Sospecho que necesito trabajar más en config.m4 para crear un archivo MAKE que funcione, pero soy bastante nuevo en la cadena de herramientas GCC.

Si ayuda, solo apunto a php 5.2.6+, y solo en Linux (específicamente, Ubuntu 8.04). Mi entorno de compilación está usando Ubuntu 8.10, usando gcc 4.3.2

Punteros agradecidos recibidos!

Respuestas a la pregunta(2)

Su respuesta a la pregunta