1999-05-07 04:52:19 +08:00
|
|
|
#! /bin/sh
|
|
|
|
|
2000-06-28 00:22:26 +08:00
|
|
|
# $Id: genif.sh,v 1.9 2000-06-27 16:22:26 sas Exp $
|
1999-05-07 04:52:19 +08:00
|
|
|
# replacement for genif.pl
|
|
|
|
|
|
|
|
infile="$1"
|
|
|
|
shift
|
|
|
|
srcdir="$1"
|
|
|
|
shift
|
2000-03-26 10:47:00 +08:00
|
|
|
extra_module_ptrs="$1"
|
|
|
|
shift
|
1999-05-07 04:52:19 +08:00
|
|
|
|
|
|
|
if test "$infile" = "" -o "$srcdir" = ""; then
|
|
|
|
echo "please supply infile and srcdir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2000-03-26 10:47:00 +08:00
|
|
|
module_ptrs="$extra_module_ptrs"
|
1999-05-09 05:44:12 +08:00
|
|
|
includes=""
|
|
|
|
|
1999-09-04 01:46:39 +08:00
|
|
|
olddir=`pwd`
|
|
|
|
cd $srcdir
|
|
|
|
|
1999-05-09 06:00:02 +08:00
|
|
|
for ext in ${1+"$@"} ; do
|
|
|
|
module_ptrs=" phpext_${ext}_ptr,\\\n$module_ptrs"
|
1999-09-04 01:46:39 +08:00
|
|
|
for header in ext/$ext/*.h ; do
|
|
|
|
if grep phpext_ $header >/dev/null 2>&1 ; then
|
|
|
|
includes="#include \"$header\"\\\n$includes"
|
1999-05-09 05:44:12 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
1999-09-04 01:46:39 +08:00
|
|
|
cd $olddir
|
|
|
|
|
1999-05-09 05:44:12 +08:00
|
|
|
cat $infile | \
|
1999-05-09 06:00:02 +08:00
|
|
|
sed \
|
|
|
|
-e "s'@EXT_INCLUDE_CODE@'$includes'" \
|
|
|
|
-e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \
|
2000-06-28 00:22:26 +08:00
|
|
|
-e 's/[\]n/\
|
1999-05-09 06:00:02 +08:00
|
|
|
/g'
|
|
|
|
|
1999-05-09 05:44:12 +08:00
|
|
|
|