[ZBX-8885] Impossible to build zabbix with db2 support on systems with newer gcc compilers Created: 2014 Oct 10  Updated: 2017 May 30  Resolved: 2014 Oct 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: 2.2.6, 2.4.1
Fix Version/s: 2.2.7rc1, 2.4.2rc1, 2.5.0

Type: Incident report Priority: Minor
Reporter: Andris Zeila Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: db2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The db2 checking script incorrectly uses CPPFLAGS to set linked libraries. As result the db2 library is listed in gcc parameters before the source file and it does not load the required symbols, which causes configure to fail with IBM DB2 library not found error
This patch fixes it:

Index: m4/ax_lib_ibm_db2.m4
===================================================================
--- m4/ax_lib_ibm_db2.m4	(revision 49735)
+++ m4/ax_lib_ibm_db2.m4	(working copy)
@@ -46,7 +46,9 @@
         IBM_DB2_LIBS="-ldb2"
 
         saved_CPPFLAGS="$CPPFLAGS"
-        CPPFLAGS="$CPPFLAGS $IBM_DB2_CPPFLAGS $IBM_DB2_LDFLAGS $IBM_DB2_LIBS"
+	saved_LIBS="$LIBS"
+        CPPFLAGS="$CPPFLAGS $IBM_DB2_CPPFLAGS $IBM_DB2_LDFLAGS"
+	LIBS="$IBM_DB2_LIBS"
 
         AC_MSG_CHECKING([for IBM DB2 CLI libraries])
         AC_TRY_LINK([#include <sqlcli1.h>],
@@ -60,5 +62,6 @@
                 AC_MSG_RESULT(no))
 
         CPPFLAGS="$saved_CPPFLAGS"
+	LIBS="$saved_LIBS"
     fi
 ])


 Comments   
Comment by Alexander Vladishev [ 2014 Oct 14 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-8885

Comment by Andris Zeila [ 2014 Oct 15 ]

I replaced tabs with spaces in r49885, please check.

sasha Thanks! CLOSED

Comment by Andris Zeila [ 2014 Oct 15 ]

Successfully tested

Comment by Alexander Vladishev [ 2014 Oct 15 ]

Fixed in pre-2.2.7 r49888, pre-2.4.2 r49893 and pre-2.5.0 (trunk) r49895.

Generated at Sat Apr 27 02:58:04 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.