bld.bat 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. SETLOCAL EnableDelayedExpansion
  2. cd source
  3. :: Remove all instances of /W4 from configure.
  4. :: They get passed to the linker and confuse it.
  5. :: Given that we aren't interested in warnings anyway
  6. :: remove it. I could have used a patch but this seemed
  7. :: more 'upgrade friendly'
  8. sed "s~ /W4~~g" configure > configure.new
  9. move configure.new configure
  10. :: This seems to be required - not sure why but
  11. :: rc.exe gets confused with the '/' form of slashes
  12. set MSYS_RC_MODE=1
  13. :: 32-bit and VS2015 ends in failure:
  14. :: uconv.o : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
  15. :: uconv.o : error LNK2001: unresolved external symbol _uconvmsg_dat
  16. :: ../../bin/uconv.exe : fatal error LNK1120: 1 unresolved externals
  17. :: .. without this
  18. if "%ARCH%"=="32" (
  19. if "%c_compiler%"=="vs2015" (
  20. set DISABLE_EXTRAS=--disable-extras
  21. )
  22. )
  23. :: Can't seem to determine msys2 due to bug in config.guess,
  24. :: BUT runConfigureICU expects cygwin, so we just pretend we are
  25. :: The prefix looks strange but it seems we are chrooted into almost the right
  26. :: place by msys2, but can't write to the directories we need - fix up below
  27. FOR /F "delims=" %%i IN ('cygpath.exe -u "%LIBRARY_PREFIX%"') DO set "CYGWIN_LIBRARY_PREFIX=%%i"
  28. bash runConfigureICU Cygwin/MSVC --build=x86_64-pc-cygwin --prefix=!CYGWIN_LIBRARY_PREFIX!/icu %DISABLE_EXTRAS%
  29. :: Ignore errorlevel - there are warnings about various things missing
  30. :: which we don't actually seem to need. Just keep going...
  31. ::if errorlevel 1 exit 1
  32. make -j%CPU_COUNT%
  33. :: Run make twice. There is some timing issue between msys2 and rc.exe
  34. :: that means that directories are created after they are required...
  35. make -j%CPU_COUNT%
  36. if errorlevel 1 exit 1
  37. make install
  38. if errorlevel 1 exit 1
  39. :: Fix up for not being able to write into the root path with msys2
  40. xcopy /e /i %LIBRARY_PREFIX%\icu\lib %LIBRARY_LIB%
  41. if errorlevel 1 exit 1
  42. xcopy /e /i %LIBRARY_PREFIX%\icu\bin %LIBRARY_BIN%
  43. if errorlevel 1 exit 1
  44. xcopy /e /i %LIBRARY_PREFIX%\icu\include %LIBRARY_INC%
  45. if errorlevel 1 exit 1
  46. xcopy /e /i %LIBRARY_PREFIX%\icu\share %LIBRARY_PREFIX%\share
  47. if errorlevel 1 exit 1
  48. rmdir /s /q %LIBRARY_PREFIX%\icu
  49. if errorlevel 1 exit 1
  50. :: The .dlls end up in the wrong place
  51. move %LIBRARY_LIB%\icu*.dll %LIBRARY_BIN%
  52. if errorlevel 1 exit 1