1999-04-21 18:24:41 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
1999-04-22 00:23:47 +08:00
|
|
|
extname="$1"
|
|
|
|
EXTNAME=`echo $1|tr a-z A-Z`
|
1999-04-21 18:24:41 +08:00
|
|
|
|
|
|
|
function givup() {
|
|
|
|
echo $*
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
1999-04-22 00:23:47 +08:00
|
|
|
if test "$extname" = ""; then
|
1999-04-21 18:24:41 +08:00
|
|
|
givup "usage: $0 extension-name"
|
|
|
|
fi
|
|
|
|
|
1999-04-22 00:23:47 +08:00
|
|
|
if test -d "$extname" ; then
|
|
|
|
givup "Directory $extname already exists."
|
1999-04-21 18:24:41 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Creating directory"
|
|
|
|
|
1999-04-22 00:23:47 +08:00
|
|
|
mkdir $extname || givup "Cannot create directory $extname"
|
1999-04-21 18:24:41 +08:00
|
|
|
|
1999-04-22 00:23:47 +08:00
|
|
|
cd $extname
|
1999-04-21 18:24:41 +08:00
|
|
|
chmod 755 .
|
|
|
|
|
|
|
|
echo -n "Creating basic files:"
|
|
|
|
|
|
|
|
echo -n " config.m4"
|
|
|
|
cat >config.m4 <<eof
|
|
|
|
dnl \$Id\$
|
1999-04-22 00:23:47 +08:00
|
|
|
dnl config.m4 for extension $extname
|
|
|
|
dnl don't forget to call PHP_EXTENSION($extname)
|
1999-04-21 18:24:41 +08:00
|
|
|
|
|
|
|
eof
|
|
|
|
|
|
|
|
echo -n " setup.stub"
|
|
|
|
cat >setup.stub <<eof
|
1999-04-22 06:49:16 +08:00
|
|
|
# \$Source\$
|
1999-04-21 18:24:41 +08:00
|
|
|
# \$Id\$
|
|
|
|
|
1999-04-22 06:49:16 +08:00
|
|
|
define_option with-$extname '$extname support?' yesnodir no \\
|
|
|
|
' Whether to build the $extname extension.'
|
1999-04-21 18:24:41 +08:00
|
|
|
|
|
|
|
eof
|
|
|
|
|
|
|
|
echo -n " Makefile.am"
|
|
|
|
cat >Makefile.am <<eof
|
|
|
|
# \$Id\$
|
|
|
|
|
|
|
|
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
1999-04-22 00:23:47 +08:00
|
|
|
noinst_LIBRARIES=libphpext_$extname.a
|
|
|
|
libphpext_${extname}_a_SOURCES=$extname.c
|
1999-04-21 18:24:41 +08:00
|
|
|
|
|
|
|
eof
|
|
|
|
|
|
|
|
|
|
|
|
echo -n " .cvsignore"
|
|
|
|
cat >.cvsignore <<eof
|
|
|
|
.deps
|
|
|
|
Makefile.in
|
|
|
|
Makefile
|
|
|
|
eof
|
|
|
|
|
1999-04-22 00:23:47 +08:00
|
|
|
echo -n " config.h.stub"
|
|
|
|
cat >config.h.stub<<eof
|
|
|
|
/* define if you want to use the $extname extension */
|
|
|
|
/* #undef HAVE_LIB$EXTNAME */
|
|
|
|
eof
|
|
|
|
|
1999-04-21 18:24:41 +08:00
|
|
|
chmod 644 *
|
|
|
|
|
|
|
|
echo " [done]."
|
1999-04-22 04:39:22 +08:00
|
|
|
|