php-developer-list | 2002112
Index: ext_skel
===================================================================
RCS file: /repository/php4/ext/ext_skel,v
retrieving revision 1.44
diff -u -3 -p -r1.44 ext_skel
--- ext_skel 18 Nov 2002 15:55:07 -0000 1.44
+++ ext_skel 29 Nov 2002 18:20:40 -0000
@@ -7,7 +7,7 @@ givup() {
usage() {
echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]]"
-echo " [--skel=dir] [--full-xml] [--no-help]"
+echo " [--skel=dir] [--full-xml] [--no-help] [--cpp]"
echo ""
echo " --extname=module module is the name of your extension"
echo " --proto=file file contains prototypes of functions to create"
@@ -18,6 +18,7 @@ echo " --full-xml generate xml
echo " (not yet implemented)"
echo " --no-help don't try to be nice and create comments in the code"
echo " and helper functions to test if the module compiled"
+echo " --cpp create a C++ extension"
exit 1
}
@@ -58,6 +59,9 @@ while test $# -gt 0; do
--skel=?*)
skel_dir=$optarg
;;
+ --cpp)
+ cpp="yes"
+ ;;
*)
usage
;;
@@ -94,7 +98,7 @@ if test -z "$stubs"; then
fi
if test -n "$proto"; then
- cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -f $skel_dir/create_stubs
+ cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -v cpp=$cpp -f $skel_dir/create_stubs
fi
if test -z "$stubs"; then
@@ -165,11 +169,16 @@ if test "\$PHP_$EXTNAME" != "no"; then
dnl ])
dnl
dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
+eof
- PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared)
+if test "$cpp" = "yes"; then
+ echo " PHP_REQUIRE_CXX()" >>config.m4
+ echo " PHP_NEW_EXTENSION($extname, $extname.cpp, \$ext_shared)" >>config.m4
+else
+ echo " PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared)" >>config.m4
fi
-eof
+echo "fi" >>config.m4
$ECHO_N " .cvsignore$ECHO_C"
cat >.cvsignore <

