PHP_NEW_EXTENSION () does nothing

I would like to ask if I think correctly:

I am writing an extension (using it C++as a programming language), and when it comes to the actual makeeing of customized sources and macros, my Makefile contains the following settings.

PHP_PECL_EXTENSION = extensionname
EXTENSIONNAME_SHARED_LIBADD =
PHP_MODULES =
PHP_ZEND_EX =

How does this happen if I manually add

 PHP_NEW_EXTENSION(extensionname, <listofsourcecodefilenames>...)

Perhaps I need to provide more information? I tried to create some extensions that come with the PHP source, and everything went well.


Here is my config.m4

PHP_ARG_WITH(extensionname, enable extensionname,
    [  --with-extensionname        enable extensionname)], no, no)

if test "$PHP_EXTENSIONNAME" != "no"; then
PHP_REQUIRE_CXX()
PHP_EXTENSIONNAME_CFLAGS=""

if test $PHP_EXTENSIONNAME != "yes"; then
    AC_MSG_CHECKING([for required lib in default path])
    for i in $PHP_EXTENSIONNAME /usr/local/ /usr /opt/vendor/liblocation; do
        if test -r $i/include/sqlncli.h; then
            $REQUIREDLIB_DIR=$i
            AC_MSG_RESULT(found in $i)
            break
        fi
    done

    if test -z "$REQUIREDLIB_DIR"; then
        AC_MSG_RESULT([not found])
        AC_MSG_ERROR([please obtain the original required lib for Linux])
    fi

    PHP_CHECK_LIBRARY(requiredlib, RQLCriticalFunction, [
        AC_MSG_RESULT(found)
        PHP_ADD_LIBRARY_WITH_PATH(requiredlib, $REQUIREDLIB_DIR/../lib64, EXTENSIONNAME_SHARED_LIBADD)
        PHP_ADD_INCLUDE($REQUiREDLIB_DIR/include)
    ], [
        AC_MSG_RESULT([not found])
        AC_MSG_ERROR([please install blah-blah])
    ], [
        -L$REQUIREDLIB_DIR/../lib64 -lm
    ])
fi

AC_DEFINE(HAVE_EXTENSIONNAME, 1, [Whether you have extensionname])

PHP_ADD_LIBRARY(stdc++, 1, EXTENSIONNAME_SHARED_LIBADD)

PHP_ADD_INCLUDE('sql.h')
PHP_ADD_INCLUDE('sqlext.h')

PHP_NEW_EXTENSION(extensionname, source1.cpp source2.cpp source3.cpp, $ext_shared)
PHP_SUBST(EXTENSIONNAME_SHARED_LIBADD)
fi
+3
source share
1 answer

http://www.opensource.apple.com/source/apache_mod_php/apache_mod_php-18.9/php/README.UNIX-BUILD-SYSTEM , , , $ext_shared :

PHP_NEW_EXTENSION(foo, foo.c bar.c baz.cpp, $ext_shared)
+1

All Articles