From: mistachkin Date: Tue, 13 Jul 2021 21:59:22 +0000 (+0000) Subject: Further revisions to #line handling for amalgamation builds. X-Git-Tag: version-3.37.0~337 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=696555d7b5e7aa7468109901f73308461cb3ab9f;p=thirdparty%2Fsqlite.git Further revisions to #line handling for amalgamation builds. FossilOrigin-Name: 9a84321229ad499ee0f7c85732c2728afb4476c72073a510401a559dda9be38f --- diff --git a/Makefile.in b/Makefile.in index d04d81c164..c771b5bada 100644 --- a/Makefile.in +++ b/Makefile.in @@ -165,7 +165,7 @@ LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) ############################################################################### USE_AMALGAMATION = @USE_AMALGAMATION@ -AMALGAMATION_LINE_TAGS = @AMALGAMATION_LINE_TAGS@ +AMALGAMATION_LINE_MACROS = @AMALGAMATION_LINE_MACROS@ # Object files for the SQLite library (non-amalgamation). # @@ -757,7 +757,7 @@ mptest: mptester$(TEXE) touch .target_source sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl - $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_TAGS) + $(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS) cp tsrc/sqlite3ext.h . cp $(TOP)/ext/session/sqlite3session.h . diff --git a/Makefile.msc b/Makefile.msc index 2b369d7b09..7fd43055ec 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -235,7 +235,7 @@ DEBUG = 0 !ENDIF # <> -# By default, use --line_tags=1 argument to the mksqlite3c.tcl tool, which +# By default, use --linemacros=1 argument to the mksqlite3c.tcl tool, which # is used to build the amalgamation. This can be turned off to ease debug # of the amalgamation away from the source tree. # @@ -788,10 +788,10 @@ MKSQLITE3C_TOOL = $(TOP)\tool\mksqlite3c.tcl !ENDIF !IFNDEF MKSQLITE3C_ARGS -!IF $(NO_LINEMACROS)==0 -MKSQLITE3C_ARGS = --line_tags=1 +!IF $(DEBUG)>1 && $(NO_LINEMACROS)==0 +MKSQLITE3C_ARGS = --linemacros=1 !ELSE -MKSQLITE3C_ARGS = --line_tags=0 +MKSQLITE3C_ARGS = --linemacros=0 !ENDIF !IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0 MKSQLITE3C_ARGS = $(MKSQLITE3C_ARGS) --useapicall diff --git a/configure b/configure index 9ec5ed9005..30f3ed7de0 100755 --- a/configure +++ b/configure @@ -774,7 +774,7 @@ USE_GCOV OPT_FEATURE_FLAGS HAVE_ZLIB USE_AMALGAMATION -AMALGAMATION_LINE_TAGS +AMALGAMATION_LINE_MACROS TARGET_DEBUG TARGET_HAVE_EDITLINE TARGET_HAVE_READLINE @@ -903,7 +903,7 @@ with_readline_lib with_readline_inc enable_debug enable_amalgamation -amalgamation_line_tags +amalgamation_line_macros enable_load_extension enable_math enable_all @@ -10310,9 +10310,9 @@ USE_AMALGAMATION=1 ######### # By default, amalgamation sqlite3.c will have #line directives. # This is a build option not shown by ./configure --help -# To control it, use configure option: amalgamation_line_tags=? +# To control it, use configure option: amalgamation_line_macros=? # where ? is no to suppress #line directives or yes to create them. -AMALGAMATION_LINE_TAGS=--line_tags=1 +AMALGAMATION_LINE_MACROS=--linemacros=1 ######### # See whether we can run specific tclsh versions known to work well; @@ -11286,15 +11286,15 @@ fi ######## # See whether --disable -if test "${amalgamation_line_tags+set}" = set; then : - enableval=$amalgamation_line_tags; +if test "${amalgamation_line_macros+set}" = set; then : + enableval=$amalgamation_line_macros; fi -if test "${amalgamation_line_tags}" = "yes" ; then - AMALGAMATION_LINE_TAGS=--line_tags=1 +if test "${amalgamation_line_macros}" = "yes" ; then + AMALGAMATION_LINE_MACROS=--linemacros=1 fi -if test "${amalgamation_line_tags}" = "no" ; then - AMALGAMATION_LINE_TAGS=--line_tags=0 +if test "${amalgamation_line_macros}" = "no" ; then + AMALGAMATION_LINE_MACROS=--linemacros=0 fi diff --git a/main.mk b/main.mk index 152202cefc..64c25a5139 100644 --- a/main.mk +++ b/main.mk @@ -664,7 +664,7 @@ sqlite3ext.h: target_source cp tsrc/sqlite3ext.h . sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl - tclsh $(TOP)/tool/mksqlite3c.tcl --line_tags=1 + tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros=1 echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c cat sqlite3.c >>tclsqlite3.c echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c diff --git a/manifest b/manifest index 023e749344..8d184cc0c8 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Get\scorrect\s#line\stags\sinto\samalgamation\sfor\sother\sbuilds\stoo. -D 2021-07-13T20:55:26.417 +C Further\srevisions\sto\s#line\shandling\sfor\samalgamation\sbuilds. +D 2021-07-13T21:59:22.649 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 31b3f386d47577c610dedf116aa5deab039c749d36b7735e9bc01a6f31c90f2b +F Makefile.in 83c348515cb62f6f2a2ddf3fd014113ff20564b776e1a614079722c88c6ff43d F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241 -F Makefile.msc a44ead80b4676506954d27c2de6a4d669153f2f7967dedf588b6d9c7c5f46edc +F Makefile.msc d481375cd138e705f749dad2549b2f80d5d76e23132c5fc9be337f7416cb9fc8 F README.md 27fb76aa7eb57ed63a53bbba7292b6bf71f51125554f79f16b5d040edd1e6110 F VERSION c6595fef606851f2bc3ebed6a7386c73751835fc909feab7c093739fa4b3c1d1 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -34,7 +34,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63 F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6 F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559 -F configure 6d4409696c9f91a4a9108123ea52b97d8f2b4f056565e0a4ab62f899944f3acb x +F configure b392a2f2a44673f1e31a5bb266a08256a5bb1428e71fd8c6fbc90f60a88286fe x F configure.ac 4e4b58b32f88c8da9914a2f2c3158f80e69907eccc019fcc7e3ba14ffd91c640 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd @@ -466,7 +466,7 @@ F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk 6e3aceeb728ac72a6c265e24817166c4eb126e17cc49d419591b53372d9db817 +F main.mk 200bf75c882c4822ea722840fc5212f22e5e18773851352c2a0d077958de8b7f F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 @@ -1858,7 +1858,7 @@ F tool/mkshellc.tcl 5fe7e518112b262e25726f248c0f33dd153192867453984b6af0a76a88e9 F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f -F tool/mksqlite3c.tcl e5d1c5b61f530e9307f7dc9c2880ebe5d0578cb3817d8223933f24ca8a74cc2d +F tool/mksqlite3c.tcl 8127f4c2b11078f9dc4956fa1401291b6d6dd81e41a4fd3f74a9710ab16a791c F tool/mksqlite3h.tcl 1f5e4a1dbbbc43c83cc6e74fe32c6c620502240b66c7c0f33a51378e78fc4edf F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b F tool/mkvsix.tcl b9e0777a213c23156b6542842c238479e496ebf5 @@ -1920,7 +1920,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 5d81b598a7cd2cea2553fdf6ca38d2f65f0f1b2d5a8eea8a01c1800f68aa2422 -R 8047cbd4c8070d900b13d435b1c9a26f -U larrybr -Z cd87850b5562004651d7c32e14873964 +P 999eb80018f1bb8a8ad73483610400faf5fb37b1be446ce30edbf7028340f50b +R f35bd0cfcf360e047d19fadb646cae86 +U mistachkin +Z d52b02f968087a7fee10f230044f7d8b diff --git a/manifest.uuid b/manifest.uuid index bf85853f3f..176f226770 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -999eb80018f1bb8a8ad73483610400faf5fb37b1be446ce30edbf7028340f50b \ No newline at end of file +9a84321229ad499ee0f7c85732c2728afb4476c72073a510401a559dda9be38f \ No newline at end of file diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl index afb9740d2b..863eeba801 100644 --- a/tool/mksqlite3c.tcl +++ b/tool/mksqlite3c.tcl @@ -25,11 +25,11 @@ set help {Usage: tclsh mksqlite3c.tcl where is zero or more of the following with these effects: --nostatic => Do not generate with compile-time modifiable linkage. - --line_tags=? => Emit #line directives into output or not. (? = 1 or 0) + --linemacros=? => Emit #line directives into output or not. (? = 1 or 0) --useapicall => Prepend functions with SQLITE_APICALL or SQLITE_CDECL. --srcdir $SRC => Specify the directory containing constituent sources. --help => See this. - The value setting options default to --line_tags=1 and '--srcdir tsrc' . + The value setting options default to --linemacros=1 and '--srcdir tsrc' . } # Begin by reading the "sqlite3.h" header file. Extract the version number @@ -38,7 +38,7 @@ set help {Usage: tclsh mksqlite3c.tcl # set addstatic 1 -set line_tags 1 +set linemacros 1 set useapicall 0 set srcdir tsrc @@ -46,8 +46,9 @@ for {set i 0} {$i<[llength $argv]} {incr i} { set x [lindex $argv $i] if {[regexp {^-?-nostatic$} $x]} { set addstatic 0 - } elseif {[regexp {^-?-line_tags=([01])$} $x ma ulm]} { - set line_tags $ulm + } elseif {[regexp {^-?-linemacros(?:=([01]))?$} $x ma ulm]} { + if {$ulm == ""} {set ulm 1} + set linemacros $ulm } elseif {[regexp {^-?-useapicall$} $x]} { set useapicall 1 } elseif {[regexp {^-?-srcdir$} $x]} { @@ -204,11 +205,11 @@ proc section_comment {text} { # proc copy_file {filename} { global seen_hdr available_hdr varonly_hdr cdecllist out - global addstatic line_tags useapicall srcdir + global addstatic linemacros useapicall srcdir set ln 0 set tail [file tail $filename] section_comment "Begin file $tail" - if {$line_tags} {puts $out "#line 1 \"$filename\""} + if {$linemacros} {puts $out "#line 1 \"$filename\""} set in [open $filename r] set varpattern {^[a-zA-Z][a-zA-Z_0-9 *]+(sqlite3[_a-zA-Z0-9]+)(\[|;| =)} set declpattern {([a-zA-Z][a-zA-Z_0-9 ]+ \**)(sqlite3[_a-zA-Z0-9]+)(\(.*)} @@ -228,7 +229,7 @@ proc copy_file {filename} { section_comment "Include $hdr in the middle of $tail" copy_file $srcdir/$hdr section_comment "Continuing where we left off in $tail" - if {$line_tags} {puts $out "#line [expr {$ln+1}] \"$filename\""} + if {$linemacros} {puts $out "#line [expr {$ln+1}] \"$filename\""} } else { # Comment out the entire line, replacing any nested comment # begin/end markers with the harmless substring "**". @@ -250,7 +251,7 @@ proc copy_file {filename} { } } elseif {[regexp {^#ifdef __cplusplus} $line]} { puts $out "#if 0" - } elseif {!$line_tags && [regexp {^#line} $line]} { + } elseif {!$linemacros && [regexp {^#line} $line]} { # Skip #line directives. } elseif {$addstatic && ![regexp {^(static|typedef|SQLITE_PRIVATE)} $line]} {