1999-05-07 04:52:19 +08:00
|
|
|
#! /bin/sh
|
|
|
|
|
2002-03-22 18:22:41 +08:00
|
|
|
# $Id: genif.sh,v 1.3 2002-03-22 10:22:41 sas Exp $
|
1999-05-07 04:52:19 +08:00
|
|
|
# replacement for genif.pl
|
|
|
|
|
2002-03-22 18:22:41 +08:00
|
|
|
infile=$1
|
1999-05-07 04:52:19 +08:00
|
|
|
shift
|
2002-03-22 18:22:41 +08:00
|
|
|
srcdir=$1
|
1999-05-07 04:52:19 +08:00
|
|
|
shift
|
2002-03-22 18:22:41 +08:00
|
|
|
extra_module_ptrs=$1
|
2000-03-26 10:47:00 +08:00
|
|
|
shift
|
2002-03-22 18:22:41 +08:00
|
|
|
awk=$1
|
2000-12-21 00:29:07 +08:00
|
|
|
shift
|
1999-05-07 04:52:19 +08:00
|
|
|
|
2002-03-22 18:22:41 +08:00
|
|
|
if test -z "$infile" || test -z "$srcdir"; then
|
1999-05-07 04:52:19 +08:00
|
|
|
echo "please supply infile and srcdir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2002-03-22 18:22:41 +08:00
|
|
|
module_ptrs=$extra_module_ptrs
|
|
|
|
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
|
2001-03-30 22:02:20 +08:00
|
|
|
module_ptrs=" phpext_${ext}_ptr,@NEWLINE@$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'" \
|
2001-03-30 22:02:20 +08:00
|
|
|
-e 's/@NEWLINE@/\
|
1999-05-09 06:00:02 +08:00
|
|
|
/g'
|
|
|
|
|
1999-05-09 05:44:12 +08:00
|
|
|
|