Skip to content
Snippets Groups Projects
Commit 36226165 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix builds for macOS

It builds and appears to run... not actually tested.
parent bc988560
No related branches found
No related tags found
No related merge requests found
Pipeline #6153 passed
...@@ -64,7 +64,6 @@ include: ...@@ -64,7 +64,6 @@ include:
platform: 'x86' platform: 'x86'
tagname: 'macOS' tagname: 'macOS'
cross_platform: 'yes' cross_platform: 'yes'
no_javascript: 'yes'
smoketest-jsexec-linux: smoketest-jsexec-linux:
tags: [Linux] tags: [Linux]
......
...@@ -28,11 +28,9 @@ ifeq ($(shell perl -e 'print "$(machine)"=~/\.arm/?"YES":"NO"'),YES) ...@@ -28,11 +28,9 @@ ifeq ($(shell perl -e 'print "$(machine)"=~/\.arm/?"YES":"NO"'),YES)
endif endif
endif endif
# OS/2 and "GNU" (HURD?) also need this, but we never plan to support them. # OS/2 and "GNU" (HURD?) also need this, but we never plan to support them.
ifneq ($(os),darwin) ifneq ($(os),linux)
ifneq ($(os),linux) ifneq ($(os),sunos)
ifneq ($(os),sunos) JS_CONFIGURE_ARGS += '--disable-tracejit'
JS_CONFIGURE_ARGS += '--disable-tracejit'
endif
endif endif
endif endif
ifeq ($(os),darwin) ifeq ($(os),darwin)
...@@ -61,7 +59,7 @@ $(JS_SRC): | $(3RDPSRCDIR) ...@@ -61,7 +59,7 @@ $(JS_SRC): | $(3RDPSRCDIR)
$(JS_IDIR): | $(3RDPODIR) $(JS_IDIR): | $(3RDPODIR)
$(QUIET)$(IFNOTEXIST) mkdir $(JS_IDIR) $(QUIET)$(IFNOTEXIST) mkdir $(JS_IDIR)
$(JSLIB_BUILD): $(3RDP_ROOT)/dist/libmozjs.tgz $(3RDP_ROOT)/build/js_src_jsnativestack_cpp.patch $(3RDP_ROOT)/build/js-configure.patch $(3RDP_ROOT)/build/js-configure.in.patch $(3RDP_ROOT)/build/imacro-asm-fix.patch $(3RDP_ROOT)/build/js-volatile-outside-functions.patch $(3RDP_ROOT)/build/js-Wno-misleading-indentation.patch $(3RDP_ROOT)/build/js-allow-python3.patch $(3RDP_ROOT)/build/js-no-rwx-pages.patch $(3RDP_ROOT)/build/js-disable-shell.patch | $(JS_SRC) $(JS_IDIR) $(JSLIB_BUILD): $(3RDP_ROOT)/dist/libmozjs.tgz $(3RDP_ROOT)/build/js_src_jsnativestack_cpp.patch $(3RDP_ROOT)/build/js-configure.patch $(3RDP_ROOT)/build/js-configure.in.patch $(3RDP_ROOT)/build/imacro-asm-fix.patch $(3RDP_ROOT)/build/js-volatile-outside-functions.patch $(3RDP_ROOT)/build/js-Wno-misleading-indentation.patch $(3RDP_ROOT)/build/js-allow-python3.patch $(3RDP_ROOT)/build/js-no-rwx-pages.patch $(3RDP_ROOT)/build/js-disable-shell.patch $(3RDP_ROOT)/build/js-darwin-configure.patch | $(JS_SRC) $(JS_IDIR)
@echo Creating $@ ... @echo Creating $@ ...
$(QUIET)-rm -rf $(JS_SRC)/* $(QUIET)-rm -rf $(JS_SRC)/*
$(QUIET)tar -xzC $(JS_SRC) -f $(3RDPDISTDIR)/libmozjs.tgz $(QUIET)tar -xzC $(JS_SRC) -f $(3RDPDISTDIR)/libmozjs.tgz
...@@ -78,6 +76,7 @@ $(JSLIB_BUILD): $(3RDP_ROOT)/dist/libmozjs.tgz $(3RDP_ROOT)/build/js_src_jsnativ ...@@ -78,6 +76,7 @@ $(JSLIB_BUILD): $(3RDP_ROOT)/dist/libmozjs.tgz $(3RDP_ROOT)/build/js_src_jsnativ
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-disable-warnings.patch $(QUIET)patch -b -p0 -d $(JS_SRC) < js-disable-warnings.patch
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-disable-shell.patch $(QUIET)patch -b -p0 -d $(JS_SRC) < js-disable-shell.patch
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-no-rwx-pages.patch $(QUIET)patch -b -p0 -d $(JS_SRC) < js-no-rwx-pages.patch
$(QUIET)patch -b -p0 -d $(JS_SRC) < js-darwin-configure.patch
-$(QUIET)cd $(JS_SRC)/js-1.8.5/js/src && autoconf-2.13 -$(QUIET)cd $(JS_SRC)/js-1.8.5/js/src && autoconf-2.13
$(QUIET)cd $(JS_SRC)/js-1.8.5/js/src && env $(JS_CONFIGURE_ENV) ./configure $(JS_CONFIGURE_ARGS) $(QUIET)cd $(JS_SRC)/js-1.8.5/js/src && env $(JS_CONFIGURE_ENV) ./configure $(JS_CONFIGURE_ARGS)
ifdef VERBOSE ifdef VERBOSE
......
--- js-1.8.5/js/src/configure.orig 2024-03-16 21:46:17
+++ js-1.8.5/js/src/configure 2024-03-16 21:47:48
@@ -953,8 +953,8 @@
if test -z "$MIDL"; then MIDL=midl; fi
;;
*-darwin*)
- if test -z "$CC"; then CC=gcc-4.2; fi
- if test -z "$CXX"; then CXX=g++-4.2; fi
+ if test -z "$CC"; then CC=cc; fi
+ if test -z "$CXX"; then CXX=c++; fi
;;
esac
fi
--- js-1.8.5/js/src/configure.in.orig 2024-03-16 23:06:25
+++ js-1.8.5/js/src/configure.in 2024-03-16 23:06:47
@@ -196,8 +196,8 @@
if test -z "$MIDL"; then MIDL=midl; fi
;;
*-darwin*)
- if test -z "$CC"; then CC=gcc-4.2; fi
- if test -z "$CXX"; then CXX=g++-4.2; fi
+ if test -z "$CC"; then CC=cc; fi
+ if test -z "$CXX"; then CXX=c++; fi
;;
esac
fi
...@@ -247,9 +247,7 @@ endif ...@@ -247,9 +247,7 @@ endif
os := $(shell echo $(os) | tr '[A-Z]' '[a-z]' | tr ' ' '_') os := $(shell echo $(os) | tr '[A-Z]' '[a-z]' | tr ' ' '_')
ifndef win ifndef win
ifneq ($(os),darwin) CFLAGS += -DPREFER_POLL
CFLAGS += -DPREFER_POLL
endif
machine_uname := $(shell if uname -m | egrep -v "(i[3456789]*|x)86" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; fi) machine_uname := $(shell if uname -m | egrep -v "(i[3456789]*|x)86" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; fi)
machine_uname := $(shell if uname -m | egrep "64" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; else echo $(machine_uname) ; fi) machine_uname := $(shell if uname -m | egrep "64" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; else echo $(machine_uname) ; fi)
endif endif
...@@ -467,6 +465,9 @@ SFTP_SRC := $(SRC_ROOT)$(DIRSEP)sftp ...@@ -467,6 +465,9 @@ SFTP_SRC := $(SRC_ROOT)$(DIRSEP)sftp
# SDL ciolib enabled by default for the moment. # SDL ciolib enabled by default for the moment.
ifndef WITHOUT_SDL ifndef WITHOUT_SDL
USE_SDL := 1 USE_SDL := 1
ifeq ($(os),darwin)
USE_SDL_AUDIO := 1
endif
endif endif
# Pull in lib-specific flags # Pull in lib-specific flags
......
...@@ -51,9 +51,9 @@ UTIL_LIBS += $(HASH_LIBS) ...@@ -51,9 +51,9 @@ UTIL_LIBS += $(HASH_LIBS)
ifndef win ifndef win
ifndef bcc ifndef bcc
ifneq ($(os),sunos) ifneq ($(os),sunos)
LDFLAGS += -lutil LDFLAGS += -lutil
endif endif
endif endif
endif endif
...@@ -110,7 +110,7 @@ ifeq ($(shell pkg-config libarchive --exists && echo "yes"),yes) ...@@ -110,7 +110,7 @@ ifeq ($(shell pkg-config libarchive --exists && echo "yes"),yes)
else else
ifeq ($(os), darwin) ifeq ($(os), darwin)
CFLAGS += -I/usr/local/opt/libarchive/include CFLAGS += -I/usr/local/opt/libarchive/include
CFLAGS += -L/usr/local/opt/libarchive/lib LDFLAGS += -L/usr/local/opt/libarchive/lib
endif endif
FILE_LIBS = -larchive FILE_LIBS = -larchive
endif endif
...@@ -135,25 +135,22 @@ ifndef NO_LD_RUN_PATH ...@@ -135,25 +135,22 @@ ifndef NO_LD_RUN_PATH
endif endif
export LD_RUN_PATH export LD_RUN_PATH
ifeq ($(CCPRE),clang) ifeq ($(CCPRE),clang)
LDFLAGS += -rpath $(LD_RUN_PATH) # TODO Darwin needs to post-process with install_name_tool
ifneq ($(os),darwin)
LDFLAGS += -rpath $(LD_RUN_PATH)
endif
endif endif
endif endif
CON_LIBS += -lsbbs -lftpsrvr -lwebsrvr -lmailsrvr -lservices CON_LIBS += -lsbbs -lftpsrvr -lwebsrvr -lmailsrvr -lservices
SHLIBOPTS := -shared SHLIBOPTS := -shared
ifeq ($(os),darwin) ifeq ($(os),sunos)
MKSHLIB := libtool -dynamic -framework System -lcc_dynamic MKSHLIB := /usr/ccs/bin/ld -G
MKSHPPLIB := libtool -dynamic -framework System -lcc_dynamic -lstdc++ MKSHPPLIB := /usr/ccs/bin/ld -G
SHLIBOPTS := SHLIBOPTS :=
else else
ifeq ($(os),sunos) MKSHLIB := $(CC)
MKSHLIB := /usr/ccs/bin/ld -G MKSHPPLIB := $(CXX)
MKSHPPLIB := /usr/ccs/bin/ld -G
SHLIBOPTS :=
else
MKSHLIB := $(CC)
MKSHPPLIB := $(CXX)
endif
endif endif
CFLAGS += $(JS_CFLAGS) $(CRYPT_CFLAGS) $(UIFC-MT_CFLAGS) $(XPDEV-MT_CFLAGS) $(SMBLIB_CFLAGS) $(CIOLIB-MT_CFLAGS) $(ENCODE_CFLAGS) $(HASH_CFLAGS) CFLAGS += $(JS_CFLAGS) $(CRYPT_CFLAGS) $(UIFC-MT_CFLAGS) $(XPDEV-MT_CFLAGS) $(SMBLIB_CFLAGS) $(CIOLIB-MT_CFLAGS) $(ENCODE_CFLAGS) $(HASH_CFLAGS)
...@@ -167,6 +164,9 @@ OBJS += $(MTOBJODIR)/comio_nix$(OFILE) ...@@ -167,6 +164,9 @@ OBJS += $(MTOBJODIR)/comio_nix$(OFILE)
JSDOOR_OBJS += $(MTOBJODIR)/comio_nix$(OFILE) JSDOOR_OBJS += $(MTOBJODIR)/comio_nix$(OFILE)
endif endif
LDFLAGS += $(UIFC-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS) $(SMBLIB_LDFLAGS) $(ENCODE_LDFLAGS) $(HASH_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(JS_LDFLAGS) $(CRYPT_LDFLAGS) $(SFTP-MT_LDFLAGS) LDFLAGS += $(UIFC-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS) $(SMBLIB_LDFLAGS) $(ENCODE_LDFLAGS) $(HASH_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(JS_LDFLAGS) $(CRYPT_LDFLAGS) $(SFTP-MT_LDFLAGS)
ifneq ($(os),darwin)
SBBS_EXTRA_LDFLAGS += -Wl,--version-script=sbbs.version
endif
# Synchronet BBS library Link Rule # Synchronet BBS library Link Rule
$(SBBS): $(JS_DEPS) $(CRYPT_DEPS) $(OBJS) $(LIBS) $(EXTRA_SBBS_DEPENDS) $(ENCODE_LIB) $(HASH_LIB) $(SFTPLIB-MT) | $(LIBODIR) $(SBBS): $(JS_DEPS) $(CRYPT_DEPS) $(OBJS) $(LIBS) $(EXTRA_SBBS_DEPENDS) $(ENCODE_LIB) $(HASH_LIB) $(SFTPLIB-MT) | $(LIBODIR)
......
...@@ -161,8 +161,6 @@ extern "C" { ...@@ -161,8 +161,6 @@ extern "C" {
#define PLATFORM_DESC "GNU/Hurd" #define PLATFORM_DESC "GNU/Hurd"
#elif defined(__QNX__) #elif defined(__QNX__)
#define PLATFORM_DESC "QNX" #define PLATFORM_DESC "QNX"
#elif defined(__unix__)
#define PLATFORM_DESC "Unix"
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include <TargetConditionals.h> #include <TargetConditionals.h>
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
...@@ -172,6 +170,8 @@ extern "C" { ...@@ -172,6 +170,8 @@ extern "C" {
#else #else
#define PLATFORM_DESC "Apple" #define PLATFORM_DESC "Apple"
#endif #endif
#elif defined(__unix__)
#define PLATFORM_DESC "Unix"
#elif defined(__HAIKU__) #elif defined(__HAIKU__)
#define PLATFORM_DESC "Haiku" #define PLATFORM_DESC "Haiku"
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment