Skip to content

Commit 3a82924

Browse files
committed
Fix static build on macOS
The build tag `openssl_static` does not produce a binary with static linked libcrypto and libssl. The patch fixes it. Related to tarantool/tt#308
1 parent d93c1ef commit 3a82924

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package openssl
1919

2020
// #cgo linux windows freebsd openbsd solaris pkg-config: libssl libcrypto
2121
// #cgo linux freebsd openbsd solaris CFLAGS: -Wno-deprecated-declarations
22-
// #cgo darwin CFLAGS: -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/openssl/include -Wno-deprecated-declarations
23-
// #cgo darwin LDFLAGS: -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/openssl/lib -lssl -lcrypto
22+
// #cgo darwin CFLAGS: -I/usr/local/opt/openssl/include -Wno-deprecated-declarations
23+
// #cgo darwin LDFLAGS: -L/usr/local/opt/openssl/lib -lssl -lcrypto
2424
// #cgo windows CFLAGS: -DWIN32_LEAN_AND_MEAN
2525
import "C"

build_static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package openssl
1919

2020
// #cgo linux windows freebsd openbsd solaris pkg-config: --static libssl libcrypto
2121
// #cgo linux freebsd openbsd solaris CFLAGS: -Wno-deprecated-declarations
22-
// #cgo darwin CFLAGS: -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/openssl/include -Wno-deprecated-declarations
23-
// #cgo darwin LDFLAGS: -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/openssl/lib -lssl -lcrypto
22+
// #cgo darwin CFLAGS: -I/usr/local/opt/openssl/include -Wno-deprecated-declarations
23+
// #cgo darwin LDFLAGS: /usr/local/opt/openssl/lib/libcrypto.a /usr/local/opt/openssl/lib/libssl.a
2424
// #cgo windows CFLAGS: -DWIN32_LEAN_AND_MEAN
2525
import "C"

0 commit comments

Comments
 (0)