summaryrefslogtreecommitdiff
path: root/build/genif.sh
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:21 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:21 -0400
commit0e920280a2e04b110827bb766b9f29e3d581c4ee (patch)
tree8f2125f3d00fe3089e3b94adb06f04479ee15f2a /build/genif.sh
downloadphp-0e920280a2e04b110827bb766b9f29e3d581c4ee.tar.gz
Imported Upstream version 5.0.4upstream/5.0.4
Diffstat (limited to 'build/genif.sh')
-rw-r--r--build/genif.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/build/genif.sh b/build/genif.sh
new file mode 100644
index 000000000..49e17a38e
--- /dev/null
+++ b/build/genif.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+# $Id: genif.sh,v 1.3 2002/03/22 10:22:41 sas Exp $
+# replacement for genif.pl
+
+infile=$1
+shift
+srcdir=$1
+shift
+extra_module_ptrs=$1
+shift
+awk=$1
+shift
+
+if test -z "$infile" || test -z "$srcdir"; then
+ echo "please supply infile and srcdir"
+ exit 1
+fi
+
+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'
+
+