update
authorMichael Wallner <mike@php.net>
Wed, 30 Sep 2015 09:02:38 +0000 (11:02 +0200)
committerMichael Wallner <mike@php.net>
Wed, 30 Sep 2015 09:04:19 +0000 (11:04 +0200)
.editorconfig
.gitattributes [new file with mode: 0644]
init
presets/.editorconfig
presets/BUGS [new file with mode: 0644]
presets/Makefile.frag [new file with mode: 0644]
presets/TODO [new file with mode: 0644]
presets/config.m4 [new file with mode: 0644]
presets/config.w32 [new file with mode: 0644]

index 84c99337f69133bbb1548f9cc8c8477bc6f4ac2e..9b444aed05bf1b5de1a0aa8f5ea6756669f6f48d 100644 (file)
@@ -14,3 +14,10 @@ trim_trailing_whitespace = false
 [*.json]
 indent_style = space
 indent_size = 4
+
+[package.xml]
+indent_style = space
+indent_size = 1
+
+[config.w32]
+end_of_line = crlf
diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..58415df
--- /dev/null
@@ -0,0 +1 @@
+presets/config.w32     eol=crlf
diff --git a/init b/init
index f172675d8665ca08fa031dc0388b165a7d17c2a2..cbf6dc09b29fc28a469734440c2fe9a5a7b7724b 100755 (executable)
--- a/init
+++ b/init
@@ -15,6 +15,7 @@ do
        SRCFILE=$(dirname -- $0)/presets/$FILE
        case $FILE in
        .|..)
+               echo $FILE
                continue
                ;;
        composer.json)
@@ -22,7 +23,7 @@ do
                SRCFILE=$(mktemp)
                php -d variables_order=E $(dirname -- $0)/presets/composer.json >$SRCFILE
                ;;
-       package.xml|CREDITS)
+       package.xml|CREDITS|config.*|Makefile.frag)
                test "${PECL+set}" = "" && continue
                SRCFILE=$(mktemp)
                php -d variables_order=E $(dirname -- $0)/presets/$FILE >$SRCFILE
@@ -38,8 +39,7 @@ do
        if test -e $FILE
        then
                DIFF="diff -udbBE -- $SRCFILE $FILE"
-               # ignore changes with only additions or removals
-               if  ! $DIFF | awk '{if(NR<4){next}}/^-/{if(p){exit 1}m++}/^\+/{if(m){exit 1}p++}'
+               if ! $DIFF >/dev/null
                then
                        while read -n 1 -p "File $FILE exists and differs (q,s,r,d,v,?) " ACTION
                        do
index 84c99337f69133bbb1548f9cc8c8477bc6f4ac2e..9b444aed05bf1b5de1a0aa8f5ea6756669f6f48d 100644 (file)
@@ -14,3 +14,10 @@ trim_trailing_whitespace = false
 [*.json]
 indent_style = space
 indent_size = 4
+
+[package.xml]
+indent_style = space
+indent_size = 1
+
+[config.w32]
+end_of_line = crlf
diff --git a/presets/BUGS b/presets/BUGS
new file mode 100644 (file)
index 0000000..75711d2
--- /dev/null
@@ -0,0 +1 @@
+Yay, now known and unresolved issues yet!
diff --git a/presets/Makefile.frag b/presets/Makefile.frag
new file mode 100644 (file)
index 0000000..c5ba809
--- /dev/null
@@ -0,0 +1,17 @@
+<?php extract($_ENV) ?>
+# provide headers in builddir, so they do not end up in /usr/include/ext/<?=$PECL?>/src
+
+PHP_<?=strtoupper($PECL)?>_HEADERS := $(addprefix $(PHP_<?=strtoupper($PECL)?>_BUILDDIR)/,$(PHP_<?=strtoupper($PECL)?>_HEADERS))
+
+$(PHP_<?=strtoupper($PECL)?>_BUILDDIR)/%.h: $(PHP_<?=strtoupper($PECL)?>_SRCDIR)/src/%.h
+       @cat >$@ <$<
+
+all: <?=$PECL?>-build-headers
+clean: <?=$PECL?>-clean-headers
+
+.PHONY: <?=$PECL?>-build-headers
+<?=$PECL?>-build-headers: $(PHP_<?=strtoupper($PECL)?>_HEADERS)
+
+.PHONY: <?=$PECL?>-clean-headers
+<?=$PECL?>-clean-headers:
+       -rm -f $(PHP_<?=strtoupper($PECL)?>_HEADERS)
diff --git a/presets/TODO b/presets/TODO
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/presets/config.m4 b/presets/config.m4
new file mode 100644 (file)
index 0000000..f608ae1
--- /dev/null
@@ -0,0 +1,25 @@
+<?php extract($_ENV) ?>
+PHP_ARG_ENABLE(<?=$PECL?>, whether to enable <?=$PECL?> support,
+[  --enable-<?=$PECL?>         Enable <?=$PECL?> support])
+
+if test "$PHP_<?=strtoupper($PECL)?>" != "no"; then
+       PHP_<?=strtoupper($PECL)?>_SRCDIR=PHP_EXT_SRCDIR(<?=$PECL?>)
+       PHP_<?=strtoupper($PECL)?>_BUILDDIR=PHP_EXT_BUILDDIR(<?=$PECL?>)
+
+       PHP_ADD_INCLUDE($PHP_<?=strtoupper($PECL)?>_SRCDIR/src)
+       PHP_ADD_BUILD_DIR($PHP_<?=strtoupper($PECL)?>_BUILDDIR/src)
+
+       PHP_<?=strtoupper($PECL)?>_HEADERS=`(cd $PHP_<?=strtoupper($PECL)?>_SRCDIR/src && echo *.h)`
+       PHP_<?=strtoupper($PECL)?>_SOURCES=`(cd $PHP_<?=strtoupper($PECL)?>_SRCDIR && echo src/*.c)`
+
+       PHP_NEW_EXTENSION(<?=$PECL?>, $PHP_<?=strtoupper($PECL)?>_SOURCES, $ext_shared)
+       PHP_INSTALL_HEADERS(ext/<?=$PECL?>, php_<?=$PECL?>.h $PHP_<?=strtoupper($PECL)?>_HEADERS)
+
+       PHP_SUBST(PHP_<?=strtoupper($PECL)?>_HEADERS)
+       PHP_SUBST(PHP_<?=strtoupper($PECL)?>_SOURCES)
+
+       PHP_SUBST(PHP_<?=strtoupper($PECL)?>_SRCDIR)
+       PHP_SUBST(PHP_<?=strtoupper($PECL)?>_BUILDDIR)
+
+       PHP_ADD_MAKEFILE_FRAGMENT
+fi
diff --git a/presets/config.w32 b/presets/config.w32
new file mode 100644 (file)
index 0000000..b361abf
--- /dev/null
@@ -0,0 +1,16 @@
+<?php extract($_ENV) ?>\r
+ARG_ENABLE("<?=$PECL?>", "for <?=$PECL?> support", "no");\r
+\r
+if (PHP_<?=strtoupper($PECL)?> == "yes") {\r
+       var PHP_<?=strtoupper($PECL)?>_HEADERS=glob("src/*.h"), PHP_<?=strtoupper($PECL)?>_SOURCES=glob("src/*.c");\r
+\r
+       EXTENSION("<?=$PECL?>", PHP_<?=strtoupper($PECL)?>_SOURCES);\r
+       PHP_INSTALL_HEADERS("ext/<?=$PECL?>", "php_propro.h");\r
+       for (var i=0; i<PHP_<?=strtoupper($PECL)?>_HEADERS.length; ++i) {\r
+               var basename = FSO.GetFileName(PHP_<?=strtoupper($PECL)?>_HEADERS[i]);\r
+               copy_and_subst(PHP_<?=strtoupper($PECL)?>_HEADERS[i], basename, []);\r
+               PHP_INSTALL_HEADERS("ext/<?=$PECL?>", basename);\r
+       }\r
+\r
+       AC_DEFINE("HAVE_<?=strtoupper($PECL)?>", 1);\r
+}\r