Skip to content

Commit c82098e

Browse files
runer112ZERICO2005
authored andcommitted
Move EASTL building support out of EASTL submodule
1 parent 66cb013 commit c82098e

File tree

6 files changed

+130
-5
lines changed

6 files changed

+130
-5
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
path = examples/library_examples/graphx/template
2020
url = https://github.com/CE-Programming/graphx-template
2121
[submodule "src/EASTL"]
22-
path = src/EASTL
22+
path = src/ea/EASTL
2323
url = https://github.com/electronicarts/EASTL.git
2424
[submodule "src/EABase"]
25-
path = src/EABase
25+
path = src/ea/EABase
2626
url = https://github.com/electronicarts/EABase.git

src/EABase

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/EASTL

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/ea/include/__EASTL_user_config.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#ifndef _EASTL_USER_CONFIG_H
2+
#define _EASTL_USER_CONFIG_H
3+
4+
5+
#define EASTL_THREAD_SUPPORT_AVAILABLE 0
6+
7+
8+
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) && !defined(SSIZE_T_DEFINED)
9+
#define _SSIZE_T_
10+
#define _SSIZE_T_DEFINED
11+
#define SSIZE_T_DEFINED
12+
13+
#include <cstddef>
14+
15+
typedef ptrdiff_t ssize_t;
16+
#define SSIZE_MAX INT_MAX
17+
#endif
18+
19+
20+
#include <__config>
21+
#include <cstdint>
22+
23+
_EZCXX_INLINE void* operator new[](size_t size,
24+
const char* name,
25+
int flags,
26+
unsigned debugFlags,
27+
const char* file,
28+
int line)
29+
{
30+
(void)name;
31+
(void)flags;
32+
(void)debugFlags;
33+
(void)file;
34+
(void)line;
35+
return new uint8_t[size];
36+
}
37+
38+
_EZCXX_INLINE void* operator new[](size_t size,
39+
size_t alignment,
40+
size_t alignmentOffset,
41+
const char* name,
42+
int flags,
43+
unsigned debugFlags,
44+
const char* file,
45+
int line)
46+
{
47+
(void)alignment;
48+
(void)alignmentOffset;
49+
(void)name;
50+
(void)flags;
51+
(void)debugFlags;
52+
(void)file;
53+
(void)line;
54+
return new uint8_t[size];
55+
}
56+
57+
#endif // _EASTL_USER_CONFIG_H

src/ea/makefile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright (C) 2015-2023 CE Programming
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# modify it under the terms of the GNU Lesser General Public
5+
# License as published by the Free Software Foundation; either
6+
# version 3 of the License, or (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
# Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public License
14+
# along with this program; if not, write to the Free Software Foundation,
15+
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16+
17+
include $(CURDIR)/../common.mk
18+
19+
BUILD := $(call NATIVEPATH,EASTL/build)
20+
# TODO: atomic
21+
BUILD_SRC := $(filter-out EASTL/build/atomic.cpp.src,$(patsubst EASTL/source/%,EASTL/build/%.src,$(wildcard EASTL/source/*.c EASTL/source/*.cpp)))
22+
23+
EZCFLAGS := -S -ffreestanding -Wall -Wextra -Oz
24+
EZCFLAGS += -D_EZ80 -isystem ../ce/include -isystem ../libc/include -mllvm -profile-guided-section-prefix=false
25+
EZCFLAGS += -DEASTL_USER_CONFIG_HEADER="<__EASTL_user_config.h>"
26+
EZCXXFLAGS := $(EZCFLAGS) -fno-exceptions -fno-rtti -fno-use-cxa-atexit
27+
EZCXXFLAGS += -isystem ../libcxx/include -isystem EABase/include/Common -isystem EASTL/include -isystem include
28+
29+
CONFIG_H = include/__EASTL_user_config.h
30+
31+
WILDCARD_SRC = $(wildcard *.src) $(BUILD_SRC)
32+
WILDCARD_EASTL_H := $(wildcard EASTL/include/EASTL/*.h)
33+
WILDCARD_EASTL_BONUS_H := $(wildcard EASTL/include/EASTL/bonus/*.h)
34+
WILDCARD_EASTL_INTERNAL_H := $(wildcard EASTL/include/EASTL/internal/*.h)
35+
# WILDCARD_EASTL_INTERNAL_ATOMIC_H := $(wildcard EASTL/include/EASTL/internal/atomic/*.h)
36+
WILDCARD_EABASE_H := $(wildcard EABase/include/Common/EABase/*.h)
37+
WILDCARD_EABASE_CONFIG_H := $(wildcard EABase/include/Common/EABase/config/*.h)
38+
39+
all: $(BUILD_SRC)
40+
41+
EASTL/build/%.c.src: EASTL/source/%.c
42+
$(Q)$(call MKDIR,$(BUILD))
43+
$(Q)$(EZCC) $(EZCFLAGS) $< -o $@
44+
45+
EASTL/build/%.cpp.src: EASTL/source/%.cpp
46+
$(Q)$(call MKDIR,$(BUILD))
47+
$(Q)$(EZCC) $(EZCXXFLAGS) $< -o $@
48+
49+
clean:
50+
$(Q)$(call RMDIR,$(BUILD))
51+
52+
install: all
53+
$(Q)$(call MKDIR,$(INSTALL_H))
54+
$(Q)$(call MKDIR,$(INSTALL_EABASE_H))
55+
$(Q)$(call MKDIR,$(INSTALL_EABASE_CONFIG_H))
56+
$(Q)$(call MKDIR,$(INSTALL_EASTL_H))
57+
$(Q)$(call MKDIR,$(INSTALL_EASTL_BONUS_H))
58+
$(Q)$(call MKDIR,$(INSTALL_EASTL_INTERNAL_H))
59+
# $(Q)$(call MKDIR,$(INSTALL_EASTL_INTERNAL_ATOMIC_H))
60+
$(Q)$(call MKDIR,$(INSTALL_EASTL))
61+
$(Q)$(call COPY,$(call NATIVEPATH,$(WILDCARD_SRC)),$(INSTALL_EASTL))
62+
# $(Q)$(call COPY,$(foreach file,$(call NATIVEPATH,$(WILDCARD_EASTL_INTERNAL_ATOMIC_H)),$(call QUOTE_ARG,$(file))),$(INSTALL_EASTL_INTERNAL_ATOMIC_H))
63+
$(Q)$(call COPY,$(foreach file,$(call NATIVEPATH,$(WILDCARD_EASTL_INTERNAL_H)),$(call QUOTE_ARG,$(file))),$(INSTALL_EASTL_INTERNAL_H))
64+
$(Q)$(call COPY,$(foreach file,$(call NATIVEPATH,$(WILDCARD_EASTL_BONUS_H)),$(call QUOTE_ARG,$(file))),$(INSTALL_EASTL_BONUS_H))
65+
$(Q)$(call COPY,$(foreach file,$(call NATIVEPATH,$(WILDCARD_EASTL_H)),$(call QUOTE_ARG,$(file))),$(INSTALL_EASTL_H))
66+
$(Q)$(call COPY,$(foreach file,$(call NATIVEPATH,$(WILDCARD_EABASE_CONFIG_H)),$(call QUOTE_ARG,$(file))),$(INSTALL_EABASE_CONFIG_H))
67+
$(Q)$(call COPY,$(foreach file,$(call NATIVEPATH,$(WILDCARD_EABASE_H)),$(call QUOTE_ARG,$(file))),$(INSTALL_EABASE_H))
68+
$(Q)$(call COPY,$(foreach file,$(call NATIVEPATH,$(CONFIG_H)),$(call QUOTE_ARG,$(file))),$(INSTALL_H))
69+
70+
.PHONY: all clean

src/linker.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ LIBC_FILES := $(wildcard libc/*.src) $(patsubst libc/%,libc/build/%.src,$(wildca
2424
LIBCXX_FILES := $(wildcard libcxx/*.src) $(patsubst libcxx/%,libcxx/build/%.src,$(wildcard libcxx/*.c libcxx/*.cpp))
2525
SOFTFLOAT_FILES := $(wildcard softfloat/*.src) $(patsubst softfloat/%,softfloat/build/%.src,$(wildcard softfloat/*.c softfloat/*.cpp))
2626
# TODO: atomic
27-
EASTL_FILES := $(filter-out EASTL/atomic.cpp.src,$(patsubst EASTL/source/%,EASTL/%.src,$(wildcard EASTL/source/*.c EASTL/source/*.cpp)))
27+
EASTL_FILES := $(filter-out EASTL/atomic.cpp.src,$(patsubst ea/EASTL/source/%,EASTL/%.src,$(wildcard ea/EASTL/source/*.c ea/EASTL/source/*.cpp)))
2828
CE_FILES := $(wildcard ce/*.src)
2929

3030
linker_script: $(STATIC_FILES) $(LINKED_FILES) $(SHARED_FILES)

0 commit comments

Comments
 (0)