Add support for shared_rcflag, useful for windres (Cygwin and Mingw)
authorRichard Levitte <levitte@openssl.org>
Fri, 5 Feb 2016 14:17:33 +0000 (15:17 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 11 Feb 2016 15:50:01 +0000 (16:50 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Configurations/00-base-templates.conf
Configurations/10-main.conf
Configure
Makefile.in
Makefile.shared

index 1771e3d3864cb626670ad8f6979c8468dd955be0..9d405efdae29088b9ad8eb33d9a004a96717cc27 100644 (file)
@@ -35,6 +35,7 @@
        shared_target   => "",
        shared_cflag    => "",
        shared_ldflag   => "",
+       shared_rcflag   => "",
        shared_extension        => "",
        build_scheme    => "unixmake",
        build_file      => "Makefile",
index c408763f66a4b34b55e73164479c0fcdf33f8e0b..07e1d6a208e10eb0e3034d37167e76f7bbb96894 100644 (file)
         shared_target    => "cygwin-shared",
         shared_cflag     => "-D_WINDLL -DOPENSSL_USE_APPLINK",
         shared_ldflag    => "-static-libgcc",
+        shared_rcflag    => "--target=pe-i386",
         shared_extension => ".dll",
     },
     "mingw64" => {
         shared_target    => "cygwin-shared",
         shared_cflag     => "-D_WINDLL",
         shared_ldflag    => "-static-libgcc",
+        shared_rcflag    => "--target=pe-x86-64",
         shared_extension => ".dll",
     },
 
index 722d7c1faf037affcabd8a03eb57f7e9d71b4a0b..d3800cbf77f469e97b83593c029c4beeea1e53ae 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -2180,6 +2180,7 @@ sub print_table_entry
        "shared_target",
        "shared_cflag",
        "shared_ldflag",
+       "shared_rcflag",
        "shared_extension",
        "obj_extension",
        "exe_extension",
index a1c3252bc0a09beb9839e74adb904acb60a9e3b4..b78804266320e5a60d35174b0c7d1ba32df2304e 100644 (file)
@@ -205,6 +205,7 @@ SHARED_LDFLAG={- $target{shared_ldflag}
                  # $prefix is not /usr.
                  . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
                     ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
+SHARED_RCFLAG={- $target{shared_rcflag} -}
 
 GENERAL=        Makefile
 BASENAME=       openssl
@@ -255,6 +256,7 @@ BUILDENV=   LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
                LIBDIR='$(LIBDIR)'                              \
                DEPFLAG='$(DEPFLAG)'                            \
                SHARED_LDFLAG='$(SHARED_LDFLAG)'                \
+               SHARED_RCFLAG='$(SHARED_RCFLAG)'                \
                ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)'     \
                EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)'       \
                SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
index a474f16916150c2e52e2b508e2d24acb32ce1024..29e180845a503753544c378033e7451d622423c9 100644 (file)
@@ -14,6 +14,10 @@ CFLAGS=$(CFLAG)
 LDFLAGS=$(LDFLAG)
 SHARED_LDFLAGS=$(SHARED_LDFLAG)
 
+# SHARED_RCFLAGS are flags used with windres, i.e. when build for Cygwin
+# or Mingw.
+SHARED_RCFLAGS=$(SHARED_RCFLAG)
+
 NM=nm
 
 # LIBNAME contains just the name of the library, without prefix ("lib"
@@ -305,7 +309,7 @@ link_a.cygwin:
        fi; \
        dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
        $(PERL) util/mkrc.pl $$dll_name | \
-               $(CROSS_COMPILE)windres -o rc.o; \
+               $(CROSS_COMPILE)windres $(SHARED_RCFLAGS) -o rc.o; \
        extras="$$extras rc.o"; \
        ALLSYMSFLAGS='-Wl,--whole-archive'; \
        NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \