mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 00:26:16 +03:00
Check if the user is on ARM64, add target to CFLAGS/LDFLAGS
This commit is contained in:
19
Makefile
19
Makefile
@@ -33,4 +33,23 @@ distclean:
|
|||||||
$(MAKE) $(SELECTOR) -C src distclean
|
$(MAKE) $(SELECTOR) -C src distclean
|
||||||
$(MAKE) $(SELECTOR) -C test distclean
|
$(MAKE) $(SELECTOR) -C test distclean
|
||||||
|
|
||||||
|
macarm64:
|
||||||
|
$(MAKE) $(SELECTOR) -C src clean
|
||||||
|
$(MAKE) $(SELECTOR) -C src distclean
|
||||||
|
$(MAKE) $(SELECTOR) -C src all
|
||||||
|
# $(MAKE) $(SELECTOR) -C test all
|
||||||
|
# $(MAKE) $(SELECTOR) -C test distclean
|
||||||
|
$(MAKE) $(SELECTOR) -C src install
|
||||||
|
$(MAKE) $(SELECTOR) -C man install
|
||||||
|
$(INSTALL) -dm0755 "${DESTDIR}${PREFIX}/share/doc/faketime/"
|
||||||
|
$(INSTALL) -m0644 README "${DESTDIR}${PREFIX}/share/doc/faketime/README"
|
||||||
|
$(INSTALL) -m0644 NEWS "${DESTDIR}${PREFIX}/share/doc/faketime/NEWS"
|
||||||
|
|
||||||
|
macarm64full:
|
||||||
|
$(MAKE) $(SELECTOR) -C src clean
|
||||||
|
$(MAKE) $(SELECTOR) -C src distclean
|
||||||
|
$(MAKE) $(SELECTOR) -C src all
|
||||||
|
$(MAKE) $(SELECTOR) -C test all
|
||||||
|
# $(MAKE) $(SELECTOR) -C test distclean
|
||||||
|
|
||||||
.PHONY: all test install uninstall clean distclean
|
.PHONY: all test install uninstall clean distclean
|
||||||
|
|||||||
@@ -58,6 +58,21 @@ PREFIX ?= /usr/local
|
|||||||
CFLAGS += -DFAKE_SLEEP -DFAKE_INTERNAL_CALLS -DPREFIX='"'${PREFIX}'"' $(FAKETIME_COMPILE_CFLAGS) -DMACOS_DYLD_INTERPOSE -DFAKE_SETTIME
|
CFLAGS += -DFAKE_SLEEP -DFAKE_INTERNAL_CALLS -DPREFIX='"'${PREFIX}'"' $(FAKETIME_COMPILE_CFLAGS) -DMACOS_DYLD_INTERPOSE -DFAKE_SETTIME
|
||||||
LIB_LDFLAGS += -dynamiclib -current_version 0.9.10 -compatibility_version 0.7
|
LIB_LDFLAGS += -dynamiclib -current_version 0.9.10 -compatibility_version 0.7
|
||||||
|
|
||||||
|
# ARM64 MacOS (M1/M2/M3/Apple Silicon/etc) processors require a target set as their current version, or they
|
||||||
|
# will receive the following error:
|
||||||
|
# dyld[6675]: terminating because inserted dylib '/usr/local/lib/faketime/libfaketime.1.dylib' could not be loaded: tried: '/usr/local/lib/faketime/libfaketime.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'arm64e')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/faketime/libfaketime.1.dylib' (no such file), '/usr/local/lib/faketime/libfaketime.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'arm64e'))
|
||||||
|
# dyld[6675]: tried: '/usr/local/lib/faketime/libfaketime.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'arm64e')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/faketime/libfaketime.1.dylib' (no such file), '/usr/local/lib/faketime/libfaketime.1.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'arm64e'))
|
||||||
|
# Outputs `arm64` on ARM64
|
||||||
|
OS := $(shell uname -m)
|
||||||
|
# Outputs a number, eg 14.4 for MacOS Sonoma 14.4
|
||||||
|
MACOS_PRODUCT_VERSION := $(shell sw_vers --productVersion | cut -d. -f1,2)
|
||||||
|
|
||||||
|
# Check if arm64 is in OS, if so, add the target
|
||||||
|
ifeq ($(OS),arm64)
|
||||||
|
CFLAGS += -target arm64e-apple-macos$(MACOS_PRODUCT_VERSION)
|
||||||
|
LIB_LDFLAGS += -target arm64e-apple-macos$(MACOS_PRODUCT_VERSION)
|
||||||
|
endif
|
||||||
|
|
||||||
SONAME = 1
|
SONAME = 1
|
||||||
LIBS = libfaketime.${SONAME}.dylib
|
LIBS = libfaketime.${SONAME}.dylib
|
||||||
BINS = faketime
|
BINS = faketime
|
||||||
|
|||||||
Reference in New Issue
Block a user