summaryrefslogtreecommitdiff
path: root/ext/ext_skel
blob: 5b533eace4b749233d50850b75cb472f6487caab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/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
# \$Id\$

define_option with-$extname '$extname support?' yesnodir \\
    "defs" \\
'    Whether to include $extname support.'
	
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]."