mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 15:34:18 +08:00
188 lines
6.8 KiB
Diff
188 lines
6.8 KiB
Diff
diff --git a/include/platformBoxedwine.h b/include/platformBoxedwine.h
|
|
index b7a798d..6ab00a3 100644
|
|
--- a/include/platformBoxedwine.h
|
|
+++ b/include/platformBoxedwine.h
|
|
@@ -30,7 +30,7 @@
|
|
#include "platformtypes.h"
|
|
#define FD S32
|
|
|
|
-#ifdef __APPLE__
|
|
+#if defined(USE_FILE32API)
|
|
#define lseek64 lseek
|
|
#endif
|
|
|
|
diff --git a/lib/asmjit/asmjit/core/api-build_p.h b/lib/asmjit/asmjit/core/api-build_p.h
|
|
index 2de68d2..d0b5688 100644
|
|
--- a/lib/asmjit/asmjit/core/api-build_p.h
|
|
+++ b/lib/asmjit/asmjit/core/api-build_p.h
|
|
@@ -40,7 +40,8 @@
|
|
defined(__DragonFly__) || \
|
|
defined(__FreeBSD__ ) || \
|
|
defined(__NetBSD__ ) || \
|
|
- defined(__OpenBSD__ )
|
|
+ defined(__OpenBSD__ ) || \
|
|
+ defined(__redox__ )
|
|
#define ASMJIT_FILE64_API(NAME) NAME
|
|
#else
|
|
#define ASMJIT_FILE64_API(NAME) NAME##64
|
|
diff --git a/lib/glew/src/glew.cpp b/lib/glew/src/glew.cpp
|
|
index d19534c..994db49 100644
|
|
--- a/lib/glew/src/glew.cpp
|
|
+++ b/lib/glew/src/glew.cpp
|
|
@@ -38,6 +38,7 @@
|
|
|
|
#if defined(GLEW_OSMESA)
|
|
# define GLAPI extern
|
|
+# define APIENTRY
|
|
# include <GL/osmesa.h>
|
|
#elif defined(GLEW_EGL)
|
|
# include <GL/eglew.h>
|
|
diff --git a/lib/simde/simde/simde-math.h b/lib/simde/simde/simde-math.h
|
|
index d18bf4f..ebecd1c 100644
|
|
--- a/lib/simde/simde/simde-math.h
|
|
+++ b/lib/simde/simde/simde-math.h
|
|
@@ -1285,9 +1285,7 @@ simde_math_fpclass(double v, const int imm8) {
|
|
#endif
|
|
|
|
#if !defined(simde_math_roundevenf)
|
|
- #if \
|
|
- ((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && HEDLEY_HAS_BUILTIN(__builtin_roundevenf)) || \
|
|
- HEDLEY_GCC_VERSION_CHECK(10,0,0)
|
|
+ #if 0
|
|
#define simde_math_roundevenf(v) __builtin_roundevenf(v)
|
|
#elif defined(simde_math_roundf) && defined(simde_math_fabsf)
|
|
static HEDLEY_INLINE
|
|
diff --git a/project/linux/makefile b/project/linux/makefile
|
|
index c27766c..ad656a9 100644
|
|
--- a/project/linux/makefile
|
|
+++ b/project/linux/makefile
|
|
@@ -4,8 +4,9 @@ ifndef BUILD_DIR
|
|
|
|
default all: release
|
|
|
|
-uname_m := $(shell uname -m)
|
|
-uname_n := $(shell uname -n)
|
|
+TARGET ?=
|
|
+uname_m := $(firstword $(TARGET))
|
|
+uname_n := $(word 3, $(TARGET))
|
|
$(info uname -m is $(uname_m))
|
|
ifeq ($(uname_m), armv7l)
|
|
export GCC_EXTRA_FLAGS := -fno-tree-vectorize
|
|
@@ -34,7 +35,7 @@ export MAKEFLAGS := -j $(cpus)
|
|
$(info MAKEFLAGS is $(MAKEFLAGS))
|
|
endif
|
|
release test:
|
|
- @$(MAKE)
|
|
+ $(MAKE)
|
|
|
|
clean:
|
|
$(RM) -r Build
|
|
@@ -53,7 +54,7 @@ SOURCES += $(wildcard $(PROJDIR)/lib/pugixml/src/*.cpp)
|
|
SOURCES += $(PROJDIR)/lib/glew/src/glew.cpp
|
|
SOURCES += $(PROJDIR)/lib/imgui/addon/imguitinyfiledialogs.cpp
|
|
SOURCES += $(PROJDIR)/lib/imgui/examples/imgui_impl_sdl.cpp
|
|
-SOURCES += $(PROJDIR)/lib/imgui/examples/imgui_impl_opengl2.cpp
|
|
+SOURCES += $(PROJDIR)/lib/imgui/examples/imgui_impl_opengl3.cpp
|
|
SOURCES += $(PROJDIR)/lib/imgui/imgui_widgets.cpp
|
|
SOURCES += $(PROJDIR)/lib/imgui/imgui_draw.cpp
|
|
SOURCES += $(PROJDIR)/lib/imgui/imgui.cpp
|
|
@@ -95,32 +96,34 @@ DEPS := $(ALL:.o=.d)
|
|
$(OBJS): INCLUDES := -I../../lib/asmjit -I../../include -I../../lib/glew/include -I../../lib/imgui -I../../lib/simde -I../../lib/pugixml/src
|
|
$(SOFT_OBJS): INCLUDES := -I../../lib/softfloat/source/include -I../../lib/softfloat/source -I../../lib/softfloat/source/8086-SSE
|
|
|
|
-SDL_CFLAGS = $(shell sdl2-config --cflags)
|
|
-SDL_LIBS = $(shell sdl2-config --libs)
|
|
-CPPFLAGS ?= -std=c++20 -O2 $(EXTRA_CPP_FLAGS) $(GCC_EXTRA_FLAGS) -Werror=switch -Wall -Wno-invalid-offsetof -Wno-delete-incomplete -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable $(INCLUDES) -DBOXEDWINE_RECORDER -DBOXEDWINE_ZLIB -DBOXEDWINE_HAS_SETJMP -DSDL2=1 "-DGLH=<SDL_opengl.h>" -DBOXEDWINE_OPENGL_SDL -DSIMDE_SSE2_NO_NATIVE -DBOXEDWINE_POSIX -DBOXEDWINE_OPENGL_IMGUI_V2 $(SDL_CFLAGS)
|
|
-CFLAGS ?= -O2 $(INCLUDES)
|
|
-LDFLAGS = -L./linux_build/lib -lcurl -lssl -lcrypto -lpthread -lm -lz -lminizip -lGL -lstdc++ -lstdc++fs $(SDL_LIBS)
|
|
+PKG_CONFIG ?= pkg-config
|
|
+SDL_CFLAGS = $(shell $(PKG_CONFIG) --cflags sdl2)
|
|
+SDL_LIBS = $(shell $(PKG_CONFIG) --libs sdl2)
|
|
+CPPFLAGS ?=
|
|
+LDFLAGS ?=
|
|
+CPPFLAGS := $(CPPFLAGS) -O2 $(EXTRA_CPP_FLAGS) $(GCC_EXTRA_FLAGS) -Werror=switch -Wall -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -DBOXEDWINE_RECORDER -DBOXEDWINE_ZLIB -DBOXEDWINE_HAS_SETJMP -DSDL2=1 "-DGLH=<SDL_opengl.h>" -DSIMDE_SSE2_NO_NATIVE -DBOXEDWINE_POSIX -DIMGUI_IMPL_OPENGL_ES3 $(SDL_CFLAGS)
|
|
+LDFLAGS := $(LDFLAGS) -L./linux_build/lib -lcurl -lssl -lcrypto -lpthread -lm -lz -lminizip -lstdc++ -lOSMesa -lGLESv2 $(SDL_LIBS)
|
|
|
|
#$(TEST_BUILD_DIR)/boxedwineTest: $(TEST_OBJS)
|
|
# $(CC) $(TEST_OBJS) -o $@ $(LDFLAGS)
|
|
|
|
$(BUILD_DIR)/$(TARGET_EXEC): $(ALL)
|
|
- @$(CC) $(ALL) -o $@ $(LDFLAGS)
|
|
+ $(CC) $(ALL) -o $@ $(LDFLAGS)
|
|
|
|
# assembly
|
|
$(BUILD_DIR)/%.s.o: %.s
|
|
- @$(MKDIR_P) $(dir $@)
|
|
- @$(AS) $(ASFLAGS) -c $< -o $@
|
|
+ $(MKDIR_P) $(dir $@)
|
|
+ $(AS) $(ASFLAGS) -c $< -o $@
|
|
|
|
# c source
|
|
$(BUILD_DIR)/%.c.o: %.c
|
|
- @$(MKDIR_P) $(dir $@)
|
|
- @$(CC) $(CFLAGS) -c $< -o $@
|
|
+ $(MKDIR_P) $(dir $@)
|
|
+ $(CC) $(CPPFLAGS) $(INCLUDES) -c $< -o $@
|
|
|
|
# c++ source
|
|
$(BUILD_DIR)/%.cpp.o: %.cpp
|
|
- @$(MKDIR_P) $(dir $@)
|
|
- @$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MP -c $< -o $@
|
|
+ $(MKDIR_P) $(dir $@)
|
|
+ $(CXX) $(CPPFLAGS) -std=c++20 -Wno-invalid-offsetof -Wno-delete-incomplete $(INCLUDES) -MMD -MP -c $< -o $@
|
|
|
|
.PHONY: clean
|
|
|
|
diff --git a/source/io/fs.h b/source/io/fs.h
|
|
index eb60eb6..49227ff 100644
|
|
--- a/source/io/fs.h
|
|
+++ b/source/io/fs.h
|
|
@@ -41,8 +41,6 @@
|
|
#define K_O_CLOEXEC 0x080000
|
|
#define K_O_TMPFILE 0x400000
|
|
|
|
-#define FD_CLOEXEC 1
|
|
-
|
|
#define K_F_SEAL_SEAL 0x01
|
|
#define K_F_SEAL_SHRINK 0x02
|
|
#define K_F_SEAL_GROW 0x04
|
|
diff --git a/source/kernel/knativesocket.cpp b/source/kernel/knativesocket.cpp
|
|
index 4f6a435..5b9ec44 100644
|
|
--- a/source/kernel/knativesocket.cpp
|
|
+++ b/source/kernel/knativesocket.cpp
|
|
@@ -33,6 +33,7 @@ static int winsock_intialized;
|
|
#pragma comment(lib, "Ws2_32.lib")
|
|
#undef min
|
|
#else
|
|
+#include <sys/select.h>
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
@@ -524,10 +525,10 @@ struct ifconf {
|
|
};
|
|
*/
|
|
#define K_IFNAMSIZ 16
|
|
-
|
|
U32 KNativeSocketObject::ioctl(KThread* thread, U32 request) {
|
|
CPU* cpu = thread->cpu;
|
|
if (request == 0x541b) {
|
|
+/*
|
|
#ifdef WIN32
|
|
u_long value=0;
|
|
U32 result = ioctlsocket(this->nativeSocket, FIONREAD, &value);
|
|
@@ -718,12 +719,13 @@ U32 KNativeSocketObject::ioctl(KThread* thread, U32 request) {
|
|
thread->memory->writew(address + K_IFNAMSIZ, ifr.ifr_mtu);
|
|
return 0;
|
|
#endif
|
|
+*/
|
|
+ kwarn_fmt("KNativeSocketObject::ioctl request=%x commented out", request);
|
|
} else {
|
|
kwarn_fmt("KNativeSocketObject::ioctl request=%x not implemented", request);
|
|
}
|
|
return -K_ENOTTY;
|
|
}
|
|
-
|
|
S64 KNativeSocketObject::seek(S64 pos) {
|
|
return -K_ESPIPE;
|
|
}
|