Package: freecad
Version: 0.10.3247.dfsg-1
Severity: important
Tags: patch
User: debian-...@lists.debian.org
Usertags: kfreebsd


Hi,

the current version fails to build on GNU/kFreeBSD.

The userspace libc on GNU/kFreeBSD is the same as on Linux.
It suffices to alter GetTickCount() to more portable variant,
the rest is the same as on Linux.

Please find attached patch with needed changes.

It would also be nice if you can ask upstream
to include this changes. Of course, upstream have
to patch configure.ac, not configure.

Thanks in advance

                        Petr

--- freecad-0.10.3247.dfsg.orig/configure
+++ freecad-0.10.3247.dfsg/configure
@@ -18029,7 +18029,7 @@
   darwin*)
     GL_LIBS="-Wl,-F/System/Library/Frameworks -Wl,-framework,OpenGL"
     ;;
-  linux*)
+  linux*|kfreebsd*-gnu*)
     GL_LIBS="-lGL -lGLU"
     ;;
 esac
--- freecad-0.10.3247.dfsg.orig/src/FCConfig.h
+++ freecad-0.10.3247.dfsg/src/FCConfig.h
@@ -66,7 +66,7 @@
 #	ifndef FC_OS_WIN32

 #	define FC_OS_WIN32

 #	endif

-#elif defined(linux) || defined(__linux) || defined(__linux__)

+#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GLIBC__)

 #	ifndef FC_OS_LINUX

 #	define FC_OS_LINUX

 #	endif

--- freecad-0.10.3247.dfsg.orig/src/Mod/Sketcher/App/sketchflat/sketch.h
+++ freecad-0.10.3247.dfsg/src/Mod/Sketcher/App/sketchflat/sketch.h
@@ -56,14 +56,14 @@
 #endif
 
 #if defined(FC_OS_LINUX)
-#include <sys/sysinfo.h>
+#include <sys/time.h>

 
 inline DWORD GetTickCount()
 {
-    //FIXME: Must be tested
-    struct sysinfo si;
-    if (sysinfo(&si) == 0) return (si.uptime * 1000);
-    else return 1000;
+    struct timeval tv;

+    

+    gettimeofday(&tv, NULL);

+    return (tv.tv_sec * 1000 + tv.tv_usec / 1000);

 }
 
 #elif defined(FC_OS_MACOSX)

Reply via email to