Skip to content

Commit

Permalink
Add experimental builds for Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Oct 23, 2023
1 parent 650568a commit 05acd81
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ jobs:
# These names are used in conditional statements below.
java: [ 8, 11, 17, 21 ]
experimental: [false]
include:
- java: 21
os: macos-13-arm64
experimental: true
- java: 21
os: macos-13-arm64
experimental: true
- java: 21
os: macos-13-arm64
experimental: true
# include:
# - java: 22-ea
# os: ubuntu-20.04
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ mac32:
mac64:
$(MAKE) native OS_NAME=Mac OS_ARCH=x86_64

macArm64:
$(MAKE) native OS_NAME=Mac OS_ARCH=arm64-apple-macos11

linux32:
$(MAKE) native OS_NAME=Linux OS_ARCH=x86

Expand Down
12 changes: 11 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif

# os=Default is meant to be generic Unix/Linux

known_os_archs := Linux-x86 Linux-x86_64 Linux-aarch64 Linux-arm Linux-armhf Linux-ppc Linux-ppc64 Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc64
known_os_archs := Linux-x86 Linux-x86_64 Linux-aarch64 Linux-arm Linux-armhf Linux-ppc Linux-ppc64 Mac-x86 Mac-x86_64 Mac-arm64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc64
os_arch := $(OS_NAME)-$(OS_ARCH)

ifeq (,$(findstring $(strip $(os_arch)),$(known_os_archs)))
Expand Down Expand Up @@ -209,6 +209,16 @@ Mac-x86_64_LIBNAME := libcommons-crypto.jnilib
Mac-x86_64_LIBNAME_OSSL3 := libcommons-crypto-ossl3.jnilib
Mac-x86_64_COMMONS_CRYPTO_FLAGS :=

Mac-arm64_CC := gcc -arch $(OS_ARCH)
Mac-arm64_CXX := gcc -arch $(OS_ARCH)
Mac-arm64_STRIP := strip -x
Mac-arm64_CFLAGS := -Ilib/inc_mac -I"$(JAVA_HOME)/include" -O2 -fPIC -mmacosx-version-min=11.0 -fvisibility=hidden -I/usr/local/include -I/usr/local/opt/openssl/include
Mac-arm64_CXXFLAGS := -Ilib/inc_mac -I"$(JAVA_HOME)/include" -O2 -fPIC -mmacosx-version-min=11.0 -fvisibility=hidden -I/usr/local/include -I/usr/local/opt/openssl/include
Mac-arm64_LINKFLAGS := -dynamiclib -L/usr/local/lib
Mac-arm64_LIBNAME := libcommons-crypto.jnilib
Mac-arm64_LIBNAME_OSSL3 := libcommons-crypto-ossl3.jnilib
Mac-arm64_COMMONS_CRYPTO_FLAGS :=

FreeBSD-x86_64_CC := $(CROSS_PREFIX)gcc
FreeBSD-x86_64_CXX := $(CROSS_PREFIX)g++
FreeBSD-x86_64_STRIP := $(CROSS_PREFIX)strip
Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The following provides more details on the included cryptographic software:
<commons.release.isDistModule>true</commons.release.isDistModule>
<jna.version>5.13.0</jna.version>

<!-- The property "target.name" is used to specify the ant target, The All target will use
<!-- The property "target.name" is used to specify the ant target, The "all" target will use
OsInfo.java to detect the OS info and arch to generate the native binary for detected platform.
User is able to specify the platform by maven profiles.-->
<target.name>all</target.name>
Expand Down Expand Up @@ -291,6 +291,12 @@ The following provides more details on the included cryptographic software:
<target.name>mac64</target.name>
</properties>
</profile>
<profile>
<id>macArm64</id>
<properties>
<target.name>macArm64</target.name>
</properties>
</profile>
<profile>
<id>linux32</id>
<properties>
Expand Down

0 comments on commit 05acd81

Please sign in to comment.