since newer autoconf detects linux-musl as separate, try to support it (#32)

* since newer autoconf detects linux-musl as separate, try to support it
This commit is contained in:
Riccardo 2022-12-04 23:14:34 +01:00 committed by GitHub
parent 13db21b769
commit 58d9d3a9e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -1169,6 +1169,13 @@ elif test "$host_os" = linux-gnu; then
LIBS="$OBJCRT"
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "config_thread.m"]])],[objc_threaded="works"],[objc_threaded=""],[objc_threaded="works"])
fi
elif test "$host_os" = linux-musl; then
LIBS="$OBJCRT -lpthread"
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "config_thread.m"]])],[objc_threaded="-lpthread"],[objc_threaded=""],[objc_threaded="-lpthread"])
if test x"$objc_threaded" = x""; then
LIBS="$OBJCRT"
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "config_thread.m"]])],[objc_threaded="works"],[objc_threaded=""],[objc_threaded="works"])
fi
elif test "`echo $host_os|sed 's/[[0-9]].*//'|sed s/elf//`" = freebsd; then
LIBS="-pthread $OBJCRT"
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "config_thread.m"]])],[objc_threaded="-pthread"],[objc_threaded=""],[objc_threaded="-pthread"])

View file

@ -24,6 +24,9 @@
# the 'shared' variable, because we have not set it up yet when this
# file is processed!
# variable to for all OSs treated as Linux and Linux-like
IS_LINUX = no
#
# Host and target specific settings
#
@ -497,12 +500,23 @@ endif
####################################################
#
# Linux ELF or GNU/Hurd
# Linux ELF with GNU or GNU/HURD
#
# The following ifeq matches both 'linux-gnu' (which is GNU/Linux ELF)
# and 'gnu0.3' (I've been told GNUSTEP_TARGET_OS is 'gnu0.3' on
# GNU/Hurd at the moment). We want the same code in both cases.
# GNU/Hurd at the moment).
# We treat GNU/HURD as GNU/Linux for now
ifeq ($(findstring gnu, $(GNUSTEP_TARGET_OS)), gnu)
IS_LINUX = yes
endif
# The following ifeq matches 'linux-musl' but does not re-match 'linux-gnu'
# We treat is as GNU/Linux
ifeq ($(findstring linux-musl, $(GNUSTEP_TARGET_OS)), linux-musl)
IS_LINUX = yes
endif
ifeq ($(IS_LINUX), yes)
HAVE_SHARED_LIBS = yes
SHARED_LIB_LINK_CMD = \
$(LD) $(SHARED_LD_PREFLAGS) -shared -Wl,-soname,$(LIB_LINK_SONAME_FILE) \