[ZBX-16341] Rename config.h to avoid conflicts with loadable modules using Autotools Created: 2019 Jul 04 Updated: 2020 May 04 |
|
Status: | Open |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Installation (I) |
Affects Version/s: | 4.4.0alpha1 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Trivial |
Reporter: | Glebs Ivanovskis | Assignee: | Zabbix Development Team |
Resolution: | Unresolved | Votes: | 2 |
Labels: | autoconf, codequality, headers, loadablemodule | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Description |
As discussed in Zabbix uses Autotools and exposes automatically generated config.h header in module interface. I.e. before using Zabbix header files (module.h and sysinc.h) one needs to run ./configure script of Zabbix, more on that in ZBX-15677. If user compiling loadable module forgets to ./configure Zabbix, he/she will fail to compile module because of missing config.h header. Or even worse, user may succeed compiling module, because like suggested in ZBX-11767, many loadable modules use Autotools and have their own auto-generated config.h files. sysinc.h of Zabbix will happily include any config.h available in include path, even if it's not a config.h of Zabbix. Such thing can happen and is quite tricky to troubleshoot. A solution would be to name auto-generated header of Zabbix differently (e.g. zbxconfig.h) using AC_CONFIG_HEADERS autoconf macro. This will make sure that loadable module compilation always fails when ./configure wasn't executed. |
Comments |
Comment by Glebs Ivanovskis [ 2019 Oct 03 ] |
One more example. |
Comment by Glebs Ivanovskis [ 2020 May 04 ] |
Here is one more example. |