----- Original Message -----
                From: Tim Hemel tim timit nl
                To: toady gscore org
                Sent: Sat  8/11/08 19:29
                Subject: Fwd: FreeBSD port done

<hi>Hi Sebastien,

I mailed you earlier today to ask for your help. In the meantime, I
managed to fix it myself, including a few other incompatibilities. If
you are interested in what I patched, you can see the patches below.
I changed a cmake file, added an implementation of strndup (which does
not exist on BSD) and added some flex functions that FreeBSD's flex did
not provide. Furthermore, FreeBSD does not need -ldl to do dynamic
linking, this is in libc instead.

The port has been submitted to FreeBSD and hopefully will be accepted.

Regards,

Tim

Patches:

--- src/libpicviz/CMakeLists.txt.orig   2008-10-27 12:39:31.000000000 +0100
+++ src/libpicviz/CMakeLists.txt        2008-11-08 16:12:34.000000000 +0100
@@ -1,7 +1,7 @@
 add_subdirectory(plugins)
 #add_subdirectory(bindings)
 
-include_directories(${picviz_SOURCE_DIR}/src/libpicviz/include 
${picviz_SOURCE_DIR}/src/libpicviz/parser 
${picviz_SOURCE_DIR}/src/libpicviz/props)
+include_directories(${picviz_SOURCE_DIR}/src/libpicviz/include 
${picviz_SOURCE_DIR}/src/libpicviz/parser 
${picviz_SOURCE_DIR}/src/libpicviz/props ${PCRE_INCLUDE_DIR})
 
 #set(CMAKE_SHARED_LINKER_FLAGS "-lm -lfl -ly")
 configure_file(
@@ -26,7 +26,7 @@
 
 set_target_properties(picviz PROPERTIES SOVERSION 1)
 
-target_link_libraries(picviz "-lm -ldl")
+target_link_libraries(picviz "-lm")
 
 install(TARGETS picviz LIBRARY DESTINATION ${LIB_INSTALL_DIR})
 INSTALL(FILES
--- src/libpicviz/values-mapping.c.orig 2008-11-08 16:07:44.000000000 +0100
+++ src/libpicviz/values-mapping.c      2008-11-08 16:08:33.000000000 +0100
@@ -24,6 +24,7 @@
 #include <sys/socket.h>
 #include <netdb.h>
 #include <ctype.h>
+#include <netinet/in.h>
 
 
 #if defined(__linux__) && ! defined(__USE_XOPEN)
--- src/libpicviz/parser/lexer.l.orig   2008-10-27 12:39:31.000000000 +0100
+++ src/libpicviz/parser/lexer.l        2008-11-08 17:11:55.000000000 +0100
@@ -19,7 +19,27 @@
 static char *realfile;
 
 void yyerror (char *s);
+
+#ifdef __FreeBSD__
+char* strndup(const char* string, size_t n)
+{
+        char* copy_string = 0;
+
+        if(0 == string || 0 == n)
+                return 0;
+
+        copy_string = (char*) malloc(n + 1);
+        if(0 == copy_string)
+                return 0;
+
+        memcpy(copy_string, string, n);
+        *(copy_string + n) = '\0';
+
+        return copy_string;
+}
+#else
 char * strndup (const char *s, size_t n);
+#endif
 
 #define MAX_INCLUDE_DEPTH 10
 YY_BUFFER_STATE includes[MAX_INCLUDE_DEPTH];
@@ -48,7 +68,20 @@
         return str;
 }
 
+void yyset_lineno(int line_number) {
+       yylineno = line_number;
+}
+
+int yyget_lineno() {
+       return yylineno;
+}
+
+char * yyget_text() {
+       return yytext;
+}
+
 %}
+%option yylineno
 %option noyywrap
 
 SECTION                (header|engine|axes|data)



_______________________________________________
Picviz mailing list
Picviz@wallinfire.net
http://www.wallinfire.net/cgi-bin/mailman/listinfo/picviz

Reply via email to