Skip to content

Commit

Permalink
auto/otel: don't look for OpenSSL on Darwin
Browse files Browse the repository at this point in the history
Rust code relies on macOS-provided frameworks for TLS.

Fixes: 9d3dcb8 ("otel: add build tooling to include otel code")
[ Tweaked subject prefix. Some minor tweaks for current changes. -
  Andrew ]
Signed-off-by: Andrew Clayton <[email protected]>
  • Loading branch information
thresheek authored and ac000 committed Jan 7, 2025
1 parent da91741 commit 6c005a0
Showing 1 changed file with 39 additions and 23 deletions.
62 changes: 39 additions & 23 deletions auto/otel
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,44 @@ if [ $NXT_OTEL = YES ]; then
fi
$echo "found"

$echo -n " - "

nxt_feature="OpenSSL library"
nxt_feature_name=NXT_HAVE_OTEL
nxt_feature_run=yes
nxt_feature_incs=
nxt_feature_libs="-lssl -lcrypto"
nxt_feature_test="#include <openssl/ssl.h>

int main(void) {
SSL_library_init();
return 0;
}"
. auto/feature

if [ ! $nxt_found = yes ]; then
$echo
$echo $0: error: OpenTelemetry support requires OpenSSL.
$echo
exit 1;
fi

NXT_OTEL_LIBS="-lssl -lcrypto"
case "$NXT_SYSTEM" in
Darwin)
NXT_OTEL_LIBS="-framework CoreFoundation -framework Security -framework SystemConfiguration"

cat << END >> $NXT_AUTO_CONFIG_H

#ifndef NXT_HAVE_OTEL
#define NXT_HAVE_OTEL 1
#endif

END
;;
*)

$echo -n " - "

nxt_feature="OpenSSL library"
nxt_feature_name=NXT_HAVE_OTEL
nxt_feature_run=yes
nxt_feature_incs=
nxt_feature_libs="-lssl -lcrypto"
nxt_feature_test="#include <openssl/ssl.h>

int main(void) {
SSL_library_init();
return 0;
}"
. auto/feature

if [ ! $nxt_found = yes ]; then
$echo
$echo $0: error: OpenTelemetry support requires OpenSSL.
$echo
exit 1;
fi

NXT_OTEL_LIBS="-lssl -lcrypto"
;;
esac

fi

0 comments on commit 6c005a0

Please sign in to comment.