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.

jan 2015-06-19 20:36 trunk
Commit 2a0bc313fbb1b6ac50612dee3248f266b02ddf37
1 file changed +22 -2
+22 -2
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -1337,10 +1337,18 @@
13371337
# Uncomment to enable TH1 hooks
13381338
# FOSSIL_ENABLE_TH1_HOOKS = 1
13391339
13401340
# Uncomment to enable Tcl support
13411341
# 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
13421350
13431351
!ifdef FOSSIL_ENABLE_SSL
13441352
SSLDIR = $(B)\compat\openssl-1.0.2c
13451353
SSLINCDIR = $(SSLDIR)\inc32
13461354
SSLLIBDIR = $(SSLDIR)\out32
@@ -1380,11 +1388,15 @@
13801388
!endif
13811389
13821390
# zlib options
13831391
ZINCDIR = $(B)\compat\zlib
13841392
ZLIBDIR = $(B)\compat\zlib
1393
+!if FOSSIL_DYNAMIC_LINK
1394
+ZLIB = zdll.lib
1395
+!else
13851396
ZLIB = zlib.lib
1397
+!endif
13861398
13871399
INCL = /I. /I$(SRCDIR) /I$B\win\include
13881400
13891401
!ifndef FOSSIL_ENABLE_MINIZ
13901402
INCL = $(INCL) /I$(ZINCDIR)
@@ -1397,11 +1409,17 @@
13971409
!ifdef FOSSIL_ENABLE_TCL
13981410
INCL = $(INCL) /I$(TCLINCDIR)
13991411
!endif
14001412
14011413
CFLAGS = /nologo
1414
+!if FOSSIL_DYNAMIC_LINK
1415
+LDFLAGS = /MANIFEST:NO
1416
+CCRTOPT = /MD
1417
+!else
14021418
LDFLAGS = /NODEFAULTLIB:msvcrt /MANIFEST:NO
1419
+CCRTOPT = /MT
1420
+!endif
14031421
14041422
!ifdef FOSSIL_ENABLE_WINXP
14051423
XPCFLAGS = $(XPCFLAGS) /D_USING_V110_SDK71_=1
14061424
CFLAGS = $(CFLAGS) $(XPCFLAGS)
14071425
!if "$(PLATFORM)"=="amd64" || "$(PLATFORM)"=="x64"
@@ -1411,14 +1429,14 @@
14111429
!endif
14121430
LDFLAGS = $(LDFLAGS) $(XPLDFLAGS)
14131431
!endif
14141432
14151433
!ifdef DEBUG
1416
-CFLAGS = $(CFLAGS) /Zi /MTd /Od
1434
+CFLAGS = $(CFLAGS) /Zi $(CCRTOPT)d /Od
14171435
LDFLAGS = $(LDFLAGS) /DEBUG
14181436
!else
1419
-CFLAGS = $(CFLAGS) /MT /O2
1437
+CFLAGS = $(CFLAGS) $(CCRTOPT) /O2
14201438
!endif
14211439
14221440
BCC = $(CC) $(CFLAGS)
14231441
TCC = $(CC) /c $(CFLAGS) $(MSCDEF) $(INCL)
14241442
RCC = rc /D_WIN32 /D_MSC_VER $(MSCDEF) $(INCL)
@@ -1552,11 +1570,13 @@
15521570
@pushd "$(SSLDIR)" && $(MAKE) /f $(SSLNMAKE) "CC=cl $(SSLCFLAGS)" && popd
15531571
!endif
15541572
!endif
15551573
15561574
!ifndef FOSSIL_ENABLE_MINIZ
1575
+!if FOSSIL_BUILD_ZLIB
15571576
APPTARGETS = $(APPTARGETS) zlib
1577
+!endif
15581578
!endif
15591579
15601580
!ifdef FOSSIL_ENABLE_SSL
15611581
!ifdef FOSSIL_BUILD_SSL
15621582
APPTARGETS = $(APPTARGETS) openssl
15631583
--- 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

Keyboard Shortcuts

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