mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
Add ability to compile on iOS
This commit is contained in:
parent
043ff257c4
commit
9f87b6dd9c
6 changed files with 40 additions and 4 deletions
|
@ -75,7 +75,15 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(platform),Darwin)
|
ifeq ($(platform),Darwin)
|
||||||
|
ifeq ($(shell uname -p),arm64)
|
||||||
|
# The platform is iOS
|
||||||
|
USE_BREW ?= 0
|
||||||
|
# iOS refuses to compile unless this is set
|
||||||
|
export IPHONEOS_DEPLOYMENT_TARGET=11.0
|
||||||
|
else
|
||||||
|
# M* macOS devices return arm
|
||||||
USE_BREW ?= 1
|
USE_BREW ?= 1
|
||||||
|
endif
|
||||||
USE_MACPORTS ?= 0
|
USE_MACPORTS ?= 0
|
||||||
AR= /usr/bin/ar rcs
|
AR= /usr/bin/ar rcs
|
||||||
RANLIB= /usr/bin/ranlib
|
RANLIB= /usr/bin/ranlib
|
||||||
|
@ -132,6 +140,10 @@ ifeq ($(shell expr $(CC_VERSION) \>= 10), 1)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(platform),Darwin)
|
ifeq ($(platform),Darwin)
|
||||||
|
ifeq ($(shell uname -p),arm64)
|
||||||
|
# iOS will refuse to compile without the minimum target of iOS 11.0
|
||||||
|
DEFCFLAGS += -mios-version-min=11.0
|
||||||
|
endif
|
||||||
# their readline has strict-prototype issues
|
# their readline has strict-prototype issues
|
||||||
DEFCFLAGS += -Wno-strict-prototypes
|
DEFCFLAGS += -Wno-strict-prototypes
|
||||||
# some warnings about braced initializers on structs we want to ignore
|
# some warnings about braced initializers on structs we want to ignore
|
||||||
|
|
|
@ -380,7 +380,13 @@ message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
message(STATUS "Apple device detected.")
|
message(STATUS "Apple device detected.")
|
||||||
set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC})
|
set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC})
|
||||||
|
if (EXISTS /private/var/mobile)
|
||||||
|
message(STATUS "iOS detected.")
|
||||||
|
set(ADDITIONAL_LNK "-framework Foundation" "-framework UIKit")
|
||||||
|
else
|
||||||
|
message(STATUS "macOS detected.")
|
||||||
set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
|
set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
|
||||||
|
endif (EXISTS /private/var/mobile)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
||||||
|
|
|
@ -434,8 +434,14 @@ LDFLAGS += $(MYLDFLAGS)
|
||||||
|
|
||||||
PM3LDFLAGS = $(LDFLAGS)
|
PM3LDFLAGS = $(LDFLAGS)
|
||||||
ifeq ($(platform),Darwin)
|
ifeq ($(platform),Darwin)
|
||||||
|
ifeq ($(shell uname -p),arm64)
|
||||||
|
# The platform is iOS
|
||||||
|
PM3LDFLAGS += -framework Foundation -framework UIKit
|
||||||
|
else
|
||||||
|
# M* macOS devices return arm
|
||||||
PM3LDFLAGS += -framework Foundation -framework AppKit
|
PM3LDFLAGS += -framework Foundation -framework AppKit
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# printing status #
|
# printing status #
|
||||||
|
|
|
@ -22,6 +22,9 @@ endif
|
||||||
ifneq ($(findstring aarch64, $(cpu_arch)), )
|
ifneq ($(findstring aarch64, $(cpu_arch)), )
|
||||||
IS_SIMD_ARCH=arm64
|
IS_SIMD_ARCH=arm64
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(findstring iP, $(cpu_arch)), )
|
||||||
|
IS_SIMD_ARCH=arm64
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(IS_SIMD_ARCH), )
|
ifneq ($(IS_SIMD_ARCH), )
|
||||||
MULTIARCHSRCS = hardnested_bf_core.c hardnested_bitarray_core.c
|
MULTIARCHSRCS = hardnested_bf_core.c hardnested_bitarray_core.c
|
||||||
|
|
|
@ -380,7 +380,13 @@ message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
message(STATUS "Apple device detected.")
|
message(STATUS "Apple device detected.")
|
||||||
set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC})
|
set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC})
|
||||||
|
if (EXISTS /private/var/mobile)
|
||||||
|
message(STATUS "iOS detected.")
|
||||||
|
set(ADDITIONAL_LNK "-framework Foundation" "-framework UIKit")
|
||||||
|
else
|
||||||
|
message(STATUS "macOS detected.")
|
||||||
set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
|
set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
|
||||||
|
endif (EXISTS /private/var/mobile)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
||||||
|
|
|
@ -9,6 +9,9 @@ MYLDLIBS = -lcrypto
|
||||||
cpu_arch = $(shell uname -m)
|
cpu_arch = $(shell uname -m)
|
||||||
ifneq ($(findstring arm64, $(cpu_arch)), )
|
ifneq ($(findstring arm64, $(cpu_arch)), )
|
||||||
MYCFLAGS += -mcpu=native
|
MYCFLAGS += -mcpu=native
|
||||||
|
# iOS 'fun'
|
||||||
|
else ifneq ($(findstring iP, $(cpu_arch)), )
|
||||||
|
MYCFLAGS += -mcpu=native
|
||||||
else
|
else
|
||||||
MYCFLAGS += -march=native
|
MYCFLAGS += -march=native
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue