[ZBX-12793] zabbix autoconf script does not use the system compiler by default Created: 2017 Sep 28  Updated: 2024 Apr 10  Resolved: 2017 Oct 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: None
Fix Version/s: 4.0.0alpha1, 4.0 (plan)

Type: Incident report Priority: Trivial
Reporter: Andrea Biscuola (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: autoconf, compiler
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team A
Team: Team A
Sprint: Sprint 17, Sprint 18
Story Points: 0.25

 Description   

The zabbix autoconf script search, by default for the ``gcc'' compiler command. This is not standard.
Any standard-compliant specification of ``make'', MUST define the CC environment variable if not previously set with a default value (could be ``cc'' or ``c99'') and if the CC environment variable is exported before configure the exported value must be used.

This actually affect all the platforms that does not use gcc as a system compiler, causing the user to force the setting of the CC environment variable to override what the zabbix configure script want to do.

It's just a minor annoyance, but respecting the standards is always good



 Comments   
Comment by Andrea Biscuola (Inactive) [ 2017 Sep 29 ]

The fix for this is pretty simple:

Index: configure.ac
===================================================================
--- configure.ac	(revision 73064)
+++ configure.ac	(working copy)
@@ -37,7 +37,7 @@
 dnl *                                                               *
 dnl *****************************************************************
 
-AC_PROG_CC
+AC_PROG_CC([cc gcc clang])
 AM_PROG_CC_C_O
 
 dnl *****************************************************************

We check for cc (generally the system compiler) and after that we check for specific compilers.
We can do this simply because clang flags are compatible with gcc ones, so it's not going to break if no invalid flags are passed. Of course, if a user need different compilers (IBM XLC, Oracle studio etc..), they can still set the CC environment variable and the CFLAGS environment variable for those.

Comment by Andrea Biscuola (Inactive) [ 2017 Oct 03 ]

Fixed in svn://svn.zabbix.com/branches/dev/ZBX-12793

Add to the main configuration script the explicit checks for cc
and c99. The cc utility is, in theory, deprecated, but it's much
more common to find than c99 in supported systems.
So add a check for both the standard commands (cc first, c99
second) and after that for the two specific compilers we test
(gcc and clang).
No changes on the usage of the CC and CFLAGS environment
variables.

Comment by Andris Mednis [ 2017 Oct 05 ]

Successfully tested.

Comment by Andrea Biscuola (Inactive) [ 2017 Oct 06 ]

Released in

  • pre-4.0.0alpha1 (trunk) r73244
Generated at Thu Apr 18 07:43:21 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.