From: drh <> Date: Fri, 2 Aug 2024 15:28:40 +0000 (+0000) Subject: New MSVC makefile targets: tclextension, tclextension-install, X-Git-Tag: version-3.47.0~267 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dcea6335c7e8c50194a341da328f52822a5fa54c;p=thirdparty%2Fsqlite.git New MSVC makefile targets: tclextension, tclextension-install, tclextension-uninstall, and tclextension-list. FossilOrigin-Name: c38734f57509c50dd28029738dd602600950703b773d9b7b60fdb1dcb06e8fd8 --- diff --git a/Makefile.msc b/Makefile.msc index a5191739ff..e31aee0899 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -1820,6 +1820,19 @@ pkgIndex.tcl: $(TOP)\VERSION $(SQLITE3TCLDLL): libtclsqlite3.lib $(LIBRESOBJS) tclsqlite3.def pkgIndex.tcl $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:tclsqlite3.def /OUT:$@ libtclsqlite3.lib $(LIBRESOBJS) $(LTLIBS) $(TLIBS) + +tclextension: $(SQLITE3TCLDLL) + +tclextension-install: $(SQLITE3TCLDLL) + $(TCLSH_CMD) $(TOP)\tool\buildtclext.tcl --install-only + +tclextension-uninstall: + $(TCLSH_CMD) $(TOP)\tool\buildtclext.tcl --uninstall + +tclextension-list: + $(TCLSH_CMD) $(TOP)\tool\buildtclext.tcl --info + + # <> $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) diff --git a/manifest b/manifest index a208551566..0e8de61d1a 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Fix\stypo\sin\sa\sprogress\smessage\sin\sthe\sbuilttclext.tcl\sscript. -D 2024-08-02T13:56:55.670 +C New\sMSVC\smakefile\stargets:\s\stclextension,\stclextension-install,\ntclextension-uninstall,\sand\stclextension-list. +D 2024-08-02T15:28:40.391 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F Makefile.in d9d8d60efaad73dde2ed2380ab3ae3b9b15cb98089d0a7d0573f39de7f093ea2 F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 -F Makefile.msc 993f8addade63bcac7192416e7161ceee60edcee2376299ea48b2a74c66ac2d5 +F Makefile.msc 6c3fe8b6ce60e73f34a148c957d78b4648745c8d30e792423aa1a8d8bf12d065 F README.md 6358805260a03ebead84e168bbf3740ddf3f683b477e478567186aa7afb490d3 F VERSION 0db40f92c04378404eb45bff93e9e42c148c7e54fd3da99469ed21e22411f5a6 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -2093,7 +2093,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5 -F tool/buildtclext.tcl 6b8907c6a7b6734940513886d06ea9c00d2f3ba62ce39208db4e2ea5d115198b +F tool/buildtclext.tcl b64d250517b148e644d26fcbc097851867a0df52cd4bafe9bcd94b8421e1428a F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2202,8 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P a59319fe4adc094381c46e490289b3e0cda8f804edaea6984571c47a68a23eef -R 50f27b8d2c62eae13aeca51f3735d0b2 +P 5e7c94645632b736e805428ff4c135666ab525fac99c29c12d5127b06f39fc6e +R 34f8aa4c5bd786ba6f617a118e3aad0d U drh -Z d21a99cc930b4bc362ff91cb037b47fd +Z 99d8311f9a3fa0ec204446f79bbc573f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index bd9c9a3c54..e3145013e7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5e7c94645632b736e805428ff4c135666ab525fac99c29c12d5127b06f39fc6e +c38734f57509c50dd28029738dd602600950703b773d9b7b60fdb1dcb06e8fd8 diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index 016f5751d2..6d9e4c3063 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -32,8 +32,12 @@ for {set ii 0} {$ii<[llength $argv]} {incr ii} { } elseif {$a0=="--build-only"} { set install 0 } elseif {$a0=="--uninstall"} { + set build 0 + set install 0 set uninstall 1 } elseif {$a0=="--info"} { + set build 0 + set install 0 set infoonly 1 } elseif {$a0=="--cc" && $ii+1<[llength $argv]} { incr ii @@ -57,79 +61,93 @@ set fd [open $srcdir/VERSION] set VERSION [string trim [read $fd]] close $fd -# Figure out the location of the tclConfig.sh file used by the -# tclsh that is executing this script. -# -if {[catch { - set LIBDIR [tcl::pkgconfig get libdir,install] -}]} { - puts stderr "$argv0: tclsh does not support tcl::pkgconfig." - exit 1 -} -if {![file exists $LIBDIR]} { - puts stderr "$argv0: cannot find the tclConfig.sh file." - puts stderr "$argv0: tclsh reported library directory \"$LIBDIR\"\ - does not exist." - exit 1 -} -if {![file exists $LIBDIR/tclConfig.sh] - || [file size $LIBDIR/tclConfig.sh]<5000} { - set n1 $LIBDIR/tcl$::tcl_version - if {[file exists $n1/tclConfig.sh] - && [file size $n1/tclConfig.sh]>5000} { - set LIBDIR $n1 - } else { - puts stderr "$argv0: cannot find tclConfig.sh in either $LIBDIR or $n1" +if {$tcl_platform(platform)=="windows"} { + # We are only able to install, uninstall, and list on Windows. + # The build process is handled by the Makefile.msc, specifically + # using "nmake /f Makefile.msc pkgIndex.tcl tclsqlite3.dll" + # + if {$build} { + puts "Unable to build on Windows using the builttclext.tcl script." + puts "To build, run\n" + puts " \"nmake /f Makefile.msc pkgIndex.tcl tclsqlite3.dll" exit 1 } -} - -# Read the tclConfig.sh file into the $tclConfig variable -# -#puts "using $LIBDIR/tclConfig.sh" -set fd [open $LIBDIR/tclConfig.sh rb] -set tclConfig [read $fd] -close $fd + set OUT tclsqlite3.dll +} else { + # Figure out the location of the tclConfig.sh file used by the + # tclsh that is executing this script. + # + if {[catch { + set LIBDIR [tcl::pkgconfig get libdir,install] + }]} { + puts stderr "$argv0: tclsh does not support tcl::pkgconfig." + exit 1 + } + if {![file exists $LIBDIR]} { + puts stderr "$argv0: cannot find the tclConfig.sh file." + puts stderr "$argv0: tclsh reported library directory \"$LIBDIR\"\ + does not exist." + exit 1 + } + if {![file exists $LIBDIR/tclConfig.sh] + || [file size $LIBDIR/tclConfig.sh]<5000} { + set n1 $LIBDIR/tcl$::tcl_version + if {[file exists $n1/tclConfig.sh] + && [file size $n1/tclConfig.sh]>5000} { + set LIBDIR $n1 + } else { + puts stderr "$argv0: cannot find tclConfig.sh in either $LIBDIR or $n1" + exit 1 + } + } -# Extract parameter we will need from the tclConfig.sh file -# -set TCLMAJOR 8 -regexp {TCL_MAJOR_VERSION='(\d)'} $tclConfig all TCLMAJOR -set SUFFIX so -regexp {TCL_SHLIB_SUFFIX='\.([^']+)'} $tclConfig all SUFFIX -if {$CC==""} { - set cc {} - regexp {TCL_CC='([^']+)'} $tclConfig all cc - if {$cc!=""} { - set CC $cc + # Read the tclConfig.sh file into the $tclConfig variable + # + #puts "using $LIBDIR/tclConfig.sh" + set fd [open $LIBDIR/tclConfig.sh rb] + set tclConfig [read $fd] + close $fd + + # Extract parameter we will need from the tclConfig.sh file + # + set TCLMAJOR 8 + regexp {TCL_MAJOR_VERSION='(\d)'} $tclConfig all TCLMAJOR + set SUFFIX so + regexp {TCL_SHLIB_SUFFIX='\.([^']+)'} $tclConfig all SUFFIX + if {$CC==""} { + set cc {} + regexp {TCL_CC='([^']+)'} $tclConfig all cc + if {$cc!=""} { + set CC $cc + } + } + if {$CC==""} { + set CC gcc + } + set CFLAGS -fPIC + regexp {TCL_SHLIB_CFLAGS='([^']+)'} $tclConfig all CFLAGS + set LIBS {} + regexp {TCL_STUB_LIB_SPEC='([^']+)'} $tclConfig all LIBS + set INC "-I$srcdir/src" + set inc {} + regexp {TCL_INCLUDE_SPEC='([^']+)'} $tclConfig all inc + if {$inc!=""} { + append INC " $inc" + } + set cmd {${CC} ${CFLAGS} ${LDFLAGS} -shared} + regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd + set LDFLAGS "$INC -DUSE_TCL_STUBS" + if {[string length $OPTS]>1} { + append LDFLAGS $OPTS + } + set CMD [subst $cmd] + if {$TCLMAJOR>8} { + set OUT libtcl9sqlite$VERSION.$SUFFIX + } else { + set OUT libsqlite$VERSION.$SUFFIX } } -if {$CC==""} { - set CC gcc -} -set CFLAGS -fPIC -regexp {TCL_SHLIB_CFLAGS='([^']+)'} $tclConfig all CFLAGS -set LIBS {} -regexp {TCL_STUB_LIB_SPEC='([^']+)'} $tclConfig all LIBS -set INC "-I$srcdir/src" -set inc {} -regexp {TCL_INCLUDE_SPEC='([^']+)'} $tclConfig all inc -if {$inc!=""} { - append INC " $inc" -} -set cmd {${CC} ${CFLAGS} ${LDFLAGS} -shared} -regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd -set LDFLAGS "$INC -DUSE_TCL_STUBS" -if {[string length $OPTS]>1} { - append LDFLAGS $OPTS -} -set CMD [subst $cmd] -if {$TCLMAJOR>8} { - set OUT libtcl9sqlite$VERSION.$SUFFIX -} else { - set OUT libsqlite$VERSION.$SUFFIX -} - + # Show information about prior installs # if {$infoonly} {