Enable building of filesys on the wii. Note that this needs some workarounds

which are probably broken (see sysdeps.h). Also fix ST_ISDIR macro (mode)
in filesys.c. I have not tested anything of this.
This commit is contained in:
simon.kagstrom 2009-05-23 09:03:23 +00:00
parent 63510ec300
commit 402438e425
4 changed files with 21 additions and 9 deletions

View File

@ -26,8 +26,8 @@ SRCS := $(wildcard $(SRC_DIR)/*.c $(SRC_DIR)/caps/*.c $(SRC_DIR)/dms/*.c $(SRC_D
SRCS := $(filter-out src/compemu_raw_x86.c src/compemu_fpp.c src/compemu_support.c src/svgancui.c src/build68k.c src/catweasel.c \ SRCS := $(filter-out src/compemu_raw_x86.c src/compemu_fpp.c src/compemu_support.c src/svgancui.c src/build68k.c src/catweasel.c \
src/cdrom.c src/blkdev-libscg.c src/blkdev.c src/blitops.c src/akiko.c src/filesys_bootrom.c \ src/cdrom.c src/blkdev-libscg.c src/blkdev.c src/blitops.c src/akiko.c src/filesys_bootrom.c \
src/filesys.c src/fsdb.c src/fsdb_unix.c src/hardfile_unix.c src/genblitter.c src/gencomp.c src/gencpu.c \ src/genblitter.c src/gencomp.c src/gencpu.c \
src/hardfile.c src/genlinetoscr.c src/compemu.c src/compstbl.c src/fsusage.c src/filesys_unix.c \ src/genlinetoscr.c src/compemu.c src/compstbl.c \
src/enforcer.c src/ar.c src/debug.c \ src/enforcer.c src/ar.c src/debug.c \
src/readdisk.c src/gengenblitter.c src/scsiemul.c src/tui.c src/linetoscr.c, $(SRCS)) src/readdisk.c src/gengenblitter.c src/scsiemul.c src/tui.c src/linetoscr.c, $(SRCS))
@ -44,7 +44,7 @@ all: uae-host.elf
# How to delete the intermediate files. # How to delete the intermediate files.
clean: clean:
@echo Cleaning $(OBJ_DIR) @echo Cleaning $(OBJ_DIR)
@rm -rf $(OBJS) $(OBJ_DIR) src/machdep src/target.h src/md-fpp.h $(SYMLINKS) @rm -rf $(OBJS) $(OBJ_DIR) src/machdep src/target.h src/md-fpp.h src/sysconfig.h $(SYMLINKS)
$(OBJ_DIR): $(OBJ_DIR):
install -d $@ install -d $@
@ -113,7 +113,7 @@ $(BIN_DIR)/%.dol: %.elf
COMMON_FLAGS := -g -Wall $(MACHDEP) COMMON_FLAGS := -g -Wall $(MACHDEP)
INCLUDES := -Isrc/md-generic/ -Isrc/include -Isrc -I/usr/include/SDL INCLUDES := -Isrc/md-generic/ -Isrc/include -Isrc -I/usr/include/SDL
DEFINES := -DOS_WITHOUT_MEMORY_MANAGEMENT -DSAVESTATE -DUSE_SDL -DSUPPORT_THREADS -DCPUEMU_0 -DCPUEMU_5 -DCPUEMU_6 \ DEFINES := -DOS_WITHOUT_MEMORY_MANAGEMENT -DSAVESTATE -DUSE_SDL -DSUPPORT_THREADS -DCPUEMU_0 -DCPUEMU_5 -DCPUEMU_6 \
-DFPUEMU -DAGA -DAUTOCONFIG -DFPUEMU -DAGA -DAUTOCONFIG -DFILESYS
CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES) CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES)
#unused defines; -DFDI2RAW #unused defines; -DFDI2RAW

View File

@ -31,8 +31,8 @@ SRCS := $(wildcard $(SRC_DIR)/*.c $(SRC_DIR)/caps/*.c $(SRC_DIR)/dms/*.c $(SRC_D
SRCS := $(filter-out src/compemu_raw_x86.c src/compemu_fpp.c src/compemu_support.c src/svgancui.c src/build68k.c src/catweasel.c \ SRCS := $(filter-out src/compemu_raw_x86.c src/compemu_fpp.c src/compemu_support.c src/svgancui.c src/build68k.c src/catweasel.c \
src/cdrom.c src/blkdev-libscg.c src/blkdev.c src/blitops.c src/akiko.c src/filesys_bootrom.c \ src/cdrom.c src/blkdev-libscg.c src/blkdev.c src/blitops.c src/akiko.c src/filesys_bootrom.c \
src/filesys.c src/fsdb.c src/fsdb_unix.c src/hardfile_unix.c src/genblitter.c src/gencomp.c src/gencpu.c \ src/genblitter.c src/gencomp.c src/gencpu.c \
src/hardfile.c src/genlinetoscr.c src/compemu.c src/compstbl.c src/fsusage.c src/filesys_unix.c \ src/genlinetoscr.c src/compemu.c src/compstbl.c \
src/enforcer.c src/ar.c src/debug.c \ src/enforcer.c src/ar.c src/debug.c \
src/readdisk.c src/gengenblitter.c src/scsiemul.c src/tui.c src/linetoscr.c, $(SRCS)) src/readdisk.c src/gengenblitter.c src/scsiemul.c src/tui.c src/linetoscr.c, $(SRCS))
@ -49,7 +49,7 @@ all: uae.dol
# How to delete the intermediate files. # How to delete the intermediate files.
clean: clean:
@echo Cleaning $(OBJ_DIR) @echo Cleaning $(OBJ_DIR)
@rm -rf $(OBJS) $(OBJ_DIR) src/machdep src/target.h src/md-fpp.h $(SYMLINKS) @rm -rf $(OBJS) $(OBJ_DIR) src/machdep src/target.h src/md-fpp.h src/sysconfig.h $(SYMLINKS)
$(OBJ_DIR): $(OBJ_DIR):
install -d $@ install -d $@
@ -118,7 +118,7 @@ $(BIN_DIR)/%.dol: %.elf
COMMON_FLAGS := -g -O3 -G8 -mrvl -Wall -D__inline__=__inline__ $(MACHDEP) COMMON_FLAGS := -g -O3 -G8 -mrvl -Wall -D__inline__=__inline__ $(MACHDEP)
INCLUDES := -Isrc/md-generic/ -Isrc/include -Isrc -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/SDL INCLUDES := -Isrc/md-generic/ -Isrc/include -Isrc -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/SDL
DEFINES := -DOS_WITHOUT_MEMORY_MANAGEMENT -DSAVESTATE -DUSE_SDL -DSUPPORT_THREADS -DCPUEMU_0 -DCPUEMU_5 -DCPUEMU_6 \ DEFINES := -DOS_WITHOUT_MEMORY_MANAGEMENT -DSAVESTATE -DUSE_SDL -DSUPPORT_THREADS -DCPUEMU_0 -DCPUEMU_5 -DCPUEMU_6 \
-DFPUEMU -DAGA -DAUTOCONFIG -DFPUEMU -DAGA -DAUTOCONFIG -DFILESYS
CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES) CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES)
#unused defines; -DFDI2RAW #unused defines; -DFDI2RAW

View File

@ -67,7 +67,7 @@ static int wii_access (const char *pathname, int mode)
if (stat(pathname, &st) < 0) if (stat(pathname, &st) < 0)
return -1; return -1;
if (mode == R_OK && !S_ISDIR(st)) if (mode == R_OK && !S_ISDIR(st.st_mode))
return 0; return 0;
return -1; return -1;
} }

View File

@ -333,3 +333,15 @@ extern int gui_message_multibutton (int flags, const char *format,...);
#ifndef MAX_DPATH #ifndef MAX_DPATH
# define MAX_DPATH 512 # define MAX_DPATH 512
#endif #endif
#ifdef GEKKO
/* Technically not true, but looking at libfat, it seems like
* unlink can remove directories as well */
# define rmdir unlink
/* Definately problems! */
# define chmod(a,b)
# define dup(fd) fd
# define utime(filename, buf) 0
#endif