Compare commits

...

7 Commits

Author SHA1 Message Date
Casey Gardiner ac6b73317f
Merge pull request #6 from harmony-one/develop-darwin 2 years ago
Casey Gardiner 83e553ec4e Update openssl directory for m1/m2 chips 2 years ago
Ganesha Upadhyaya 99e9aa76e8
Merge pull request #5 from jamesrowe08/m1-fix 3 years ago
JamesRowe c3ad8adcb3 adding additional flags so make passes 3 years ago
JamesRowe 76447fd528 path changes 3 years ago
JamesRowe 149f3e577b more fixes 3 years ago
JamesRowe 270f9995b7 porting m1 changes 3 years ago
  1. 13
      Makefile
  2. 18
      common.mk

@ -78,6 +78,10 @@ ifneq ($(CPU),)
ASM_SRC=$(ASM_SRC_PATH_NAME).s
endif
ASM_OBJ=$(OBJ_DIR)/$(CPU).o
ifeq ($(OS),mac-m1)
ASM_SRC=src/base64.ll
ASM_OBJ=$(OBJ_DIR)/base64.o
endif
LIB_OBJ=$(OBJ_DIR)/fp.o
BN256_OBJ=$(OBJ_DIR)/bn_c256.o
BN384_OBJ=$(OBJ_DIR)/bn_c384.o
@ -135,6 +139,15 @@ ifneq ($(findstring $(OS),mac/mingw64),)
SHE384_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
SHE384_256_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
endif
ifneq ($(findstring $(OS),mac/mac-m1/mingw64),)
BN256_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
BN384_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
BN384_256_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
BN512_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
SHE256_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
SHE384_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
SHE384_256_SLIB_LDFLAGS+=-l$(MCL_SNAME) -L./lib
endif
ifeq ($(OS),mingw64)
MCL_SLIB_LDFLAGS+=-Wl,--out-implib,$(LIB_DIR)/lib$(MCL_SNAME).a
BN256_SLIB_LDFLAGS+=-Wl,--out-implib,$(LIB_DIR)/lib$(BN256_SNAME).a

@ -1,5 +1,6 @@
GCC_VER=$(shell $(PRE)$(CC) -dumpversion)
UNAME_S=$(shell uname -s)
ARCH?=$(shell uname -m)
ifeq ($(UNAME_S),Linux)
OS=Linux
endif
@ -11,19 +12,22 @@ ifeq ($(findstring CYGWIN,$(UNAME_S)),CYGWIN)
OS=cygwin
endif
ifeq ($(UNAME_S),Darwin)
OS=mac
ARCH=x86_64
ifeq ($(ARCH),x86_64)
OS=mac
GMP_DIR?=/usr/local/opt/gmp
else
OS=mac-m1
GMP_DIR?=/opt/homebrew/opt/gmp
endif
LIB_SUF=dylib
OPENSSL_DIR?=/usr/local/opt/openssl
OPENSSL_DIR?=/opt/homebrew/opt/openssl@1.1
CFLAGS+=-I$(OPENSSL_DIR)/include
LDFLAGS+=-L$(OPENSSL_DIR)/lib
GMP_DIR?=/usr/local/opt/gmp
CFLAGS+=-I$(GMP_DIR)/include
LDFLAGS+=-L$(GMP_DIR)/lib
else
LIB_SUF=so
endif
ARCH?=$(shell uname -m)
ifneq ($(findstring $(ARCH),x86_64/amd64),)
CPU=x86-64
INTEL=1
@ -47,11 +51,11 @@ ifeq ($(ARCH),armv7l)
BIT=32
#LOW_ASM_SRC=src/asm/low_arm.s
endif
ifeq ($(ARCH),aarch64)
ifneq ($(findstring $(ARCH),aarch64/arm64),)
CPU=aarch64
BIT=64
endif
ifeq ($(findstring $(OS),mac/mingw64),)
ifeq ($(findstring $(OS),mac/mac-m1/mingw64/openbsd),)
LDFLAGS+=-lrt
endif

Loading…
Cancel
Save