[Git][NTPsec/ntpsec][master] Fix the check for building without OpenSSL's libssl

Hal Murray gitlab at mg.gitlab.com
Wed May 6 09:29:28 UTC 2020



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
bd9de8ca by Matt Selsky at 2020-05-06T03:51:10-04:00
Fix the check for building without OpenSSL's libssl

The "if" statement never evaluated to True, even if you attempted to disable
NTS since the flag wasn't set until line 743/744 in the "configure" function.

Also, there's no need to conditionalize the "use" parameters. If the library
doesn't exist, the variables aren't set.

- - - - -


3 changed files:

- libntp/wscript
- ntpd/wscript
- wscript


Changes:

=====================================
libntp/wscript
=====================================
@@ -38,18 +38,13 @@ def build(ctx):
     if not ctx.env.HAVE_STRLCAT or not ctx.env.HAVE_STRLCPY:
         libntp_source_sharable += ["strl_obsd.c"]
 
-    if ctx.env.DISABLE_NTS:
-      useSSL = ""
-    else:
-      useSSL = "SSL"
-
     # C library
     ctx(
         features="c cstlib",
         includes=[ctx.bldnode.parent.abspath(), "../include"],
         source=libntp_source + libntp_source_sharable,
         target="ntp",
-        use="%s CRYPTO" % useSSL,
+        use="CRYPTO SSL",
     )
 
     # Loadable Python extension


=====================================
ntpd/wscript
=====================================
@@ -121,11 +121,6 @@ def build(ctx):
         ctx.bldnode.parent.find_node("host/ntpd/ntp_parser.tab.c")
     ]
 
-    if ctx.env.DISABLE_NTS:
-      useSSL = ""
-    else:
-      useSSL = "SSL"
-
     ctx(
         features="c rtems_trace cprogram",
         includes=[
@@ -135,7 +130,7 @@ def build(ctx):
         source=ntpd_source,
         target="ntpd",
         use="libntpd_obj ntp M parse RT CAP SECCOMP PTHREAD NTPD "
-            "%s CRYPTO DNS_SD %s SOCKET NSL SCF" % (useSSL, use_refclock),
+            "CRYPTO SSL DNS_SD %s SOCKET NSL SCF" % use_refclock,
     )
 
     ctx.manpage(8, "ntpd-man.adoc")


=====================================
wscript
=====================================
@@ -579,7 +579,7 @@ int main(int argc, char **argv) {
     for header, sizeof in sorted(sizeofs, key=lambda x: x[1:]):
         check_sizeof(ctx, header, sizeof)
 
-    if not ctx.env.DISABLE_NTS:
+    if not ctx.options.disable_nts:
         # Check via pkg-config first, then fall back to a direct search
         if not ctx.check_cfg(
             package='libssl', uselib_store='SSL',
@@ -588,7 +588,7 @@ int main(int argc, char **argv) {
             define_name='', mandatory=False,
         ):
             ctx.check_cc(msg="Checking for OpenSSL's ssl library",
-                     lib="ssl", mandatory=True)
+                         lib="ssl", mandatory=True)
 
     # Check via pkg-config first, then fall back to a direct search
     if not ctx.check_cfg(



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

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/bd9de8cac198031950e19cf1f3216fa815bb77ef
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/20200506/1c9a17ce/attachment-0001.htm>


More information about the vc mailing list