lrint()の存在を決めうち。おーのー。Solaris9にはない!
--- applet.c.dist Sat Nov 18 01:27:03 2006 +++ applet.c Fri Feb 9 04:35:24 2007 @@ -28,6 +28,9 @@ #define _ISOC99_SOURCE #include <math.h> #include <string.h> +#ifdef HAVE_INTTYPES_H +#define lrint(x) ((long)rint((x))) +#endif #include <glib-object.h> #include <gdk/gdkkeysyms.h>
ifdefの変数はこれじゃ正しくないけど、まあまちがって判定しても rintからのキャストであってるということで。
install時に icon-name-mapping をダイレクトに起動しちゃうので
bmake 起動には
PATH=$PKG/libexec:$PATH bmake install clean
などとする必要あり。
これまた trunc() があると決めうち。ここだけC99にされても……。 これ困ったね。しかたないので、
#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__Solaris__) # define trunc(x) ((double)floor(x)) #endif
という感じにして、gmake CC="gcc -D__Solaris__"
で逃げた。
これもC99な round() を使っていてこける。
#define round(x) (floor((x)+0.5))
で対処。あ、dasher_main.cpp にもある。じゃ dasher.h にdefine文を移動。
Posix/posix_main で getopt_long を使っている。これもNG。 適当にこんな感じ。
--- posix_main.c.orig	Sat Feb 10 15:41:59 2007
+++ posix_main.c	Sat Feb 10 15:43:03 2007
@@ -172,13 +172,23 @@
 	sigset_t				signalSet;
 	int					sig;
 
+#ifdef __Solaris__
+#define NO_GETOPT_LONG
+#endif
+
+#ifndef NO_GETOPT_LONG
 	static struct option long_opts[] =
 	{
 		{ "verbose", no_argument, &verbose_flag, 1 },
 		{ 0, 0, 0, 0 }
 	};
+#endif
 
+#ifndef NO_GETOPT_LONG
 	while ((opt = getopt_long(argc, argv, "?hvdi:a:f:", long_opts, &option_index ) ) != EOF)
+#else
+	while ((opt = getopt(argc, argv, "?hvVdi:a:f:") ) != EOF)
+#endif
 	{
 		switch (opt)
 		{
@@ -218,14 +228,23 @@
 			{
 				conf_file = sw_strdup(optarg);
 			}
+
+#ifdef NO_GETOPT_LONG
+			case 'V':
+			{
+				sw_debug_set_level( SW_LOG_VERBOSE );
+			}
 			break;
+#endif
 		}
 	}
 
+#ifndef NO_GETOPT_LONG
 	if ( verbose_flag )
 	{
 		sw_debug_set_level( SW_LOG_VERBOSE );
 	}
+#endif
 
 	if (make_daemon)
 	{
Makefileに -D__Solaris__ が渡るようにしてコンパイル。
stdint.hだ。
--- rfbproto.h.dist Mon Jul 12 21:17:52 2004 +++ rfbproto.h Sun Feb 11 07:21:05 2007 @@ -60,7 +60,11 @@ #include <rfb/rfbint.h> #else #include <config.h> +#ifdef HAVE_INTTYPES_H +#include <sys/int_types.h> +#else #include <stdint.h> +#endif #endif #endif #include <rfb/keysym.h>
叱咤激励感想ツッコミはゲストブックへ
Generated with mkdiary.rb