[Nagiosplug-help] statically compile for rpm creation

Andreas Ericsson ae at op5.se
Wed Apr 7 11:57:15 CEST 2004

Pedro wrote:
> The problem is that I have different versions of mysql server on the 
> systems. Some have 3.23 and some have 4.0 and thus have different 
> versions of libmysqlclient.so.  The code in check_mysql is pretty simple 
> and it really shouldn't matter if I statically compile the library into 
> the executable.
> I'm not sure how to do that. I've tried adding --enable-static to the 
> configure line and I've even tried adding -static to the Makefile.  When 
> I add the '-static'  to the Makefile, complication fails with this error 
> message:
> netutils.o(.text+0x473): In function `my_connect':
> /opt/install/nagios-plugins-1.3.1/plugins/netutils.c:281: Using 
> 'gethostbyname' in statically linked applications requires at runtime 
> the shared libraries from the glibc version used for linkin
If you remove the call to gethostbyname() you can tweak it a bit so that 
things work fine anyways, but you won't be able to use hostnames (as 
opposed to IP-addresses) for things to work. 'man 3 gethostbyname' for 
more info on how to hack your way around it.

> Any help would be appreciated.
> Thanks
> -p
Mvh / Best Regards
Sourcerer / Andreas Ericsson
+46 (0)733 709032
andreas.ericsson at op5.se

More information about the Help mailing list