[Git][NTPsec/ntpsec][master] Print 'LibSSL version' as "Libname version" sans quotes.

Hal Murray (@hal.murray) gitlab at mg.gitlab.com
Fri Apr 14 01:08:51 UTC 2023



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
7743d221 by James Browning at 2023-04-13T14:42:00-07:00
Print 'LibSSL version' as "Libname version" sans quotes.

If openssl/opensslv.h is not present print 
"something not_OpenSSL_or_LibreSSL"
- - - - -


2 changed files:

- wafhelpers/openssl.py
- wscript


Changes:

=====================================
wafhelpers/openssl.py
=====================================
@@ -42,7 +42,11 @@ def check_openssl_bad_version(ctx):
 
 SNIP_OPENSSL_DUMP_VERSION = """
 #include <stdio.h>
+#ifdef HAVE_OPENSSL_OPENSSLV_H
 #include <openssl/opensslv.h>
+#else
+#define OPENSSL_VERSION_TEXT "something not_OpenSSL_or_LibreSSL something"
+#endif // HAVE_OPENSSL_OPENSSLV_H
 
 int main(void) {
   printf("%s\\n", OPENSSL_VERSION_TEXT);
@@ -53,12 +57,16 @@ int main(void) {
 
 def dump_openssl_version(ctx):
     _ = "XXX_LIBSSL_VERSION"
-    ctx.start_msg("OpenSSL version")
-    ctx.check_cc(
+    ctx.start_msg("LibSSL version")
+    ret = ctx.check_cc(
         fragment=SNIP_OPENSSL_DUMP_VERSION,
         execute=True,
         define_ret=True,
         define_name=_,
+        mandatory=False,
     )
-    ctx.end_msg(ctx.get_define(_).split()[1])
-    ctx.undefine(_)
+    if ret:
+        ctx.end_msg(' '.join(ctx.get_define(_).split()[0:2])[1:])
+        ctx.undefine(_)
+    else:
+        ctx.end_msg("Failed")


=====================================
wscript
=====================================
@@ -720,6 +720,7 @@ int main(int argc, char **argv) {
         "linux/serial.h",
         "net/if6.h",
         ("net/route.h", ["sys/types.h", "sys/socket.h", "net/if.h"]),
+        "openssl/opensslv.h",  # just for wafhelper OpenSSL 
         "priv.h",           # Solaris
         "stdatomic.h",
         "sys/clockctl.h",   # NetBSD



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/7743d221343e69e469c895777998cef6074c8a43

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/7743d221343e69e469c895777998cef6074c8a43
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20230414/26885176/attachment-0001.htm>


More information about the vc mailing list