Allow pecl like usage in ext/phar, closes #2955
authorAnatol Belski <ab@php.net>
Mon, 15 Jan 2018 13:23:46 +0000 (14:23 +0100)
committerAnatol Belski <ab@php.net>
Mon, 15 Jan 2018 13:23:46 +0000 (14:23 +0100)
ext/phar/Makefile.frag

index e58795deea81c9afb036afc7eb8502b2cca4e9df..0e3713fc63b69ec04ad60fa6d92b4dd9ee9a2a77 100644 (file)
@@ -1,5 +1,10 @@
 $(srcdir)/phar_path_check.c: $(srcdir)/phar_path_check.re
-       @(cd $(top_srcdir); $(RE2C) --no-generation-date -b -o ext/phar/phar_path_check.c ext/phar/phar_path_check.re)
+       @(cd $(top_srcdir); \
+       if test -f ./php_phar.h; then \
+               $(RE2C) --no-generation-date -b -o phar_path_check.c phar_path_check.re; \
+       else \
+               $(RE2C) --no-generation-date -b -o ext/phar/phar_path_check.c ext/phar/phar_path_check.re; \
+       fi)
 
 pharcmd: $(builddir)/phar.php $(builddir)/phar.phar