[Nagios-devel] Nagios/CVS HEAD compilation issues on Solaris (strsep patch)

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Nagios/CVS HEAD compilation issues on Solaris (strsep patch)

Post by Guest »

Nagios/CVS HEAD already has a configure script, so I ran that and it
completed fine. But compilation fails, complaining about symbols that
are part of Nagios.

gcc -g -O2 -I/opt/imagelib/include -DHAVE_CONFIG_H -DNSCORE -o nagios nagios.c broker.o nebmods.o checks.o config.o commands.o events.o flapping.o logging.o notifications.o sehandlers.o utils.o retention-base.o xretention-base.o comments-base.o xcomments-base.o objects-base.o xobjects-base.o statusdata-base.o xstatusdata-base.o perfdata-base.o xperfdata-base.o downtime-base.o xdowntime-base.o -L/opt/imagelib/lib -lm -lnsl -lsocket -lpthread -ldl
Undefined first referenced
symbol in file
strsep xretention-base.o
nanosleep events.o
ld: fatal: Symbol referencing errors. No output written to nagios
collect2: ld returned 1 exit status

First, in every file except for the x?ddefaults.c files you replaced
strsep() with my_strsep(). This patch brings these two together:

*** xdata/xrddefault.c_orig Sat Nov 22 13:36:18 2003
--- xdata/xrddefault.c Sat Nov 22 13:36:56 2003
***************
*** 633,639 ****
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(strsep(&temp_ptr,","));
temp_host->state_history_index=0;
}
}
--- 633,639 ----
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(my_strsep(&temp_ptr,","));
temp_host->state_history_index=0;
}
}
***************
*** 796,802 ****
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(strsep(&temp_ptr,","));
temp_service->state_history_index=0;
}
}
--- 796,802 ----
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(my_strsep(&temp_ptr,","));
temp_service->state_history_index=0;
}
}

*** xdata/xsddefault.c_orig Sat Nov 22 13:36:31 2003
--- xdata/xsddefault.c Sat Nov 22 13:37:06 2003
***************
*** 650,656 ****
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(strsep(&temp_ptr,","));
temp_hoststatus->state_history_index=0;
}
*/
--- 650,656 ----
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(my_strsep(&temp_ptr,","));
temp_hoststatus->state_history_index=0;
}
*/
***************
*** 743,749 ****
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(strsep(&temp_ptr,","));
temp_servicestatus->state_history_index=0;
}
*/
--- 743,749 ----
else if(!strcmp(var,"state_history")){
temp_ptr=val;
for(x=0;xstate_history[x]=atoi(my_strsep(&temp_ptr,","));
temp_servicestatus->state_history_index=0;
}
*/



To get nanosleep on Solaris, so you have to link with -lposix4.
This should be tested for by autoconf



--
Joe Rhett Chief Geek
[email protected] Isite Services, Inc.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked