diff --git a/core/core.mk b/core/core.mk index c0db0774b..cc8eb9423 100755 --- a/core/core.mk +++ b/core/core.mk @@ -9,7 +9,8 @@ RZDCY_SRC_DIR ?= $(call my-dir) RZDCY_MODULES := cfg/ hw/arm7/ hw/aica/ hw/holly/ hw/ hw/gdrom/ hw/maple/ hw/modem/ \ hw/mem/ hw/pvr/ hw/sh4/ hw/sh4/interpr/ hw/sh4/modules/ plugins/ profiler/ oslib/ \ hw/extdev/ hw/arm/ hw/naomi/ imgread/ ./ deps/coreio/ deps/zlib/ deps/chdr/ deps/crypto/ \ - deps/libelf/ deps/chdpsr/ arm_emitter/ rend/ reios/ deps/libpng/ deps/xbrz/ + deps/libelf/ deps/chdpsr/ arm_emitter/ rend/ reios/ deps/libpng/ deps/xbrz/ \ + deps/picotcp/modules/ deps/picotcp/stack/ ifdef WEBUI @@ -74,10 +75,11 @@ endif RZDCY_FILES := $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.cpp)) RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.c)) RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.S)) - + ifdef FOR_PANDORA RZDCY_CFLAGS := \ $(CFLAGS) -c -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \ + -I$(RZDCY_SRC_DIR)/deps/picotcp/include -I$(RZDCY_SRC_DIR)/deps/picotcp/modules \ -DRELEASE -DPANDORA\ -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp \ -frename-registers -fsingle-precision-constant -ffast-math \ @@ -85,21 +87,28 @@ RZDCY_CFLAGS := \ RZDCY_CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7 else + ifdef FOR_ANDROID RZDCY_CFLAGS := \ - $(CFLAGS) -c -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \ - -D_ANDROID -DRELEASE\ - -frename-registers -fsingle-precision-constant -ffast-math \ - -ftree-vectorize -fomit-frame-pointer - - ifndef NOT_ARM - RZDCY_CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 - RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7 - else - ifndef ISMIPS - RZDCY_CFLAGS += -DTARGET_LINUX_x86 + $(CFLAGS) -c -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \ + -I$(RZDCY_SRC_DIR)/deps/picotcp/include -I$(RZDCY_SRC_DIR)/deps/picotcp/modules \ + -D_ANDROID -DRELEASE \ + -frename-registers -fsingle-precision-constant -ffast-math \ + -ftree-vectorize -fomit-frame-pointer + + ifndef NOT_ARM + RZDCY_CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 + RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7 else - RZDCY_CFLAGS += -DTARGET_LINUX_MIPS + ifndef ISMIPS + RZDCY_CFLAGS += -DTARGET_LINUX_x86 + else + RZDCY_CFLAGS += -DTARGET_LINUX_MIPS + endif endif + else +RZDCY_CFLAGS := \ + -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \ + -I$(RZDCY_SRC_DIR)/deps/picotcp/include -I$(RZDCY_SRC_DIR)/deps/picotcp/modules endif endif diff --git a/core/deps/picotcp/include/pico_defines.h b/core/deps/picotcp/include/pico_defines.h new file mode 100644 index 000000000..2d2e740fe --- /dev/null +++ b/core/deps/picotcp/include/pico_defines.h @@ -0,0 +1,13 @@ +#ifndef PICO_DEFINES_H +#define PICO_DEFINES_H + +#define PICO_SUPPORT_ETH +#define PICO_SUPPORT_IPV4 +#define PICO_SUPPORT_IPV4FRAG +#define PICO_SUPPORT_ICMP4 +#define PICO_SUPPORT_TCP +#define PICO_SUPPORT_UDP +#define PICO_SUPPORT_DNS_CLIENT +#define PICO_SUPPORT_CRC +#define PICO_SUPPORT_PPP +#endif diff --git a/core/deps/picotcp/modules/pico_dev_tap.c b/core/deps/picotcp/modules/pico_dev_tap.c index c5d8ff641..42f835002 100644 --- a/core/deps/picotcp/modules/pico_dev_tap.c +++ b/core/deps/picotcp/modules/pico_dev_tap.c @@ -5,7 +5,7 @@ Authors: Daniele Lacamera *********************************************************************/ - +#ifndef _WIN32 #include #include #include @@ -228,3 +228,4 @@ struct pico_device *pico_tap_create(const char *name) return (struct pico_device *)tap; } +#endif diff --git a/core/deps/picotcp/modules/pico_dev_tap.h b/core/deps/picotcp/modules/pico_dev_tap.h index e67f8a7a3..01c41f344 100644 --- a/core/deps/picotcp/modules/pico_dev_tap.h +++ b/core/deps/picotcp/modules/pico_dev_tap.h @@ -3,6 +3,7 @@ See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage. *********************************************************************/ +#ifndef _WIN32 #ifndef INCLUDE_PICO_TAP #define INCLUDE_PICO_TAP #include "pico_config.h" @@ -12,4 +13,4 @@ void pico_tap_destroy(struct pico_device *tap); struct pico_device *pico_tap_create(const char *name); #endif - +#endif diff --git a/core/deps/picotcp/modules/pico_dev_tap_windows.c b/core/deps/picotcp/modules/pico_dev_tap_windows.c index dc235e03c..e9cec50c3 100644 --- a/core/deps/picotcp/modules/pico_dev_tap_windows.c +++ b/core/deps/picotcp/modules/pico_dev_tap_windows.c @@ -14,7 +14,7 @@ * there is no destroy function, yet * it has only been tested on a Windows 7 machine *********************************************************************/ - +#ifdef _WIN32 #include "pico_device.h" #include "pico_dev_null.h" #include "pico_stack.h" @@ -1107,3 +1107,5 @@ const char *pico_tap_get_guid(struct pico_device *dev) { return ((struct pico_device_tap *)dev)->tt->guid; } +#endif + diff --git a/core/deps/picotcp/modules/pico_dev_tap_windows.h b/core/deps/picotcp/modules/pico_dev_tap_windows.h index ded5cd072..d8f62071b 100644 --- a/core/deps/picotcp/modules/pico_dev_tap_windows.h +++ b/core/deps/picotcp/modules/pico_dev_tap_windows.h @@ -3,6 +3,7 @@ See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage. *********************************************************************/ +#ifdef _WIN32 #ifndef INCLUDE_PICO_TAP #define INCLUDE_PICO_TAP #include "pico_config.h" @@ -15,4 +16,5 @@ struct pico_device *pico_tap_create(char *name, uint8_t *mac); const char *pico_tap_get_guid(struct pico_device *dev); #endif +#endif diff --git a/core/deps/picotcp/modules/pico_dev_tun.c b/core/deps/picotcp/modules/pico_dev_tun.c index 8721b0ea2..035f74b6e 100644 --- a/core/deps/picotcp/modules/pico_dev_tun.c +++ b/core/deps/picotcp/modules/pico_dev_tun.c @@ -5,7 +5,7 @@ Authors: Daniele Lacamera *********************************************************************/ - +#ifndef _WIN32 #include #include #include @@ -88,7 +88,7 @@ struct pico_device *pico_tun_create(const char *name) return NULL; if( 0 != pico_device_init((struct pico_device *)tun, name, NULL)) { - dbg("Tun init failed.\n"); + printf("Tun init failed.\n"); pico_tun_destroy((struct pico_device *)tun); return NULL; } @@ -96,7 +96,7 @@ struct pico_device *pico_tun_create(const char *name) tun->dev.overhead = 0; tun->fd = tun_open(name); if (tun->fd < 0) { - dbg("Tun creation failed.\n"); + printf("Tun creation failed.\n"); pico_tun_destroy((struct pico_device *)tun); return NULL; } @@ -108,3 +108,4 @@ struct pico_device *pico_tun_create(const char *name) return (struct pico_device *)tun; } +#endif diff --git a/core/deps/picotcp/modules/pico_dev_tun.h b/core/deps/picotcp/modules/pico_dev_tun.h index c31436d43..0931de046 100644 --- a/core/deps/picotcp/modules/pico_dev_tun.h +++ b/core/deps/picotcp/modules/pico_dev_tun.h @@ -3,6 +3,7 @@ See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage. *********************************************************************/ +#ifndef _WIN32 #ifndef INCLUDE_PICO_TUN #define INCLUDE_PICO_TUN #include "pico_config.h" @@ -12,4 +13,5 @@ void pico_tun_destroy(struct pico_device *tun); struct pico_device *pico_tun_create(const char *name); #endif +#endif diff --git a/shell/android-studio/reicast/src/main/jni/Android.mk b/shell/android-studio/reicast/src/main/jni/Android.mk index fc808be1b..724f3a463 100644 --- a/shell/android-studio/reicast/src/main/jni/Android.mk +++ b/shell/android-studio/reicast/src/main/jni/Android.mk @@ -59,9 +59,9 @@ LOCAL_CXXFLAGS += -std=c++11 -fopenmp LOCAL_LDFLAGS += -fopenmp ifeq ($(TARGET_ARCH_ABI),x86) - LOCAL_CFLAGS+= -DTARGET_NO_AREC - LOCAL_CXXFLAGS+= -DTARGET_NO_AREC -fpermissive - LOCAL_CPPFLAGS+= -DTARGET_NO_AREC + LOCAL_CFLAGS+= -DTARGET_NO_AREC -DTARGET_NO_OPENMP + LOCAL_CXXFLAGS+= -DTARGET_NO_AREC -fpermissive -DTARGET_NO_OPENMP + LOCAL_CPPFLAGS+= -DTARGET_NO_AREC -DTARGET_NO_OPENMP endif LOCAL_CPP_FEATURES := diff --git a/shell/linux/Makefile b/shell/linux/Makefile index 6ce8e9081..43b5675c6 100644 --- a/shell/linux/Makefile +++ b/shell/linux/Makefile @@ -263,11 +263,11 @@ include $(RZDCY_SRC_DIR)/core.mk LDFLAGS += -g -Wl,-Map,$(notdir $@).map,--gc-sections -Wl,-O3 -Wl,--sort-common -fopenmp -CFLAGS += -g -O3 -D RELEASE -c -D USES_HOMEDIR -fopenmp #-D NO_REND +CFLAGS += $(RZDCY_CFLAGS) -g -O3 -D RELEASE -c -D USES_HOMEDIR -fopenmp #-D NO_REND CFLAGS += -frename-registers -fno-strict-aliasing CFLAGS += -ffast-math -ftree-vectorize -CXXFLAGS += -fno-rtti -fpermissive -fno-operator-names -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++11 +CXXFLAGS += $(RZDCY_CFLAGS) -fno-rtti -fpermissive -fno-operator-names -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++11 INCS += -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps -I$(RZDCY_SRC_DIR)/khronos @@ -398,9 +398,6 @@ DEPS:=$(DEPS:.S=.d) DEPS:=$(patsubst $(RZDCY_SRC_DIR)/%,$(DEPDIR)/%,$(DEPS)) POSTCOMPILE = mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d -INCS += -I$(PWD)/$(BUILDDIR)/deps/picotcp/include -LIBS += -L$(PWD)/$(BUILDDIR)/deps/picotcp/lib -lpicotcp - all: $(CPPFILES) $(EXECUTABLE) $(EXECUTABLE_STRIPPED) ifneq (,$(findstring gcwz,$(platform))) mksquashfs $(EXECUTABLE_STRIPPED) $(GCWZ_PKG_FILES) $(GCWZ_PKG) -all-root @@ -466,13 +463,6 @@ uninstall: clean: rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE_STRIPPED) .map - rm -rf $(BUILDDIR)/deps/picotcp - -$(BUILDDIR)/hw/modem/picoppp.build_obj: $(BUILDDIR)/deps/picotcp/lib/libpicotcp.a - -$(BUILDDIR)/deps/picotcp/lib/libpicotcp.a: - mkdir -p $(BUILDDIR)/deps/picotcp - cd $(RZDCY_SRC_DIR)/deps/picotcp ; make PREFIX=$(PWD)/$(BUILDDIR)/deps/picotcp .PRECIOUS = $(DEPDIR)/%.d $(DEPDIR)/%.d: ;