Commit Graph

19 Commits

Author SHA1 Message Date
David Korth
cb3ada3e88 [gettext.win32] Recompiled with gcc-15.1.0.
Some checks failed
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Has been cancelled
2025-04-25 18:23:11 -04:00
David Korth
684ef662a7 [gettext.win32] Updated to gettext-0.24.
Compiled with:
- i386:  gcc-14.2.1_p20241116, MinGW-w64 12.0.0
- amd64: gcc-14.2.1_p20241221, MinGW-w64 12.0.0

I tried updating it before, but every time I rebuilt gettext, it would
cause all of rom-properties to crash on startup. It turns out the
problem was -Wl,--pic-executable; removing this fixed it.

This *might* prevent ASLR .reloc sections from being generated in the
gettext executables. These are only used at compile time, so it's not
that big of an issue.

Removed most of the patches, since they are no longer necessary.
The remaining patches:

- 001-gettext-runtime-disable-iconv.patch
- 122-Use-LF-as-newline-in-envsubst.patch

Both patches have been updated for gettext-0.24.

TODO: Build for arm, arm64, and arm64ec.
2025-04-21 20:37:26 -04:00
David Korth
a9a454d912 [gettext.win32] Updated to gettext-0.22.
Compiled using gcc-13.2.0 and MinGW-w64 11.0.0.

Removed the *.dll.debug files, since I'm not planning on debugging
gettext, and no one seems to care about them anyway.

NOTE: The libgnuintl-8.dll files are more than double the size of
the previous version. This might be due to using a newly-built
Gentoo crossdev MinGW-w64 toolchain on my laptop instead of the
old MinGW-w64 toolchain on Ubuntu 22.04, or it might be because
gettext-0.22 has more wchar_t functionality on Windows now.

TODO: Build for Windows on ARM using LLVM MinGW-w64.
2023-07-28 19:37:18 -04:00
David Korth
33d7ce6a6c [gettext.win32] patches: Add missing 200-tools-gnulib-define-installdir.patch patch.
Not strictly necessary, though...
2023-05-07 12:14:22 -04:00
David Korth
5257a7fe45 [gettext.win32] Rebuild using -D_WIN32_WINNT=0x0501/0x0502.
Otherwise, the gettext executables don't work on Windows 7 due to
gnulib using GetSystemTimePreciseAsFileTime().
2021-09-03 18:47:06 -04:00
David Korth
33a5be5230 [gettext.win32] Rebuilt using MinGW-w64 9.0.0 and gcc-11.2.0.
Also enabled the following flags:
- large address aware
- high entropy VA (64-bit only)
- dynamic base
- nxcompat

For some reason, these weren't enabled when I built them before, which
broke when running ROM Properties from a network share on Windows 10
due to the "Prohibit Dynamic Code" policy. (Probably nxcompat.)

Also, strip the binaries in bin.i386/.
2021-09-02 18:20:46 -04:00
David Korth
eadcdf9327 Remove "/Gz" for stdcall on i386 when building with MSVC.
I tested a release build and it saved a total of 10,752 bytes.

On the other hand, it had a rather huge maintenance overhead, since I had
to ensure that all extlibs had __cdecl set up in the headers properly,
and this had to be redone on every update.

The i386 build of LZ4 on AppVeyor was failing in tests because of missing
stdcall symbols. I decided not to bother adding stdcall support to LZ4
and simply revert stdcall entirely.
2021-03-31 22:24:17 -04:00
David Korth
86c1366312 [gettext.win32] Rebuilt libgnuintl-8.lib for i386 using MSVC 2019.
It seems MSVC 2010 is generating a broken .lib file...
2020-08-20 23:09:05 -04:00
David Korth
43c01b14d6 [gettext.win32] Rebuilt libgnuintl-8.lib for i386.
AppVeyor complained that it was corrupt...
2020-08-20 20:17:41 -04:00
David Korth
98af19118b [gettext.win32] Updated gettext-win32: 0.20.2 -> 0.21
Main changes:
- gettext now has wbindtextdomain() on Windows, so we can remove our
  custom Unicode patch.
- The 64-bit version seems to always build DllMain from the relocatable
  package, even though we're disabling that...

New patches:

122-Use-LF-as-newline-in-envsubst.patch
- From: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext
- Use LF as newlines instead of CRLF.

1002-dcigettext-c-include-wchar-h.patch:
- #include <wchar.h> for _wgetcwd().

1003-gettextsrc-exports-missing-formatstring-ruby.patch:
- Fix a missing export for formatstring_ruby, which fixes an undefined
  __imp_* symbol error.

1004-gettext-runtime-disable-iconv.patch:
- Disable iconv support in gettext runtime so we don't need to bundle
  iconv.dll in the final package.
- Was applied previously, but I forgot to include it as a patch.
2020-08-20 19:08:03 -04:00
David Korth
15ac32f7a0 [gettext.win32] lib.i386: AppVeyor reported libgnuintl-8.lib was corrupt.
Not sure what happened here...
2020-06-01 18:21:22 -04:00
David Korth
66276caba4 [gettext.win32] Updated gettext-win32: 0.20.1 -> 0.20.2
Compiled on Ubuntu 20.04 using MinGW-w64 with gcc-9.3.0-7ubuntu1+22~exp1ubuntu4.

Some changes:
- The libraries are significantly smaller than before. Not sure what
  really changed...
- The .def files no longer have ordinals.
2020-06-01 17:23:17 -04:00
David Korth
ad5baef669 [gettext.win32] lib.i386: I copied in the 64-bit DLL by mistake...
This now has the correct 32-bit DLL and supporting libraries.

The __imp_libintl_version symbol is present again.

This fixes a 32-bit Windows build regression from
commit bc41a4e845.
([gettext.win32] Recompiled gettext-0.20.1.)
2019-12-09 01:09:58 -05:00
David Korth
bc41a4e845 [gettext.win32] Recompiled gettext-0.20.1.
Compiled on Ubuntu 19.10 using MinGW-w64 with gcc-9.2.1-9ubuntu1+22~exp1ubuntu2.

The previous build was compiled on Ubuntu 19.04 using MinGW-w64
with gcc-8.3.0.

Some changes:
- The i386 .def file no longer has __imp_libintl_version.
- The .debug files are no longer compressed. I'm not sure how many
  Windows tools support compressed debug files.
2019-12-05 22:52:11 -05:00
David Korth
08e9c1557c [gettext.win32] Added lib.amd64/libgnuintl.dll.a.
This should have been added before, but apparently it wasn't added to
the repository due to the .gitignore rule, and I forgot to specify the
--force option. Oh well.
2019-12-05 21:49:31 -05:00
David Korth
4fc3de9e36 [gettext.win32] Updated to gettext-0.20.1.
Compiled on Ubuntu 19.04 using MinGW-w64 with gcc-8.3.0.

Some patches were dropped:
- 05-always-use-libintl-vsnprintf.mingw.patch: Doesn't apply cleanly
  and isn't needed.
- 09-asm-underscore-mingw.patch: Merged upstream.

All other patches were applied, though some manual adjustments were
needed for a few patches, including the ctype/unistd include patch,
06-dont-include-ctype-after-gnulibs-wctype.mingw.patch.
2019-05-25 15:08:43 -04:00
David Korth
4027d6e370 Enabled delay-load for libgnuintl-8.dll.
libintl.h: Disabled libgnuintl wrappers for printf() functions.
We don't need to use the GNU versions for anything, and it causes problems
if libgnuintl-8.dll is unavailable, since we can't use printf() to print
an error message in that case.
- Redefine snprintf() as _snprintf() on older versions of MSVC.
  See c99-compat.msvcrt.h.

DelayLoadHelper.cmake: Delay-load libgnuintl-8.dll.

DelayLoadHelper.h: Added a 1-argument macro.

[win32] DllMain.cpp, DllGetClassObject() Fail if libgnuintl-8.dll can't
be loaded.

[rpcli] rpcli.cpp: Print an error message if libgnuintl-8.dll can't be
loaded.
- TODO: Print the program information.

[win32] ConfigDialog.cpp: Show an error message if libgnuintl-8.dll
can't be loaded.
- TODO: Move this to rp-config.c? Doing that will result in no error
  message if rundll32.exe is used, though...

This should be the last thing needed for issue #122:
[win32] Build and link in GNU gettext or equivalent
2018-05-17 22:48:03 -04:00
David Korth
5e98aed6c7 [gettext.win32] Added support for Unicode paths on Windows.
loadmsgcat.c: Convert the filename from UTF-8 to UTF-16, then use
_wopen() to open the file.

[libi18n] i18n.c: Convert the filename to UTF-8 instead of ANSI.

gettext now works on Windows if non-ANSI characters are present in
rom-properties' path.
2018-04-29 16:15:15 -04:00
David Korth
314a8b7f81 Initial build of gettext for Win32.
The gettext libraries and executables were built on Ubuntu 18.04 using
MinGW-w64 with gcc-7.3.0.

iconv support has been disabled for the runtime, but it's still needed
for some of the build executables. For that, we're using win-iconv, which
is an iconv wrapper that uses the Windows API. [1]

In addition, several patches from the official MinGW package repository
were applied to gettext-0.19.8.1 in order to get it to build correctly
for Windows. [2]

TODO:
- Test packaging to ensure the correct DLL is packaged.
- Test bindtextdomain() to determine if it supports Unicode. If it
  doesn't, then another patch will be needed.

[1] https://github.com/win-iconv/win-iconv
[2] https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext
2018-04-29 13:32:20 -04:00