Fix android build
This commit is contained in:
parent
1314a1551d
commit
fc96593e80
37
core/core.mk
37
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/ \
|
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/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/ \
|
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
|
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)*.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)*.c))
|
||||||
RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.S))
|
RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.S))
|
||||||
|
|
||||||
ifdef FOR_PANDORA
|
ifdef FOR_PANDORA
|
||||||
RZDCY_CFLAGS := \
|
RZDCY_CFLAGS := \
|
||||||
$(CFLAGS) -c -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \
|
$(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\
|
-DRELEASE -DPANDORA\
|
||||||
-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp \
|
-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp \
|
||||||
-frename-registers -fsingle-precision-constant -ffast-math \
|
-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 += -march=armv7-a -mtune=cortex-a8 -mfpu=neon
|
||||||
RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7
|
RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7
|
||||||
else
|
else
|
||||||
|
ifdef FOR_ANDROID
|
||||||
RZDCY_CFLAGS := \
|
RZDCY_CFLAGS := \
|
||||||
$(CFLAGS) -c -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \
|
$(CFLAGS) -c -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \
|
||||||
-D_ANDROID -DRELEASE\
|
-I$(RZDCY_SRC_DIR)/deps/picotcp/include -I$(RZDCY_SRC_DIR)/deps/picotcp/modules \
|
||||||
-frename-registers -fsingle-precision-constant -ffast-math \
|
-D_ANDROID -DRELEASE \
|
||||||
-ftree-vectorize -fomit-frame-pointer
|
-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
|
ifndef NOT_ARM
|
||||||
RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7
|
RZDCY_CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16
|
||||||
else
|
RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7
|
||||||
ifndef ISMIPS
|
|
||||||
RZDCY_CFLAGS += -DTARGET_LINUX_x86
|
|
||||||
else
|
else
|
||||||
RZDCY_CFLAGS += -DTARGET_LINUX_MIPS
|
ifndef ISMIPS
|
||||||
|
RZDCY_CFLAGS += -DTARGET_LINUX_x86
|
||||||
|
else
|
||||||
|
RZDCY_CFLAGS += -DTARGET_LINUX_MIPS
|
||||||
|
endif
|
||||||
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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -5,7 +5,7 @@
|
||||||
Authors: Daniele Lacamera
|
Authors: Daniele Lacamera
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -228,3 +228,4 @@ struct pico_device *pico_tap_create(const char *name)
|
||||||
return (struct pico_device *)tap;
|
return (struct pico_device *)tap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
|
See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
|
||||||
|
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
#ifndef _WIN32
|
||||||
#ifndef INCLUDE_PICO_TAP
|
#ifndef INCLUDE_PICO_TAP
|
||||||
#define INCLUDE_PICO_TAP
|
#define INCLUDE_PICO_TAP
|
||||||
#include "pico_config.h"
|
#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);
|
struct pico_device *pico_tap_create(const char *name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* there is no destroy function, yet
|
* there is no destroy function, yet
|
||||||
* it has only been tested on a Windows 7 machine
|
* it has only been tested on a Windows 7 machine
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
#ifdef _WIN32
|
||||||
#include "pico_device.h"
|
#include "pico_device.h"
|
||||||
#include "pico_dev_null.h"
|
#include "pico_dev_null.h"
|
||||||
#include "pico_stack.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;
|
return ((struct pico_device_tap *)dev)->tt->guid;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
|
See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
|
||||||
|
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
#ifdef _WIN32
|
||||||
#ifndef INCLUDE_PICO_TAP
|
#ifndef INCLUDE_PICO_TAP
|
||||||
#define INCLUDE_PICO_TAP
|
#define INCLUDE_PICO_TAP
|
||||||
#include "pico_config.h"
|
#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);
|
const char *pico_tap_get_guid(struct pico_device *dev);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
Authors: Daniele Lacamera
|
Authors: Daniele Lacamera
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -88,7 +88,7 @@ struct pico_device *pico_tun_create(const char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if( 0 != pico_device_init((struct pico_device *)tun, name, 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);
|
pico_tun_destroy((struct pico_device *)tun);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ struct pico_device *pico_tun_create(const char *name)
|
||||||
tun->dev.overhead = 0;
|
tun->dev.overhead = 0;
|
||||||
tun->fd = tun_open(name);
|
tun->fd = tun_open(name);
|
||||||
if (tun->fd < 0) {
|
if (tun->fd < 0) {
|
||||||
dbg("Tun creation failed.\n");
|
printf("Tun creation failed.\n");
|
||||||
pico_tun_destroy((struct pico_device *)tun);
|
pico_tun_destroy((struct pico_device *)tun);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -108,3 +108,4 @@ struct pico_device *pico_tun_create(const char *name)
|
||||||
return (struct pico_device *)tun;
|
return (struct pico_device *)tun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
|
See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
|
||||||
|
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
#ifndef _WIN32
|
||||||
#ifndef INCLUDE_PICO_TUN
|
#ifndef INCLUDE_PICO_TUN
|
||||||
#define INCLUDE_PICO_TUN
|
#define INCLUDE_PICO_TUN
|
||||||
#include "pico_config.h"
|
#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);
|
struct pico_device *pico_tun_create(const char *name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ LOCAL_CXXFLAGS += -std=c++11 -fopenmp
|
||||||
LOCAL_LDFLAGS += -fopenmp
|
LOCAL_LDFLAGS += -fopenmp
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||||
LOCAL_CFLAGS+= -DTARGET_NO_AREC
|
LOCAL_CFLAGS+= -DTARGET_NO_AREC -DTARGET_NO_OPENMP
|
||||||
LOCAL_CXXFLAGS+= -DTARGET_NO_AREC -fpermissive
|
LOCAL_CXXFLAGS+= -DTARGET_NO_AREC -fpermissive -DTARGET_NO_OPENMP
|
||||||
LOCAL_CPPFLAGS+= -DTARGET_NO_AREC
|
LOCAL_CPPFLAGS+= -DTARGET_NO_AREC -DTARGET_NO_OPENMP
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LOCAL_CPP_FEATURES :=
|
LOCAL_CPP_FEATURES :=
|
||||||
|
|
|
@ -263,11 +263,11 @@ include $(RZDCY_SRC_DIR)/core.mk
|
||||||
|
|
||||||
LDFLAGS += -g -Wl,-Map,$(notdir $@).map,--gc-sections -Wl,-O3 -Wl,--sort-common -fopenmp
|
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 += -frename-registers -fno-strict-aliasing
|
||||||
CFLAGS += -ffast-math -ftree-vectorize
|
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
|
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))
|
DEPS:=$(patsubst $(RZDCY_SRC_DIR)/%,$(DEPDIR)/%,$(DEPS))
|
||||||
POSTCOMPILE = mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d
|
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)
|
all: $(CPPFILES) $(EXECUTABLE) $(EXECUTABLE_STRIPPED)
|
||||||
ifneq (,$(findstring gcwz,$(platform)))
|
ifneq (,$(findstring gcwz,$(platform)))
|
||||||
mksquashfs $(EXECUTABLE_STRIPPED) $(GCWZ_PKG_FILES) $(GCWZ_PKG) -all-root
|
mksquashfs $(EXECUTABLE_STRIPPED) $(GCWZ_PKG_FILES) $(GCWZ_PKG) -all-root
|
||||||
|
@ -466,13 +463,6 @@ uninstall:
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE_STRIPPED) .map
|
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
|
.PRECIOUS = $(DEPDIR)/%.d
|
||||||
$(DEPDIR)/%.d: ;
|
$(DEPDIR)/%.d: ;
|
||||||
|
|
Loading…
Reference in New Issue