1999-05-07 04:52:19 +08:00
|
|
|
#! /bin/sh
|
|
|
|
|
2000-12-21 01:21:37 +08:00
|
|
|
# $Id: genif.sh,v 1.1 2000-12-20 17:21:37 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
|
2000-12-21 00:29:07 +08:00
|
|
|
awk="$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"
|
2000-12-21 00:29:07 +08:00
|
|
|
header_list=""
|
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"
|
2000-12-21 00:29:07 +08:00
|
|
|
header_list="$header_list ext/$ext/*.h"
|
1999-05-09 05:44:12 +08:00
|
|
|
done
|
|
|
|
|
2000-12-21 01:21:37 +08:00
|
|
|
includes=`$awk -f ./build/print_include.awk $header_list`
|
2000-12-21 00:29:07 +08:00
|
|
|
|
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
|
|
|
|