Compiling geos with mingw64

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiling geos with mingw64

David Burken

Hi,

I'm attempting a 64 bit windows build with the mingw cross compiler on
linux.  Here's my hacks to get geos to compile if anyone's interested.  
See below.

Take care,
Dave

// My cmake script:
#!/bin/sh

# ---
# File: geos-cmake-config.sh
# ---

build_dir="/work/mingw"

mingw64-cmake -G "Unix Makefiles" \
-DGNU_HOST=x86_64-w64-mingw32 \
-DCMAKE_C_COMPILER=/usr/bin/x86_64-w64-mingw32-gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/x86_64-w64-mingw32-g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${build_dir}/sandbox \
-DCMAKE_MODULE_PATH=${build_dir}/geos/geos-svn/cmake/modules \
../geos-svn

// Files touched:
$ svn status
?       geos_svn_revision.h
M       include/geos/inline.h
M       include/geos/platform.h.cmake
M       include/geos/profiler.h
M       include/geos/timeval.h

// Fixe "multiple defines" in dot.inl files:
$ svn diff include/geos/inline.h
Index: include/geos/inline.h
===================================================================
--- include/geos/inline.h    (revision 3765)
+++ include/geos/inline.h    (working copy)
@@ -18,7 +18,7 @@
  #ifdef GEOS_INLINE
  # define INLINE inline
  #else
-# define INLINE
+# define INLINE inline
  #endif

  // isnan is in std namespace (hack):
$ svn diff include/geos/platform.h.cmake
Index: include/geos/platform.h.cmake
===================================================================
--- include/geos/platform.h.cmake    (revision 3765)
+++ include/geos/platform.h.cmake    (working copy)
@@ -123,6 +123,7 @@
  # endif
  #endif

+#define HAVE_STD_ISNAN 1
  #if defined(HAVE_STD_ISNAN)
  # define ISNAN(x) (std::isnan)(x)
  #elif defined(HAVE_INLINE_ISNAND_XCODE)

// No config.h and gettimeofday call is ambiguous:
$ svn diff include/geos/profiler.h
Index: include/geos/profiler.h
===================================================================
--- include/geos/profiler.h    (revision 3765)
+++ include/geos/profiler.h    (working copy)
@@ -20,7 +20,7 @@
  /* For MingW builds with __STRICT_ANSI__ (-ansi) */
  #if defined(__MINGW32__)
  /* Allow us to check for presence of gettimeofday in MingW */
-#include <config.h>
+// #include <config.h>

  #include <sys/time.h>
  extern "C" {
@@ -71,13 +71,13 @@

      /** \brief start a new timer */
      void start() {
-        gettimeofday(&starttime, NULL);
+           gettimeofday(&starttime, (void*)NULL);
      }

      /** \brief stop current timer */
      void stop()
      {
-        gettimeofday(&stoptime, NULL);
+           gettimeofday(&stoptime, (void*)NULL);
          double elapsed = 1000000*(stoptime.tv_sec-starttime.tv_sec)+
              (stoptime.tv_usec-starttime.tv_usec);


// timezone struct defined in time.h
$ svn diff include/geos/timeval.h
Index: include/geos/timeval.h
===================================================================
--- include/geos/timeval.h    (revision 3765)
+++ include/geos/timeval.h    (working copy)
@@ -31,10 +31,12 @@
  #define EPOCHFILETIME (116444736000000000LL)
  #endif

+#if 0 /* tmp drb */
  struct timezone {
      int tz_minuteswest; /* minutes W of Greenwich */
      int tz_dsttime;     /* type of dst correction */
  };
+#endif



_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: Compiling geos with mingw64

Mateusz Loskot
On 15 February 2013 14:48, David Burken <[hidden email]> wrote:
>
> I'm attempting a 64 bit windows build with the mingw cross compiler on
> linux.  Here's my hacks to get geos to compile if anyone's interested.  See below.

Feel free to add to
http://trac.osgeo.org/geos/wiki/BuildingOnWindowsWithCMake

You may also consider ticket with .patch file
attached, with svn diff  output.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: Compiling geos with mingw64

David Burken
Hi,

On 02/15/2013 10:06 AM, Mateusz Loskot wrote:
> On 15 February 2013 14:48, David Burken <[hidden email]> wrote:
>> I'm attempting a 64 bit windows build with the mingw cross compiler on
>> linux.  Here's my hacks to get geos to compile if anyone's interested.  See below.
> Feel free to add to
> http://trac.osgeo.org/geos/wiki/BuildingOnWindowsWithCMake
This is actually a linux build / experiment on Fedora 18.  Fedora yum
repo has a pile of miingw 64 bit rpms I need including qt4 compiled for
windows.  Just got geotiff compiled, I'm up to compiling OpenSceneGraph,
then ossim stuff.
>
> You may also consider ticket with .patch file
> attached, with svn diff  output.
If I get something less hard coded will do ticket.  Was looking at below
link for isnan error:

http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:TestForSTDNamespace

Dave

>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> _______________________________________________
> geos-devel mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>

_______________________________________________
geos-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/geos-devel