Make util/mkrc.pl location agnostic and adapt Makefile.shared
authorRichard Levitte <levitte@openssl.org>
Thu, 11 Feb 2016 11:59:33 +0000 (12:59 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 11 Feb 2016 16:08:38 +0000 (17:08 +0100)
With this, Cygwin and Mingw builds stand a much better chance to be
able to build outside of the source tree with the unified build.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Makefile.shared
util/mkrc.pl

index 29e180845a503753544c378033e7451d622423c9..26ea561a72a1bee40127fc9222bf768beba4d5c4 100644 (file)
@@ -308,7 +308,7 @@ link_a.cygwin:
                base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
        fi; \
        dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
                base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \
        fi; \
        dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
-       $(PERL) util/mkrc.pl $$dll_name | \
+       $(PERL) $(SRCDIR)/util/mkrc.pl $$dll_name | \
                $(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o; \
        extras="$$extras rc.o"; \
        ALLSYMSFLAGS='-Wl,--whole-archive'; \
                $(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o; \
        extras="$$extras rc.o"; \
        ALLSYMSFLAGS='-Wl,--whole-archive'; \
index e20a50283c21443f28e0565604151a7e3abaef08..8b74ff8adc5617dd55573105613358d523766702 100755 (executable)
@@ -1,6 +1,13 @@
 #!/bin/env perl
 #
 #!/bin/env perl
 #
-open FD,"include/openssl/opensslv.h";
+
+use lib ".";
+use configdata;
+use File::Spec::Functions;
+
+my $versionfile = catfile($config{sourcedir},"include/openssl/opensslv.h");
+
+open FD, $versionfile or die "Couldn't open include/openssl/opensslv.h: $!\n";
 while(<FD>) {
     if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
        $ver = hex($1);
 while(<FD>) {
     if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
        $ver = hex($1);