summaryrefslogtreecommitdiff
path: root/genif.sh
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>1999-05-06 20:52:19 +0000
committerSascha Schumann <sas@php.net>1999-05-06 20:52:19 +0000
commita793fea1f7b2c79819ea63d3c83084bd41afe66f (patch)
tree95a9c56eb1933c5e728a7025c4b4b1a85638d323 /genif.sh
parentc5d8c389a5f942dc6e1427853c6c4c224fc4c12e (diff)
downloadphp-git-a793fea1f7b2c79819ea63d3c83084bd41afe66f.tar.gz
Do we really want to depend on Perl? Shell scripts are handy and run on
virtually every Unix box whereas Perl does not. I don't think Perl should be required when actually configuring PHP4. Open to comments...
Diffstat (limited to 'genif.sh')
-rw-r--r--genif.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/genif.sh b/genif.sh
new file mode 100644
index 0000000000..d30c37e581
--- /dev/null
+++ b/genif.sh
@@ -0,0 +1,37 @@
+#! /bin/sh
+
+# $Id: genif.sh,v 1.1 1999-05-06 20:52:19 sas Exp $
+# replacement for genif.pl
+
+infile="$1"
+shift
+srcdir="$1"
+shift
+
+if test "$infile" = "" -o "$srcdir" = ""; then
+ echo "please supply infile and srcdir"
+ exit 1
+fi
+
+cmd1='echo $data | grep @EXT_INCLUDE_CODE@ > /dev/null 2>&1'
+cmd2='echo $data | grep @EXT_MODULE_PTRS@ > /dev/null 2>&1'
+
+while read ; do
+ data="$REPLY"
+ if eval $cmd1 ; then
+ for ext in $* ; do
+ for pre in php3 php php4 zend; do
+ hdrfile="ext/$ext/${pre}_${ext}.h"
+ if test -f $hdrfile ; then
+ echo "#include \"$hdrfile\""
+ fi
+ done
+ done
+ elif eval $cmd2 ; then
+ for ext in $* ; do
+ echo " phpext_${ext}_ptr,"
+ done
+ else
+ echo "$data"
+ fi
+done < $infile