xref: /PHP-5.5/build/genif.sh (revision e34dc6c6)
1#! /bin/sh
2
3# $Id: genif.sh,v 1.6 2005-06-21 13:47:38 sniper Exp $
4# replacement for genif.pl
5
6infile=$1
7shift
8srcdir=$1
9shift
10extra_module_ptrs=$1
11shift
12awk=$1
13shift
14
15if test -z "$infile" || test -z "$srcdir"; then
16	echo "please supply infile and srcdir"
17	exit 1
18fi
19
20header_list=
21olddir=`pwd`
22cd $srcdir
23
24module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
25
26for ext in ${1+"$@"} ; do
27	header_list="$header_list ext/$ext/*.h*"
28done
29
30includes=`$awk -f ./build/print_include.awk $header_list`
31
32cd $olddir
33
34cat $infile | \
35	sed \
36	-e "s'@EXT_INCLUDE_CODE@'$includes'" \
37	-e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \
38	-e 's/@NEWLINE@/\
39/g'
40
41
42