php-src/build/genif.sh

42 lines
664 B
Bash
Raw Normal View History

#! /bin/sh
2002-03-22 18:22:41 +08:00
# $Id: genif.sh,v 1.3 2002-03-22 10:22:41 sas Exp $
# replacement for genif.pl
2002-03-22 18:22:41 +08:00
infile=$1
shift
2002-03-22 18:22:41 +08:00
srcdir=$1
shift
2002-03-22 18:22:41 +08:00
extra_module_ptrs=$1
shift
2002-03-22 18:22:41 +08:00
awk=$1
shift
2002-03-22 18:22:41 +08:00
if test -z "$infile" || test -z "$srcdir"; then
echo "please supply infile and srcdir"
exit 1
fi
2002-03-22 18:22:41 +08:00
module_ptrs=$extra_module_ptrs
header_list=
olddir=`pwd`
cd $srcdir
for ext in ${1+"$@"} ; do
module_ptrs=" phpext_${ext}_ptr,@NEWLINE@$module_ptrs"
header_list="$header_list ext/$ext/*.h"
done
includes=`$awk -f ./build/print_include.awk $header_list`
cd $olddir
cat $infile | \
sed \
-e "s'@EXT_INCLUDE_CODE@'$includes'" \
-e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \
-e 's/@NEWLINE@/\
/g'