Hi You use 'ldap' USE flag on nagios-plugins but this flag has no effect on the build system. So the ldap plugin gets activated when it finds ldap headers on the host system. ./configure --help|grep ldap -> returns nothing and root@Eternity ~ # grep -r ldap /home/hwoarang/development/gentoo-cvs/gentoo-x86/net-analyzer/nagios-plugins/nagios-plugins-1.4.15.ebuild IUSE="+ssl samba mysql postgres ldap snmp nagios-dns nagios-ntp nagios-ping nagios-ssh nagios-game ups ipv6 radius +suid jabber" DEPEND="ldap? ( >=net-nds/openldap-2.0.25 ) So this flag seems pretty much useless. Either drop this flag and make openldap mandatory ( not recommended ) or create a patch for build system to enable/disable openldap support
Created attachment 247054 [details, diff] patch to add/remove support for openldap Initial patch which add --with/--without-ldap switch to enable/disable check_ldap plugin @QA Please review the patch since I am not that experienced with autotools Thanks
You have to change the AC_CHECK_LIB call, see http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful
(In reply to comment #2) > You have to change the AC_CHECK_LIB call, see > http://blog.flameeyes.eu/2008/04/29/i-consider-ac_check_lib-harmful > Ok let me think about this aloud. This is bad because the libldap will be added to LIBS and this has ugly effects to other plugins because they will list libldap to the linking libraries. Fair enough. However I am not sure I understand the solution. Apparently you do not need libldap on LIBS but only when you build the ldap plugin. So if you override the default behavior of ACTION-IF-FOUND should be fine right? So AC_CHECK_LIB(ldap,main,[],,-llber) should be ok right?
You ought to use [:], as [] is just "nothing".
Created attachment 250429 [details, diff] updated patch What about this one?
Fixed
this fix actual is no fix, it messes up the ldap plugin. it actually compiles fine but I figured out that the linker misses -lldap config.log: configure:13682: checking for ldap_init configure:13682: x86_64-pc-linux-gnu-gcc -o conftest -g -O2 -L. conftest.c >&5 /tmp/cc0s6THd.o: In function `main': /var/tmp/portage/net-analyzer/some/conftest.c:66: undefined reference to `ldap_init' collect2: ld returned 1 exit status changing the patch back to: -+ AC_CHECK_LIB(ldap,main,[:],,-llber) ++ AC_CHECK_LIB(ldap,main,,,-llber) works fine
Fixed. Thank you