UI: fix uitest for VMS
authorRichard Levitte <levitte@openssl.org>
Thu, 12 Jan 2017 12:07:39 +0000 (13:07 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 12 Jan 2017 14:23:15 +0000 (15:23 +0100)
- On VMS, apps/apps.c depends on apps/vms_term_sock.c, so add it to
  the build
- On VMS, apps/*.c are compiled with default symbol settings,
  i.e. uppercased and truncated symbols, which differs from test
  programs.  Make sure uitest.c knows that with a few pragmas.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2218)

test/build.info
test/uitest.c

index eed8aa5fa79bfc9b60c69e82f96c2f4ddd31abcb..c11623894853db6e06837b8a63a2292cf804099f 100644 (file)
@@ -5,6 +5,9 @@
          my ($base, $files) = @_;
          return join(" ", map { "$base/$_" } split(/\s+/, $files));
      }
+     our $apps_extra =
+         $config{target} =~ /^vms-/ ? "../apps/vms_term_sock.c" : "";
+     ""
 -}
 IF[{- !$disabled{tests} -}]
   PROGRAMS_NO_INST=\
@@ -316,7 +319,8 @@ IF[{- !$disabled{tests} -}]
     DEPEND[cipher_overhead_test]=../libcrypto ../libssl
   ENDIF
 
-  SOURCE[uitest]=uitest.c testutil.c test_main_custom.c ../apps/apps.c ../apps/opt.c
+  SOURCE[uitest]=uitest.c testutil.c test_main_custom.c \
+    ../apps/apps.c ../apps/opt.c {- $apps_extra -}
   INCLUDE[uitest]=.. ../include
   DEPEND[uitest]=../libcrypto ../libssl
 
index 16d83b9528d6664c53a3592f6e7023146ac88681..0a7420d4d1ae0d8806af59c2ab128f858973c58b 100644 (file)
 #include <string.h>
 #include <openssl/opensslconf.h>
 #include <openssl/err.h>
+
+/*
+ * We know that on VMS, the [.apps] object files are compiled with uppercased
+ * symbols.  We must therefore follow suit, or there will be linking errors.
+ * Additionally, the VMS build does stdio via a socketpair.
+ */
+#ifdef __VMS
+# pragma names save
+# pragma names uppercase, truncated
+
+# include "../apps/vms_term_sock.h"
+#endif
+
 #include "../apps/apps.h"
 
+#ifdef __VMS
+# pragma names restore
+#endif
+
 #include "testutil.h"
 #include "test_main_custom.h"