[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building the client on Mac OS X 10.6 -> success



Hi

I tried to compile the xymon client on Mac OS X 10.6 and ran into the same problem that was reported about a year ago[1]. The problem comes from a namespace collision because the system include files on the Mac now have a file called Availability.h which is meant to be included by /usr/include/stdlib.h . However, xymon has a file lib/availability.h which gets included instead.

Unfortunately, the default behaviour for the Mac HFS+ file system is to ignore case so the two files get mixed up. The solution to this is fairly simple. Just drop the -I. from the CFLAGS options. Having -I. should not be necessary anyway because the preprocessor differentiates between #include <file.h> and #include "file.h" precisely to separate system includes from project includes.

Once this problem is solved, there are two more problems that will arise. The first one would be the same on all platforms whenever xymon is built without SSL support (not needed on the client). In lib/sendmsg.c TALK_SSLWRITE_RECEIVE will be referenced even though the enum only goes up to TALK_RECEIVE when HAVE_OPENSSL is not defined.

The second problem ist with the zlib where the dynamic library for Mac OS X is in /usr/lib/libz.dylib which does not get search.

The attached patch fixes all three problems and the Mac OS X client builds successfully.

Hope this helps.

Regards,     -- Elmar



[1] http://www.xymon.com/archive/2009/11/msg00311.html

--
Dr. Elmar S. Heeb <heeb (at) phys.ethz.ch>   support: +41 44 633 26 68
IT Services Group, HPT D 19               voice: +41 44 633 25 91
Department of Physics, ETH Zurich        mobile: +41 79 628 75 24
CH-8093 Zurich, Switzerland              http://nic.phys.ethz.ch/
-----------------------------------------------------------------
Please consider the environment before printing this e-mail
diff -ur xymon-4.3.0-0.20080929.orig/build/Makefile.rules xymon-4.3.0-0.20080929/build/Makefile.rules
--- xymon-4.3.0-0.20080929.orig/build/Makefile.rules	2010-12-10 14:27:26.000000000 +0100
+++ xymon-4.3.0-0.20080929/build/Makefile.rules	2010-12-13 13:21:04.000000000 +0100
@@ -13,7 +13,7 @@
 # Build targets
 #####################
 
-CFLAGS += -I. -I$(BUILDTOPDIR)/include
+CFLAGS += -I$(BUILDTOPDIR)/include
 
 ifeq ($(CLIENTONLY),yes)
 	BUILDTARGETS = client
diff -ur xymon-4.3.0-0.20080929.orig/build/zlib.sh xymon-4.3.0-0.20080929/build/zlib.sh
--- xymon-4.3.0-0.20080929.orig/build/zlib.sh	2010-12-10 14:27:26.000000000 +0100
+++ xymon-4.3.0-0.20080929/build/zlib.sh	2010-12-13 15:23:45.000000000 +0100
@@ -29,6 +29,10 @@
 		then
 			ZLIBLIB=$DIR/lib64
 		fi
+		if test -f $DIR/lib/libz.dylib
+		then
+			ZLIBLIB=$DIR/lib
+		fi
 	done
 
 	if test "$USERZLIBINC" != ""; then
diff -ur xymon-4.3.0-0.20080929.orig/lib/Makefile xymon-4.3.0-0.20080929/lib/Makefile
--- xymon-4.3.0-0.20080929.orig/lib/Makefile	2010-12-10 14:27:27.000000000 +0100
+++ xymon-4.3.0-0.20080929/lib/Makefile	2010-12-13 15:29:38.000000000 +0100
@@ -9,7 +9,7 @@
 endif
 
 
-CFLAGS += -I. -I../include
+CFLAGS += -I../include
 
 ifeq ($(HOBBITLIBRARY),libhobbit.so)
 	CFLAGS += -fPIC
diff -ur xymon-4.3.0-0.20080929.orig/lib/sendmsg.c xymon-4.3.0-0.20080929/lib/sendmsg.c
--- xymon-4.3.0-0.20080929.orig/lib/sendmsg.c	2010-12-10 14:27:27.000000000 +0100
+++ xymon-4.3.0-0.20080929/lib/sendmsg.c	2010-12-13 13:51:00.000000000 +0100
@@ -88,15 +88,21 @@
 #endif
 } talkstate_t;
 
+#ifdef HAVE_OPENSSL
 static char *tsstrings[TALK_SSLWRITE_RECEIVE+1] = {
+#else
+static char *tsstrings[TALK_RECEIVE+1] = {
+#endif
 	"talk_done", 
 	"talk_init_connection", "talk_connecting", 
-	"talk_send", "talk_receive",
-	"talk_sslsend", "talk_sslreceive",
+	"talk_send", "talk_receive"
+#ifdef HAVE_OPENSSL
+	,"talk_sslsend", "talk_sslreceive",
 	"talk_send_starttls",
 	"talk_sslread_setup", "talk_sslwrite_setup",
 	"talk_sslread_send", "talk_sslwrite_send",
 	"talk_sslread_receive", "talk_sslwrite_receive"
+#endif
 };
 
 static int sslinitialize(void)