Skip to content

Commit

Permalink
fixed vita build
Browse files Browse the repository at this point in the history
  • Loading branch information
leiradel committed Sep 1, 2015
1 parent f02256a commit d8a7f39
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 5 deletions.
95 changes: 95 additions & 0 deletions build/Makefile.vita_arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
##############
# Works on hosts Linux
# Install devkitppc

#########################
# Check the host platform

HOST_PLATFORM = linux
ifeq ($(shell uname -a),)
HOST_PLATFORM = windows
else ifneq ($(findstring MINGW,$(shell uname -a)),)
HOST_PLATFORM = windows
else ifneq ($(findstring Darwin,$(shell uname -a)),)
HOST_PLATFORM = darwin
else ifneq ($(findstring win,$(shell uname -a)),)
HOST_PLATFORM = windows
endif

#########################
# Set the target platform

TARGET_PLATFORM = vita_arm

#################
# Toolchain setup

CC = $(VITASDK_ROOT_DIR)/bin/arm-vita-eabi-gcc
CXX = $(VITASDK_ROOT_DIR)/bin/arm-vita-eabi-g++
AS = $(VITASDK_ROOT_DIR)/bin/arm-vita-eabi-as
AR = $(VITASDK_ROOT_DIR)/bin/arm-vita-eabi-ar

############
# Extensions

OBJEXT = .vita_arm.o
SOEXT = .vita_arm..so

################
# Platform setup

STATIC_LINKING = 1
platform = vita
PLATDEFS = -DVITA
PLATCFLAGS =
PLATCXXFLAGS =
PLATLDFLAGS = -shared -lm
PLATLDXFLAGS = -shared -lm

################
# libretro setup

RETRODEFS = -D__LIBRETRO__
RETROCFLAGS =
RETROCXXFLAGS =
RETROLDFLAGS =
RETROLDXFLAGS =

#################
# Final variables

DEFINES = $(PLATDEFS) $(RETRODEFS)
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)

########
# Tuning

ifneq ($(DEBUG),)
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
else
CFLAGS += -O3 -DNDEBUG
CXXFLAGS += -O3 -DNDEBUG
endif

ifneq ($(LOG_PERFORMANCE),)
CFLAGS += -DLOG_PERFORMANCE
CXXFLAGS += -DLOG_PERFORMANCE
endif

####################################
# Variable setup for Makefile.common

CORE_DIR ?= ..
BUILD_DIR ?= .
INCLUDES =

include $(BUILD_DIR)/Makefile.common

###############
# Include rules

include $(BUILD_DIR)/Makefile.rules
14 changes: 10 additions & 4 deletions fuse/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
#define FUSE_COMPAT_H

#include <stdio.h>

#ifndef VITA
#include <dirent.h>
#endif

#include <stdlib.h>
#include <sys/types.h>

Expand Down Expand Up @@ -102,11 +106,13 @@ int compat_get_next_path( path_context *ctx );

typedef FILE* compat_fd;

#ifndef GEKKO
typedef DIR* compat_dir;
#else /* #ifndef GEKKO */
#if defined( GEKKO )
typedef DIR_ITER* compat_dir;
#endif /* #ifndef GEKKO */
#elif defined( VITA )
typedef void* compat_dir;
#else
typedef DIR* compat_dir;
#endif

extern const compat_fd COMPAT_FILE_OPEN_FAILED;

Expand Down
2 changes: 1 addition & 1 deletion libspectrum/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ extern const char *libspectrum_tzx_signature;

/* Convert a 48K memory dump into separate RAM pages */

int libspectrum_split_to_48k_pages( libspectrum_snap *snap,
libspectrum_error libspectrum_split_to_48k_pages( libspectrum_snap *snap,
const libspectrum_byte* data );

/* Sizes of some of the arrays in the snap structure */
Expand Down

0 comments on commit d8a7f39

Please sign in to comment.