unable to compile nagios with --with-mysql-xdata
Daniel Henninger
daniel at unity.ncsu.edu
Thu Mar 11 14:37:42 CET 2004
> ld: fatal: Symbol referencing errors. No output written to
> nagios
> collect2: ld returned 1 exit status
> *** Error code 1
> make: Fatal error: Command failed for target `nagios'
> Current working directory /opt/src/tools/nagios-1.2/base
> *** Error code 1
> make: Fatal error: Command failed for target `all'
> bash-2.03#
Same deal as the other thread I was talking in, the mysqlclient library is
"out of place". It needs to come after the objects that depend on it.
I've attached the patch I put together to get around this. It should be
applied to the fresh 1.2 source code. Hope it works out for you.
Daniel
--
/\\\----------------------------------------------------------------------///\
\ \\\ Daniel Henninger http://www.vorpalcloud.org/ /// /
\_\\\ North Carolina State University - Systems Programmer ///_/
\\\ Information Technology <IT> ///
"""--------------------------------------------------------------"""
-------------- next part --------------
diff -Ncr nagios-1.2.orig/base/Makefile.in nagios-1.2/base/Makefile.in
*** nagios-1.2.orig/base/Makefile.in 2002-11-10 22:52:13.000000000 -0500
--- nagios-1.2/base/Makefile.in 2003-09-09 13:35:39.000000000 -0400
***************
*** 88,94 ****
OBJS=checks.o config.o commands.o flapping.o logging.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS) $(SNPRINTF_O)
nagios: nagios.c $(OBJS) nagios.h $(SRC_COMMON)/locations.h
! $(CC) $(CFLAGS) $(LDFLAGS) nagios.c $(OBJS) $(PERLLIBS) $(MATHLIBS) -o $@
#$(SRC_COMMON)/locations.h: $(SRC_COMMON)/locations.sub
# perl -pe 's|\$${prefix}|${prefix}|g;s|\$${exec_prefix}|${exec_prefix}|g;s|\$${htmurl}|$(HTMURL)|g;s|\$${cgiurl}|$(CGIURL)|g;' $(SRC_COMMON)/locations.sub > $(SRC_COMMON)/locations.h
--- 88,94 ----
OBJS=checks.o config.o commands.o flapping.o logging.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS) $(SNPRINTF_O)
nagios: nagios.c $(OBJS) nagios.h $(SRC_COMMON)/locations.h
! $(CC) $(CFLAGS) nagios.c $(OBJS) $(LDFLAGS) $(PERLLIBS) $(MATHLIBS) -o $@
#$(SRC_COMMON)/locations.h: $(SRC_COMMON)/locations.sub
# perl -pe 's|\$${prefix}|${prefix}|g;s|\$${exec_prefix}|${exec_prefix}|g;s|\$${htmurl}|$(HTMURL)|g;s|\$${cgiurl}|$(CGIURL)|g;' $(SRC_COMMON)/locations.sub > $(SRC_COMMON)/locations.h
diff -Ncr nagios-1.2.orig/cgi/Makefile.in nagios-1.2/cgi/Makefile.in
*** nagios-1.2.orig/cgi/Makefile.in 2002-08-25 19:53:00.000000000 -0400
--- nagios-1.2/cgi/Makefile.in 2003-09-09 13:38:03.000000000 -0400
***************
*** 95,152 ****
$(COMMENTLIBS): $(COMMENTHDRS)
avail.cgi: avail.c $(CGIDEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) avail.c $(CGILIBS) -o $@
checksanity.cgi: checksanity.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS) $(DDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) checksanity.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) -o $@
cmd.cgi: cmd.c $(CGIDEPS) $(CDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) cmd.c $(CGILIBS) $(CDATALIBS) $(DDATALIBS) -o $@
config.cgi: config.c $(CGIDEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) config.c $(CGILIBS) -o $@
extinfo.cgi: extinfo.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS) $(DDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) extinfo.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) -o $@
history.cgi: history.c $(CGIDEPS) $(LIFODEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) history.c $(CGILIBS) $(LIFOLIBS) -o $@
ministatus.cgi: ministatus.c $(CGIDEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) ministatus.c $(CGILIBS) -o $@
notifications.cgi: notifications.c $(CGIDEPS) $(LIFODEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) notifications.c $(CGILIBS) $(LIFOLIBS) -o $@
outages.cgi: outages.c $(CGIDEPS) $(CDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) outages.c $(CGILIBS) $(CDATALIBS) -o $@
showlog.cgi: showlog.c $(CGIDEPS) $(LIFODEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) showlog.c $(CGILIBS) $(LIFOLIBS) -o $@
status.cgi: status.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) status.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) -o $@
statuswml.cgi: statuswml.c $(CGIDEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) statuswml.c $(CGILIBS) -o $@
statusmap.cgi: statusmap.c $(CGIDEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) statusmap.c $(CGILIBS) $(GDLIBS) $(EDATALIBS) -o $@
statuswrl.cgi: statuswrl.c $(CGIDEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) statuswrl.c $(CGILIBS) $(MATHLIBS) $(EDATALIBS) -o $@
summary.cgi: summary.c $(CGIDEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) summary.c $(CGILIBS) -o $@
tac.cgi: tac.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) tac.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) -o $@
trends.cgi: trends.c $(CGIDEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) trends.c $(CGILIBS) $(GDLIBS) -o $@
histogram.cgi: histogram.c $(CGIDEPS)
! $(CC) $(CFLAGS) $(LDFLAGS) histogram.c $(CGILIBS) $(GDLIBS) -o $@
clean:
rm -f $(CGIS) *.o *.cfg *.sub core
--- 95,152 ----
$(COMMENTLIBS): $(COMMENTHDRS)
avail.cgi: avail.c $(CGIDEPS)
! $(CC) $(CFLAGS) avail.c $(CGILIBS) $(LDFLAGS) -o $@
checksanity.cgi: checksanity.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS) $(DDATADEPS)
! $(CC) $(CFLAGS) checksanity.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) $(LDFLAGS) -o $@
cmd.cgi: cmd.c $(CGIDEPS) $(CDATADEPS)
! $(CC) $(CFLAGS) cmd.c $(CGILIBS) $(CDATALIBS) $(DDATALIBS) $(LDFLAGS) -o $@
config.cgi: config.c $(CGIDEPS)
! $(CC) $(CFLAGS) config.c $(CGILIBS) $(LDFLAGS) -o $@
extinfo.cgi: extinfo.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS) $(DDATADEPS)
! $(CC) $(CFLAGS) extinfo.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) $(LDFLAGS) -o $@
history.cgi: history.c $(CGIDEPS) $(LIFODEPS)
! $(CC) $(CFLAGS) history.c $(CGILIBS) $(LIFOLIBS) $(LDFLAGS) -o $@
ministatus.cgi: ministatus.c $(CGIDEPS)
! $(CC) $(CFLAGS) ministatus.c $(CGILIBS) $(LDFLAGS) -o $@
notifications.cgi: notifications.c $(CGIDEPS) $(LIFODEPS)
! $(CC) $(CFLAGS) notifications.c $(CGILIBS) $(LIFOLIBS) $(LDFLAGS) -o $@
outages.cgi: outages.c $(CGIDEPS) $(CDATADEPS)
! $(CC) $(CFLAGS) outages.c $(CGILIBS) $(CDATALIBS) $(LDFLAGS) -o $@
showlog.cgi: showlog.c $(CGIDEPS) $(LIFODEPS)
! $(CC) $(CFLAGS) showlog.c $(CGILIBS) $(LIFOLIBS) $(LDFLAGS) -o $@
status.cgi: status.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) status.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(LDFLAGS) -o $@
statuswml.cgi: statuswml.c $(CGIDEPS)
! $(CC) $(CFLAGS) statuswml.c $(CGILIBS) $(LDFLAGS) -o $@
statusmap.cgi: statusmap.c $(CGIDEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) statusmap.c $(CGILIBS) $(GDLIBS) $(EDATALIBS) $(LDFLAGS) -o $@
statuswrl.cgi: statuswrl.c $(CGIDEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) statuswrl.c $(CGILIBS) $(MATHLIBS) $(EDATALIBS) $(LDFLAGS) -o $@
summary.cgi: summary.c $(CGIDEPS)
! $(CC) $(CFLAGS) summary.c $(CGILIBS) $(LDFLAGS) -o $@
tac.cgi: tac.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS)
! $(CC) $(CFLAGS) tac.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(LDFLAGS) -o $@
trends.cgi: trends.c $(CGIDEPS)
! $(CC) $(CFLAGS) trends.c $(CGILIBS) $(GDLIBS) $(LDFLAGS) -o $@
histogram.cgi: histogram.c $(CGIDEPS)
! $(CC) $(CFLAGS) histogram.c $(CGILIBS) $(GDLIBS) $(LDFLAGS) -o $@
clean:
rm -f $(CGIS) *.o *.cfg *.sub core
diff -Ncr nagios-1.2.orig/configure nagios-1.2/configure
*** nagios-1.2.orig/configure 2003-06-02 23:47:57.000000000 -0400
--- nagios-1.2/configure 2003-09-09 13:42:00.000000000 -0400
***************
*** 2457,2463 ****
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
! LIBS="-lmysqlclient $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2463 "configure"
#include "confdefs.h"
--- 2457,2463 ----
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
! LIBS="-lmysqlclient -lz $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2463 "configure"
#include "confdefs.h"
***************
*** 2487,2493 ****
#define $ac_tr_lib 1
EOF
! LIBS="-lmysqlclient $LIBS"
else
echo "$ac_t""no" 1>&6
--- 2487,2493 ----
#define $ac_tr_lib 1
EOF
! LIBS="-lmysqlclient -lz $LIBS"
else
echo "$ac_t""no" 1>&6
More information about the Users
mailing list