mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
74 lines
1.1 KiB
Bash
Executable File
74 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
extname="$1"
|
|
EXTNAME=`echo $1|tr a-z A-Z`
|
|
|
|
function givup() {
|
|
echo $*
|
|
exit 1
|
|
}
|
|
|
|
if test "$extname" = ""; then
|
|
givup "usage: $0 extension-name"
|
|
fi
|
|
|
|
if test -d "$extname" ; then
|
|
givup "Directory $extname already exists."
|
|
fi
|
|
|
|
echo "Creating directory"
|
|
|
|
mkdir $extname || givup "Cannot create directory $extname"
|
|
|
|
cd $extname
|
|
chmod 755 .
|
|
|
|
echo -n "Creating basic files:"
|
|
|
|
echo -n " config.m4"
|
|
cat >config.m4 <<eof
|
|
dnl \$Id\$
|
|
dnl config.m4 for extension $extname
|
|
dnl don't forget to call PHP_EXTENSION($extname)
|
|
|
|
eof
|
|
|
|
echo -n " setup.stub"
|
|
cat >setup.stub <<eof
|
|
# \$Source\$
|
|
# \$Id\$
|
|
|
|
define_option with-$extname '$extname support?' yesnodir no \\
|
|
' Whether to build the $extname extension.'
|
|
|
|
eof
|
|
|
|
echo -n " Makefile.am"
|
|
cat >Makefile.am <<eof
|
|
# \$Id\$
|
|
|
|
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
|
noinst_LIBRARIES=libphpext_$extname.a
|
|
libphpext_${extname}_a_SOURCES=$extname.c
|
|
|
|
eof
|
|
|
|
|
|
echo -n " .cvsignore"
|
|
cat >.cvsignore <<eof
|
|
.deps
|
|
Makefile.in
|
|
Makefile
|
|
eof
|
|
|
|
echo -n " config.h.stub"
|
|
cat >config.h.stub<<eof
|
|
/* define if you want to use the $extname extension */
|
|
/* #undef HAVE_LIB$EXTNAME */
|
|
eof
|
|
|
|
chmod 644 *
|
|
|
|
echo " [done]."
|
|
|