Open main menu

Difference between revisions of "Compiling ScummVM/MinGW"

no edit summary
Line 73: Line 73:
* [http://liba52.sourceforge.net/ liba52]. Optional, for AC-3 support.
* [http://liba52.sourceforge.net/ liba52]. Optional, for AC-3 support.
** You need the latest liba52 source code ([http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz v0.7.4] at the time of writing).
** You need the latest liba52 source code ([http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz v0.7.4] at the time of writing).
* [https://tls.mbed.org/ mbedTLS]. Optional, for cloud support.
** You need the latest mbedTLS source code ([https://github.com/ARMmbed/mbedtls/archive/v2.25.0.tar.gz v2.25.0] at the time of writing).


* [https://curl.se/ libcurl]. Optional, for cloud support.
* [https://curl.se/ libcurl]. Optional, for cloud support.
Line 366: Line 369:


  ./configure --disable-shared --prefix=/mingw
  ./configure --disable-shared --prefix=/mingw
make
make install
=== mbedTLS ===
Unzip the mbedTLS archive in a folder, open MSYS, go to the mbedtls folder and apply the following patch:
<syntaxhighlight lang="diff">
--- library/platform_util.c.orig        2020-12-10 12:55:25 +0000
+++ library/platform_util.c    2021-03-08 23:59:37 +0000
@@ -92,9 +92,11 @@
  * threading.h. However, this macro is not part of the Mbed TLS public API, so
  * we keep it private by only defining it in this file
  */
-#if ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) )
+#if ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) || \
+      ( defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) )
#define PLATFORM_UTIL_USE_GMTIME
-#endif /* ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) */
+#endif /* ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) || \
+            (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) ) */
#endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) ||    \
              ( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) &&                    \
@@ -103,7 +105,7 @@
struct tm *mbedtls_platform_gmtime_r( const mbedtls_time_t *tt,
                                      struct tm *tm_buf )
{
-#if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)
+#if defined(_WIN32) && !defined(PLATFORM_UTIL_USE_GMTIME)
    return( ( gmtime_s( tm_buf, tt ) == 0 ) ? tm_buf : NULL );
#elif !defined(PLATFORM_UTIL_USE_GMTIME)
    return( gmtime_r( tt, tm_buf ) );
</syntaxhighlight>
Then issue these commands to compile and install the library:
CPPFLAGS=-D_WIN32_WINNT=0x400 cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF .
  make
  make
  make install
  make install
Line 374: Line 416:
Unzip the curl archive in a folder, open MSYS, go to the curl folder and issue these commands to compile and install the library:
Unzip the curl archive in a folder, open MSYS, go to the curl folder and issue these commands to compile and install the library:


  CPPFLAGS=-D_WIN32_WINNT=0x400 ./configure --disable-shared --prefix=/mingw --with-winssl --disable-pthreads --disable-ldap
  CPPFLAGS=-D_WIN32_WINNT=0x400 ./configure --disable-shared --prefix=/mingw --with-winssl --with-mbedtls --disable-pthreads --disable-ldap
  make
  make
  make install
  make install
202

edits