Skip to content

Commit

Permalink
fixes two issues for non-cmake builds on macOS:
Browse files Browse the repository at this point in the history
- adds CUSTOM_INCLUDEDIR and CUSTOM_LIBDIR params for specifying custom dependency paths
- removes unsupported --version-script=lib.lds, --no-undefined, -Bstatic and -Bdynamic linker flags

Signed-off-by: kozyilmaz <[email protected]>
  • Loading branch information
kozyilmaz committed May 20, 2024
1 parent 31e510b commit 88c4222
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Cpp_Files := cosigner/cosigner_exception.cpp cosigner/cmp_setup_service.cpp cosi

Cpp_Objects := $(Cpp_Files:.cpp=.o)

Include_Paths := -I. -I../../include
Include_Paths := -I. -I../../include -I$(CUSTOM_INCLUDEDIR)

C_Flags := $(COMMON_CFLAGS) -fstack-protector-strong
C_Flags += $(Include_Paths)
C_Flags += -Wno-unknown-pragmas

Cpp_Flags := $(C_Flags) -std=c++17 -Wno-overloaded-virtual

Link_Flags := $(COMMON_CFLAGS) -shared -Wl,--version-script=lib.lds -Wl,--no-undefined -Wl,-Bstatic -lcrypto -Wl,-Bdynamic -lpthread -ldl
Link_Flags := $(COMMON_CFLAGS) -shared -L$(CUSTOM_LIBDIR) -lcrypto -lpthread -ldl

Lib_Name := libcosigner.so

Expand Down
4 changes: 2 additions & 2 deletions test/cosigner/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
App_Name := test

App_C_Flags := -g -I../../include -DTEST_ONLY
App_C_Flags := -g -I../../include -I$(CUSTOM_INCLUDEDIR) -DTEST_ONLY
App_Cpp_Flags := $(App_C_Flags) -std=c++17
App_Link_Flags := -L../../src/common -lcosigner -Wl,-Bstatic -lcrypto -Wl,-Bdynamic -luuid -lsecp256k1 -pthread -ldl
App_Link_Flags := -L../../src/common -lcosigner -L$(CUSTOM_LIBDIR) -lcrypto -luuid -lsecp256k1 -pthread -ldl

App_Cpp_Files := $(wildcard ./*.cpp) ../tests_main.cpp
App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o)
Expand Down
4 changes: 2 additions & 2 deletions test/crypto/drng/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
App_Name := test

App_C_Flags := -g -Wall -Wextra -I../../../include
App_C_Flags := -g -Wall -Wextra -I../../../include -I$(CUSTOM_INCLUDEDIR)
App_Cpp_Flags := $(App_C_Flags) -std=c++17
App_Link_Flags := -lcrypto
App_Link_Flags := -L$(CUSTOM_LIBDIR) -lcrypto

all: $(App_Name)

Expand Down
4 changes: 2 additions & 2 deletions test/crypto/ed25519_algebra/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
App_Name := test

App_C_Flags := -g -Wall -Wextra -I../../../include
App_C_Flags := -g -Wall -Wextra -I../../../include -I$(CUSTOM_INCLUDEDIR)
App_Cpp_Flags := $(App_C_Flags) -std=c++17
App_Link_Flags := -Wl,-Bstatic -lcrypto -Wl,-Bdynamic -pthread -ldl
App_Link_Flags := -L$(CUSTOM_LIBDIR) -lcrypto -pthread -ldl

all: $(App_Name)

Expand Down
4 changes: 2 additions & 2 deletions test/crypto/paillier/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
App_Name := test

App_C_Flags := -g -Wall -Wextra -I../../../include
App_C_Flags := -g -Wall -Wextra -I../../../include -I$(CUSTOM_INCLUDEDIR)
App_Cpp_Flags := $(App_C_Flags) -std=c++17
App_Link_Flags := -lcrypto
App_Link_Flags := -L$(CUSTOM_LIBDIR) -lcrypto

all: $(App_Name)

Expand Down
4 changes: 2 additions & 2 deletions test/crypto/secp256k1_algebra/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
App_Name := test

App_C_Flags := -g -Wall -Wextra -I../../../include
App_C_Flags := -g -Wall -Wextra -I../../../include -I$(CUSTOM_INCLUDEDIR)
App_Cpp_Flags := $(App_C_Flags) -std=c++17
App_Link_Flags := -lcrypto
App_Link_Flags := -L$(CUSTOM_LIBDIR) -lcrypto

all: $(App_Name)

Expand Down
4 changes: 2 additions & 2 deletions test/crypto/shamir_secret_sharing/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
App_Name := test

App_C_Flags := -g -Wall -Wextra -I../../../include
App_C_Flags := -g -Wall -Wextra -I../../../include -I$(CUSTOM_INCLUDEDIR)
App_Cpp_Flags := $(App_C_Flags) -std=c++17
App_Link_Flags := -Wl,-Bstatic -lcrypto -Wl,-Bdynamic -pthread -ldl
App_Link_Flags := -L$(CUSTOM_LIBDIR) -lcrypto -pthread -ldl

all: $(App_Name)

Expand Down
4 changes: 2 additions & 2 deletions test/crypto/zero_knowledge_proof/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
App_Name := test

App_C_Flags := -g -O0 -Wall -Wextra -I../../../include
App_C_Flags := -g -O0 -Wall -Wextra -I../../../include -I$(CUSTOM_INCLUDEDIR)
App_Cpp_Flags := $(App_C_Flags) -std=c++17
App_Link_Flags := -Wl,-Bstatic -lcrypto -Wl,-Bdynamic -ldl -pthread
App_Link_Flags := -L$(CUSTOM_LIBDIR) -lcrypto -ldl -pthread

all: $(App_Name)

Expand Down

0 comments on commit 88c4222

Please sign in to comment.