| | @@ -139,11 +139,14 @@ |
| 139 | 139 | # |
| 140 | 140 | puts "building main.mk" |
| 141 | 141 | set output_file [open main.mk w] |
| 142 | 142 | fconfigure $output_file -translation binary |
| 143 | 143 | |
| 144 | | -writeln {# DO NOT EDIT |
| 144 | +writeln {# |
| 145 | +############################################################################## |
| 146 | +# WARNING: DO NOT EDIT, AUTOMATICALLY GENERATED FILE (SEE "src/makemake.tcl") |
| 147 | +############################################################################## |
| 145 | 148 | # |
| 146 | 149 | # This file is automatically generated. Instead of editing this |
| 147 | 150 | # file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 148 | 151 | # to regenerate this file. |
| 149 | 152 | # |
| | @@ -190,11 +193,11 @@ |
| 190 | 193 | $(BCC) -o $(OBJDIR)/mkindex $(SRCDIR)/mkindex.c |
| 191 | 194 | |
| 192 | 195 | $(OBJDIR)/mkversion: $(SRCDIR)/mkversion.c |
| 193 | 196 | $(BCC) -o $(OBJDIR)/mkversion $(SRCDIR)/mkversion.c |
| 194 | 197 | |
| 195 | | -# WARNING. DANGER. Running the testsuite modifies the repository the |
| 198 | +# WARNING. DANGER. Running the test suite modifies the repository the |
| 196 | 199 | # build is done from, i.e. the checkout belongs to. Do not sync/push |
| 197 | 200 | # the repository after running the tests. |
| 198 | 201 | test: $(OBJDIR) $(APPNAME) |
| 199 | 202 | $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) |
| 200 | 203 | |
| | @@ -209,12 +212,15 @@ |
| 209 | 212 | # using -lsqlite3. |
| 210 | 213 | SQLITE3_OBJ.1 = |
| 211 | 214 | SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o |
| 212 | 215 | SQLITE3_OBJ. = $(SQLITE3_OBJ.0) |
| 213 | 216 | |
| 214 | | -TCL_OBJ.1 = |
| 215 | | -TCL_OBJ.0 = $(OBJDIR)/th_tcl.o |
| 217 | +# The FOSSIL_ENABLE_TCL variable may be undefined, set to 0, or set to 1. |
| 218 | +# If it is set to 1, then we need to build the Tcl integration code and |
| 219 | +# link to the Tcl library. |
| 220 | +TCL_OBJ.0 = |
| 221 | +TCL_OBJ.1 = $(OBJDIR)/th_tcl.o |
| 216 | 222 | TCL_OBJ. = $(TCL_OBJ.0) |
| 217 | 223 | |
| 218 | 224 | EXTRAOBJ = \ |
| 219 | 225 | $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \ |
| 220 | 226 | $(OBJDIR)/shell.o \ |
| | @@ -307,20 +313,27 @@ |
| 307 | 313 | set output_file [open ../win/Makefile.mingw w] |
| 308 | 314 | fconfigure $output_file -translation binary |
| 309 | 315 | |
| 310 | 316 | writeln {#!/usr/bin/make |
| 311 | 317 | # |
| 312 | | -# This is a makefile for us on windows using mingw. |
| 318 | +############################################################################## |
| 319 | +# WARNING: DO NOT EDIT, AUTOMATICALLY GENERATED FILE (SEE "src/makemake.tcl") |
| 320 | +############################################################################## |
| 321 | +# |
| 322 | +# This file is automatically generated. Instead of editing this |
| 323 | +# file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 324 | +# to regenerate this file. |
| 325 | +# |
| 326 | +# This is a makefile for us on windows using MinGW. |
| 313 | 327 | # |
| 314 | 328 | #### The toplevel directory of the source tree. Fossil can be built |
| 315 | 329 | # in a directory that is separate from the source tree. Just change |
| 316 | 330 | # the following to point from the build directory to the src/ folder. |
| 317 | 331 | # |
| 318 | 332 | SRCDIR = src |
| 319 | 333 | |
| 320 | 334 | #### The directory into which object code files should be written. |
| 321 | | -# |
| 322 | 335 | # |
| 323 | 336 | OBJDIR = wbld |
| 324 | 337 | |
| 325 | 338 | #### C Compiler and options for use in building executables that |
| 326 | 339 | # will run on the platform that is doing the build. This is used |
| | @@ -329,51 +342,134 @@ |
| 329 | 342 | # |
| 330 | 343 | BCC = gcc |
| 331 | 344 | |
| 332 | 345 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 333 | 346 | # |
| 334 | | -# FOSSIL_ENABLE_SSL=1 |
| 335 | | - |
| 336 | | -#### The directory in which the zlib compression library is installed. |
| 337 | | -# |
| 338 | | -# |
| 339 | | -ZLIBDIR = /programs/gnuwin32 |
| 340 | | - |
| 341 | | -#### C Compile and options for use in building executables that |
| 347 | +# FOSSIL_ENABLE_SSL = 1 |
| 348 | + |
| 349 | +#### Enable scripting support via Tcl/Tk |
| 350 | +# |
| 351 | +# FOSSIL_ENABLE_TCL = 1 |
| 352 | + |
| 353 | +#### Use the Tcl source directory instead of the install directory? |
| 354 | +# This is useful when Tcl has been compiled statically with MinGW. |
| 355 | +# |
| 356 | +FOSSIL_TCL_SOURCE = 1 |
| 357 | + |
| 358 | +#### The directories where the zlib include and library files are located. |
| 359 | +# The recommended usage here is to use the Sysinternals junction tool |
| 360 | +# to create a hard link between an "zlib-1.x.y" sub-directory of the |
| 361 | +# Fossil source code directory and the target zlib source directory. |
| 362 | +# |
| 363 | +ZINCDIR = $(SRCDIR)/../zlib-1.2.5 |
| 364 | +ZLIBDIR = $(SRCDIR)/../zlib-1.2.5 |
| 365 | + |
| 366 | +#### The directories where the OpenSSL include and library files are located. |
| 367 | +# The recommended usage here is to use the Sysinternals junction tool |
| 368 | +# to create a hard link between an "openssl-1.x" sub-directory of the |
| 369 | +# Fossil source code directory and the target OpenSSL source directory. |
| 370 | +# |
| 371 | +OPENSSLINCDIR = $(SRCDIR)/../openssl-1.0.0e/include |
| 372 | +OPENSSLLIBDIR = $(SRCDIR)/../openssl-1.0.0e |
| 373 | + |
| 374 | +#### Either the directory where the Tcl library is installed or the Tcl |
| 375 | +# source code directory resides (depending on the value of the macro |
| 376 | +# FOSSIL_TCL_SOURCE). If this points to the Tcl install directory, |
| 377 | +# this directory must have "include" and "lib" sub-directories. If |
| 378 | +# this points to the Tcl source code directory, this directory must |
| 379 | +# have "generic" and "win" sub-directories. The recommended usage |
| 380 | +# here is to use the Sysinternals junction tool to create a hard |
| 381 | +# link between a "tcl-8.x" sub-directory of the Fossil source code |
| 382 | +# directory and the target Tcl directory. This removes the need to |
| 383 | +# hard-code the necessary paths in this Makefile. |
| 384 | +# |
| 385 | +TCLDIR = $(SRCDIR)/../tcl-8.6 |
| 386 | + |
| 387 | +#### The Tcl source code directory. This defaults to the same value as |
| 388 | +# TCLDIR macro (above), which may not be correct. This value will |
| 389 | +# only be used if the FOSSIL_TCL_SOURCE macro is defined. |
| 390 | +# |
| 391 | +TCLSRCDIR = $(TCLDIR) |
| 392 | + |
| 393 | +#### The Tcl include and library directories. These values will only be |
| 394 | +# used if the FOSSIL_TCL_SOURCE macro is not defined. |
| 395 | +# |
| 396 | +TCLINCDIR = $(TCLDIR)/include |
| 397 | +TCLLIBDIR = $(TCLDIR)/lib |
| 398 | + |
| 399 | +#### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)? |
| 400 | +# |
| 401 | +LIBTCL = -ltcl86 |
| 402 | + |
| 403 | +#### C Compile and options for use in building executables that |
| 342 | 404 | # will run on the target platform. This is usually the same |
| 343 | 405 | # as BCC, unless you are cross-compiling. This C compiler builds |
| 344 | 406 | # the finished binary for fossil. The BCC compiler above is used |
| 345 | 407 | # for building intermediate code-generator tools. |
| 346 | 408 | # |
| 347 | | -TCC = gcc -Os -Wall -L$(ZLIBDIR)/lib -I$(ZLIBDIR)/include |
| 409 | +TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR) |
| 410 | + |
| 411 | +# With HTTPS support |
| 412 | +ifdef FOSSIL_ENABLE_SSL |
| 413 | +TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR) |
| 414 | +endif |
| 415 | + |
| 416 | +# With Tcl support |
| 417 | +ifdef FOSSIL_ENABLE_TCL |
| 418 | +ifdef FOSSIL_TCL_SOURCE |
| 419 | +TCC += -L$(TCLSRCDIR)/win -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win |
| 420 | +else |
| 421 | +TCC += -L$(TCLLIBDIR) -I$(TCLINCDIR) |
| 422 | +endif |
| 423 | +endif |
| 348 | 424 | |
| 349 | 425 | # With HTTPS support |
| 350 | 426 | ifdef FOSSIL_ENABLE_SSL |
| 351 | | -TCC += -static -DFOSSIL_ENABLE_SSL=1 |
| 427 | +TCC += -DFOSSIL_ENABLE_SSL=1 |
| 428 | +endif |
| 429 | + |
| 430 | +# With Tcl support (statically linked) |
| 431 | +ifdef FOSSIL_ENABLE_TCL |
| 432 | +TCC += -DFOSSIL_ENABLE_TCL=1 -DSTATIC_BUILD |
| 352 | 433 | endif |
| 353 | 434 | |
| 354 | 435 | #### Extra arguments for linking the finished binary. Fossil needs |
| 355 | 436 | # to link against the Z-Lib compression library. There are no |
| 356 | | -# other dependencies. We sometimes add the -static option here |
| 437 | +# other mandatory dependencies. We add the -static option here |
| 357 | 438 | # so that we can build a static executable that will run in a |
| 358 | 439 | # chroot jail. |
| 359 | 440 | # |
| 360 | | -#LIB = -lz -lws2_32 |
| 361 | | -# OpenSSL: |
| 441 | +LIB = -static |
| 442 | +LIB += -lmingwex -lz |
| 443 | + |
| 444 | +# OpenSSL: Add the necessary libaries required, if enabled. |
| 362 | 445 | ifdef FOSSIL_ENABLE_SSL |
| 363 | 446 | LIB += -lssl -lcrypto -lgdi32 |
| 364 | 447 | endif |
| 365 | | -LIB += -lmingwex -lz -lws2_32 |
| 366 | 448 | |
| 367 | | -#### Tcl shell for use in running the fossil testsuite. This is only |
| 368 | | -# used for testing. If you do not run |
| 449 | +# Tcl: Add the necessary libaries required, if enabled. |
| 450 | +ifdef FOSSIL_ENABLE_TCL |
| 451 | +LIB += $(LIBTCL) |
| 452 | +endif |
| 453 | + |
| 454 | +#### These libraries MUST appear in the same order as they do for Tcl |
| 455 | +# or linking with it will not work (exact reason unknown). |
| 456 | +# |
| 457 | +ifdef FOSSIL_ENABLE_TCL |
| 458 | +LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 |
| 459 | +else |
| 460 | +LIB += -lws2_32 |
| 461 | +endif |
| 462 | + |
| 463 | +#### Tcl shell for use in running the fossil test suite. This is only |
| 464 | +# used for testing. |
| 369 | 465 | # |
| 370 | 466 | TCLSH = tclsh |
| 371 | 467 | |
| 372 | 468 | #### Nullsoft installer makensis location |
| 373 | 469 | # |
| 374 | | -MAKENSIS = "c:\Program Files\NSIS\makensis.exe" |
| 470 | +MAKENSIS = "$(ProgramFiles)\NSIS\makensis.exe" |
| 375 | 471 | |
| 376 | 472 | #### Include a configuration file that can override any one of these settings. |
| 377 | 473 | # |
| 378 | 474 | -include config.w32 |
| 379 | 475 | |
| | @@ -427,15 +523,15 @@ |
| 427 | 523 | $(BCC) -o $(OBJDIR)/mkindex $(SRCDIR)/mkindex.c |
| 428 | 524 | |
| 429 | 525 | $(VERSION): $(SRCDIR)/mkversion.c |
| 430 | 526 | $(BCC) -o $(OBJDIR)/version $(SRCDIR)/mkversion.c |
| 431 | 527 | |
| 432 | | -# WARNING. DANGER. Running the testsuite modifies the repository the |
| 528 | +# WARNING. DANGER. Running the test suite modifies the repository the |
| 433 | 529 | # build is done from, i.e. the checkout belongs to. Do not sync/push |
| 434 | 530 | # the repository after running the tests. |
| 435 | | -test: $(APPNAME) |
| 436 | | - $(TCLSH) test/tester.tcl $(APPNAME) |
| 531 | +test: $(OBJDIR) $(APPNAME) |
| 532 | + $(TCLSH) $(SRCDIR)/../test/tester.tcl $(APPNAME) |
| 437 | 533 | |
| 438 | 534 | $(OBJDIR)/VERSION.h: $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION) |
| 439 | 535 | $(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(SRCDIR)/../VERSION >$(OBJDIR)/VERSION.h |
| 440 | 536 | |
| 441 | 537 | EXTRAOBJ = \ |
| | @@ -442,25 +538,29 @@ |
| 442 | 538 | $(OBJDIR)/sqlite3.o \ |
| 443 | 539 | $(OBJDIR)/shell.o \ |
| 444 | 540 | $(OBJDIR)/th.o \ |
| 445 | 541 | $(OBJDIR)/th_lang.o \ |
| 446 | 542 | $(OBJDIR)/cson_amalgamation.o |
| 543 | + |
| 544 | +ifdef FOSSIL_ENABLE_TCL |
| 545 | +EXTRAOBJ += $(OBJDIR)/th_tcl.o |
| 546 | +endif |
| 447 | 547 | |
| 448 | 548 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/icon.o |
| 449 | 549 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/icon.o |
| 450 | 550 | |
| 451 | 551 | # This rule prevents make from using its default rules to try build |
| 452 | 552 | # an executable named "manifest" out of the file named "manifest.c" |
| 453 | 553 | # |
| 454 | | -$(SRCDIR)/../manifest: |
| 554 | +$(SRCDIR)/../manifest: |
| 455 | 555 | # noop |
| 456 | 556 | |
| 457 | | -# Requires msys to be installed in addition to the mingw, for the "rm" |
| 557 | +# Requires msys to be installed in addition to the MinGW, for the "rm" |
| 458 | 558 | # command. "del" will not work here because it is not a separate command |
| 459 | 559 | # but a MSDOS-shell builtin. |
| 460 | 560 | # |
| 461 | | -clean: |
| 561 | +clean: |
| 462 | 562 | rm -rf $(OBJDIR) $(APPNAME) |
| 463 | 563 | |
| 464 | 564 | setup: $(OBJDIR) $(APPNAME) |
| 465 | 565 | $(MAKENSIS) ./fossil.nsi |
| 466 | 566 | |
| | @@ -498,11 +598,11 @@ |
| 498 | 598 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n" |
| 499 | 599 | |
| 500 | 600 | set opt {} |
| 501 | 601 | writeln "\$(OBJDIR)/cson_amalgamation.o:\t\$(SRCDIR)/cson_amalgamation.c" |
| 502 | 602 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/cson_amalgamation.c -o \$(OBJDIR)/cson_amalgamation.o -DCSON_FOSSIL_MODE\n" |
| 503 | | -writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h" |
| 603 | +writeln "\$(OBJDIR)/json.o \$(OBJDIR)/json_artifact.o \$(OBJDIR)/json_branch.o \$(OBJDIR)/json_diff.o \$(OBJDIR)/json_login.o \$(OBJDIR)/json_query.o \$(OBJDIR)/json_report.o \$(OBJDIR)/json_tag.o \$(OBJDIR)/json_timeline.o \$(OBJDIR)/json_user.o \$(OBJDIR)/json_wiki.o : \$(SRCDIR)/json_detail.h\n" |
| 504 | 604 | |
| 505 | 605 | writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h" |
| 506 | 606 | set opt {-Dmain=sqlite3_shell} |
| 507 | 607 | append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1" |
| 508 | 608 | writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/shell.c -o \$(OBJDIR)/shell.o\n" |
| | @@ -511,10 +611,15 @@ |
| 511 | 611 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n" |
| 512 | 612 | |
| 513 | 613 | writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c" |
| 514 | 614 | writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n" |
| 515 | 615 | |
| 616 | +writeln {ifdef FOSSIL_ENABLE_TCL |
| 617 | +$(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c |
| 618 | + $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o |
| 619 | +endif |
| 620 | +} |
| 516 | 621 | |
| 517 | 622 | close $output_file |
| 518 | 623 | # |
| 519 | 624 | # End of the main.mk output |
| 520 | 625 | ############################################################################## |
| | @@ -524,15 +629,19 @@ |
| 524 | 629 | # |
| 525 | 630 | puts "building ../win/Makefile.dmc" |
| 526 | 631 | set output_file [open ../win/Makefile.dmc w] |
| 527 | 632 | fconfigure $output_file -translation binary |
| 528 | 633 | |
| 529 | | -writeln {# DO NOT EDIT |
| 634 | +writeln {# |
| 635 | +############################################################################## |
| 636 | +# WARNING: DO NOT EDIT, AUTOMATICALLY GENERATED FILE (SEE "src/makemake.tcl") |
| 637 | +############################################################################## |
| 530 | 638 | # |
| 531 | 639 | # This file is automatically generated. Instead of editing this |
| 532 | | -# file, edit "makemake.tcl" then run "tclsh src/makemake.tcl" |
| 640 | +# file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 533 | 641 | # to regenerate this file. |
| 642 | +# |
| 534 | 643 | B = .. |
| 535 | 644 | SRCDIR = $B\src |
| 536 | 645 | OBJDIR = . |
| 537 | 646 | O = .obj |
| 538 | 647 | E = .exe |
| | @@ -668,15 +777,19 @@ |
| 668 | 777 | # |
| 669 | 778 | puts "building ../win/Makefile.msc" |
| 670 | 779 | set output_file [open ../win/Makefile.msc w] |
| 671 | 780 | fconfigure $output_file -translation binary |
| 672 | 781 | |
| 673 | | -writeln {# DO NOT EDIT |
| 782 | +writeln {# |
| 783 | +############################################################################## |
| 784 | +# WARNING: DO NOT EDIT, AUTOMATICALLY GENERATED FILE (SEE "src/makemake.tcl") |
| 785 | +############################################################################## |
| 674 | 786 | # |
| 675 | 787 | # This file is automatically generated. Instead of editing this |
| 676 | | -# file, edit "makemake.tcl" then run "tclsh src/makemake.tcl" |
| 788 | +# file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 677 | 789 | # to regenerate this file. |
| 790 | +# |
| 678 | 791 | B = .. |
| 679 | 792 | SRCDIR = $B\src |
| 680 | 793 | OBJDIR = . |
| 681 | 794 | OX = . |
| 682 | 795 | O = .obj |
| | @@ -821,14 +934,17 @@ |
| 821 | 934 | # |
| 822 | 935 | puts "building ../win/Makefile.PellesCGMake" |
| 823 | 936 | set output_file [open ../win/Makefile.PellesCGMake w] |
| 824 | 937 | fconfigure $output_file -translation binary |
| 825 | 938 | |
| 826 | | -writeln {# DO NOT EDIT |
| 939 | +writeln {# |
| 940 | +############################################################################## |
| 941 | +# WARNING: DO NOT EDIT, AUTOMATICALLY GENERATED FILE (SEE "src/makemake.tcl") |
| 942 | +############################################################################## |
| 827 | 943 | # |
| 828 | 944 | # This file is automatically generated. Instead of editing this |
| 829 | | -# file, edit "makemake.tcl" then run "tclsh src/makemake.tcl" |
| 945 | +# file, edit "makemake.tcl" then run "tclsh makemake.tcl" |
| 830 | 946 | # to regenerate this file. |
| 831 | 947 | # |
| 832 | 948 | # HowTo |
| 833 | 949 | # ----- |
| 834 | 950 | # |
| 835 | 951 | |