Commit Graph

506 Commits

Author SHA1 Message Date
David Korth
de24fd4ca9 [libjpeg-turbo] release/: These files shouldn't be marked as executable. 2018-11-18 01:08:26 -05:00
David Korth
1458529bd7 [libjpeg-turbo] Updated to libjpeg-turbo-2.0.1. 2018-11-18 01:08:09 -05:00
David Korth
1f3db35ddb [minizip] .gitignore: CMakeLists.txt generates zip.h and unzip.h for compatibility with older MiniZip.
Ignore these files so they don't get checked in accidentally.
2018-11-12 00:54:04 -05:00
David Korth
784d688a01 [minizip] Updated to v2.6.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-11-12 00:01:47 -05:00
David Korth
243bea473f [minizip] Updated to v2.6.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-10-14 15:50:09 -04:00
David Korth
2b1ce8b3f2 [unice68] Check for fileno() and _fileno().
It's still not finding it on MSVC 2010, but we might as well
check for it anyway.
2018-10-06 12:54:20 -04:00
David Korth
ded8ecea19 [unice68] Fixed MSVC build errors.
- `inline` isn't defined in C mode in MSVC 2010 and 2013.
  (It might be in 2015 and 2017?)

- main() must be `__cdecl`, but we're defaulting to `__stdcall`
  in 32-bit builds.

- myfileno(): Added a missing semicolon.
2018-10-06 12:51:08 -04:00
David Korth
b58a3b4d3e Merge branch 'feature/Audio-SNDH'
No metadata properties yet, but it's good enough for now.
2018-10-06 12:07:21 -04:00
David Korth
da90a646cd [unice68] CMakeLists.txt: Specify "-fpic -fPIC" for shared library compatibility.
This broke the travis-ci build:

/usr/bin/ld: ../../../lib/../extlib/unice68/CMakeFiles/unice68_lib.dir/unice68_unpack.c.o:
	relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
../../../lib/libunice68.a: error adding symbols: Bad value

I didn't see this locally because I was only building rpcli when testing
the SNDH unice68 functionality.
2018-10-06 12:00:32 -04:00
David Korth
997ee7ff87 [unice68] CMakeLists.txt: Write config files *after* checking includes and functions.
Otherwise, basename() won't be detected properly on the first pass.
2018-10-06 11:56:14 -04:00
David Korth
be1feb628f [googletest] Build as a DLL on Windows.
This significantly reduces the size of the test executables.

This can be done more easily on Windows than on other platforms because
Windows includes the program's directory as part of the DLL search path
by default.

NOTE: I was originally trying to fix a linkage issue with
g_linked_ptr_mutex that was showing up when building on MSVC 2010,
but that seems to have disappeared by itself...

References for the linkage issue:
- https://github.com/google/googletest/issues/292
- https://github.com/ornladios/ADIOS2/pull/477
- d9657bda86
2018-09-30 18:15:55 -04:00
David Korth
784ef57097 [googletest] Updated to v1.8.1. 2018-09-30 17:52:15 -04:00
David Korth
0237650c67 [minizip] .travis.yml doesn't need to be renamed.
travis-ci only checks the top-level .travis.yml file.
2018-09-30 17:41:58 -04:00
David Korth
0cf1b54bb0 [libjpeg-turbo] SIMD: Fix c000001d exception on Win 7 w/o SP1
Apparently Windows 7 without SP1 has O/S support for XSAVE but not for
YMM registers, and this exposed a bug in our usage of xgetbv.  The test
instruction will set ZF only if none of the bits match between the two
operarands, so in effect, we were enabling AVX2 instructions if the O/S
supported XSAVE and the CPU supported AVX2 but the O/S only supported
XMM registers.  This bug was not exposed on, for instance, Windows XP or
RHEL 5 because those O/S's do not support XSAVE.

Upstream commit:
d5f281b734
2018-09-30 17:35:12 -04:00
David Korth
2ae0815ab7 [minizip] Updated to v2.5.4 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-09-30 17:31:32 -04:00
David Korth
bb3b816448 [unice68] Fixed signed/unsigned comparison and fall-through warnings.
The fall-through is intentional, so fall-through comments were added.
2018-09-29 15:05:38 -04:00
David Korth
e827229667 [unice68] Renamed config.h to config.unice68.h; added HAVE_CONFIG_H to unice68_exe.
This fixes the build of unice68.

The unice68 executable can now be built in tree for testing purposes,
but it isn't built or installed as part of the normal build.
2018-09-29 15:01:05 -04:00
David Korth
a7bb4e5151 [unice68] Disable -Wempty-body and -Wshift-negative-value.
unice68_pack.c generates a lot of these warnings, and there doesn't
seem to be a straightforward fix.
2018-09-29 11:15:14 -04:00
David Korth
2d2c64f817 [extlib] unice68: Initial import of unice68-2.0.0.690.
This will be used to decompress Atari ST SNDH files.

Note that unice68 is GPLv3, so there's a compile-time option to
disable it.

TODO: Make it a DLL/SO instead and use dlopen().
2018-09-29 11:01:57 -04:00
David Korth
c2772eaf8f [minizip] mz_compat.h: Fix extern "C" {.
This was apparently broken in upstream commit 3eaa5560bfeda53a295651cca8e623493971ecd2.
(Added back ZEXPORT. Coeur/ZipArchive#444)
2018-09-08 22:08:23 -04:00
David Korth
dd85809cd8 [minizip] Updated to v2.5.2 (plus some additional patches) from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-09-08 22:03:34 -04:00
David Korth
fbb1d58f2d extlib, tests: Marked target link libraries as PUBLIC and/or PRIVATE.
Tests are all executables, so none of the libraries need to be PUBLIC.

External libraries should not be exporting their dependencies if they
aren't needed.
2018-08-26 20:58:23 -04:00
David Korth
d8e9ba8641 [minizip] Updated to v2.5.1 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

Removed the test files, since we don't need them here.
2018-08-25 11:43:01 -04:00
David Korth
576a2a135d [extlib] minizip: Added test/empty.txt to the repository. 2018-08-10 09:43:28 -04:00
David Korth
36fafbca18 [minizip] Updated to v2.4.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-08-10 09:25:51 -04:00
David Korth
6c50ecca39 [libjpeg-turbo] Added JPEGCALL to various functions in TurboJPEG files.
We're not using these, but they should still have JPEGCALL anyway.
2018-07-28 19:30:37 -04:00
David Korth
74d6f02ca1 [libjpeg-turbo] turbojpeg.h: #define JPEGCALL if it hasn't been defined already.
jmorecfg.h: Don't #define JPEGCALL if it has already been defined.
2018-07-28 19:20:06 -04:00
David Korth
45f61ca698 [libjpeg-turbo] Updated to libjpeg-turbo-2.0.0.
Major changes include AVX2 optimizations and a vastly improved
CMakeLists.txt that works on all platforms.

This includes the JPEGCALL changes required for /Gz on 32-bit MSVC.

libjpeg-turbo.rc: Moved from sharedlib/ to win/.
2018-07-28 19:05:39 -04:00
David Korth
ef4d518004 [libjpeg-turbo] Removed the executable bit from non-executable files. 2018-07-28 16:42:54 -04:00
David Korth
9f2d13fec1 [minizip] Updated to v2.3.9 (plus some patches) from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-07-28 16:06:43 -04:00
David Korth
b8c52ea528 [libpng] Updated to libpng-1.6.35. 2018-07-23 15:15:20 -04:00
David Korth
7b17bd8a10 [extlib] CMakeLists.txt: Set EXCLUDE_FROM_ALL (extlib properties) for libminizip.
It's not needed if tests are disabled.
2018-07-23 14:54:37 -04:00
David Korth
76ccd13bb6 [minizip] Updated to v2.3.8 (plus some patches) from the MiniZip fork.
https://github.com/nmoinvaz/minizip

[extlib] CMakeLists.txt: Disabled MiniZip compression. We're currently
only using it for decompression, so there's no need to build the
compression code, which wastes time and disk space.
2018-07-23 14:51:36 -04:00
David Korth
369873ada4 [libromdata/tests] GcnFstTest: Fix issues caused by the minizip-2.3.2 update.
- #include "config.librpbase.h" in order to define HAVE_ZLIB, which tells
  mz_compat.h to #include <zlib.h>.
- #include <zlib.h> manually anyway.
- unz_file_info64.uncompressed_size is uint64_t, not uLong.
2018-06-02 12:28:07 -04:00
David Korth
38385ba897 [minizip] CMakeLists.txt: Disable optimizations in debug builds. 2018-06-02 12:27:48 -04:00
David Korth
f324e7b0b4 [minizip] Updated to v2.3.2 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-06-02 12:19:59 -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
d720bcdd0c [inih] Updated to inih-r42. 2018-05-17 22:22:52 -04:00
David Korth
583fc3a1cf [minizip] Updated to v2.3.1 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-05-11 23:13:52 -04:00
David Korth
57ca83fab7 [minizip] Updated to v2.3.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-05-05 16:14:20 -04:00
David Korth
7afea5cb73 Merge branch 'feature/gettext-win32'
Now with localization on Windows.
2018-05-02 22:45:48 -04:00
David Korth
16621dfffc [extlib] CMakeLists.txt: Build a static library for TinyXML2 on Mac OS X for now.
This will fix some of the unit tests that aren't running because they
can't find libtinyxml2.6.dylib.

FIXME: #include <fstream> is still causing fseeko()/ftello() issues in
bmp.cpp, but not rpcli.cpp or properties.cpp...
2018-05-02 01:58:51 -04:00
David Korth
f2e30e60a2 [tinyxml2] CMakeLists.txt: Fix ending block for WIN32 AND INSTALL_DEBUG. 2018-05-02 01:02:17 -04:00
David Korth
38ec96d4b0 [tinyxml2] Disable installation on non-Windows platforms.
We're building TinyXML2 as a static library on non-Windows platforms.

TODO: Build as a shared library on Mac OS X and install in the bundle?
2018-05-02 00:59:44 -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
David Korth
62afa471c4 [libjpeg-turbo] simd/CMakeLists.txt: Fixed the $ENV{ProgramW6432} variable.
This fixes NASM detection on Win64 if 64-bit NASM is installed and
hasn't been added to PATH.

This should fix issue #79. (cmake can't find NASM on Win 10)
2018-04-29 12:28:46 -04:00
David Korth
9bac615d8e [minizip] Updated _MODIFIED_MINIZIP.txt. 2018-04-29 11:58:00 -04:00
David Korth
8bc01d6033 [minizip] CMakeLists.txt: Remove "/src" from TARGET_INCLUDE_DIRECTORIES().
This fixes a regression from commit e95756aaba.
([minizip] Updated to v2.2.9 from the MiniZip fork.)
2018-04-22 14:28:35 -04:00
David Korth
e95756aaba [minizip] Updated to v2.2.9 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

Note that this release removes the AES-NI code, though we weren't
enabling encryption in the first place.

There's also some changes to use add_compile_options() and the
POSITION_INDEPENDENT_CODE property instead of manually setting
CMAKE_C_FLAGS and "-fpic -fPIC".

TODO: Use POSITION_INDEPENDENT_CODE in other libraries?
2018-04-21 13:56:44 -04:00
David Korth
3a37df04ce [tinyxml2] Updated to tinyxml2-6.2.0. 2018-04-14 14:01:14 -04:00
David Korth
7163ec1dc4 [libpng] _MODIFIED_LIBPNG.txt: 1.6.34, not 1.6.32. 2018-04-14 13:44:10 -04:00
David Korth
e10b592fd6 [extlib] Added Windows resource scripts to libjpeg-turbo and tinyxml2.
Based on zlib's resource script.

Using the default MSVC manifest, which sets isolation-awareness,
execution level asInvoker, and no UI access.
2018-04-04 00:13:34 -04:00
David Korth
de2efe2ba8 [tinyxml2] Updated to tinyxml2-6.0.0.
gcc7 fall-through comments were added upstream in 6.0.0, so it's
no longer listed in _MODIFIED_TINYXML2.txt.
2018-04-03 23:55:42 -04:00
David Korth
952769421e [inih] Updated to inih r41.
This adds INI_START_COMMENT_PREFIXES to allow changing start-of-line
comment characters. It also adds dynamic line buffer reallocation,
though it's disabled in rom-properties.
2018-03-30 09:31:58 -04:00
David Korth
0d973a8b94 [minizip] Updated to v2.2.8 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-03-18 16:42:33 -04:00
David Korth
fc1754054c [libjpeg-turbo] Fixed some JPEGCALL issues in 1.5.3.
This broke the 32-bit Windows build.
2018-03-04 12:39:43 -05:00
David Korth
a733259152 [libjpeg-turbo] _MODIFIED_LIBJPEG-TURBO.txt: Updated the version number. 2018-03-04 12:26:12 -05:00
David Korth
a172d9ca01 [libjpeg-turbo] Updated to libjpeg-turbo-1.5.3. 2018-03-04 12:25:34 -05:00
David Korth
1c1842e662 [minizip] Updated to v2.2.7+ from the MiniZip fork.
https://github.com/nmoinvaz/minizip

NOTE: The changes include removing the 16-bit size limitation, which only
really applies when building for DOS, but it was incorrectly set for all
platforms. I'm not going to change anything that uses it right now, though.
2018-03-04 10:44:45 -05:00
David Korth
c3fd222c1e [minizip] Updated to v2.2.4+ from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2017-12-09 22:23:30 -05:00
David Korth
a8aaed8182 [minizip] mz_strm_split.c: snprintf() isn't defined before MSVC 2015.
_snprintf() is available, so use that instead.
2017-11-26 13:45:30 -05:00
David Korth
af9711f709 [minizip] CMakeLists.txt: Fix the libbsd check.
MiniZip already checks for libbsd, but doesn't fail if it's not found.
Added a failure if it's not found, and removed the broken FIND_PACKAGE()
call, which doesn't work because there's no CMake module for it.
2017-11-12 12:04:44 -05:00
David Korth
21ed4ba5c9 [minizip] libbsd is required for <bsd/stdlib.h>.
Updated .travis.yml, debian/control, and doc/COMPILING.md to require
libbsd-dev as a build dependency.
2017-11-12 11:58:25 -05:00
David Korth
b4d0346264 [minizip] Updated to v2.2.3+ from the MiniZip fork.
https://github.com/nmoinvaz/minizip

An additional fix for unzOpen() hasn't been merged yet:
https://github.com/nmoinvaz/minizip/pull/207

Note that MiniZip 2.x uses UTF-8 for filenames on all platforms,
including Windows. I'm keeping the fill_win32_filefunc64W() call
in place just in case, though.

Bzip2, LZMA, ZipCrypto, and AES support are all disabled for now,
but the sources are still included.
2017-11-12 11:35:59 -05:00
David Korth
8b9b214f51 [libpng] Updated to libpng-1.6.34. 2017-10-29 19:19:06 -04:00
David Korth
e2f45db263 [minizip] Updated to upstream commit d507f2e7e8b771a76f4eb96d5c5d4dee50988196.
5083bef59f

Merge pull request #124 from Coeur/patch-3
2017-09-16 12:34:10 -04:00
David Korth
2e96ec05b0 [inih] ini.h: Use __cdecl in function pointers on 32-bit MSVC builds.
This fixes a Run-Time Check Failure #0 on 32-bit builds with /Gz.

[librpbase] ConfReader: Use `INIHCALL` for the inih callbacks.
2017-09-02 13:09:18 -04:00
David Korth
d070af5148 [libjpeg-turbo] Use JPEGCALL to ensure use of cdecl in MSVC builds.
I'm going to try using stdcall to build the 32-bit version, which should
save a bit of space and improve performance slightly. However, in order
to preserve ABI compatibility, exported C functions must have __cdecl,
and libjpeg-turbo doesn't do this.

JPEGCALL expands to __cdecl on MSVC and nothing on other compilers.
JPEGCALL has been added to function declarations and function pointers
in order to fix compilation with /Gz on MSVC.
2017-09-02 11:55:31 -04:00
David Korth
775835d309 [libpng] Updated to libpng-1.6.32.
The eXIf functions added in 1.6.31 were broken, so two new functions
were added and the old ones stubbed. This shifts the ordinals for APNG
over by two again.
2017-09-02 11:46:27 -04:00
David Korth
3376deb2c5 [libjpeg-turbo] Updated to libjpeg-turbo-1.5.2.
Allow `yasm` to be used if `nasm` can't be found.
TODO: Add default paths for `yasm` on Windows.
2017-09-02 09:08:40 -04:00
David Korth
8293b727dd [extlib] TODO: Set TinyXML2::tinyxml2 and use it in libromdata? 2017-08-12 18:06:54 -04:00
David Korth
4649813f34 [libjpeg-turbo] simd/CMakeLists.txt: Replace backslashes with slashes in paths.
CMake uses slashes, but these variables have backslashes.

This may fix issue #79. (cmake can't find NASM on Win 10)
2017-08-06 12:43:14 -04:00
David Korth
5f46020b9f Merge branch 'feature/rp-config.AboutTab.kde' 2017-08-05 06:40:04 -04:00
David Korth
938bdb15cc [tinyxml2] CMakeLists.txt: Compile as PIC on Unix/Linux systems.
This is needed becuase tinyxml2 is linked into a shared library.

This bug was reported by @DankRank in #retro.
2017-08-05 06:17:01 -04:00
David Korth
8767e15e6c [libpng] .gitattributes: Set EOL for *.dfa.
This fixes issue #95. (libpng: pnglibconf.dfa needs to be LF line endings.)
2017-08-05 03:57:42 -04:00
David Korth
adc4f78991 [minizip] Added files new to this version of MiniZip that I forgot to add during the upgrade. 2017-08-04 22:32:38 -04:00
David Korth
e786162617 [minizip] unzip.c: Removed an extra ';' that caused compile errors on MSVC 2010.
MSVC didn't properly support C99 until MSVC 2015, so the extra ';' makes
MSVC think that we've started adding statements. Hence, it fails because
there are still some variable declarations after it.
2017-08-04 22:32:38 -04:00
David Korth
1fcfd9baa8 [minizip] Updated to an unofficial fork: https://github.com/nmoinvaz/minizip
Commit: d507f2e7e8b771a76f4eb96d5c5d4dee50988196
Merge pull request #124 from Coeur/patch-3

The original MiniZip hasn't been updated in quite a while. This fork has
a lot of new functionality, including support for AES (though we aren't
using it). It also has some of the stuff I manually added before,
including CMakeLists.txt and Windows fixes.

FIXME: It's not compiling on MSVC 2010, probably due to declaring
variables after statements.
2017-08-04 22:32:38 -04:00
David Korth
e5d0759f1c [libpng] scripts/makefile.linux-opt: Forgot to add this file to the repository. 2017-07-28 00:35:29 -04:00
David Korth
00988f0a3c [libpng] Updated to libpng-1.6.31.
Note that two new functions were added to the original libpng, so the
ordinals for APNG were shifted over by two. This shouldn't be a problem,
since programs should be accessing functions by name instead of by
ordinal in 2017.
2017-07-28 00:20:18 -04:00
David Korth
a6902185af [libpng] CMakeLists.txt: Fix CMAKE_HOST_WIN32 stuff. 2017-07-15 20:00:40 -04:00
David Korth
36b53e5111 [libpng] Updated to libpng-1.6.30. 2017-07-04 13:26:25 -04:00
David Korth
6be9ef6c32 [tinyxml2] Updated to tinyxml2-5.0.1.
Gentoo's xmltest.cpp patch was implemented upstream in 5.0.0, so it's
no longer listed in _MODIFIED_TINYXML2.txt.
2017-06-28 01:03:31 -04:00
David Korth
553f38afda [tinyxml2] Updated to tinyxml2-5.0.0.
Among other things, this update adds in reporting of the location oc
parsing errors, which was present in the original TinyXML but not
earlier versions of TinyXML2.
2017-06-26 01:12:50 -04:00
David Korth
a09a65c372 [inih] Updated to inih r40.
This adds a new function ini_parse_string(), which parses an INI file
from a loaded C string buffer.

Local changes, including ini_parse_w(), have been preserved.
2017-06-10 22:11:54 -04:00
David Korth
66918e42d9 [zlib] Don't compile zlib (DLL) on Linux, or zlibstatic on Windows.
Only compile what's needed.
2017-05-19 00:27:23 -04:00
David Korth
2792b9990f [minizip] CMakeLists: Link to ${ZLIB_LIBRARY} on Windows, not zlibstatic.
This didn't seem to actually cause any problems, but it could result in
the statically-linked zlib being used in test suites in addition to the
DLL zlib.
2017-05-19 00:21:00 -04:00
David Korth
51ffc94a13 [extlib] CMakeLists.txt: Make sure tinyxml2_static is built correctly when it's needed. 2017-05-14 14:01:04 -04:00
David Korth
7f84c707b9 [tinyxml2] CMakeLists.txt: Enable DLL builds.
Rebased CMakeLists.txt on the original TinyXML2 CMakeLists.txt,
but with lots of stuff disabled and some changes.

- Disable installation of everything except the DLL.
- Disable testing.
- Set TINYXML2_IMPORT as an interface definition when building
  as a DLL.
- Remove TINYXML2_EXPORT in the static library build, which didn't
  work anyway due to a typo.
- Added a debug postfix for debug DLLs.
- Disabled MSVC configuration that's alread yset in the platform
  configuration.
- Added other MSVC options, including split debug settings.
2017-05-14 13:35:02 -04:00
David Korth
b340d4889c [tinyxml2] Applied Gentoo patch tinyxml2-4.0.1-xmltest.patch. 2017-05-14 13:15:15 -04:00
David Korth
ac4f95c401 Merge branch 'feature/EXE-manifest'
This may help with #51. (EXE: Icon thumbnailing, and LX support.)
No specific issue was filed for manifests, though.
2017-05-14 02:33:54 -04:00
David Korth
093da371d5 Use the system TinyXML2 on Linux if it's present.
USE_INTERNAL_XML can be used to force usage of the internal TinyXML2.

TODO: Build TinyXML2 as a DLL on Windows.
2017-05-08 23:45:20 -04:00
David Korth
4f8426b719 [tinyxml2] Added fall-through comments to fix gcc-7.1's -Wimplicit-fallthrough warnings. 2017-05-08 22:55:27 -04:00
David Korth
5807243805 [tinyxml2] Initial import of tinyxml2-4.0.1.
TinyXML2 will be used to parse Windows manifests.

The Ubuntu 17.04 64-bit dynamic library build is around 83 KB, so
this won't add too much to the executable size.

TODO:
- Use the system TinyXML2 if available.
- Compile as a DLL? (with delay loading on Windows, maybe)
2017-05-08 22:53:18 -04:00
David Korth
550234c070 [inih] Disable multi-line value parsing.
Windows' INI code doesn't support it, and we probably don't need
it anyway.

libinih.a sizes (64-bit Linux, gcc-6.3.0):

Debug build:
- Before: 12,818 bytes
- After:  12,706 bytes
- Diff:      112 bytes

Release build:
- Before: 13,378 bytes
- After:  13,298 bytes
- Diff:       80 bytes
2017-05-07 12:59:46 -04:00
David Korth
c52df506cb Miscellaneous build system changes.
CMakeLists.txt: Use the top-level CMake directories.

cmake/platform/win32*.cmake: Define the Windows SDK version in
win32.cmake. Use the same version (Windows XP) regardless of
the target operating system in order to keep everything consistent.

[libpng] CMakeLists.txt: Fix MSVC debug paths for png_static.
2017-05-04 01:16:17 -04:00
David Korth
29b9e9159e [inih] ini.c: _wfopen() needs a wide string for the mode.
MSVC 2010 gladly compiled this in C mode with only a warning.
The program ended up crashing at runtime with an MSVCRTD assertion.
2017-05-04 01:10:00 -04:00
David Korth
fbf8dd0c34 [inih] ini.c: Open the files as binary.
rstrip() removes trailing newlines and carriage returns, so we should
disable automatic "text mode" handling in the CRT.
2017-05-04 00:52:27 -04:00
David Korth
d92fec619f [inih] ini_parse_w(): New function that takes a wchar_t* filename.
Needed for Unicode filenames on Windows.
2017-05-04 00:51:43 -04:00
David Korth
77e87cf590 [inih] New INI parser library inih.
inih version r39: https://github.com/benhoyt/inih/releases/tag/r39

License: 3-clause BSD
2017-05-04 00:16:28 -04:00
David Korth
0143302326 [libpng] CMakeLists.txt: Fix setting "-msse2" when building with gcc.
The intel/ directory was moved outside of contrib/.
The MSVC path was updated, but the non-MSVC path wasn't.
2017-04-08 16:38:34 -04:00
David Korth
8f0092087f [libpng] scripts/symbols.def: Re-added the APNG symbols.
This fixes a regression from commit 8745251acc.
([libpng] Updated to libpng-1.6.29.)
2017-03-18 17:17:19 -04:00
David Korth
8745251acc [libpng] Updated to libpng-1.6.29.
Intel SSE2 was merged into the main codebase.

Added more ARM, MIPS, and PowerPC optimizations, though some of them
aren't currently used by CMakeLists.txt.
2017-03-18 16:01:56 -04:00
David Korth
a59181c460 Fixed several issues in the MinGW-w64 build.
Using MinGW-w64 4.0.6 with gcc-6.2.0.

Note that it still doesn't compile successfully due to missing
functionality in MinGW-w64 4.0.6. I'll try it again with 5.0.1 later.
Note that MinGW-w64 5.0.1 is still missing isolation-aware functionality,
so it won't be able to handle XP theming correctly.

Summary of changes:

- cmake/platform.cmake: MinGW-w64 uses separate crt*.o files for Unicode
  instead of a separate entry point. Handle this by removing the "w" from
  the Unicode entry point and passing the "-municode" option instead.

- libpng, rpcli, win32: CMake-3.7.2 doesn't add include paths to windres.
  Add the include paths manually in order to fix .rc compilation.

- c++11-compat.h: Moved the case-insensitive string comparison macros
  from c++11-compat.msvc.h. MinGW-w64 doesn't have the wcs*() functions,
  but it does have macros for str*(), so we have to define the macros
  only if said macros don't already exist.

- [libcachemgr] CacheManager: gettimeofday() is in time.h on MSVC,
  and sys/time.h on MinGW-w64 and other platforms. sys/types.h is
  no longer needed.

libromdata:
- RpWin32.cpp: Added more conditionals to the error list in order to
  fix compilation with MinGW-w64.
- RpWin32.hpp: Use reinterpret_cast<> for the atomic memory access
  functions.

rpcli:
- time_r.h: #define _POSIX_C_SOURCE is required on MinGW-w64 in order
  to use the *_r() functions.
- properties.cpp: #include "time_r.h" earlier to prevent time.h from
  being included before _POSIX_C_SOURCE is defined.

win32:
- QITab.h: Split the QISearch() defines out of RP_ComBase.h and added
  definitions that are missing on MinGW-w64.
- Added an extra '0' in QITAB instances in order to suppress gcc's
  "missing initializer" warning. [-Wmissing-field-initializers]
- Moved all COM smart pointers to the top of the file. Disabled some of
  them in MSVC builds because they're already defined in comdefsp.h.
- rom-properties.def: Removed the comment and "LIBRARY" statement, since
  GNU ld doesn't recognize them.
2017-03-05 03:18:45 -05:00
David Korth
e09d15f1ae [libjpeg-turbo] Install jpeg62.dll and don't install jpeg62.lib.
With the same hack as zlib and libpng for PDB filenames in debug builds.

Reported by @DankRank.
2017-03-03 00:52:09 -05:00
David Korth
209c38703c [libpng] CMakeLists.txt: Fixed installation of libpng16d.pdb.
Based on a similar fix for zlib.

Added a comment to both libpng and zlib regarding the PDB shenanigans.
2017-03-02 23:55:51 -05:00
David Korth
8fb364fc4f [libjpeg-turbo] Removed testimages/.
These are used by the test suites, so we don't need them.
2017-02-26 19:28:41 -05:00
David Korth
c9ab82f369 [libjpeg-turbo] Set the debug postfix correctly.
This ensures that debug versions of DLLs have "d" appended to them.
2017-02-26 19:23:24 -05:00
David Korth
ce78dd5968 [libjpeg-turbo] Added DO_SPLIT_DEBUG() and SET_WINDOWS_SUBSYSTEM(). 2017-02-26 19:12:02 -05:00
David Korth
3e69a65b23 [libjpeg-turbo] win/: *.def and *.inc files should not be marked as executable. 2017-02-26 19:08:16 -05:00
David Korth
bd4ed0f043 [libjpeg-turbo] Added libjpeg-turbo 1.5.1.
The internal version of libjpeg-turbo currently only builds on Windows.
(The bundled CMakeLists.txt is Windows only.)

All example and demo executables have been disabled, and the autoconf
build system has been removed. The only target that builds now is
jpeg62.dll.
2017-02-26 19:07:19 -05:00
David Korth
c10b0d156b [extlib] libpng, zlib: Set the Windows subsystem.
The subsystem was being set to 6.0 in 64-bit builds, which prevents
usage on XP64 and Server 2003 64-bit. Use SET_WINDOWS_SUBSYSTEM()
to fix this.

Also mark the DLLs as using the Windows subsystem. (Not that it matters,
since that field is only relevant for EXEs...)

TODO: Check other DLLs before committing, and do this before the
/TSAWARE commit.
2017-02-06 22:19:49 -05:00
David Korth
a5a2e35ee3 [minizip] iowin32.c: WINAPI_FAMILY_ONE_PARTITION() doesn't seem to be defined on my system.
Windows 7, MSVC 2015, Windows 8.1 and Windows 10 SDKs.

This macro simply doesn't exist.

I found a copy online:
https://github.com/jp9000/OBS/blob/master/extras/winapifamily.h
2017-01-22 16:22:42 -05:00
David Korth
f83aaade25 [zlib] Updated to zlib-1.2.11. 2017-01-22 00:25:03 -05:00
David Korth
b945771f33 [zlib] Updated to zlib-1.2.10. 2017-01-14 04:20:54 -05:00
David Korth
d1a6fe34f8 [libpng] Updated to libpng-1.6.28.
libpng's CMakeLists.txt has a new option, PNG_BUILD_ZLIB. If set,
FIND_PACKAGE(ZLIB) will be skipped.
2017-01-07 20:07:23 -05:00
David Korth
736511c8af [googletest] CMakeLists.txt: Don't set CMP0063 if using cmake earlier than 3.3.0.
CMake complains if we set a policy that it doesn't know about.
2017-01-01 16:01:05 -05:00
David Korth
d735df219f [extlib] Disable zlib asm optimizations, again.
zlib-1.2.9 seems to crash when using the asm optimizations on 32-bit
Windows. A zlib issue seems to indicate that previous versions had
issues as well:  https://github.com/madler/zlib/issues/41
2017-01-01 15:57:19 -05:00
David Korth
614ab793ec Don't apply hidden visibility settings to extlib.
This causes zlib, libpng, and possibly others to not export any symbols
in either the .a or .so on Linux, which makes them unusable.

CheckHiddenVisibility.cmake: New macro CHECK_HIDDEN_VISIBILITY().
Use this in the upper-level source directory to apply hidden visibility
to all subprojects. Used in src/CMakeLists.txt.
2017-01-01 15:48:31 -05:00
David Korth
cd3caf9f0e [minizip] Imported changes from zlib-1.2.9. 2017-01-01 14:26:18 -05:00
David Korth
b2d8c8a49d [zlib] Updated to zlib-1.2.9. 2017-01-01 14:22:00 -05:00
David Korth
cd844c8d01 libpng] Updated to libpng-1.6.27. 2016-12-29 22:46:44 -05:00
David Korth
21194fcd20 DO_SPLIT_DEBUG(): Handle SET_MSVC_DEBUG_PATH() here.
[extlib] CMakeLists.txt: Remove SET_MSVC_DEBUG_PATH() from the
SET_EXTLIB_PROPERTIES() macro.

[minizip] Removed EXCLUDE_FROM_ALL, since this is handled by the
extlib/CMakeLists.txt file.

NOTE: We can't move DO_SPLIT_DEBUG() out of the individual extlib
directories, since CMake complains if we attempt to use it on targets
created in a different directory.
2016-12-26 14:50:35 -05:00
David Korth
aae4c34c50 [extlib] CMakeLists.txt: Removed the AppVeyor FIXME. 2016-12-26 14:46:28 -05:00
David Korth
aa7b5b1018 [zlib] CMakeLists.txt: Fix installation of PDB files in MSVC builds.
CPack doesn't like using the PDB property for some reason, so we have to
manually build the pathname using the correct postfix. Also, install both
debug and release PDBs with the "optional" tag so it won't fail if one is
missing (and one is always missing because we're only building either
Debug or Release).
2016-11-25 14:57:19 -05:00
David Korth
a4779dbc6a [libpng] .gitattributes: Force LF line endings for *.awk.
awk doesn't like CRLF line endings, which results in build errors
on Windows if autocrlf is enabled.
2016-11-20 21:09:25 -05:00
David Korth
95b22295ce [libpng] pngwin.rc: Only indicate APNG if PNG_APNG_SUPPORTED is defined.
Just in case I update libpng later and forget to apply the APNG patch.
2016-11-05 17:23:37 -04:00
David Korth
2222701a1b [libpng] pngwin.rc: Add "APNG"; set the POSTFIX even if PNG_DEBUG == 0.
Indicate that this is an APNG build.

For the debug postfix: Setting -DPNG_DEBUG worked, but not -DPNG_DEBUG=0.
2016-11-05 16:40:49 -04:00
David Korth
da72e9b5bf [libpng] Compile pngwin.rc on Windows in DLL builds.
Set -DPNG_DEBUG=0 in debug builds. This tells pngwin.rc to append "D"
to the filename, but doesn't actually enable the debugging macros,
which we don't need.
2016-11-05 16:34:02 -04:00
David Korth
dbe5ff421a [zlib] zlib1.rc: Set the filenames to "zlib1d.dll" in debug builds. 2016-11-05 16:28:08 -04:00
David Korth
92db91e215 [zlib] Make sure the library is built as zlib1d.dll or zlib1.dll.
Set BUILD_SHARED_LIBRARIES=ON to do this.

Note that the default filename for the debug version is zlibd1.dll,
which doesn't make sense. It should be zlib1d.dll.
2016-11-05 16:25:16 -04:00
David Korth
78d4f903f6 Install PDB files for zlib and libpng.
SetMSVCDebugPath.cmake: Add PREFIX and POSTFIX even if OUTPUT_NAME
is set, since libpng sets PREFIX to "lib" for consistency with other
operating systems. (Both set POSTFIX to "d" in debug builds.)
2016-11-05 16:03:52 -04:00
David Korth
8d485051e6 Install zlib and libpng in the correct locations in Windows builds.
Don't install the import libraries or static libraries.

libpng: Disabled EXPORT, since it caused problems when using the
internal zlib target.
2016-11-03 22:17:09 -04:00
David Korth
02315a1c1b Compile zlib and libpng as DLLs on Windows.
I'll eventually make them delayload so they won't be loaded unless they're
actually needed.

Rearranged the build directory layout such that all binaries are located
in the top-level bin/ directory. This is needed in order for the test
suites to work, since they might depend on zlib and/or libpng.

NOTE: We have to use CACHE INTERNAL; otherwise, the KDE5 build ignores
the directory options. (Maybe this is why the KDE4 build always used
this directory layout in the first place?)

NOTE 2: On Windows, DLLs are copied to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY},
whereas on Linux, SOs are copied to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}.

Test images are now copied using a custom command, since the output
directory isn't easily determined at generate time. (It could be
the same as ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}, but msbuild uses
configuration-specific subdirectories.

TODO: Keep test images in a subdirectory. This will need adjustments in
the test suites to look in img/ first, then the current directory.
2016-11-02 23:50:04 -04:00
David Korth
1b9d5a40c5 [libpng] Enable Intel SSE2 intrinsics.
Added a CPUID check to disable SSE2 functionality if the system
doesn't support it.

The following are changes respective to the original Intel patch:

pngpriv.h: Disable compiler checks for SSE2, since we're conditionally
enabling it only on filter_sse2_intrinsics.c to prevent issues on
systems that don't have SSE2.

intel_init.c: Added CPUID checking for MSVC and gcc. (TODO test gcc)

filter_sse2_intrinsics.c: Added casting for some variables. For MSVC
versions older than 2015, we need to compile with /TP, since older
MSVC doesn't support declaring variables after statements in C mode.
C++ doesn't support some types of implicit casting, so we have to make
it explicit.
2016-11-02 23:07:58 -04:00
David Korth
5898b4b36f [libpng] Updated to libpng-1.6.26.
Added contrib/intel/. I'll apply this patch with a CPUID check
to allow it to be used on systems that don't have SSE2.
2016-11-02 22:51:05 -04:00
David Korth
842d020bde [libpng] Initial import of libpng-1.6.23 from GCN MemCard Recover.
I've decided to get rid of the GDI+ PNG handling. It doesn't improve
anything performance-wise, adds coding overhead, and probably isn't
any faster than libpng.

GDI+ also doesn't support APNG. This version does.

NOTE: If I add APNG export, I'll need to use the included libpng
in Ubuntu builds, since Ubuntu still has libpng-1.2, and it's a
version that doesn't support APNG.

Reworked the bundled library system to be similar to the one in
mcrecover, but improved.

Added "-fpic -fPIC" to all extlib static libraries when building
for Linux systems. This is needed for libpng, but might not be
needed for other libraries; nevertheless, it should be set.

TODO: Use libpng in the Windows build. It's being linked in,
but it isn't actually being used for anything yet.
2016-11-02 21:45:51 -04:00
David Korth
432f4ad364 Cleaned up the 64-bit OS checks for zlib and Windows DLL filenames. 2016-10-17 00:24:18 -04:00
David Korth
6d83303894 Removed EXCLUDE_FROM_DEFAULT_BUILD.
This breaks building solutions in MSVC through the IDE.

Reported by @DankRank (Egor) in #retro.
2016-10-10 20:20:12 -04:00
David Korth
76c229470a Fixed zlib asm optimizations on 32-bit MSVC 2015, again.
Need to set CMAKE_ASM_MASM_FLAGS in the cache in order to prevent
it from caching an empty string, resulting in ml.exe failing.
2016-10-07 21:54:17 -04:00
David Korth
5b797c6def [extlib] CMakeLists.txt: Disable zlib asm optimizations in 32-bit MSVC builds, again.
This keeps breaking on AppVeyor for some reason.
2016-10-06 21:32:26 -04:00
David Korth
257e34f2ef [minizip] Set interface include paths and remove DO_SPLIT_DEBUG().
Interface include paths are needed in order to automatically add paths
when adding minizip as a dependent library.

DO_SPLIT_DEBUG() breaks the static library:
../../../extlib/minizip/libminizip.a: error adding symbols: Archive has no index; run ranlib to add one
2016-10-04 22:15:03 -04:00
David Korth
2ae5750e9b [extlib] CMakeLists.txt: New function SET_EXTLIB_PROPERTIES().
This function sets common properties on extlib targets.

[zlib] Remove the MSVC debug path and build exclusion settings, since
these are now set by the parent CMakeLists.txt file.
2016-09-30 21:00:01 -04:00
David Korth
163c234241 [minizip] Initial import of minizip-1.1, with changes from Gens/GS II.
The FST test files will be zipped into a single ZIP archive, since
they're usually less than 4 KB each.
2016-09-18 18:21:32 -04:00
David Korth
50d8ab0297 [zlib] Re-enable ASM optimizations for MSVC.
msvc.cmake: Specify MASM flags "/W0 /safeseh". This fixes the 32-bit masm
build when using MSBUILD with MSVC 2015. 64-bit wasn't affected, though
we're setting it for all MSVC platforms.
2016-09-18 18:08:17 -04:00
David Korth
45491b4661 Simplify the Google Test build infrastructure a bit.
libromdata/tests/CMakeLists.txt:
- Link to gtest directly instead of ${GTEST_LIBRARY}.
- Removed INCLUDE_DIRECTORIES() for googletest, since it's added to
  TARGET_INCLUDE_DIRECTORIES() by googletest's CMakeLists.txt.

extlib/googletest/googletest/CMakeLists.txt:
- Uncommented gtest_hide_internal_symbols.

Removed cmake/gtest.cmake, since it doesn't have anything useful other
than INCLUDE(CTest), which is now present in the top-level CMakeLists.txt.
2016-09-14 23:18:20 -04:00
David Korth
5567d2a7d9 [zlib] CMakeLists.txt: Disable cmake_minimum_required().
This interfered with setting CMake policy CMP0063.
2016-09-08 22:15:20 -04:00
David Korth
ed7171854c [googletest] Disabled cmake_minimum_required().
This interfered with setting CMake policy CMP0063.
2016-09-05 23:12:59 -04:00
David Korth
c6053eaeae [extlib] Disable zlib assembly optimizations for now.
It's breaking on AppVeyor, which uses MSVC 2015.
2016-09-04 02:46:31 -04:00
David Korth
2825416d8c [zlib] CMakeLists.txt: Set TARGET_INCLUDE_DIRECTORIES() on the library targets. 2016-09-03 23:33:01 -04:00
David Korth
db82a5d897 [zlib] Initial import of zlib-1.2.8, with changes from Gens/GS II and mcrecover.
Unlike the aforementioned two programs, this copy of zlib will *only*
be used for Windows builds, and it will only be used for test suites.
We're using GDI+ instead of libpng, so the only reason we need zlib
is to decompress the compressed reference BMP images used by
RpImageLoaderTest.

Changes compared to upstream zlib-1.2.8:

- Non-CMake build infratsructure has been removed.

- CMakeLists.txt has been edited to prevent building the Win32 resource
  data when being built as a shared library.

- Example binaries are no longer built.

- The GZip functions are now prefixed with "mcr_z_" in order to prevent
  function naming conflicts with Qt4/Win32, which has its own copy of
  zlib that exposes the same functions.

- The OF() and ON() macros have been renamed to _Z_OF() and _Z_ON().
  Based on Gentoo's zlib-1.2.8 patches.

- contrib/ has been stripped of everything but asm-optimized functions.

- 64-bit assembly-optimized routines now check for __x86_64__ in addition
  to __amd64__ for compatibility with certain compilers, e.g. icc.

- CMakeLists.txt adds -DZLIB_CONST to the zlib and zlibstatic targets'
  compile definitions.
2016-09-03 23:25:05 -04:00
David Korth
480675a5ea [extlib] Add CMakeLists.txt and googletest/_MODIFIED_GTEST.txt.
I really need to check for untracked files before committing.
2016-09-02 22:58:29 -04:00
David Korth
4c65f452c7 [googletest] Force static library builds. 2016-09-02 22:57:44 -04:00
David Korth
8c8a444f7b [googletest] Disabled INSTALL() rules.
We aren't installing googletest or googlemock, and because we're setting
EXCLUDE_FROM_ALL, cmake complains about the INSTALL() rules.
2016-09-02 22:23:31 -04:00
David Korth
ddbfadd715 [gtest] Initial import of Google Test 1.8.0.
Google Test will be used for implementing unit tests. The first set of
unit tests will be for testing RpPng with various PNG image formats.

The Google Test code is currently identical to the release archive,
except for the removal of .travis.yml and appveyor.xml.

CMakeLists.txt: Added CTest support. (see cmake/gtest.cmake)

extlibs/CMakeLists.txt: Only build googletest libraries if testing is
enabled and some project depends on them.
2016-09-02 21:01:52 -04:00