Index: src/makemake.tcl ================================================================== --- src/makemake.tcl +++ src/makemake.tcl @@ -687,17 +687,22 @@ #### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)? # ifdef FOSSIL_ENABLE_TCL_STUBS ifndef FOSSIL_ENABLE_TCL_PRIVATE_STUBS -LIBTCL = -ltclstub86 +LIBTCL = $(XLDARG) -ltclstub86 endif TCLTARGET = libtclstub86.a else -LIBTCL = -ltcl86 +LIBTCL = $(XLDARG) -ltcl86 TCLTARGET = binaries endif + +#### The prefix for all arguments that should be passed to the linker. +# GCC does not need this; however, other compilers may. +# +XLDARG = #### C compiler for use in building executables that will run on the # target platform. This is usually the same as BCCEXE, unless you # are cross-compiling. This C compiler builds the finished binary # for fossil. See BCC and BCCEXE above for the C compiler for @@ -723,11 +728,11 @@ endif #### When not using the miniz compression library, zlib is required. # ifndef FOSSIL_ENABLE_MINIZ -TCC += -L$(ZLIBDIR) -I$(ZINCDIR) +TCC += $(XLDARG) -L$(ZLIBDIR) -I$(ZINCDIR) endif #### Compile resources for use in building executables that will run # on the target platform. # @@ -737,21 +742,21 @@ RCC += -I$(ZINCDIR) endif # With HTTPS support ifdef FOSSIL_ENABLE_SSL -TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR) +TCC += $(XLDARG) -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR) RCC += -I$(OPENSSLINCDIR) endif # With Tcl support ifdef FOSSIL_ENABLE_TCL ifdef FOSSIL_TCL_SOURCE -TCC += -L$(TCLSRCDIR)/win -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win +TCC += $(XLDARG) -L$(TCLSRCDIR)/win -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win RCC += -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win else -TCC += -L$(TCLLIBDIR) -I$(TCLINCDIR) +TCC += $(XLDARG) -L$(TCLLIBDIR) -I$(TCLINCDIR) RCC += -I$(TCLINCDIR) endif endif # With miniz (i.e. instead of zlib) @@ -842,17 +847,17 @@ endif #### SQLite: If enabled, use the system SQLite library. # ifdef USE_SYSTEM_SQLITE -LIB += -lsqlite3 +LIB += $(XLDARG) -lsqlite3 endif #### OpenSSL: Add the necessary libraries required, if enabled. # ifdef FOSSIL_ENABLE_SSL -LIB += -lssl -lcrypto -lgdi32 +LIB += $(XLDARG) -lssl $(XLDARG) -lcrypto $(XLDARG) -lgdi32 endif #### Tcl: Add the necessary libraries required, if enabled. # ifdef FOSSIL_ENABLE_TCL @@ -861,29 +866,31 @@ #### Extra arguments for linking the finished binary. Fossil needs # to link against the Z-Lib compression library. There are no # other mandatory dependencies. # -LIB += -lmingwex +LIB += $(XLDARG) -lmingwex #### When not using the miniz compression library, zlib is required. # ifndef FOSSIL_ENABLE_MINIZ -LIB += -lz +LIB += $(XLDARG) -lz endif #### These libraries MUST appear in the same order as they do for Tcl # or linking with it will not work (exact reason unknown). # ifdef FOSSIL_ENABLE_TCL ifdef FOSSIL_ENABLE_TCL_STUBS -LIB += -lkernel32 -lws2_32 +LIB += $(XLDARG) -lkernel32 $(XLDARG) -lws2_32 else -LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 +LIB += $(XLDARG) -lnetapi32 $(XLDARG) -lkernel32 +LIB += $(XLDARG) -luser32 $(XLDARG) -ladvapi32 +LIB += $(XLDARG) -lws2_32 endif else -LIB += -lkernel32 -lws2_32 +LIB += $(XLDARG) -lkernel32 $(XLDARG) -lws2_32 endif #### Tcl shell for use in running the fossil test suite. This is only # used for testing. # @@ -1066,14 +1073,14 @@ $(OBJDIR)/cson_amalgamation.o }] writeln { zlib: - $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) $(ZLIBCONFIG) -f win32/Makefile.gcc libz.a + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) $(ZLIBCONFIG) -f win32/Makefile.gcc libz.a clean-zlib: - $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc clean + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) -f win32/Makefile.gcc clean $(ZLIBDIR)/inffas86.o: $(TCC) -c -o $@ -DASMINF -I$(ZLIBDIR) -O3 $(ZLIBDIR)/contrib/inflate86/inffas86.c $(ZLIBDIR)/match.o: Index: win/Makefile.mingw ================================================================== --- win/Makefile.mingw +++ win/Makefile.mingw @@ -203,17 +203,22 @@ #### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)? # ifdef FOSSIL_ENABLE_TCL_STUBS ifndef FOSSIL_ENABLE_TCL_PRIVATE_STUBS -LIBTCL = -ltclstub86 +LIBTCL = $(XLDARG) -ltclstub86 endif TCLTARGET = libtclstub86.a else -LIBTCL = -ltcl86 +LIBTCL = $(XLDARG) -ltcl86 TCLTARGET = binaries endif + +#### The prefix for all arguments that should be passed to the linker. +# GCC does not need this; however, other compilers may. +# +XLDARG = #### C compiler for use in building executables that will run on the # target platform. This is usually the same as BCCEXE, unless you # are cross-compiling. This C compiler builds the finished binary # for fossil. See BCC and BCCEXE above for the C compiler for @@ -239,11 +244,11 @@ endif #### When not using the miniz compression library, zlib is required. # ifndef FOSSIL_ENABLE_MINIZ -TCC += -L$(ZLIBDIR) -I$(ZINCDIR) +TCC += $(XLDARG) -L$(ZLIBDIR) -I$(ZINCDIR) endif #### Compile resources for use in building executables that will run # on the target platform. # @@ -253,21 +258,21 @@ RCC += -I$(ZINCDIR) endif # With HTTPS support ifdef FOSSIL_ENABLE_SSL -TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR) +TCC += $(XLDARG) -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR) RCC += -I$(OPENSSLINCDIR) endif # With Tcl support ifdef FOSSIL_ENABLE_TCL ifdef FOSSIL_TCL_SOURCE -TCC += -L$(TCLSRCDIR)/win -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win +TCC += $(XLDARG) -L$(TCLSRCDIR)/win -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win RCC += -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win else -TCC += -L$(TCLLIBDIR) -I$(TCLINCDIR) +TCC += $(XLDARG) -L$(TCLLIBDIR) -I$(TCLINCDIR) RCC += -I$(TCLINCDIR) endif endif # With miniz (i.e. instead of zlib) @@ -358,17 +363,17 @@ endif #### SQLite: If enabled, use the system SQLite library. # ifdef USE_SYSTEM_SQLITE -LIB += -lsqlite3 +LIB += $(XLDARG) -lsqlite3 endif #### OpenSSL: Add the necessary libraries required, if enabled. # ifdef FOSSIL_ENABLE_SSL -LIB += -lssl -lcrypto -lgdi32 +LIB += $(XLDARG) -lssl $(XLDARG) -lcrypto $(XLDARG) -lgdi32 endif #### Tcl: Add the necessary libraries required, if enabled. # ifdef FOSSIL_ENABLE_TCL @@ -377,29 +382,31 @@ #### Extra arguments for linking the finished binary. Fossil needs # to link against the Z-Lib compression library. There are no # other mandatory dependencies. # -LIB += -lmingwex +LIB += $(XLDARG) -lmingwex #### When not using the miniz compression library, zlib is required. # ifndef FOSSIL_ENABLE_MINIZ -LIB += -lz +LIB += $(XLDARG) -lz endif #### These libraries MUST appear in the same order as they do for Tcl # or linking with it will not work (exact reason unknown). # ifdef FOSSIL_ENABLE_TCL ifdef FOSSIL_ENABLE_TCL_STUBS -LIB += -lkernel32 -lws2_32 +LIB += $(XLDARG) -lkernel32 $(XLDARG) -lws2_32 else -LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 +LIB += $(XLDARG) -lnetapi32 $(XLDARG) -lkernel32 +LIB += $(XLDARG) -luser32 $(XLDARG) -ladvapi32 +LIB += $(XLDARG) -lws2_32 endif else -LIB += -lkernel32 -lws2_32 +LIB += $(XLDARG) -lkernel32 $(XLDARG) -lws2_32 endif #### Tcl shell for use in running the fossil test suite. This is only # used for testing. # @@ -973,14 +980,14 @@ $(OBJDIR)/th_tcl.o \ $(OBJDIR)/cson_amalgamation.o zlib: - $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) $(ZLIBCONFIG) -f win32/Makefile.gcc libz.a + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) $(ZLIBCONFIG) -f win32/Makefile.gcc libz.a clean-zlib: - $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc clean + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) -f win32/Makefile.gcc clean $(ZLIBDIR)/inffas86.o: $(TCC) -c -o $@ -DASMINF -I$(ZLIBDIR) -O3 $(ZLIBDIR)/contrib/inflate86/inffas86.c $(ZLIBDIR)/match.o: Index: win/Makefile.mingw.mistachkin ================================================================== --- win/Makefile.mingw.mistachkin +++ win/Makefile.mingw.mistachkin @@ -203,17 +203,22 @@ #### Tcl: Which Tcl library do we want to use (8.4, 8.5, 8.6, etc)? # ifdef FOSSIL_ENABLE_TCL_STUBS ifndef FOSSIL_ENABLE_TCL_PRIVATE_STUBS -LIBTCL = -ltclstub86 +LIBTCL = $(XLDARG) -ltclstub86 endif TCLTARGET = libtclstub86.a else -LIBTCL = -ltcl86 +LIBTCL = $(XLDARG) -ltcl86 TCLTARGET = binaries endif + +#### The prefix for all arguments that should be passed to the linker. +# GCC does not need this; however, other compilers may. +# +XLDARG = #### C compiler for use in building executables that will run on the # target platform. This is usually the same as BCCEXE, unless you # are cross-compiling. This C compiler builds the finished binary # for fossil. See BCC and BCCEXE above for the C compiler for @@ -239,11 +244,11 @@ endif #### When not using the miniz compression library, zlib is required. # ifndef FOSSIL_ENABLE_MINIZ -TCC += -L$(ZLIBDIR) -I$(ZINCDIR) +TCC += $(XLDARG) -L$(ZLIBDIR) -I$(ZINCDIR) endif #### Compile resources for use in building executables that will run # on the target platform. # @@ -253,21 +258,21 @@ RCC += -I$(ZINCDIR) endif # With HTTPS support ifdef FOSSIL_ENABLE_SSL -TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR) +TCC += $(XLDARG) -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR) RCC += -I$(OPENSSLINCDIR) endif # With Tcl support ifdef FOSSIL_ENABLE_TCL ifdef FOSSIL_TCL_SOURCE -TCC += -L$(TCLSRCDIR)/win -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win +TCC += $(XLDARG) -L$(TCLSRCDIR)/win -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win RCC += -I$(TCLSRCDIR)/generic -I$(TCLSRCDIR)/win else -TCC += -L$(TCLLIBDIR) -I$(TCLINCDIR) +TCC += $(XLDARG) -L$(TCLLIBDIR) -I$(TCLINCDIR) RCC += -I$(TCLINCDIR) endif endif # With miniz (i.e. instead of zlib) @@ -358,17 +363,17 @@ endif #### SQLite: If enabled, use the system SQLite library. # ifdef USE_SYSTEM_SQLITE -LIB += -lsqlite3 +LIB += $(XLDARG) -lsqlite3 endif #### OpenSSL: Add the necessary libraries required, if enabled. # ifdef FOSSIL_ENABLE_SSL -LIB += -lssl -lcrypto -lgdi32 +LIB += $(XLDARG) -lssl $(XLDARG) -lcrypto $(XLDARG) -lgdi32 endif #### Tcl: Add the necessary libraries required, if enabled. # ifdef FOSSIL_ENABLE_TCL @@ -377,29 +382,31 @@ #### Extra arguments for linking the finished binary. Fossil needs # to link against the Z-Lib compression library. There are no # other mandatory dependencies. # -LIB += -lmingwex +LIB += $(XLDARG) -lmingwex #### When not using the miniz compression library, zlib is required. # ifndef FOSSIL_ENABLE_MINIZ -LIB += -lz +LIB += $(XLDARG) -lz endif #### These libraries MUST appear in the same order as they do for Tcl # or linking with it will not work (exact reason unknown). # ifdef FOSSIL_ENABLE_TCL ifdef FOSSIL_ENABLE_TCL_STUBS -LIB += -lkernel32 -lws2_32 +LIB += $(XLDARG) -lkernel32 $(XLDARG) -lws2_32 else -LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32 +LIB += $(XLDARG) -lnetapi32 $(XLDARG) -lkernel32 +LIB += $(XLDARG) -luser32 $(XLDARG) -ladvapi32 +LIB += $(XLDARG) -lws2_32 endif else -LIB += -lkernel32 -lws2_32 +LIB += $(XLDARG) -lkernel32 $(XLDARG) -lws2_32 endif #### Tcl shell for use in running the fossil test suite. This is only # used for testing. # @@ -973,14 +980,14 @@ $(OBJDIR)/th_tcl.o \ $(OBJDIR)/cson_amalgamation.o zlib: - $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) $(ZLIBCONFIG) -f win32/Makefile.gcc libz.a + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) $(ZLIBCONFIG) -f win32/Makefile.gcc libz.a clean-zlib: - $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc clean + $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) -f win32/Makefile.gcc clean $(ZLIBDIR)/inffas86.o: $(TCC) -c -o $@ -DASMINF -I$(ZLIBDIR) -O3 $(ZLIBDIR)/contrib/inflate86/inffas86.c $(ZLIBDIR)/match.o: @@ -2136,11 +2143,11 @@ -DSQLITE_ENABLE_FTS3_PARENTHESIS \ -DSQLITE_ENABLE_DBSTAT_VTAB \ -DSQLITE_ENABLE_JSON1 \ -DSQLITE_ENABLE_FTS5 \ -DSQLITE_WIN32_NO_ANSI \ - -D_HAVE__MINGW_H \ + $(MINGW_OPTIONS) \ -DSQLITE_USE_MALLOC_H \ -DSQLITE_USE_MSIZE SHELL_OPTIONS = -Dmain=sqlite3_shell \ -DSQLITE_SHELL_IS_UTF8=1 \