From bdc7a43670c0b41707af866f7c919c2e8b80a722 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 13 Dec 2014 13:05:27 +0000 Subject: [PATCH] [WINDOWS] Explore compiling against mapnik with g++ - but ultimately disable it. The acquired mapnik.dll is not compatible with the g++ compiler, as I believe the mapnik.dll is generated with MS Visual Studio and thus not binary compatible; as it fails at the link stage :( Thus in light of not compiling mapnik.dll (and possibly other dependencies) from source myself, disable using mapnik on Windows for now. --- win32/configure_and_make.bat | 2 +- win32/generate_install.sh | 3 +++ win32/prepare.bat | 50 +++++++++++++++++++++++++++++++++++- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/win32/configure_and_make.bat b/win32/configure_and_make.bat index 4e194512..f9ec1314 100644 --- a/win32/configure_and_make.bat +++ b/win32/configure_and_make.bat @@ -7,6 +7,6 @@ set PATH=%PATH%;%SystemDrive%\Mingw\bin;%SystemDrive%\msys\1.0\bin pushd .. :: ATM Don't have build method for libgexiv2, so use the fallback of libexif -sh configure CFLAGS="-DWINDOWS -mwindows" LIBCURL=-lcurldll LIBS=-lzdll --with-libexif --disable-realtime-gps-tracking --disable-scrollkeeper --enable-windows +sh configure CFLAGS="-DWINDOWS -DWIN32 -mwindows" LIBCURL=-lcurldll LIBS=-lzdll --with-libexif --disable-realtime-gps-tracking --disable-scrollkeeper --enable-windows --disable-mapnik popd make.bat diff --git a/win32/generate_install.sh b/win32/generate_install.sh index 83472f5e..58f0fe72 100755 --- a/win32/generate_install.sh +++ b/win32/generate_install.sh @@ -23,3 +23,6 @@ if [ ! -e ~/.wine/drive_c/Program\ Files/GnuWin32/bin/wget.exe ]; then fi wine ~/.wine/drive_c/windows/system32/cmd.exe /c prepare.bat + +# Fix broken Mapnik 2.2.0 shipped unicode headers +cp -f /usr/include/x86_64-linux-gnu/unicode/*.h ~/.wine/drive_c/MinGW/include/unicode/ diff --git a/win32/prepare.bat b/win32/prepare.bat index 602096bc..41bfdfd5 100644 --- a/win32/prepare.bat +++ b/win32/prepare.bat @@ -73,7 +73,14 @@ set W32API_URL=%MINGW_BASE_URL%/w32api/w32api-4.0.3/%W32API_LZ%/download set ZLIB_LZ=zlib-1.2.8-1-mingw32-dll.tar.lzma set ZLIB_URL=%MINGW_BASE_URL%/zlib/zlib-1.2.8/%ZLIB_LZ%/download set GETTEXT_LZ=gettext-0.18.3.1-1-mingw32-dll.tar.lzma -set GETTEXT_URL=%MINGW_BASE_URL%/gettext/gettext-0.18.3.1-1/%GETTEXT_LZ%/download +set GETTEXT_URL=%MINGW_BASE_URL%/gettext/gettext-0.18.3.1-1/%GETTEXT_LZ%/download + +set GCC-CPP_BIN_LZ=gcc-c++-4.8.1-4-mingw32-bin.tar.lzma +set GCC-CPP_BIN_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC-CPP_BIN_LZ%/download +set GCC-CPP_DEV_LZ=gcc-c++-4.8.1-4-mingw32-dev.tar.lzma +set GCC-CPP_DEV_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC-CPP_DEV_LZ%/download +set GCC-CPP_DLL_LZ=gcc-c++-4.8.1-4-mingw32-dll.tar.lzma +set GCC-CPP_DLL_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC-CPP_DLL_LZ%/download if not exist "%MINGW_BIN%" ( :: Here we download all default components manually in an attempt to get autoinstall to work... @@ -133,6 +140,27 @@ if not exist "%MINGW_BIN%" ( call :Download "%GETTEXT_LZ%" "%GETTEXT_URL%" call :InstallLZMA "%GETTEXT_LZ%" + + REM Seems '+' in the filename screws things up for script function calls :( + REM call :Download "%GCC_CPP_DEV_LZ%" "%GCC_CPP_DEV_URL%" + REM call :InstallLZMA "%GCC_CPP_DEV_LZ%" + + REM call :Download "%GCC_CPP_DLL_LZ%" "%GCC_CPP_DLL_URL%" + REM call :InstallLZMA "%GCC_CPP_DLL_LZ%" + + REM call :Download "%GCC_CPP_BIN_LZ%" "%GCC_CPP_BIN_URL%" + REM call :InstallLZMA "%GCC_CPP_BIN_LZ%" + + REM Do it every time... + wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-bin.tar.lzma/download + wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-dev.tar.lzma/download + wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-dll.tar.lzma/download + 7z e gcc-c++-4.8.1-4-mingw32-bin.tar.lzma + 7z e gcc-c++-4.8.1-4-mingw32-dev.tar.lzma + 7z e gcc-c++-4.8.1-4-mingw32-dll.tar.lzma + 7z x gcc-c++-4.8.1-4-mingw32-bin.tar -o"%MinGW%" -y + 7z x gcc-c++-4.8.1-4-mingw32-dev.tar -o"%MinGW%" -y + 7z x gcc-c++-4.8.1-4-mingw32-dll.tar -o"%MinGW%" -y ) echo =+=+= @@ -358,6 +386,26 @@ if not exist "%MINGW_BIN%\sqlite3.dll" ( if ERRORLEVEL 1 goto Error ) + +echo =+=+= +echo Mapnik... +echo =+=+= +set MAPNIK_ZIP=mapnik-win-sdk-v2.2.0.zip +set MAPNIK_URL=http://mapnik.s3.amazonaws.com/dist/v2.2.0/%MAPNIK_ZIP% +if not exist "%MINGW_BIN%\mapnik.dll" ( + call :Download "%MAPNIK_ZIP%" "%MAPNIK_URL%" + 7z x %MAPNIK_ZIP% + if ERRORLEVEL 1 goto Error + copy /Y mapnik-v2.2.0\include\* "%MinGW%\include" + copy /Y mapnik-v2.2.0\lib\*.lib "%MinGW%\lib\" + copy /Y mapnik-v2.2.0\lib\*.dll "%MinGW%\bin" + copy /Y mapnik-v2.2.0\lib\mapnik\input "\" + rmdir /S /Q mapnik-v2.2.0 + REM Mapnik 2.2.0 seems to ship with a unicode copy which is missing ptypes.h + REM Copy headers from a known good version... + REM See fix in calling shell script when using wine +) + :: :: Ideally building the code on Windows shouldn't need Doc Utils or the Help processor stuff :: But ATM it's too hard to avoid. -- 2.39.5