Skip to content

Commit 4694f18

Browse files
committed
update libromfs wrap file. so that it uses gnu11 and also works on the gamecube
1 parent d551769 commit 4694f18

File tree

4 files changed

+29
-98
lines changed

4 files changed

+29
-98
lines changed

subprojects/libromfs.wrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ url = https://github.com/yawut/libromfs-wiiu.git
66
revision = master
77
depth = 1
88
patch_directory = libromfs
9-
diff_files = libromfs-0.7_wii.diff
9+
diff_files = libromfs-0.7_patches.diff
1010

1111
[provide]
1212
libromfs = libromfs_dep
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/source/romfs.c b/source/romfs.c
2+
index 02d6bd5..17b0cf7 100644
3+
--- a/source/romfs.c
4+
+++ b/source/romfs.c
5+
@@ -15,7 +15,18 @@
6+
#include <sys/param.h>
7+
#include <stdint.h>
8+
#include <unistd.h>
9+
+
10+
+#if defined(__WII__) || defined(__GAMECUBE__)
11+
+#include <gccore.h>
12+
+
13+
+#define OSBlockMove(dest, src, size, flush) memmove((dest), (src), (size))
14+
+
15+
+#elif defined(__WIIU__)
16+
#include <coreinit/memory.h>
17+
+#else
18+
+#error "Unsupported platform"
19+
+#endif
20+
+
21+
22+
23+
/* include the implementation files (needed for static functions) */

subprojects/packagefiles/libromfs-0.7_wii.diff

Lines changed: 0 additions & 89 deletions
This file was deleted.

subprojects/packagefiles/libromfs/meson.build

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@ project(
44
version: '0.7.0',
55
meson_version: '>=1.2.0',
66
default_options: {
7-
'c_std': ['c11'],
7+
'c_std': ['gnu11'],
88
},
99
)
1010

1111
deps = []
1212

13-
1413
if meson.is_cross_build()
15-
if host_machine.system() == 'wiiu' or host_machine.system() == 'wii'
14+
if host_machine.system() == 'wiiu' or host_machine.system() == 'wii' or host_machine.system() == 'gamecube'
1615

1716
object_target = 'elf32-powerpc'
1817
binary_arch = 'powerpc:common'
1918

20-
2119
library_dirs = meson.get_external_property('library_dirs', [''])
2220
if library_dirs.length() == 0
2321
error('property \'library_dirs\' has to be set!')
@@ -31,7 +29,7 @@ if meson.is_cross_build()
3129
required: true,
3230
dirs: library_dirs,
3331
)
34-
elif host_machine.system() == 'wii'
32+
elif host_machine.system() == 'wii' or host_machine.system() == 'gamecube'
3533

3634
deps += c.find_library(
3735
'ogc',
@@ -66,7 +64,6 @@ objcopy = find_program('objcopy', native: false)
6664
romfs_tar_name = 'romfs.tar'
6765
romfs_obj_name = 'romfs.o'
6866

69-
7067
romfs_tar = custom_target(
7168
romfs_tar_name,
7269
command: [
@@ -80,7 +77,8 @@ romfs_tar = custom_target(
8077
)
8178

8279
binary_start_name = (
83-
'_binary' + (
80+
'_binary'
81+
+ (
8482
romfs_tar.full_path().replace(meson.global_build_root(), '').replace(
8583
'/',
8684
'_',
@@ -111,7 +109,6 @@ inc_dirs = include_directories('include')
111109
libromfs_lib = library(
112110
'romfs',
113111
files('source/romfs.c'),
114-
c_args: ['-D_POSIX_C_SOURCE=200809'],
115112
include_directories: inc_dirs,
116113
dependencies: deps,
117114
install: true,

0 commit comments

Comments
 (0)