cmake file for kolabformat.so
Mihai Badici <[email protected]> Tue, 20 Apr 2021 15:35:17 +0300
| Newsgroups | gmane.comp.kde.devel.kroupware |
|---|---|
| Message-ID | <b4eaaa2e-11b0-bebf-fdef-e2f11e43dc7d__28014.9777115852$1618928153$gmane$org@badici.ro> |
Hello,
Since php7 I always had problems to compile php kolabformat module on
Debian but always managed to sort out somehow.
Now I had some time to found the root causes.
The main problem is on Debian the include path is versioned to support
multiple php releases.
On a recent installed buster i have for example:
/usr/include/php/20180731
that make this directive in src/php/CmakeLists.txt:
find_path(PHP_INCLUDE_DIR NAMES main/php.h PATH_SUFFIXES php php5)
to fail. This will make the autogen to fail with message "php not found"
in the end.
My idea is to remove that directive and use the php-config utility instead:
I have added some lines like :
execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --vernum
OUTPUT_VARIABLE PHP_VERSION_ID
)
message("version a: ${PHP_VERSION_ID}")
execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --include-dir
OUTPUT_VARIABLE PHP_INCLUDE_DIR
)
message("version: ${PHP_INCLUDE_DIR}")
string(REGEX REPLACE "\n" "" PHP_INCLUDE_DIR "${PHP_INCLUDE_DIR}")
string(REGEX REPLACE "\n" "" PHP_VERSION_ID "${PHP_VERSION_ID}")
right after the similar lines for --extension-dir
I think using php-config is pretty universal and more accurate so it
will not have side effects for other distributions.
Mihai
_______________________________________________
users mailing list
[email protected]
https://lists.kolab.org/mailman/listinfo/users