Fossil SCM

Update the makemake.tcl script.

florian 2022-01-31 05:32 msvc-openssl-winxp
Commit 771ab1943904d51fde81afca3afa163be42fb271e9a21ca1dd8b65252cd4971d
1 file changed +39 -6
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -1571,11 +1571,10 @@
15711571
!if $(FOSSIL_DYNAMIC_BUILD)!=0
15721572
SSLLIBDIR = $(SSLDIR)
15731573
!else
15741574
SSLLIBDIR = $(SSLDIR)
15751575
!endif
1576
-SSLLFLAGS = /nologo /opt:ref /debug
15771576
SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib
15781577
!if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64"
15791578
!message Using 'x64' platform for OpenSSL...
15801579
SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers
15811580
!if $(FOSSIL_DYNAMIC_BUILD)!=0
@@ -1643,16 +1642,27 @@
16431642
!endif
16441643
16451644
!if $(FOSSIL_ENABLE_WINXP)!=0
16461645
XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1
16471646
CFLAGS = $(CFLAGS) $(XPCFLAGS)
1647
+#
1648
+# NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and
1649
+# explicit initialization is redundant, but is required for post-built edits.
1650
+#
16481651
!if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64"
1649
-XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02
1652
+XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02
16501653
!else
1651
-XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01
1654
+XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01
16521655
!endif
16531656
LDFLAGS = $(LDFLAGS) $(XPLDFLAGS)
1657
+#
1658
+# NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS
1659
+# is applied in a separate post-build step, see below for more information.
1660
+#
1661
+!if $(FOSSIL_ENABLE_SSL)!=0
1662
+SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS)
1663
+!endif
16541664
!endif
16551665
16561666
!if $(FOSSIL_DYNAMIC_BUILD)!=0
16571667
!if $(DEBUG)!=0
16581668
CRTFLAGS = /MDd
@@ -1823,19 +1833,42 @@
18231833
@pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd
18241834
18251835
!if $(FOSSIL_ENABLE_SSL)!=0
18261836
openssl:
18271837
@echo Building OpenSSL from "$(SSLDIR)"...
1838
+!if $(FOSSIL_ENABLE_WINXP)!=0
1839
+ @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration...
1840
+!endif
18281841
!ifdef PERLDIR
18291842
@pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd
18301843
!else
18311844
@pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd
18321845
!endif
1833
-!if $(FOSSIL_ENABLE_WINXP)!=0
1834
- @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd
1835
-!else
18361846
@pushd "$(SSLDIR)" && $(MAKE) && popd
1847
+!if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0
1848
+#
1849
+# NOTE: Appending custom linker flags to the OpenSSL default linker flags is
1850
+# somewhat difficult, as summarized in this Fossil Forum post:
1851
+#
1852
+# https://fossil-scm.org/forum/forumpost/a9a2d6af28b
1853
+#
1854
+# Therefore the custom linker flags required for Windows XP dynamic builds are
1855
+# applied in a separate post-build step.
1856
+#
1857
+# If the build stops here, or if the custom linker flags are outside the scope
1858
+# of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking
1859
+# the OpenSSL makefile by hand.
1860
+#
1861
+# Also note that this step changes the subsystem for the OpenSSL DLLs from
1862
+# WINDOWS to CONSOLE, but which has no effect on DLLs.
1863
+#
1864
+ @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs...
1865
+ @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) <<<NEXT_LINE>>>
1866
+ do @( <<<NEXT_LINE>>>
1867
+ echo %F & <<<NEXT_LINE>>>
1868
+ link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 <<<NEXT_LINE>>>
1869
+ )
18371870
!endif
18381871
18391872
clean-openssl:
18401873
@pushd "$(SSLDIR)" && $(MAKE) clean && popd
18411874
!endif
18421875
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -1571,11 +1571,10 @@
1571 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1572 SSLLIBDIR = $(SSLDIR)
1573 !else
1574 SSLLIBDIR = $(SSLDIR)
1575 !endif
1576 SSLLFLAGS = /nologo /opt:ref /debug
1577 SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib
1578 !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64"
1579 !message Using 'x64' platform for OpenSSL...
1580 SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers
1581 !if $(FOSSIL_DYNAMIC_BUILD)!=0
@@ -1643,16 +1642,27 @@
1643 !endif
1644
1645 !if $(FOSSIL_ENABLE_WINXP)!=0
1646 XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1
1647 CFLAGS = $(CFLAGS) $(XPCFLAGS)
 
 
 
 
1648 !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64"
1649 XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.02
1650 !else
1651 XPLDFLAGS = $(XPLDFLAGS) /SUBSYSTEM:CONSOLE,5.01
1652 !endif
1653 LDFLAGS = $(LDFLAGS) $(XPLDFLAGS)
 
 
 
 
 
 
 
1654 !endif
1655
1656 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1657 !if $(DEBUG)!=0
1658 CRTFLAGS = /MDd
@@ -1823,19 +1833,42 @@
1823 @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd
1824
1825 !if $(FOSSIL_ENABLE_SSL)!=0
1826 openssl:
1827 @echo Building OpenSSL from "$(SSLDIR)"...
 
 
 
1828 !ifdef PERLDIR
1829 @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd
1830 !else
1831 @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd
1832 !endif
1833 !if $(FOSSIL_ENABLE_WINXP)!=0
1834 @pushd "$(SSLDIR)" && $(MAKE) "CC=cl $(XPCFLAGS)" "LFLAGS=$(XPLDFLAGS)" && popd
1835 !else
1836 @pushd "$(SSLDIR)" && $(MAKE) && popd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1837 !endif
1838
1839 clean-openssl:
1840 @pushd "$(SSLDIR)" && $(MAKE) clean && popd
1841 !endif
1842
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -1571,11 +1571,10 @@
1571 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1572 SSLLIBDIR = $(SSLDIR)
1573 !else
1574 SSLLIBDIR = $(SSLDIR)
1575 !endif
 
1576 SSLLIB = libssl.lib libcrypto.lib user32.lib gdi32.lib crypt32.lib
1577 !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64"
1578 !message Using 'x64' platform for OpenSSL...
1579 SSLCONFIG = VC-WIN64A no-asm no-ssl3 no-weak-ssl-ciphers
1580 !if $(FOSSIL_DYNAMIC_BUILD)!=0
@@ -1643,16 +1642,27 @@
1642 !endif
1643
1644 !if $(FOSSIL_ENABLE_WINXP)!=0
1645 XPCFLAGS = $(XPCFLAGS) /D_WIN32_WINNT=0x0501 /D_USING_V110_SDK71_=1
1646 CFLAGS = $(CFLAGS) $(XPCFLAGS)
1647 #
1648 # NOTE: For regular builds, /OSVERSION defaults to the /SUBSYSTEM version and
1649 # explicit initialization is redundant, but is required for post-built edits.
1650 #
1651 !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64"
1652 XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.02 /SUBSYSTEM:CONSOLE,5.02
1653 !else
1654 XPLDFLAGS = $(XPLDFLAGS) /OSVERSION:5.01 /SUBSYSTEM:CONSOLE,5.01
1655 !endif
1656 LDFLAGS = $(LDFLAGS) $(XPLDFLAGS)
1657 #
1658 # NOTE: Only XPCFLAGS is forwarded to the OpenSSL configuration, and XPLDFLAGS
1659 # is applied in a separate post-build step, see below for more information.
1660 #
1661 !if $(FOSSIL_ENABLE_SSL)!=0
1662 SSLCONFIG = $(SSLCONFIG) $(XPCFLAGS)
1663 !endif
1664 !endif
1665
1666 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1667 !if $(DEBUG)!=0
1668 CRTFLAGS = /MDd
@@ -1823,19 +1833,42 @@
1833 @pushd "$(ZLIBDIR)" && $(MAKE) /f win32\Makefile.msc clean && popd
1834
1835 !if $(FOSSIL_ENABLE_SSL)!=0
1836 openssl:
1837 @echo Building OpenSSL from "$(SSLDIR)"...
1838 !if $(FOSSIL_ENABLE_WINXP)!=0
1839 @echo Passing XPCFLAGS = [ $(XPCFLAGS) ] to the OpenSSL configuration...
1840 !endif
1841 !ifdef PERLDIR
1842 @pushd "$(SSLDIR)" && "$(PERLDIR)\$(PERL)" Configure $(SSLCONFIG) && popd
1843 !else
1844 @pushd "$(SSLDIR)" && "$(PERL)" Configure $(SSLCONFIG) && popd
1845 !endif
 
 
 
1846 @pushd "$(SSLDIR)" && $(MAKE) && popd
1847 !if $(FOSSIL_ENABLE_WINXP)!=0 && $(FOSSIL_DYNAMIC_BUILD)!=0
1848 #
1849 # NOTE: Appending custom linker flags to the OpenSSL default linker flags is
1850 # somewhat difficult, as summarized in this Fossil Forum post:
1851 #
1852 # https://fossil-scm.org/forum/forumpost/a9a2d6af28b
1853 #
1854 # Therefore the custom linker flags required for Windows XP dynamic builds are
1855 # applied in a separate post-build step.
1856 #
1857 # If the build stops here, or if the custom linker flags are outside the scope
1858 # of `editbin` or `link /EDIT` (i.e. additional libraries), consider tweaking
1859 # the OpenSSL makefile by hand.
1860 #
1861 # Also note that this step changes the subsystem for the OpenSSL DLLs from
1862 # WINDOWS to CONSOLE, but which has no effect on DLLs.
1863 #
1864 @echo Applying XPLDFLAGS = [ $(XPLDFLAGS) ] to the OpenSSL DLLs...
1865 @for /F "usebackq delims=" %F in (`dir /A:-D/B "$(SSLDIR)\*.dll" 2^>nul`) <<<NEXT_LINE>>>
1866 do @( <<<NEXT_LINE>>>
1867 echo %F & <<<NEXT_LINE>>>
1868 link /EDIT /NOLOGO $(XPLDFLAGS) "$(SSLDIR)\%F" || exit 1 <<<NEXT_LINE>>>
1869 )
1870 !endif
1871
1872 clean-openssl:
1873 @pushd "$(SSLDIR)" && $(MAKE) clean && popd
1874 !endif
1875

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button