Fossil SCM
For the MSVC makefile, fix forwarding of XPCFLAGS and XPLDFLAGS to OpenSSL. This is only relevant if the MSVC makefile is used to build OpenSSL as a sub-project (FOSSIL_BUILD_SSL=1) for Windows XP (FOSSIL_ENABLE_WINXP=1). XPLDFLAGS only matters for the shared library case (FOSSIL_DYNAMIC_BUILD=1), and is applied in a post build step -- somewhat whacky, but fixes the problem, and there's a lot of comments and diagnostic output to help with troubleshooting.
Commit
fa3f60f694918d87fe17f240cc0fcd5c2b1b4dc295b50e96fc9811d40ecde00b
Parent
b0834be5d024d2f…
4 files changed
+39
-6
+39
-6
+39
-6
+39
-6
+39
-6
| --- tools/makemake.tcl | ||
| +++ tools/makemake.tcl | ||
| @@ -1574,11 +1574,10 @@ | ||
| 1574 | 1574 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1575 | 1575 | SSLLIBDIR = $(SSLDIR) |
| 1576 | 1576 | !else |
| 1577 | 1577 | SSLLIBDIR = $(SSLDIR) |
| 1578 | 1578 | !endif |
| 1579 | -SSLLFLAGS = /nologo /opt:ref /debug | |
| 1580 | 1579 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 1581 | 1580 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1582 | 1581 | !message Using 'x64' platform for OpenSSL... |
| 1583 | 1582 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 1584 | 1583 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -1646,16 +1645,27 @@ | ||
| 1646 | 1645 | !endif |
| 1647 | 1646 | |
| 1648 | 1647 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1649 | 1648 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 1650 | 1649 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1650 | +# | |
| 1651 | +# NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and | |
| 1652 | +# explicit initialization is redundant, but is required for post-built edits. | |
| 1653 | +# | |
| 1651 | 1654 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1652 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 | |
| 1655 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 | |
| 1653 | 1656 | !else |
| 1654 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 | |
| 1657 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 | |
| 1655 | 1658 | !endif |
| 1656 | 1659 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1660 | +# | |
| 1661 | +# NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS | |
| 1662 | +# is applied in a separate post-build step, see below for more information. | |
| 1663 | +# | |
| 1664 | +!if $(FOSSIL_ENABLE_SSL)!=0 | |
| 1665 | +SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) | |
| 1666 | +!endif | |
| 1657 | 1667 | !endif |
| 1658 | 1668 | |
| 1659 | 1669 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1660 | 1670 | !if $(DEBUG)!=0 |
| 1661 | 1671 | CRTFLAGS = /MDd |
| @@ -1831,19 +1841,42 @@ | ||
| 1831 | 1841 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 1832 | 1842 | |
| 1833 | 1843 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1834 | 1844 | openssl: |
| 1835 | 1845 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 1846 | +!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 1847 | + @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... | |
| 1848 | +!endif | |
| 1836 | 1849 | !ifdef PERLDIR |
| 1837 | 1850 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 1838 | 1851 | !else |
| 1839 | 1852 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 1840 | 1853 | !endif |
| 1841 | -!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 1842 | - @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd | |
| 1843 | -!else | |
| 1844 | 1854 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 1855 | +!if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 | |
| 1856 | +# | |
| 1857 | +# NOTE: Appending custom linker flags to the OpenSSL default linker flags is | |
| 1858 | +# somewhat difficult, as summarized in this Fossil Forum post: | |
| 1859 | +# | |
| 1860 | +# https://fossil-scm.org/forum/forumpost/a9a2d6af28b | |
| 1861 | +# | |
| 1862 | +# Therefore the custom linker flags required for Windows XP dynamic builds are | |
| 1863 | +# applied in a separate post-build step. | |
| 1864 | +# | |
| 1865 | +# If the build stops here, or if the custom linker flags are outside the scope | |
| 1866 | +# of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking | |
| 1867 | +# the OpenSSL makefile by hand. | |
| 1868 | +# | |
| 1869 | +# Also note that this step changes the subsystem for the OpenSSL DLLs from | |
| 1870 | +# WINDOWS to CONSOLE, but which has no effect on DLLs. | |
| 1871 | +# | |
| 1872 | + @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... | |
| 1873 | + @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) <<<NEXT_LINE>>> | |
| 1874 | + do @( <<<NEXT_LINE>>> | |
| 1875 | + echo %F & <<<NEXT_LINE>>> | |
| 1876 | + link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 <<<NEXT_LINE>>> | |
| 1877 | + ) | |
| 1845 | 1878 | !endif |
| 1846 | 1879 | |
| 1847 | 1880 | clean-openssl: |
| 1848 | 1881 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 1849 | 1882 | !endif |
| 1850 | 1883 |
| --- tools/makemake.tcl | |
| +++ tools/makemake.tcl | |
| @@ -1574,11 +1574,10 @@ | |
| 1574 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1575 | SSLLIBDIR = $(SSLDIR) |
| 1576 | !else |
| 1577 | SSLLIBDIR = $(SSLDIR) |
| 1578 | !endif |
| 1579 | SSLLFLAGS = /nologo /opt:ref /debug |
| 1580 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 1581 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1582 | !message Using 'x64' platform for OpenSSL... |
| 1583 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 1584 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -1646,16 +1645,27 @@ | |
| 1646 | !endif |
| 1647 | |
| 1648 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1649 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 1650 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1651 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1652 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 |
| 1653 | !else |
| 1654 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 |
| 1655 | !endif |
| 1656 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1657 | !endif |
| 1658 | |
| 1659 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1660 | !if $(DEBUG)!=0 |
| 1661 | CRTFLAGS = /MDd |
| @@ -1831,19 +1841,42 @@ | |
| 1831 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 1832 | |
| 1833 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1834 | openssl: |
| 1835 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 1836 | !ifdef PERLDIR |
| 1837 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 1838 | !else |
| 1839 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 1840 | !endif |
| 1841 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1842 | @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd |
| 1843 | !else |
| 1844 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 1845 | !endif |
| 1846 | |
| 1847 | clean-openssl: |
| 1848 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 1849 | !endif |
| 1850 |
| --- tools/makemake.tcl | |
| +++ tools/makemake.tcl | |
| @@ -1574,11 +1574,10 @@ | |
| 1574 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1575 | SSLLIBDIR = $(SSLDIR) |
| 1576 | !else |
| 1577 | SSLLIBDIR = $(SSLDIR) |
| 1578 | !endif |
| 1579 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 1580 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1581 | !message Using 'x64' platform for OpenSSL... |
| 1582 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 1583 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -1646,16 +1645,27 @@ | |
| 1645 | !endif |
| 1646 | |
| 1647 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1648 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 1649 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1650 | # |
| 1651 | # NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and |
| 1652 | # explicit initialization is redundant, but is required for post-built edits. |
| 1653 | # |
| 1654 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1655 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 |
| 1656 | !else |
| 1657 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 |
| 1658 | !endif |
| 1659 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1660 | # |
| 1661 | # NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS |
| 1662 | # is applied in a separate post-build step, see below for more information. |
| 1663 | # |
| 1664 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1665 | SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) |
| 1666 | !endif |
| 1667 | !endif |
| 1668 | |
| 1669 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1670 | !if $(DEBUG)!=0 |
| 1671 | CRTFLAGS = /MDd |
| @@ -1831,19 +1841,42 @@ | |
| 1841 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 1842 | |
| 1843 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1844 | openssl: |
| 1845 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 1846 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1847 | @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... |
| 1848 | !endif |
| 1849 | !ifdef PERLDIR |
| 1850 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 1851 | !else |
| 1852 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 1853 | !endif |
| 1854 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 1855 | !if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1856 | # |
| 1857 | # NOTE: Appending custom linker flags to the OpenSSL default linker flags is |
| 1858 | # somewhat difficult, as summarized in this Fossil Forum post: |
| 1859 | # |
| 1860 | # https://fossil-scm.org/forum/forumpost/a9a2d6af28b |
| 1861 | # |
| 1862 | # Therefore the custom linker flags required for Windows XP dynamic builds are |
| 1863 | # applied in a separate post-build step. |
| 1864 | # |
| 1865 | # If the build stops here, or if the custom linker flags are outside the scope |
| 1866 | # of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking |
| 1867 | # the OpenSSL makefile by hand. |
| 1868 | # |
| 1869 | # Also note that this step changes the subsystem for the OpenSSL DLLs from |
| 1870 | # WINDOWS to CONSOLE, but which has no effect on DLLs. |
| 1871 | # |
| 1872 | @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... |
| 1873 | @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) <<<NEXT_LINE>>> |
| 1874 | do @( <<<NEXT_LINE>>> |
| 1875 | echo %F & <<<NEXT_LINE>>> |
| 1876 | link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 <<<NEXT_LINE>>> |
| 1877 | ) |
| 1878 | !endif |
| 1879 | |
| 1880 | clean-openssl: |
| 1881 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 1882 | !endif |
| 1883 |
+39
-6
| --- tools/makemake.tcl | ||
| +++ tools/makemake.tcl | ||
| @@ -1574,11 +1574,10 @@ | ||
| 1574 | 1574 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1575 | 1575 | SSLLIBDIR = $(SSLDIR) |
| 1576 | 1576 | !else |
| 1577 | 1577 | SSLLIBDIR = $(SSLDIR) |
| 1578 | 1578 | !endif |
| 1579 | -SSLLFLAGS = /nologo /opt:ref /debug | |
| 1580 | 1579 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 1581 | 1580 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1582 | 1581 | !message Using 'x64' platform for OpenSSL... |
| 1583 | 1582 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 1584 | 1583 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -1646,16 +1645,27 @@ | ||
| 1646 | 1645 | !endif |
| 1647 | 1646 | |
| 1648 | 1647 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1649 | 1648 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 1650 | 1649 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1650 | +# | |
| 1651 | +# NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and | |
| 1652 | +# explicit initialization is redundant, but is required for post-built edits. | |
| 1653 | +# | |
| 1651 | 1654 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1652 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 | |
| 1655 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 | |
| 1653 | 1656 | !else |
| 1654 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 | |
| 1657 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 | |
| 1655 | 1658 | !endif |
| 1656 | 1659 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1660 | +# | |
| 1661 | +# NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS | |
| 1662 | +# is applied in a separate post-build step, see below for more information. | |
| 1663 | +# | |
| 1664 | +!if $(FOSSIL_ENABLE_SSL)!=0 | |
| 1665 | +SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) | |
| 1666 | +!endif | |
| 1657 | 1667 | !endif |
| 1658 | 1668 | |
| 1659 | 1669 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1660 | 1670 | !if $(DEBUG)!=0 |
| 1661 | 1671 | CRTFLAGS = /MDd |
| @@ -1831,19 +1841,42 @@ | ||
| 1831 | 1841 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 1832 | 1842 | |
| 1833 | 1843 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1834 | 1844 | openssl: |
| 1835 | 1845 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 1846 | +!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 1847 | + @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... | |
| 1848 | +!endif | |
| 1836 | 1849 | !ifdef PERLDIR |
| 1837 | 1850 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 1838 | 1851 | !else |
| 1839 | 1852 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 1840 | 1853 | !endif |
| 1841 | -!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 1842 | - @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd | |
| 1843 | -!else | |
| 1844 | 1854 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 1855 | +!if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 | |
| 1856 | +# | |
| 1857 | +# NOTE: Appending custom linker flags to the OpenSSL default linker flags is | |
| 1858 | +# somewhat difficult, as summarized in this Fossil Forum post: | |
| 1859 | +# | |
| 1860 | +# https://fossil-scm.org/forum/forumpost/a9a2d6af28b | |
| 1861 | +# | |
| 1862 | +# Therefore the custom linker flags required for Windows XP dynamic builds are | |
| 1863 | +# applied in a separate post-build step. | |
| 1864 | +# | |
| 1865 | +# If the build stops here, or if the custom linker flags are outside the scope | |
| 1866 | +# of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking | |
| 1867 | +# the OpenSSL makefile by hand. | |
| 1868 | +# | |
| 1869 | +# Also note that this step changes the subsystem for the OpenSSL DLLs from | |
| 1870 | +# WINDOWS to CONSOLE, but which has no effect on DLLs. | |
| 1871 | +# | |
| 1872 | + @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... | |
| 1873 | + @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) <<<NEXT_LINE>>> | |
| 1874 | + do @( <<<NEXT_LINE>>> | |
| 1875 | + echo %F & <<<NEXT_LINE>>> | |
| 1876 | + link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 <<<NEXT_LINE>>> | |
| 1877 | + ) | |
| 1845 | 1878 | !endif |
| 1846 | 1879 | |
| 1847 | 1880 | clean-openssl: |
| 1848 | 1881 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 1849 | 1882 | !endif |
| 1850 | 1883 |
| --- tools/makemake.tcl | |
| +++ tools/makemake.tcl | |
| @@ -1574,11 +1574,10 @@ | |
| 1574 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1575 | SSLLIBDIR = $(SSLDIR) |
| 1576 | !else |
| 1577 | SSLLIBDIR = $(SSLDIR) |
| 1578 | !endif |
| 1579 | SSLLFLAGS = /nologo /opt:ref /debug |
| 1580 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 1581 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1582 | !message Using 'x64' platform for OpenSSL... |
| 1583 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 1584 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -1646,16 +1645,27 @@ | |
| 1646 | !endif |
| 1647 | |
| 1648 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1649 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 1650 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1651 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1652 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 |
| 1653 | !else |
| 1654 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 |
| 1655 | !endif |
| 1656 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1657 | !endif |
| 1658 | |
| 1659 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1660 | !if $(DEBUG)!=0 |
| 1661 | CRTFLAGS = /MDd |
| @@ -1831,19 +1841,42 @@ | |
| 1831 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 1832 | |
| 1833 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1834 | openssl: |
| 1835 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 1836 | !ifdef PERLDIR |
| 1837 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 1838 | !else |
| 1839 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 1840 | !endif |
| 1841 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1842 | @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd |
| 1843 | !else |
| 1844 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 1845 | !endif |
| 1846 | |
| 1847 | clean-openssl: |
| 1848 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 1849 | !endif |
| 1850 |
| --- tools/makemake.tcl | |
| +++ tools/makemake.tcl | |
| @@ -1574,11 +1574,10 @@ | |
| 1574 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1575 | SSLLIBDIR = $(SSLDIR) |
| 1576 | !else |
| 1577 | SSLLIBDIR = $(SSLDIR) |
| 1578 | !endif |
| 1579 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 1580 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1581 | !message Using 'x64' platform for OpenSSL... |
| 1582 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 1583 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -1646,16 +1645,27 @@ | |
| 1645 | !endif |
| 1646 | |
| 1647 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1648 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 1649 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1650 | # |
| 1651 | # NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and |
| 1652 | # explicit initialization is redundant, but is required for post-built edits. |
| 1653 | # |
| 1654 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 1655 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 |
| 1656 | !else |
| 1657 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 |
| 1658 | !endif |
| 1659 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1660 | # |
| 1661 | # NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS |
| 1662 | # is applied in a separate post-build step, see below for more information. |
| 1663 | # |
| 1664 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1665 | SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) |
| 1666 | !endif |
| 1667 | !endif |
| 1668 | |
| 1669 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1670 | !if $(DEBUG)!=0 |
| 1671 | CRTFLAGS = /MDd |
| @@ -1831,19 +1841,42 @@ | |
| 1841 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 1842 | |
| 1843 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 1844 | openssl: |
| 1845 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 1846 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 1847 | @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... |
| 1848 | !endif |
| 1849 | !ifdef PERLDIR |
| 1850 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 1851 | !else |
| 1852 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 1853 | !endif |
| 1854 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 1855 | !if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 1856 | # |
| 1857 | # NOTE: Appending custom linker flags to the OpenSSL default linker flags is |
| 1858 | # somewhat difficult, as summarized in this Fossil Forum post: |
| 1859 | # |
| 1860 | # https://fossil-scm.org/forum/forumpost/a9a2d6af28b |
| 1861 | # |
| 1862 | # Therefore the custom linker flags required for Windows XP dynamic builds are |
| 1863 | # applied in a separate post-build step. |
| 1864 | # |
| 1865 | # If the build stops here, or if the custom linker flags are outside the scope |
| 1866 | # of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking |
| 1867 | # the OpenSSL makefile by hand. |
| 1868 | # |
| 1869 | # Also note that this step changes the subsystem for the OpenSSL DLLs from |
| 1870 | # WINDOWS to CONSOLE, but which has no effect on DLLs. |
| 1871 | # |
| 1872 | @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... |
| 1873 | @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) <<<NEXT_LINE>>> |
| 1874 | do @( <<<NEXT_LINE>>> |
| 1875 | echo %F & <<<NEXT_LINE>>> |
| 1876 | link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 <<<NEXT_LINE>>> |
| 1877 | ) |
| 1878 | !endif |
| 1879 | |
| 1880 | clean-openssl: |
| 1881 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 1882 | !endif |
| 1883 |
+39
-6
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -116,11 +116,10 @@ | ||
| 116 | 116 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 117 | 117 | SSLLIBDIR = $(SSLDIR) |
| 118 | 118 | !else |
| 119 | 119 | SSLLIBDIR = $(SSLDIR) |
| 120 | 120 | !endif |
| 121 | -SSLLFLAGS = /nologo /opt:ref /debug | |
| 122 | 121 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 123 | 122 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 124 | 123 | !message Using 'x64' platform for OpenSSL... |
| 125 | 124 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 126 | 125 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -188,16 +187,27 @@ | ||
| 188 | 187 | !endif |
| 189 | 188 | |
| 190 | 189 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 191 | 190 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 192 | 191 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 192 | +# | |
| 193 | +# NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and | |
| 194 | +# explicit initialization is redundant, but is required for post-built edits. | |
| 195 | +# | |
| 193 | 196 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 194 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 | |
| 197 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 | |
| 195 | 198 | !else |
| 196 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 | |
| 199 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 | |
| 197 | 200 | !endif |
| 198 | 201 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 202 | +# | |
| 203 | +# NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS | |
| 204 | +# is applied in a separate post-build step, see below for more information. | |
| 205 | +# | |
| 206 | +!if $(FOSSIL_ENABLE_SSL)!=0 | |
| 207 | +SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) | |
| 208 | +!endif | |
| 199 | 209 | !endif |
| 200 | 210 | |
| 201 | 211 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 202 | 212 | !if $(DEBUG)!=0 |
| 203 | 213 | CRTFLAGS = /MDd |
| @@ -795,19 +805,42 @@ | ||
| 795 | 805 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 796 | 806 | |
| 797 | 807 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 798 | 808 | openssl: |
| 799 | 809 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 810 | +!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 811 | + @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... | |
| 812 | +!endif | |
| 800 | 813 | !ifdef PERLDIR |
| 801 | 814 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 802 | 815 | !else |
| 803 | 816 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 804 | 817 | !endif |
| 805 | -!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 806 | - @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd | |
| 807 | -!else | |
| 808 | 818 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 819 | +!if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 | |
| 820 | +# | |
| 821 | +# NOTE: Appending custom linker flags to the OpenSSL default linker flags is | |
| 822 | +# somewhat difficult, as summarized in this Fossil Forum post: | |
| 823 | +# | |
| 824 | +# https://fossil-scm.org/forum/forumpost/a9a2d6af28b | |
| 825 | +# | |
| 826 | +# Therefore the custom linker flags required for Windows XP dynamic builds are | |
| 827 | +# applied in a separate post-build step. | |
| 828 | +# | |
| 829 | +# If the build stops here, or if the custom linker flags are outside the scope | |
| 830 | +# of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking | |
| 831 | +# the OpenSSL makefile by hand. | |
| 832 | +# | |
| 833 | +# Also note that this step changes the subsystem for the OpenSSL DLLs from | |
| 834 | +# WINDOWS to CONSOLE, but which has no effect on DLLs. | |
| 835 | +# | |
| 836 | + @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... | |
| 837 | + @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) \ | |
| 838 | + do @( \ | |
| 839 | + echo %F & \ | |
| 840 | + link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 \ | |
| 841 | + ) | |
| 809 | 842 | !endif |
| 810 | 843 | |
| 811 | 844 | clean-openssl: |
| 812 | 845 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 813 | 846 | !endif |
| 814 | 847 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -116,11 +116,10 @@ | |
| 116 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 117 | SSLLIBDIR = $(SSLDIR) |
| 118 | !else |
| 119 | SSLLIBDIR = $(SSLDIR) |
| 120 | !endif |
| 121 | SSLLFLAGS = /nologo /opt:ref /debug |
| 122 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 123 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 124 | !message Using 'x64' platform for OpenSSL... |
| 125 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 126 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -188,16 +187,27 @@ | |
| 188 | !endif |
| 189 | |
| 190 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 191 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 192 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 193 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 194 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 |
| 195 | !else |
| 196 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 |
| 197 | !endif |
| 198 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 199 | !endif |
| 200 | |
| 201 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 202 | !if $(DEBUG)!=0 |
| 203 | CRTFLAGS = /MDd |
| @@ -795,19 +805,42 @@ | |
| 795 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 796 | |
| 797 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 798 | openssl: |
| 799 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 800 | !ifdef PERLDIR |
| 801 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 802 | !else |
| 803 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 804 | !endif |
| 805 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 806 | @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd |
| 807 | !else |
| 808 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 809 | !endif |
| 810 | |
| 811 | clean-openssl: |
| 812 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 813 | !endif |
| 814 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -116,11 +116,10 @@ | |
| 116 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 117 | SSLLIBDIR = $(SSLDIR) |
| 118 | !else |
| 119 | SSLLIBDIR = $(SSLDIR) |
| 120 | !endif |
| 121 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 122 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 123 | !message Using 'x64' platform for OpenSSL... |
| 124 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 125 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -188,16 +187,27 @@ | |
| 187 | !endif |
| 188 | |
| 189 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 190 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 191 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 192 | # |
| 193 | # NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and |
| 194 | # explicit initialization is redundant, but is required for post-built edits. |
| 195 | # |
| 196 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 197 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 |
| 198 | !else |
| 199 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 |
| 200 | !endif |
| 201 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 202 | # |
| 203 | # NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS |
| 204 | # is applied in a separate post-build step, see below for more information. |
| 205 | # |
| 206 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 207 | SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) |
| 208 | !endif |
| 209 | !endif |
| 210 | |
| 211 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 212 | !if $(DEBUG)!=0 |
| 213 | CRTFLAGS = /MDd |
| @@ -795,19 +805,42 @@ | |
| 805 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 806 | |
| 807 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 808 | openssl: |
| 809 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 810 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 811 | @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... |
| 812 | !endif |
| 813 | !ifdef PERLDIR |
| 814 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 815 | !else |
| 816 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 817 | !endif |
| 818 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 819 | !if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 820 | # |
| 821 | # NOTE: Appending custom linker flags to the OpenSSL default linker flags is |
| 822 | # somewhat difficult, as summarized in this Fossil Forum post: |
| 823 | # |
| 824 | # https://fossil-scm.org/forum/forumpost/a9a2d6af28b |
| 825 | # |
| 826 | # Therefore the custom linker flags required for Windows XP dynamic builds are |
| 827 | # applied in a separate post-build step. |
| 828 | # |
| 829 | # If the build stops here, or if the custom linker flags are outside the scope |
| 830 | # of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking |
| 831 | # the OpenSSL makefile by hand. |
| 832 | # |
| 833 | # Also note that this step changes the subsystem for the OpenSSL DLLs from |
| 834 | # WINDOWS to CONSOLE, but which has no effect on DLLs. |
| 835 | # |
| 836 | @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... |
| 837 | @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) \ |
| 838 | do @( \ |
| 839 | echo %F & \ |
| 840 | link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 \ |
| 841 | ) |
| 842 | !endif |
| 843 | |
| 844 | clean-openssl: |
| 845 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 846 | !endif |
| 847 |
+39
-6
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -116,11 +116,10 @@ | ||
| 116 | 116 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 117 | 117 | SSLLIBDIR = $(SSLDIR) |
| 118 | 118 | !else |
| 119 | 119 | SSLLIBDIR = $(SSLDIR) |
| 120 | 120 | !endif |
| 121 | -SSLLFLAGS = /nologo /opt:ref /debug | |
| 122 | 121 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 123 | 122 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 124 | 123 | !message Using 'x64' platform for OpenSSL... |
| 125 | 124 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 126 | 125 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -188,16 +187,27 @@ | ||
| 188 | 187 | !endif |
| 189 | 188 | |
| 190 | 189 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 191 | 190 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 192 | 191 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 192 | +# | |
| 193 | +# NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and | |
| 194 | +# explicit initialization is redundant, but is required for post-built edits. | |
| 195 | +# | |
| 193 | 196 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 194 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 | |
| 197 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 | |
| 195 | 198 | !else |
| 196 | -XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 | |
| 199 | +XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 | |
| 197 | 200 | !endif |
| 198 | 201 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 202 | +# | |
| 203 | +# NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS | |
| 204 | +# is applied in a separate post-build step, see below for more information. | |
| 205 | +# | |
| 206 | +!if $(FOSSIL_ENABLE_SSL)!=0 | |
| 207 | +SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) | |
| 208 | +!endif | |
| 199 | 209 | !endif |
| 200 | 210 | |
| 201 | 211 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 202 | 212 | !if $(DEBUG)!=0 |
| 203 | 213 | CRTFLAGS = /MDd |
| @@ -795,19 +805,42 @@ | ||
| 795 | 805 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 796 | 806 | |
| 797 | 807 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 798 | 808 | openssl: |
| 799 | 809 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 810 | +!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 811 | + @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... | |
| 812 | +!endif | |
| 800 | 813 | !ifdef PERLDIR |
| 801 | 814 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 802 | 815 | !else |
| 803 | 816 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 804 | 817 | !endif |
| 805 | -!if $(FOSSIL_ENABLE_WINXP)!=0 | |
| 806 | - @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd | |
| 807 | -!else | |
| 808 | 818 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 819 | +!if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 | |
| 820 | +# | |
| 821 | +# NOTE: Appending custom linker flags to the OpenSSL default linker flags is | |
| 822 | +# somewhat difficult, as summarized in this Fossil Forum post: | |
| 823 | +# | |
| 824 | +# https://fossil-scm.org/forum/forumpost/a9a2d6af28b | |
| 825 | +# | |
| 826 | +# Therefore the custom linker flags required for Windows XP dynamic builds are | |
| 827 | +# applied in a separate post-build step. | |
| 828 | +# | |
| 829 | +# If the build stops here, or if the custom linker flags are outside the scope | |
| 830 | +# of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking | |
| 831 | +# the OpenSSL makefile by hand. | |
| 832 | +# | |
| 833 | +# Also note that this step changes the subsystem for the OpenSSL DLLs from | |
| 834 | +# WINDOWS to CONSOLE, but which has no effect on DLLs. | |
| 835 | +# | |
| 836 | + @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... | |
| 837 | + @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) \ | |
| 838 | + do @( \ | |
| 839 | + echo %F & \ | |
| 840 | + link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 \ | |
| 841 | + ) | |
| 809 | 842 | !endif |
| 810 | 843 | |
| 811 | 844 | clean-openssl: |
| 812 | 845 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 813 | 846 | !endif |
| 814 | 847 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -116,11 +116,10 @@ | |
| 116 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 117 | SSLLIBDIR = $(SSLDIR) |
| 118 | !else |
| 119 | SSLLIBDIR = $(SSLDIR) |
| 120 | !endif |
| 121 | SSLLFLAGS = /nologo /opt:ref /debug |
| 122 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 123 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 124 | !message Using 'x64' platform for OpenSSL... |
| 125 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 126 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -188,16 +187,27 @@ | |
| 188 | !endif |
| 189 | |
| 190 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 191 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 192 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 193 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 194 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02 |
| 195 | !else |
| 196 | XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01 |
| 197 | !endif |
| 198 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 199 | !endif |
| 200 | |
| 201 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 202 | !if $(DEBUG)!=0 |
| 203 | CRTFLAGS = /MDd |
| @@ -795,19 +805,42 @@ | |
| 795 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 796 | |
| 797 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 798 | openssl: |
| 799 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 800 | !ifdef PERLDIR |
| 801 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 802 | !else |
| 803 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 804 | !endif |
| 805 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 806 | @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd |
| 807 | !else |
| 808 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 809 | !endif |
| 810 | |
| 811 | clean-openssl: |
| 812 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 813 | !endif |
| 814 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -116,11 +116,10 @@ | |
| 116 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 117 | SSLLIBDIR = $(SSLDIR) |
| 118 | !else |
| 119 | SSLLIBDIR = $(SSLDIR) |
| 120 | !endif |
| 121 | SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib |
| 122 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 123 | !message Using 'x64' platform for OpenSSL... |
| 124 | SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers |
| 125 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| @@ -188,16 +187,27 @@ | |
| 187 | !endif |
| 188 | |
| 189 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 190 | XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1 |
| 191 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 192 | # |
| 193 | # NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and |
| 194 | # explicit initialization is redundant, but is required for post-built edits. |
| 195 | # |
| 196 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| 197 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02 |
| 198 | !else |
| 199 | XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01 |
| 200 | !endif |
| 201 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 202 | # |
| 203 | # NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS |
| 204 | # is applied in a separate post-build step, see below for more information. |
| 205 | # |
| 206 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 207 | SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS) |
| 208 | !endif |
| 209 | !endif |
| 210 | |
| 211 | !if $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 212 | !if $(DEBUG)!=0 |
| 213 | CRTFLAGS = /MDd |
| @@ -795,19 +805,42 @@ | |
| 805 | @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd |
| 806 | |
| 807 | !if $(FOSSIL_ENABLE_SSL)!=0 |
| 808 | openssl: |
| 809 | @echo Building OpenSSL from "$(SSLDIR)"... |
| 810 | !if $(FOSSIL_ENABLE_WINXP)!=0 |
| 811 | @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration... |
| 812 | !endif |
| 813 | !ifdef PERLDIR |
| 814 | @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd |
| 815 | !else |
| 816 | @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd |
| 817 | !endif |
| 818 | @pushd "$(SSLDIR)" && $(MAKE) && popd |
| 819 | !if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0 |
| 820 | # |
| 821 | # NOTE: Appending custom linker flags to the OpenSSL default linker flags is |
| 822 | # somewhat difficult, as summarized in this Fossil Forum post: |
| 823 | # |
| 824 | # https://fossil-scm.org/forum/forumpost/a9a2d6af28b |
| 825 | # |
| 826 | # Therefore the custom linker flags required for Windows XP dynamic builds are |
| 827 | # applied in a separate post-build step. |
| 828 | # |
| 829 | # If the build stops here, or if the custom linker flags are outside the scope |
| 830 | # of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking |
| 831 | # the OpenSSL makefile by hand. |
| 832 | # |
| 833 | # Also note that this step changes the subsystem for the OpenSSL DLLs from |
| 834 | # WINDOWS to CONSOLE, but which has no effect on DLLs. |
| 835 | # |
| 836 | @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs... |
| 837 | @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) \ |
| 838 | do @( \ |
| 839 | echo %F & \ |
| 840 | link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 \ |
| 841 | ) |
| 842 | !endif |
| 843 | |
| 844 | clean-openssl: |
| 845 | @pushd "$(SSLDIR)" && $(MAKE) clean && popd |
| 846 | !endif |
| 847 |