Skip to content

Commit 565832a

Browse files
committed
Add show-config target to makefile
1 parent 8e03384 commit 565832a

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

.github/workflows/system-libs.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ jobs:
2929
version: "8.4"
3030
configureOpts: "--with-mongodb-system-libs=yes"
3131

32-
- name: "Install driver"
33-
shell: bash
34-
run: make install
35-
3632
- name: "Check driver version"
3733
shell: bash
38-
run: |
39-
php --ri mongodb
34+
run: make show-config

Makefile.frag

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: mv-coverage lcov-coveralls lcov-local coverage coveralls format format-changed format-check test-clean package package.xml libmongocrypt-version-current generate-function-map
1+
.PHONY: mv-coverage lcov-coveralls lcov-local coverage coveralls format format-changed format-check test-clean package package.xml libmongocrypt-version-current generate-function-map show-config
22

33
ifneq (,$(realpath $(EXTENSION_DIR)/json.so))
44
PHP_TEST_SHARED_EXTENSIONS := "-d" "extension=$(EXTENSION_DIR)/json.so" $(PHP_TEST_SHARED_EXTENSIONS)
@@ -88,6 +88,28 @@ generate-function-map: all
8888
echo "ERROR: Cannot generate function maps without CLI sapi."; \
8989
fi
9090

91+
show-config: all
92+
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
93+
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
94+
if test "$$INI_FILE"; then \
95+
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
96+
else \
97+
echo > $(top_builddir)/tmp-php.ini; \
98+
fi; \
99+
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
100+
if test "$$INI_SCANNED_PATH"; then \
101+
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
102+
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
103+
fi; \
104+
CC="$(CC)" \
105+
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) --ri mongodb \
106+
RESULT_EXIT_CODE=$$?; \
107+
rm $(top_builddir)/tmp-php.ini; \
108+
exit $$RESULT_EXIT_CODE; \
109+
else \
110+
echo "ERROR: Cannot show config without CLI sapi."; \
111+
fi
112+
91113
test-no-build:
92114
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
93115
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \

0 commit comments

Comments
 (0)