From 6ad98b3ef0f9a7c88c2a370e9cd00836a5c8b9c9 Mon Sep 17 00:00:00 2001 From: Dmitry Moskowski Date: Sat, 20 Jul 2024 02:48:08 +0000 Subject: [PATCH] fix openssl linking for builds with --disable-shared --- src/build/build-bach.ss | 11 +++++++---- src/std/build-spec.ss | 8 ++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/build/build-bach.ss b/src/build/build-bach.ss index 18ac42a7d..bdefbd0ae 100644 --- a/src/build/build-bach.ss +++ b/src/build/build-bach.ss @@ -125,13 +125,15 @@ ["-e" include-gambit-sharp])) (output-bin (path-expand "gerbil" gerbil-bindir)) - (gerbil-shared? - (member "--enable-shared" (string-split (configure-command-string) #\'))) + (configure-flags (string-split (configure-command-string) #\')) + (gerbil-shared? (member "--enable-shared" configure-flags)) + (enable-openssl? (member "--enable-openssl" configure-flags)) (rpath-options (if gerbil-shared? [(string-append (cond-expand (darwin "-Wl,-rpath,") (else "-Wl,-rpath=")) gambit-libdir)] - []))) + [])) + (extra-ld-options (if enable-openssl? ["-lssl" "-lcrypto"] []))) (displayln "... link " output-bin) (invoke (gerbil-gsc) ["-link" "-o" bach-link-c @@ -153,7 +155,8 @@ bach-main-o bach-link-o "-L" gerbil-libdir "-lgambit" - default-ld-options ...]) + default-ld-options ... + extra-ld-options ...]) ;; clean up (delete-file bach-main-scm) (delete-file bach-link-c) diff --git a/src/std/build-spec.ss b/src/std/build-spec.ss index c2cd1ada8..c159d3ca3 100644 --- a/src/std/build-spec.ss +++ b/src/std/build-spec.ss @@ -208,18 +208,14 @@ '()) ;; :std/net "net/address" - ,(cond-expand - (darwin - `(gxc: "net/ssl/libssl" + (gxc: "net/ssl/libssl" "-cc-options" ,(cppflags "libssl" "") "-ld-options" ,(apply append-options (ldflags "libssl" "-lssl") (ldflags "libcrypto" "-lcrypto") (if (enable-shared?) [(string-append "-L" (gerbil-libdir)) "-lgambit"] - [])))) - (else `(gxc: "net/ssl/libssl" - "-ld-options" ,(ldflags "libssl" "-lssl")))) + []))) "net/ssl/error" "net/ssl/interface" "net/ssl/socket"