summaryrefslogtreecommitdiffstats
path: root/os2/backwardify.pl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-11-28 14:51:30 +0000
committerRichard Levitte <levitte@openssl.org>2003-11-28 14:51:30 +0000
commit0b352c58db9f8d081c3abff6112e3b0c63a2b7b9 (patch)
tree98b5a0a9d9be1dc28574a22449151488bc5bb8d5 /os2/backwardify.pl
parent03ddbdd9b99ea60d0967b831ffc1fe93ae7f9792 (diff)
Make a number of changes to the OS/2 build. Submitter's comment below.
PR: 732 Submitted by: Ilya Zakharevich <nospam-abuse@ilyaz.org> Submitter's comment: This patch: a) Introduces a new file os2/backwardify.pl. b) Introduces a new mk1mf.pl variable $preamble. As you can see, it may be used also to move some OS-specific code to VC-CE too (the the first chunk of the patch); c) The DESCRIPTION specifier of the .def file is made more informative: now it contains the version number too. On OS/2 it is made conformant to OS/2 conventions; in particular, when one runs the standard command BLDLEVEL this.DLL one can see: Vendor: www.openssl.org/ Revision: 0.9.7c Description: OpenSSL: implementation of Secure Socket Layer; DLL for library crypto. Build for EMX -Zmtd [I did not make Win32 descriptions as informative as this - I'm afraid to break something. Be welcome to fix this.] d) On OS/2 the generated DLL was hardly usable (it had a shared initialized data segment). e) On OS/2 the generated DLLs had names like ssl.dll. However, DLL names on OS/2 are "global data". It is hard to have several DLLs with the same name on the system. Thus this precluded coexistence of OpenSSL with DLLs for other SLL implementations - or other name clashes. I transparently changed the names of the DLLs to open_ssl.dll and cryptssl.dll. f) The file added in (a) is used to create "forwarder" DLLs, so the applications expecting the "old" DLL names may use the new DLLs transparently. (A presence of these DLLs on the system nullifies (e), but makes old applications work. This is a stopgap measure until the old applications are relinked. Systems with no old applications do not need these DLLs, so may enjoy all the benefits of (e).) The new DLLs are placed in os2/ and os2/noname subdirectories. g) The makefiles created with os2/OS2-EMX.cmd did not work (some mysterious meaningless failures). The change to util/pl/OS2-EMX.pl uses the variable introduced in (b) to switch the Makefiles to SHELL=sh syntax. All these backslashes are removed, and the generated Makefiles started to work. h) Running os2/OS2-EMX.cmd now prints out what to do next.
Diffstat (limited to 'os2/backwardify.pl')
-rw-r--r--os2/backwardify.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/os2/backwardify.pl b/os2/backwardify.pl
new file mode 100644
index 0000000000..272423c8fa
--- /dev/null
+++ b/os2/backwardify.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/perl -w
+use strict;
+
+# Use as $0
+# Use as $0 -noname
+
+my $did_library;
+my $did_description;
+my $do_exports;
+my @imports;
+my $noname = (@ARGV and $ARGV[0] eq '-noname' and shift);
+while (<>) {
+ unless ($did_library) {
+ s/\b(cryptssl)\b/crypto/ and $did_library = $1 if /^LIBRARY\s+cryptssl\b/;
+ s/\b(open_ssl)\b/ssl/ and $did_library = $1 if /^LIBRARY\s+open_ssl\b/;
+ }
+ unless ($did_description) {
+ s&^(DESCRIPTION\s+(['"])).*&${1}\@#www.openssl.org/:#\@forwarder DLL for pre-0.9.7c+ OpenSSL to the new dll naming scheme$2& and $did_description++;
+ }
+ if ($do_exports) {{
+ last unless /\S/;
+ warn, last unless /^ \s* ( \w+ ) \s+ \@(\d+)\s*$/x;
+ push @imports, [$1, $2];
+ s/$/ NONAME/ if $noname;
+ }}
+ $do_exports++ if not $do_exports and /^EXPORTS/;
+ print $_;
+}
+print "IMPORTS\n";
+for my $imp (@imports) {
+ print "\t$imp->[0]=$did_library.$imp->[1]\n";
+}