Builds for Haiku.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4584 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-10-26 02:56:33 +00:00
parent b695a4ba3b
commit 68f5827dee
7 changed files with 60 additions and 22 deletions

View File

@ -21,6 +21,12 @@ BUILD_TYPES := debug release
HAVE_ANDROID = $(if $(shell which $(ANDROID_SDK)/platform-tools/adb),1,0)
HAVE_LINUX_IOS = $(if $(shell which deps/ios_toolchain/target/bin deps/ios_toolchain/target/bin/arm-apple-darwin11-clang),1,0)
HAVE_WIN = $(if $(shell which x86_64-w64-mingw32-gcc-win32),1,0)
else ifeq ($(UNAME_S),Haiku)
BUILD_TYPES := debug release
CFLAGS += -Dstatic_assert=_Static_assert
LDFLAGS += \
-lbsd \
-lnetwork
else
$(error Unexpected host platform $(UNAME_S).)
endif
@ -190,9 +196,11 @@ $(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/inc
$(IOSSIM_TARGETS): LDFLAGS += -Ldeps/openssl/ios/iossimulator-xcrun/usr/local/lib
ifeq ($(UNAME_M),x86_64)
ifneq ($(UNAME_S),Haiku)
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined
endif
endif
get_objs = \
$(foreach build_type,$(BUILD_TYPES),$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)))))) \
@ -257,23 +265,34 @@ UV_SOURCES_unix := \
deps/libuv/src/unix/fs.c \
deps/libuv/src/unix/getaddrinfo.c \
deps/libuv/src/unix/getnameinfo.c \
deps/libuv/src/unix/linux.c \
deps/libuv/src/unix/loop-watcher.c \
deps/libuv/src/unix/loop.c \
deps/libuv/src/unix/pipe.c \
deps/libuv/src/unix/poll.c \
deps/libuv/src/unix/process.c \
deps/libuv/src/unix/procfs-exepath.c \
deps/libuv/src/unix/proctitle.c \
deps/libuv/src/unix/random-devurandom.c \
deps/libuv/src/unix/random-getrandom.c \
deps/libuv/src/unix/random-sysctl-linux.c \
deps/libuv/src/unix/signal.c \
deps/libuv/src/unix/stream.c \
deps/libuv/src/unix/tcp.c \
deps/libuv/src/unix/thread.c \
deps/libuv/src/unix/tty.c \
deps/libuv/src/unix/udp.c
ifeq ($(UNAME_S),Linux)
UV_SOURCES_unix += \
deps/libuv/src/unix/linux.c \
deps/libuv/src/unix/procfs-exepath.c \
deps/libuv/src/unix/proctitle.c \
deps/libuv/src/unix/random-sysctl-linux.c
else ifeq ($(UNAME_S),Haiku)
UV_SOURCES_unix += \
deps/libuv/src/unix/bsd-ifaddrs.c \
deps/libuv/src/unix/haiku.c \
deps/libuv/src/unix/no-fsevents.c \
deps/libuv/src/unix/no-proctitle.c \
deps/libuv/src/unix/posix-hrtime.c \
deps/libuv/src/unix/posix-poll.c
endif
UV_SOURCES_android := \
deps/libuv/src/unix/random-getentropy.c
UV_SOURCES_win := \
@ -338,8 +357,15 @@ $(UV_OBJS): CFLAGS += \
-Wno-sign-compare \
-Wno-unused-but-set-variable \
-Wno-unused-result \
-Wno-unused-variable \
-Wno-unused-variable
ifeq ($(UNAME_S),Linux)
$(UV_OBJS): CFLAGS += \
-D_GNU_SOURCE
else ifeq ($(UNAME_S),Haiku)
$(UV_OBJS): CFLAGS += \
-D_BSD_SOURCE \
-Wno-format-truncation
endif
SODIUM_SOURCES := \
deps/libsodium/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c \
@ -528,9 +554,12 @@ LDFLAGS += \
-pthread \
-lm
debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
-ldl \
-lssl \
-lcrypto
ifneq ($(UNAME_S),Haiku)
debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
-ldl
endif
$(WINDOWS_TARGETS): LDFLAGS += \
-lssl \
-lcrypto \
@ -605,7 +634,7 @@ $(foreach build_type,$(BUILD_TYPES),$(eval $(call build_rules,$(build_type))))
src/version.h : $(firstword $(MAKEFILE_LIST))
@echo [version] $@
@echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"\n#define VERSION_NAME \"$(VERSION_NAME)\"\n" > $@
@echo -e "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"\n#define VERSION_NAME \"$(VERSION_NAME)\"\n" > $@
src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST))
@echo [android_version] $@