From: mistachkin Date: Sat, 30 Jun 2012 16:22:05 +0000 (+0000) Subject: Make use of the predefined nmake command macro CC when possible instead of the litera... X-Git-Tag: version-3.7.14~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e37f99cbef0a0e62d4704097e50a5bc7ff316852;p=thirdparty%2Fsqlite.git Make use of the predefined nmake command macro CC when possible instead of the literal string 'cl.exe'. Improve support for cross-compilation. Eliminate problematic use of double quotes in macro preprocessing expressions. FossilOrigin-Name: 6c88229aa39775a7438befebe1640a30affc72c8 --- diff --git a/Makefile.msc b/Makefile.msc index c42f949d6e..5d961bffcd 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -42,16 +42,38 @@ 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 +# the legacy default value 'cl.exe'. +# +!IFNDEF CC +CC = cl.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 +# 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: +# +# nmake /f Makefile.msc "NCC=""%VCINSTALLDIR%\bin\cl.exe""" +# +!IFNDEF NCC +NCC = $(CC) +!ENDIF + # C Compiler and options for use in building executables that # will run on the platform that is doing the build. # -BCC = cl.exe -W3 +BCC = $(NCC) -W3 # C Compile 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.) # -TCC = cl.exe -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise +TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I. -I$(TOP)\src -fp:precise # When compiling the library for use in the WinRT environment, # the following compile-time options must be used as well to @@ -135,43 +157,43 @@ TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 # prior to running nmake in order to match the actual installed location and # version on this machine. # -!if "$(TCLINCDIR)" == "" +!IFNDEF TCLINCDIR TCLINCDIR = c:\tcl\include -!endif +!ENDIF -!if "$(TCLLIBDIR)" == "" +!IFNDEF TCLLIBDIR TCLLIBDIR = c:\tcl\lib -!endif +!ENDIF -!if "$(LIBTCL)" == "" +!IFNDEF LIBTCL LIBTCL = tcl85.lib -!endif +!ENDIF # The locations of the ICU header and library files. These variables # (ICUINCDIR, ICULIBDIR, and LIBICU) may be overridden via the environment # prior to running nmake in order to match the actual installed location on # this machine. # -!if "$(ICUINCDIR)" == "" +!IFNDEF ICUINCDIR ICUINCDIR = c:\icu\include -!endif +!ENDIF -!if "$(ICULIBDIR)" == "" +!IFNDEF ICULIBDIR ICULIBDIR = c:\icu\lib -!endif +!ENDIF -!if "$(LIBICU)" == "" +!IFNDEF LIBICU LIBICU = icuuc.lib icuin.lib -!endif +!ENDIF # This is the command to use for tclsh - normally just "tclsh", but we may # know the specific version we want to use. This variable (TCLSH_CMD) may be # overridden via the environment prior to running nmake in order to select a # specific Tcl shell to use. # -!if "$(TCLSH_CMD)" == "" +!IFNDEF TCLSH_CMD TCLSH_CMD = tclsh85 -!endif +!ENDIF # Compiler options needed for programs that use the readline() library. # @@ -191,9 +213,9 @@ TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 # Any target libraries which libsqlite must be linked against # -!if "$(TLIBS)" == "" +!IFNDEF TLIBS TLIBS = -!endif +!ENDIF # Flags controlling use of the in memory btree implementation # @@ -255,7 +277,7 @@ LTLINK = $(TCC) -Fe$@ # Note that the vcvars*.bat family of batch files typically # set this for you. Otherwise, the linker will attempt # to deduce the binary type based on the object files. -!IF "$(PLATFORM)"!="" +!IFDEF PLATFORM LTLINKOPTS = /MACHINE:$(PLATFORM) LTLIBOPTS = /MACHINE:$(PLATFORM) !ENDIF diff --git a/manifest b/manifest index ad7995d713..ead73d4c61 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Another\schanges\sto\sthe\sshell\sin\ssupport\sof\sSQLITE_OMIT_AUTOINIT. -D 2012-06-27T16:41:31.500 +C Make\suse\sof\sthe\spredefined\snmake\scommand\smacro\sCC\swhen\spossible\sinstead\sof\sthe\sliteral\sstring\s'cl.exe'.\s\sImprove\ssupport\sfor\scross-compilation.\s\sEliminate\sproblematic\suse\sof\sdouble\squotes\sin\smacro\spreprocessing\sexpressions. +D 2012-06-30T16:22:05.485 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 8f6d858bf3df9978ba43df19985146a1173025e4 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 0100213e86c66ed5ac37ea98446406c06f012203 +F Makefile.msc d5fe268f23e35af9a6b8c6c7df983dda65f0a017 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 95c0c995fd18c2de907a39fc52299c8abe502b68 -R 8764407565c7470a7af4e28914ff89fc -U drh -Z 848177401525cd9b79cf5683d5f4213a +P 3b4f5add04259eec145066312bcd532182cc339c +R 437136894c0f887fea4db99bcef8bbec +U mistachkin +Z e6de48dad2c2672c700a9587a09ef1b4 diff --git a/manifest.uuid b/manifest.uuid index ecee8360b8..486e7319bb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3b4f5add04259eec145066312bcd532182cc339c \ No newline at end of file +6c88229aa39775a7438befebe1640a30affc72c8 \ No newline at end of file