Fossil SCM
Updated Makefile.msc generation: Add an option for creating a dynamically linked fossil binary. Make it possible to opt-out of building zlib.
Commit
2a0bc313fbb1b6ac50612dee3248f266b02ddf37
Parent
7bc11da24141778…
1 file changed
+22
-2
+22
-2
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -1337,10 +1337,18 @@ | ||
| 1337 | 1337 | # Uncomment to enable TH1 hooks |
| 1338 | 1338 | # FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 1339 | 1339 | |
| 1340 | 1340 | # Uncomment to enable Tcl support |
| 1341 | 1341 | # FOSSIL_ENABLE_TCL = 1 |
| 1342 | + | |
| 1343 | +# For builds which uses a prebuilt zlib set this to 0 and set the appropriate | |
| 1344 | +# Z{INC,LIB}DIR and ZLIB macros. | |
| 1345 | +FOSSIL_BUILD_ZLIB = 1 | |
| 1346 | + | |
| 1347 | +# Set to non-zero value to link against dynamic CRT and change default zlib | |
| 1348 | +# library to dynamic lib. | |
| 1349 | +FOSSIL_DYNAMIC_LINK = 0 | |
| 1342 | 1350 | |
| 1343 | 1351 | !ifdef FOSSIL_ENABLE_SSL |
| 1344 | 1352 | SSLDIR = $(B)\compat\openssl-1.0.2c |
| 1345 | 1353 | SSLINCDIR = $(SSLDIR)\inc32 |
| 1346 | 1354 | SSLLIBDIR = $(SSLDIR)\out32 |
| @@ -1380,11 +1388,15 @@ | ||
| 1380 | 1388 | !endif |
| 1381 | 1389 | |
| 1382 | 1390 | # zlib options |
| 1383 | 1391 | ZINCDIR = $(B)\compat\zlib |
| 1384 | 1392 | ZLIBDIR = $(B)\compat\zlib |
| 1393 | +!if FOSSIL_DYNAMIC_LINK | |
| 1394 | +ZLIB = zdll.lib | |
| 1395 | +!else | |
| 1385 | 1396 | ZLIB = zlib.lib |
| 1397 | +!endif | |
| 1386 | 1398 | |
| 1387 | 1399 | INCL = /I. /I$(SRCDIR) /I$B\win\include |
| 1388 | 1400 | |
| 1389 | 1401 | !ifndef FOSSIL_ENABLE_MINIZ |
| 1390 | 1402 | INCL = $(INCL) /I$(ZINCDIR) |
| @@ -1397,11 +1409,17 @@ | ||
| 1397 | 1409 | !ifdef FOSSIL_ENABLE_TCL |
| 1398 | 1410 | INCL = $(INCL) /I$(TCLINCDIR) |
| 1399 | 1411 | !endif |
| 1400 | 1412 | |
| 1401 | 1413 | CFLAGS = /nologo |
| 1414 | +!if FOSSIL_DYNAMIC_LINK | |
| 1415 | +LDFLAGS = /MANIFEST:NO | |
| 1416 | +CCRTOPT = /MD | |
| 1417 | +!else | |
| 1402 | 1418 | LDFLAGS = /NODEFAULTLIB:msvcrt /MANIFEST:NO |
| 1419 | +CCRTOPT = /MT | |
| 1420 | +!endif | |
| 1403 | 1421 | |
| 1404 | 1422 | !ifdef FOSSIL_ENABLE_WINXP |
| 1405 | 1423 | XPCFLAGS = $(XPCFLAGS) /D_USING_V110_SDK71_=1 |
| 1406 | 1424 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1407 | 1425 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| @@ -1411,14 +1429,14 @@ | ||
| 1411 | 1429 | !endif |
| 1412 | 1430 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1413 | 1431 | !endif |
| 1414 | 1432 | |
| 1415 | 1433 | !ifdef DEBUG |
| 1416 | -CFLAGS = $(CFLAGS) /Zi /MTd /Od | |
| 1434 | +CFLAGS = $(CFLAGS) /Zi $(CCRTOPT)d /Od | |
| 1417 | 1435 | LDFLAGS = $(LDFLAGS) /DEBUG |
| 1418 | 1436 | !else |
| 1419 | -CFLAGS = $(CFLAGS) /MT /O2 | |
| 1437 | +CFLAGS = $(CFLAGS) $(CCRTOPT) /O2 | |
| 1420 | 1438 | !endif |
| 1421 | 1439 | |
| 1422 | 1440 | BCC = $(CC) $(CFLAGS) |
| 1423 | 1441 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1424 | 1442 | RCC = rc /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| @@ -1552,11 +1570,13 @@ | ||
| 1552 | 1570 | @pushd "$(SSLDIR)" && $(MAKE) /f $(SSLNMAKE) "CC=cl $(SSLCFLAGS)" && popd |
| 1553 | 1571 | !endif |
| 1554 | 1572 | !endif |
| 1555 | 1573 | |
| 1556 | 1574 | !ifndef FOSSIL_ENABLE_MINIZ |
| 1575 | +!if FOSSIL_BUILD_ZLIB | |
| 1557 | 1576 | APPTARGETS = $(APPTARGETS) zlib |
| 1577 | +!endif | |
| 1558 | 1578 | !endif |
| 1559 | 1579 | |
| 1560 | 1580 | !ifdef FOSSIL_ENABLE_SSL |
| 1561 | 1581 | !ifdef FOSSIL_BUILD_SSL |
| 1562 | 1582 | APPTARGETS = $(APPTARGETS) openssl |
| 1563 | 1583 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -1337,10 +1337,18 @@ | |
| 1337 | # Uncomment to enable TH1 hooks |
| 1338 | # FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 1339 | |
| 1340 | # Uncomment to enable Tcl support |
| 1341 | # FOSSIL_ENABLE_TCL = 1 |
| 1342 | |
| 1343 | !ifdef FOSSIL_ENABLE_SSL |
| 1344 | SSLDIR = $(B)\compat\openssl-1.0.2c |
| 1345 | SSLINCDIR = $(SSLDIR)\inc32 |
| 1346 | SSLLIBDIR = $(SSLDIR)\out32 |
| @@ -1380,11 +1388,15 @@ | |
| 1380 | !endif |
| 1381 | |
| 1382 | # zlib options |
| 1383 | ZINCDIR = $(B)\compat\zlib |
| 1384 | ZLIBDIR = $(B)\compat\zlib |
| 1385 | ZLIB = zlib.lib |
| 1386 | |
| 1387 | INCL = /I. /I$(SRCDIR) /I$B\win\include |
| 1388 | |
| 1389 | !ifndef FOSSIL_ENABLE_MINIZ |
| 1390 | INCL = $(INCL) /I$(ZINCDIR) |
| @@ -1397,11 +1409,17 @@ | |
| 1397 | !ifdef FOSSIL_ENABLE_TCL |
| 1398 | INCL = $(INCL) /I$(TCLINCDIR) |
| 1399 | !endif |
| 1400 | |
| 1401 | CFLAGS = /nologo |
| 1402 | LDFLAGS = /NODEFAULTLIB:msvcrt /MANIFEST:NO |
| 1403 | |
| 1404 | !ifdef FOSSIL_ENABLE_WINXP |
| 1405 | XPCFLAGS = $(XPCFLAGS) /D_USING_V110_SDK71_=1 |
| 1406 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1407 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| @@ -1411,14 +1429,14 @@ | |
| 1411 | !endif |
| 1412 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1413 | !endif |
| 1414 | |
| 1415 | !ifdef DEBUG |
| 1416 | CFLAGS = $(CFLAGS) /Zi /MTd /Od |
| 1417 | LDFLAGS = $(LDFLAGS) /DEBUG |
| 1418 | !else |
| 1419 | CFLAGS = $(CFLAGS) /MT /O2 |
| 1420 | !endif |
| 1421 | |
| 1422 | BCC = $(CC) $(CFLAGS) |
| 1423 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1424 | RCC = rc /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| @@ -1552,11 +1570,13 @@ | |
| 1552 | @pushd "$(SSLDIR)" && $(MAKE) /f $(SSLNMAKE) "CC=cl $(SSLCFLAGS)" && popd |
| 1553 | !endif |
| 1554 | !endif |
| 1555 | |
| 1556 | !ifndef FOSSIL_ENABLE_MINIZ |
| 1557 | APPTARGETS = $(APPTARGETS) zlib |
| 1558 | !endif |
| 1559 | |
| 1560 | !ifdef FOSSIL_ENABLE_SSL |
| 1561 | !ifdef FOSSIL_BUILD_SSL |
| 1562 | APPTARGETS = $(APPTARGETS) openssl |
| 1563 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -1337,10 +1337,18 @@ | |
| 1337 | # Uncomment to enable TH1 hooks |
| 1338 | # FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 1339 | |
| 1340 | # Uncomment to enable Tcl support |
| 1341 | # FOSSIL_ENABLE_TCL = 1 |
| 1342 | |
| 1343 | # For builds which uses a prebuilt zlib set this to 0 and set the appropriate |
| 1344 | # Z{INC,LIB}DIR and ZLIB macros. |
| 1345 | FOSSIL_BUILD_ZLIB = 1 |
| 1346 | |
| 1347 | # Set to non-zero value to link against dynamic CRT and change default zlib |
| 1348 | # library to dynamic lib. |
| 1349 | FOSSIL_DYNAMIC_LINK = 0 |
| 1350 | |
| 1351 | !ifdef FOSSIL_ENABLE_SSL |
| 1352 | SSLDIR = $(B)\compat\openssl-1.0.2c |
| 1353 | SSLINCDIR = $(SSLDIR)\inc32 |
| 1354 | SSLLIBDIR = $(SSLDIR)\out32 |
| @@ -1380,11 +1388,15 @@ | |
| 1388 | !endif |
| 1389 | |
| 1390 | # zlib options |
| 1391 | ZINCDIR = $(B)\compat\zlib |
| 1392 | ZLIBDIR = $(B)\compat\zlib |
| 1393 | !if FOSSIL_DYNAMIC_LINK |
| 1394 | ZLIB = zdll.lib |
| 1395 | !else |
| 1396 | ZLIB = zlib.lib |
| 1397 | !endif |
| 1398 | |
| 1399 | INCL = /I. /I$(SRCDIR) /I$B\win\include |
| 1400 | |
| 1401 | !ifndef FOSSIL_ENABLE_MINIZ |
| 1402 | INCL = $(INCL) /I$(ZINCDIR) |
| @@ -1397,11 +1409,17 @@ | |
| 1409 | !ifdef FOSSIL_ENABLE_TCL |
| 1410 | INCL = $(INCL) /I$(TCLINCDIR) |
| 1411 | !endif |
| 1412 | |
| 1413 | CFLAGS = /nologo |
| 1414 | !if FOSSIL_DYNAMIC_LINK |
| 1415 | LDFLAGS = /MANIFEST:NO |
| 1416 | CCRTOPT = /MD |
| 1417 | !else |
| 1418 | LDFLAGS = /NODEFAULTLIB:msvcrt /MANIFEST:NO |
| 1419 | CCRTOPT = /MT |
| 1420 | !endif |
| 1421 | |
| 1422 | !ifdef FOSSIL_ENABLE_WINXP |
| 1423 | XPCFLAGS = $(XPCFLAGS) /D_USING_V110_SDK71_=1 |
| 1424 | CFLAGS = $(CFLAGS) $(XPCFLAGS) |
| 1425 | !if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64" |
| @@ -1411,14 +1429,14 @@ | |
| 1429 | !endif |
| 1430 | LDFLAGS = $(LDFLAGS) $(XPLDFLAGS) |
| 1431 | !endif |
| 1432 | |
| 1433 | !ifdef DEBUG |
| 1434 | CFLAGS = $(CFLAGS) /Zi $(CCRTOPT)d /Od |
| 1435 | LDFLAGS = $(LDFLAGS) /DEBUG |
| 1436 | !else |
| 1437 | CFLAGS = $(CFLAGS) $(CCRTOPT) /O2 |
| 1438 | !endif |
| 1439 | |
| 1440 | BCC = $(CC) $(CFLAGS) |
| 1441 | TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL) |
| 1442 | RCC = rc /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL) |
| @@ -1552,11 +1570,13 @@ | |
| 1570 | @pushd "$(SSLDIR)" && $(MAKE) /f $(SSLNMAKE) "CC=cl $(SSLCFLAGS)" && popd |
| 1571 | !endif |
| 1572 | !endif |
| 1573 | |
| 1574 | !ifndef FOSSIL_ENABLE_MINIZ |
| 1575 | !if FOSSIL_BUILD_ZLIB |
| 1576 | APPTARGETS = $(APPTARGETS) zlib |
| 1577 | !endif |
| 1578 | !endif |
| 1579 | |
| 1580 | !ifdef FOSSIL_ENABLE_SSL |
| 1581 | !ifdef FOSSIL_BUILD_SSL |
| 1582 | APPTARGETS = $(APPTARGETS) openssl |
| 1583 |