php-src/ext/ext_skel

74 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/sh
1999-04-21 16:23:47 +00:00
extname="$1"
EXTNAME=`echo $1|tr a-z A-Z`
function givup() {
echo $*
exit 1
}
1999-04-21 16:23:47 +00:00
if test "$extname" = ""; then
givup "usage: $0 extension-name"
fi
1999-04-21 16:23:47 +00:00
if test -d "$extname" ; then
givup "Directory $extname already exists."
fi
echo "Creating directory"
1999-04-21 16:23:47 +00:00
mkdir $extname || givup "Cannot create directory $extname"
1999-04-21 16:23:47 +00:00
cd $extname
chmod 755 .
echo -n "Creating basic files:"
echo -n " config.m4"
cat >config.m4 <<eof
dnl \$Id\$
1999-04-21 16:23:47 +00:00
dnl config.m4 for extension $extname
dnl don't forget to call PHP_EXTENSION($extname)
eof
echo -n " setup.stub"
cat >setup.stub <<eof
1999-04-21 22:49:16 +00:00
# \$Source\$
# \$Id\$
1999-04-21 22:49:16 +00:00
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
1999-04-21 16:23:47 +00:00
noinst_LIBRARIES=libphpext_$extname.a
libphpext_${extname}_a_SOURCES=$extname.c
eof
echo -n " .cvsignore"
cat >.cvsignore <<eof
.deps
Makefile.in
Makefile
eof
1999-04-21 16:23:47 +00: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
chmod 644 *
echo " [done]."
1999-04-21 20:39:22 +00:00