diff -urN ../nagios.orig/base/Makefile.in ./base/Makefile.in
--- ../nagios.orig/base/Makefile.in	2004-12-10 15:38:08.000000000 +0100
+++ ./base/Makefile.in	2005-05-22 17:43:36.000000000 +0200
@@ -11,16 +11,19 @@
 SRC_XDATA=../xdata
 
 CC=@CC@
-CFLAGS=@CFLAGS@ @DEFS@ -DNSCORE
+CFLAGS=@CFLAGS@
 
 # Compiler flags for optimization (overrides default)
-#CFLAGS=-O3 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DHAVE_CONFIG_H -DNSCORE
+#CFLAGS=-O3 -fomit-frame-pointer -momit-leaf-frame-pointer -funroll-loops
 
-# Compiler flags for optimization (complements default)
+# Compiler flags for optimization (complements default or optimize flags)
 #CFLAGS_WARN=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
 #CFLAGS_DEBUG=-ggdb3 -g3
 #CFLAGS+=$(CFLAGS_WARN) $(CFLAGS_DEBUG)
 
+# These must be present, so make sure they are
+CFLAGS+=@DEFS@ -DNSCORE
+
 LDFLAGS=@LDFLAGS@
 LIBS=@LIBS@
 
@@ -51,18 +54,18 @@
 CP=@CP@
 
 # External data I/O code and headers
-XSDC=@XSDC@
-XSDH=@XSDH@
-XCDC=@XCDC@
-XCDH=@XCDH@
-XRDC=@XRDC@
-XRDH=@XRDH@
-XODC=@XODC@
-XODH=@XODH@
-XPDC=@XPDC@
-XPDH=@XPDH@
-XDDC=@XDDC@
-XDDH=@XDDH@
+XSDC=$(SRC_XDATA)/@XSDC@
+XSDH=$(SRC_XDATA)/@XSDH@
+XCDC=$(SRC_XDATA)/@XCDC@
+XCDH=$(SRC_XDATA)/@XCDH@
+XRDC=$(SRC_XDATA)/@XRDC@
+XRDH=$(SRC_XDATA)/@XRDH@
+XODC=$(SRC_XDATA)/@XODC@
+XODH=$(SRC_XDATA)/@XODH@
+XPDC=$(SRC_XDATA)/@XPDC@
+XPDH=$(SRC_XDATA)/@XPDH@
+XDDC=$(SRC_XDATA)/@XDDC@
+XDDH=$(SRC_XDATA)/@XDDH@
 
 # Extra base code
 BASEEXTRALIBS=@BASEEXTRALIBS@
@@ -73,49 +76,37 @@
 BROKER_H=@BROKER_H@
 
 # Object data
-#ODATALIBS=$(SRC_COMMON)/objects.c $(SRC_XDATA)/$(XODC)
-#ODATAHDRS=$(SRC_INCLUDE)/objects.h $(SRC_XDATA)/$(XODH)
 ODATALIBS=objects-base.o xobjects-base.o
 ODATAHDRS=
 ODATADEPS=$(ODATALIBS)
 
 # Retention data
-#RDATALIBS=sretention.o $(SRC_XDATA)/$(XRDC)
-#RDATAHDRS=$(SRC_INCLUDE)/sretention.h $(SRC_XDATA)/$(XRDH)
 RDATALIBS=retention-base.o xretention-base.o
 RDATAHDRS=
 RDATADEPS=$(RDATALIBS)
 
 # Comment data
-#CDATALIBS=$(SRC_COMMON)/comments.c $(SRC_XDATA)/$(XCDC)
-#CDATAHDRS=$(SRC_INCLUDE)/comments.h $(SRC_XDATA)/$(XCDH)
 CDATALIBS=comments-base.o xcomments-base.o
 CDATAHDRS=
 CDATADEPS=$(CDATALIBS)
 
 # Status data
-#SDATALIBS=$(SRC_COMMON)/statusdata.c $(SRC_XDATA)/$(XSDC)
-#SDATAHDRS=$(SRC_INCLUDE)/statusdata.h $(SRC_XDATA)/$(XSDH)
 SDATALIBS=statusdata-base.o xstatusdata-base.o
 SDATAHDRS=
 SDATADEPS=$(SDATALIBS)
 
 # Performance data
-#PDATALIBS=perfdata.o $(SRC_XDATA)/$(XPDC)
-#PDATAHDRS=$(SRC_INCLUDE)/perfdata.h $(SRC_XDATA)/$(XPDH)
 PDATALIBS=perfdata-base.o xperfdata-base.o
 PDATAHDRS=
 PDATADEPS=$(PDATALIBS)
 
 # Downtime data
-#DDATALIBS=$(SRC_COMMON)/downtime.c $(SRC_XDATA)/$(XDDC)
-#DDATAHDRS=$(SRC_INCLUDE)/downtime.h $(SRC_XDATA)/$(XDDH)
 DDATALIBS=downtime-base.o xdowntime-base.o
 DDATAHDRS=
 DDATADEPS=$(DDATALIBS)
 
 
-OBJS=$(BROKER_O) checks.o config.o commands.o events.o flapping.o logging.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS) $(SNPRINTF_O) $(PERLXSI_O)
+OBJS=$(BROKER_O) nagios.o checks.o config.o commands.o events.o flapping.o logging.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS) $(SNPRINTF_O) $(PERLXSI_O)
 OBJDEPS=$(ODATADEPS) $(ODATADEPS) $(RDATADEPS) $(CDATADEPS) $(SDATADEPS) $(PDATADEPS) $(DDATADEPS) $(BROKER_H)
 
 all: nagios nagiostats
@@ -126,44 +117,41 @@
 objects-base.o: $(SRC_COMMON)/objects.c $(SRC_INCLUDE)/objects.h
 	$(CC) $(CFLAGS) -c -o $@ $(SRC_COMMON)/objects.c
 
-xobjects-base.o: $(SRC_XDATA)/$(XODC) $(SRC_XDATA)/$(XODH)
-	$(CC) $(CFLAGS) -c -o $@ $(SRC_XDATA)/$(XODC)
+xobjects-base.o: $(XODC) $(XODH)
+	$(CC) $(CFLAGS) -c -o $@ $(XODC)
 
 statusdata-base.o: $(SRC_COMMON)/statusdata.c $(SRC_INCLUDE)/statusdata.h
 	$(CC) $(CFLAGS) -c -o $@ $(SRC_COMMON)/statusdata.c
 
-xstatusdata-base.o: $(SRC_XDATA)/$(XSDC) $(SRC_XDATA)/$(XSDH)
-	$(CC) $(CFLAGS) -c -o $@ $(SRC_XDATA)/$(XSDC)
+xstatusdata-base.o: $(XSDC) $(XSDH)
+	$(CC) $(CFLAGS) -c -o $@ $(XSDC)
 
 comments-base.o: $(SRC_COMMON)/comments.c $(SRC_INCLUDE)/comments.h
 	$(CC) $(CFLAGS) -c -o $@ $(SRC_COMMON)/comments.c
 
-xcomments-base.o: $(SRC_XDATA)/$(XCDC) $(SRC_XDATA)/$(XCDH)
-	$(CC) $(CFLAGS) -c -o $@ $(SRC_XDATA)/$(XCDC)
+xcomments-base.o: $(XCDC) $(XCDH)
+	$(CC) $(CFLAGS) -c -o $@ $(XCDC)
 
 downtime-base.o: $(SRC_COMMON)/downtime.c $(SRC_INCLUDE)/downtime.h
 	$(CC) $(CFLAGS) -c -o $@ $(SRC_COMMON)/downtime.c
 
-xdowntime-base.o: $(SRC_XDATA)/$(XDDC) $(SRC_XDATA)/$(XDDH)
-	$(CC) $(CFLAGS) -c -o $@ $(SRC_XDATA)/$(XDDC)
+xdowntime-base.o: $(XDDC) $(XDDH)
+	$(CC) $(CFLAGS) -c -o $@ $(XDDC)
 
 perfdata-base.o: perfdata.c $(SRC_INCLUDE)/perfdata.h
 	$(CC) $(CFLAGS) -c -o $@ perfdata.c
 
-xperfdata-base.o: $(SRC_XDATA)/$(XPDC) $(SRC_XDATA)/$(XPDH)
-	$(CC) $(CFLAGS) -c -o $@ $(SRC_XDATA)/$(XPDC)
+xperfdata-base.o: $(XPDC) $(XPDH)
+	$(CC) $(CFLAGS) -c -o $@ $(XPDC)
 
 retention-base.o: sretention.c $(SRC_INCLUDE)/sretention.h
 	$(CC) $(CFLAGS) -c -o $@ sretention.c
 
-xretention-base.o: $(SRC_XDATA)/$(XRDC) $(SRC_XDATA)/$(XRDH)
-	$(CC) $(CFLAGS) -c -o $@ $(SRC_XDATA)/$(XRDC)
-
-
-########## CGIS ##########
+xretention-base.o: $(XRDC) $(XRDH)
+	$(CC) $(CFLAGS) -c -o $@ $(XRDC)
 
-nagios: nagios.c $(OBJS) $(OBJDEPS) $(SRC_INCLUDE)/nagios.h $(SRC_INCLUDE)/locations.h
-	$(CC) $(CFLAGS) -o $@ nagios.c $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(MATHLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)
+nagios: $(OBJS) $(OBJDEPS) $(SRC_INCLUDE)/nagios.h $(SRC_INCLUDE)/locations.h
+	$(CC) -o $@ $(OBJS) $(BROKER_LDFLAGS) $(LDFLAGS) $(PERLLIBS) $(MATHLIBS) $(SOCKETLIBS) $(THREADLIBS) $(BROKERLIBS) $(LIBS)
 
 nagiostats: nagiostats.c $(SRC_INCLUDE)/locations.h
 	$(CC) $(CFLAGS) -o $@ nagiostats.c $(LDFLAGS) $(MATHLIBS) $(LIBS)
@@ -188,3 +176,5 @@
 	$(STRIP) $(DESTDIR)$(BINDIR)/@nagiostats_name@
 
 
+## PHONY targets
+.PHONY: install devclean distclean clean all
