Setup the necessary library paths for cross-compilation with MSVC.

FossilOrigin-Name: 7fac56ed9feda819e66070bd5e06db8cad77e8bd
This commit is contained in:
mistachkin 2012-06-30 22:22:34 +00:00
parent 228aeffb86
commit bd58d5f7a3
3 changed files with 58 additions and 18 deletions

View File

@ -19,6 +19,11 @@ USE_ICU = 0
#
USE_CRT_DLL = 0
# Set this non-0 to use the native libraries paths for cross-compiling
# the command line tools needed during the compilation process.
#
USE_NATIVE_LIBPATHS = 0
# Set this non-0 to compile binaries suitable for the WinRT environment.
# This setting does not apply to any binaries that require Tcl to operate
# properly (i.e. the text fixture, etc).
@ -43,7 +48,7 @@ SYMBOLS = 1
DEBUG = 0
# Check for the predefined command macro CC. This should point to the compiler
# binary for the target platform. If it does not exist, simply define it to
# binary for the target platform. If it is not defined, simply define it to
# the legacy default value 'cl.exe'.
#
!IFNDEF CC
@ -51,7 +56,7 @@ CC = cl.exe
!ENDIF
# Check for the command macro LD. This should point to the linker binary for
# the target platform. If it does not exist, simply define it to the legacy
# the target platform. If it is not defined, simply define it to the legacy
# default value 'link.exe'.
#
!IFNDEF LD
@ -59,25 +64,53 @@ LD = link.exe
!ENDIF
# Check for the command macro NCC. This should point to the compiler binary
# for the platform the compilation process is taking place on. If it does not
# exist, simply define it to have the same value as the CC macro. When
# for the platform the compilation process is taking place on. If it is not
# defined, simply define it to have the same value as the CC macro. When
# cross-compiling, it is suggested that this macro be modified via the command
# line (since nmake itself does not provide a built-in method to guess it).
# For example, to use the x86 compiler when cross-compiling for x64, a command
# line similar to the following could be used:
# line similar to the following could be used (all on one line):
#
# nmake /f Makefile.msc "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
# nmake /f Makefile.msc
# "NCC=""%VCINSTALLDIR%\bin\cl.exe"""
# USE_NATIVE_LIBPATHS=1
#
!IFNDEF NCC
NCC = $(CC)
!ENDIF
# C Compiler and options for use in building executables that
# Check for the MSVC runtime library path macro. Othertise, this
# value will default to the 'lib' directory underneath the MSVC
# installation directory.
#
!IFNDEF NCRTLIBPATH
NCRTLIBPATH = $(VCINSTALLDIR)\lib
!ENDIF
# Check for the Platform SDK library path macro. Othertise, this
# value will default to the 'lib' directory underneath the Windows
# SDK installation directory (the environment variable used appears
# to be available when using Visual C++ 2008 or later via the
# command line).
#
!IFNDEF NSDKLIBPATH
NSDKLIBPATH = $(WINDOWSSDKDIR)\lib
!ENDIF
# C compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
BCC = $(NCC) -W3
# C Compile and options for use in building executables that
# Check if the native library paths should be used when compiling
# the command line tools used during the compilation process. If
# so, set the necessary macro now.
#
!IF $(USE_NATIVE_LIBPATHS)!=0
NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)"
!ENDIF
# C compiler and options for use in building executables that
# will run on the target platform. (BCC and TCC are usually the
# same unless your are cross-compiling.)
#
@ -142,11 +175,18 @@ TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE
!ENDIF
#
# Prevent warnings about "insecure" runtime library functions being used.
# Prevent warnings about "insecure" MSVC runtime library functions
# being used.
#
TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
#
# Prevent warnings about "deprecated" POSIX functions being used.
#
TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
#
# Use native Win32 heap instead of malloc/free?
#
@ -684,7 +724,7 @@ lempar.c: $(TOP)\src\lempar.c
copy $(TOP)\src\lempar.c .
lemon.exe: $(TOP)\tool\lemon.c lempar.c
$(BCC) -Fe$@ $(TOP)\tool\lemon.c
$(BCC) -Daccess=_access -Fe$@ $(TOP)\tool\lemon.c /link $(NLTLIBPATHS)
# Rules to build individual *.lo files from generated *.c files. This
# applies to:
@ -940,7 +980,7 @@ sqlite3.h: $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP) > sqlite3.h
mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
$(BCC) -Fe$@ $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c
$(BCC) -Fe$@ $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)\tool\mkkeywordhash.c /link $(NLTLIBPATHS)
keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
.\mkkeywordhash.exe > keywordhash.h

View File

@ -1,9 +1,9 @@
C Simplify\susage\sof\ssome\slinker\soptions\sin\sthe\sMSVC\smakefile.
D 2012-06-30T19:24:09.458
C Setup\sthe\snecessary\slibrary\spaths\sfor\scross-compilation\swith\sMSVC.
D 2012-06-30T22:22:34.095
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 8f6d858bf3df9978ba43df19985146a1173025e4
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc 04ebadf5e94d566d4ef9f636416f68e17205120f
F Makefile.msc 56ff0fcc3fc3b275aec7f6acb34b3c0526c684bc
F Makefile.vxworks 879f034a64062a364b21000266bbd5bc6e0c19b9
F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
F VERSION a71848df48082f1d6585d4b0819d530fc455485d
@ -1004,7 +1004,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P 6c88229aa39775a7438befebe1640a30affc72c8
R 0706037ca6af4d59d9bcb1545687aa13
P 03016020664a7459cb01c8ac9016b20af8a416bb
R 3838aec4be451692e3019372e4566300
U mistachkin
Z 4412848c1478fd90700fa3f54861d772
Z 6999152625f8f616344bc02a959eabf4

View File

@ -1 +1 @@
03016020664a7459cb01c8ac9016b20af8a416bb
7fac56ed9feda819e66070bd5e06db8cad77e8bd