Fix android build

This commit is contained in:
Flyinghead 2018-09-17 17:52:29 +02:00
parent 1314a1551d
commit fc96593e80
10 changed files with 56 additions and 35 deletions

View File

@ -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

View File

@ -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

View File

@ -5,7 +5,7 @@
Authors: Daniele Lacamera
*********************************************************************/
#ifndef _WIN32
#include <fcntl.h>
#include <sys/ioctl.h>
#include <net/if.h>
@ -228,3 +228,4 @@ struct pico_device *pico_tap_create(const char *name)
return (struct pico_device *)tap;
}
#endif

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -5,7 +5,7 @@
Authors: Daniele Lacamera
*********************************************************************/
#ifndef _WIN32
#include <fcntl.h>
#include <sys/ioctl.h>
#include <net/if.h>
@ -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

View File

@ -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

View File

@ -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 :=

View File

@ -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: ;