From 216067b63f23d0514b01013759aefbe825d54425 Mon Sep 17 00:00:00 2001 From: Jouni Ahto Date: Fri, 9 Jun 2000 03:38:37 +0000 Subject: [PATCH] - As Sascha requested. --- ext/ext_skel | 32 +++++++--- ext/skeleton/create_module | 122 ------------------------------------ ext/skeleton/php_skeleton.h | 12 ++-- ext/skeleton/skeleton.c | 11 +--- 4 files changed, 36 insertions(+), 141 deletions(-) delete mode 100755 ext/skeleton/create_module diff --git a/ext/ext_skel b/ext/ext_skel index 60b5a224f9..be8bbbfc4b 100755 --- a/ext/ext_skel +++ b/ext/ext_skel @@ -42,20 +42,28 @@ dnl \$Id\$ dnl config.m4 for extension $extname dnl don't forget to call PHP_EXTENSION($extname) +dnl Comments in this file start with the string 'dnl'. +dnl Remove where necessary. This file will not work +dnl without editing. + dnl If your extension references something external, use with: -PHP_ARG_WITH($extname, for $extname support, +dnl PHP_ARG_WITH($extname, for $extname support, dnl Make sure that the comment is aligned: -[ --with-$extname Include $extname support]) +dnl [ --with-$extname Include $extname support]) dnl Otherwise use enable: -PHP_ARG_ENABLE($extname, whether to enable $extname support, +dnl PHP_ARG_ENABLE($extname, whether to enable $extname support, dnl Make sure that the comment is aligned: -[ --enable-$extname Enable $extname support]) +dnl [ --enable-$extname Enable $extname support]) if test "\$PHP_$EXTNAME" != "no"; then - dnl Action.. + dnl If you will not be testing anything external, like existence of + dnl headers, libraries or functions in them, just uncomment the + dnl following line and you are ready to go. + dnl AC_DEFINE(HAVE_$EXTNAME, 1, [ ]) + dnl Write more examples of tests here... PHP_EXTENSION($extname, \$ext_shared) fi eof @@ -83,6 +91,15 @@ Makefile libs.mk eof +$ECHO_N " $extname.c$ECHO_C" +cat ../skeleton/skeleton.c | sed -e "s/_extname_/$extname/g" | sed -e "s/_EXTNAME_/$EXTNAME/g" > $extname.c + +$ECHO_N " php_$extname.h$ECHO_C" +cat ../skeleton/php_skeleton.h | sed -e "s/_extname_/$extname/g" | sed -e "s/_EXTNAME_/$EXTNAME/g" > php_$extname.h + +$ECHO_N " $extname.php$ECHO_C" +cat ../skeleton/skeleton.php | sed -e "s/_extname_/$extname/g" | sed -e "s/_EXTNAME_/$EXTNAME/g" > $extname.php + chmod 644 * echo " [done]." @@ -92,10 +109,11 @@ cat </dev/null 2>&1 -then - ECHO_N="echo -n" - ECHO_C="" -else - ECHO_N="echo" - ECHO_C='\c' -fi - -echo "Creating directory" - -mkdir $extname || givup "Cannot create directory $extname" - -cd $extname -chmod 755 . - -$ECHO_N "Creating basic files:$ECHO_C" - -$ECHO_N " config.m4$ECHO_C" -cat >config.m4 <Makefile.in <.cvsignore < $extname.c - -$ECHO_N " php_$extname.h$ECHO_C" -cat ../skeleton/php_skeleton.h | sed -e "s/_extname_/$extname/g" | sed -e "s/_EXTNAME_/$EXTNAME/g" > php_$extname.h - -$ECHO_N " $extname.php$ECHO_C" -cat ../skeleton/skeleton.php | sed -e "s/_extname_/$extname/g" | sed -e "s/_EXTNAME_/$EXTNAME/g" > $extname.php - -chmod 644 * - -echo " [done]." - -cat <