Commit Graph

159 Commits (97bc6918b179fffc29d97908519d50140415b22c)

Author SHA1 Message Date
Giel van Schijndel bf5230b419 Don't fetch the primary key, as we probably don't need it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5373 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 20:07:58 +00:00
Giel van Schijndel 00ffe3f55d Generate multi-line SELECT statements instead of single-line ones
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5372 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 20:03:38 +00:00
Giel van Schijndel 0cf5917686 Don't create an unnecessary temporary
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5371 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 20:03:27 +00:00
Giel van Schijndel 8a0dcfa4ac Add Makefile to produce test-output from test-input for DB mini language code generators
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5370 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:23:38 +00:00
Giel van Schijndel 14d3ccca36 Remove commented out & useless code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5369 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:57 +00:00
Giel van Schijndel a1cb6521fc "die" on a parsing error, don't just print "Unmatched line"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5368 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:46 +00:00
Giel van Schijndel c6647ae996 Move duplicated looping out of the code generators
Move the duplicated effort of looping over all structs and enums out of the code generators and into the code that invokes the code generator. Thus instead of invoking the code generator once to generate code for all structs and enums, we now invoke it once for every struct and enum.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5367 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:36 +00:00
Giel van Schijndel 6d7cbe3576 Code generators don't need to know how many code to generate anymore
A slight modification to the code generators removes their need for needing to know how many elements (enums or structs) it needs to generate code.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5366 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:10:25 +00:00
Giel van Schijndel f5055899db Add a code generator for SQL SELECT statements
Add a new code generator for the database mini-meta-language. It creates SQL SELECT statements that use INNER JOINs to join all fields across the inheritance hierarchy in a single result row.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5365 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:05:43 +00:00
Giel van Schijndel fc1f447adf Only auto-increment the ID for the base class
Don't add an AUTOINCREMENT clause to the PRIMARY KEY, ID column if it we're not working on the abstract base class.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5364 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:04:10 +00:00
Giel van Schijndel 0814e56caa Add file headers and leaders to generated files
Give the code generators the opportunity to print something at the start and the end of the file. E.g. header guards for C files, and some notice about the file being automatically generated for all types.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5363 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 19:04:00 +00:00
Giel van Schijndel 309517fc95 Rename test_code to test_code.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5362 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:56:34 +00:00
Giel van Schijndel cc3f64a21a Rewrite SQL table generator for new parser architecture
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5361 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:55:26 +00:00
Giel van Schijndel 505446f69a Don't process the "set" field type as a field qualifier. Instead rename and modify preProcessQualifiers and postProcessQualifiers to preProcessField and postProcessField respectively. These functions now parse the field's types as well as the field's qualifiers.
In addition we now also parse the "unique" keyword in set and enum lines and thus process it there as well.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5360 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:55:17 +00:00
Giel van Schijndel 3df34aeaa7 Rewrite the code generator and parser for the database metalanguage to perform less (or no) parsing in the code generators.
Instead we now have a two phase process:
 * First parse and build an abstract syntax tree (AST)
 * Secondly loop over the generated AST to produce useable code for the target language.

NOTE: Currently only the C struct definition generator is rewritten to this new architecture.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5359 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:55:06 +00:00
Giel van Schijndel 9db4235480 Add a code generator for my database meta-language
This code generator is still in a prototyping phase. It'll probably get rewritten entirely.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5358 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 18:45:32 +00:00
Dennis Schridde 45f23a4926 Merge commit 'HEAD@{3}'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5347 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 22:32:44 +00:00
Dennis Schridde fcd1455f44 Merge commit 'HEAD@{4}'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5346 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 22:32:14 +00:00
Dennis Schridde 7af41b6f3a Substitute / with $(DIRSEP) where necessary. Fixes last remainder of bug #11883 (hopefully).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5326 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-25 00:13:18 +00:00
Dennis Schridde 050ec39c11 Use the (also new in this commit) relative variants of the directories almost everywhere.
Exception is when generating the .wz files, where we need the path to the build directory and building a reverse relative path to $(srcdir) will be messy.
Also silence submake.mk a great deal.
Bug #11883 should be fixed now for the most part.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5325 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 23:41:52 +00:00
Dennis Schridde fd2bfb0e0f Prepare for another fix for parts of bug #11883: Issues with the improved raw Makefiles
- Rename Makefile.raw to lowercase


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5321 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 22:48:45 +00:00
Dennis Schridde 73b35ab8d6 Rename top_srcdir/top_builddir to abs_top_srcdir/abs_top_builddir, to make this more obvious.
Their use is currently flawed, since it will not work in directories with spaces in them... (


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5319 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 20:19:54 +00:00
Dennis Schridde 9bd8b24921 Boost raw Makefiles
- Use PACKAGE, PACKAGE_VERSION, remove VERSION
- Allow out-of-source-dir builds (mkdir build && cd build && make -f ../Makefile.raw)
- Move config.mk from $(top_srcdir)/makerules/config.mk to $(top_builddir)/config.mk
   When keeping current behaviour (srcdir=builddir), this means: Move it from makerules into the main directory


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5308 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 13:54:47 +00:00
Dennis Schridde aa2c897bd2 Usage of system() requires inclusion of cstdlib
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5307 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 13:49:12 +00:00
Dennis Schridde d747950e75 Fix ambigous else
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4711 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 23:56:20 +00:00
Giel van Schijndel 6f0a6c4988 Also use a CPPFLAGS_FOR_BUILD (alongside CC and CXX) and pass it to the configure script as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4588 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-13 23:00:40 +00:00
Roman C 49903f9593 Get rid of unnecessary warnings when compiling release build using MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4462 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 15:56:39 +00:00
Dennis Schridde d6347dd5e7 Include climits (instead of unistd.h) for PATH_MAX. Use C++ headers instead of C ones.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4398 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 19:24:31 +00:00
Giel van Schijndel 5e50119a53 Fix compilation of autorevision on Windows (a copy&paste error)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4387 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 15:24:37 +00:00
Giel van Schijndel 93517102da Add code for extracting the Subversion revision numbers from a git-svn repository
Inspired by http://svn.voria.com/code/synfig-studio/trunk/build_tools/autorevision.sh from Paul Wise
(GPLv2, git invocations where taken from that script)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4380 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 00:37:29 +00:00
Roman C a1008c093d Reduce amount of junk in the MSVC compilation output by about 70%.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4279 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 22:15:28 +00:00
Dennis Schridde cb2f0a30df Patch MSVC Solution file to depend on SQLite and change eol-style to native for them, since otherwise patches will not apply.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4044 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-14 18:16:04 +00:00
Dennis Schridde 3858daf4a1 Reset MSVC version from 9 to 8, since otherwise MSVC8 will refuse to load the project files. (bug #11219)
Does MS provide some kind of templating system? Like autotools generate Makefiles from Makefile.am.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3950 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 11:28:40 +00:00
Dennis Schridde d3455b699a Properly set include/library directories for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3949 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 01:45:45 +00:00
Dennis Schridde 3cdcf273a4 Include cstring for gcc 4.3 compatibility.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3496 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-16 10:47:43 +00:00
Dennis Schridde 31a863a90b Setup eol-style CRLF for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3473 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 20:49:48 +00:00
Dennis Schridde d7bbab46af Set eol-style and mime-type for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3471 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 19:55:59 +00:00
Dennis Schridde c64b565f14 Patch #872 by Buginator. Untested by me since in Bugs we trust. ;)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3020 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 19:10:34 +00:00
Giel van Schijndel bd1609e838 * Add two variables: CC_FOR_BUILD & CXX_FOR_BUILD to aid in building for the "build" machine when cross compiling, instead of the "host" machine
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2999 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-07 21:51:52 +00:00
Dennis Schridde 3b84c84a68 Of course this wouldn't have worked like that... (automake depends on files, not on targets)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2994 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-07 20:59:44 +00:00
Dennis Schridde 4e3cdc53c6 Some fixes for autorevision buildsystem. Still doesn't work as expected...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2993 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-07 19:36:04 +00:00
Giel van Schijndel 1c4d4b297e * Rename auto_revision to autorevision
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2954 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-02 01:11:20 +00:00
Giel van Schijndel 764a456efc * In AutoRevision set 'LC_ALL' to 'C', as well as 'LANG' which already is set to 'C'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2869 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-25 11:07:11 +00:00
Giel van Schijndel 7b0a6d7686 * Add a MSVC project file for AutoRevision
* Add it to the MSVC Workspace/Solution
 * Set svn:eol-style on the MSVC project & solution files to CRLF

Patch #832 by Buginator.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2752 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-07 15:13:09 +00:00
Giel van Schijndel 94b04775fb * Make sure that AutorRevision can be compiled even when using Unicode (makes lots of WINAPI functions accept UTF-16 LE instead of ASCII)
* Use SetEnvironmentVariableA instead of SetEnvironmentVariable which is a macro
Issue pointed out by Buginator

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2748 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 19:24:48 +00:00
Giel van Schijndel 6a2d26babd * Try '''harder''' to detect Windows platforms
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2747 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 19:17:36 +00:00
Giel van Schijndel 9f9cc3b697 * When compiling AutoRevision on MSVC make sure to #define popen and pclose as _popen and _pclose respectively
Fix provided by Buginator in bug #10269


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2743 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 14:32:17 +00:00
Giel van Schijndel 854c5eba1c * In revision information extraction class RevSVNVersionQuery (uses "svnversion"), ignore its output if the word "exported" is encountered (that way compiling from an exported working copy is possible also)
* Parse the "/autorevision.conf" file as last
 * Add template class assign_once<T> which wraps a T object so that it can only be assigned to once (all following assignments will simply be NO-OPS)
 * Make all RevisionInformation members an assign_once<T> object instead of a T object
 * Make sure src/version.c can compile when there is little revision information available
 * Add autorevision.conf which will provide a sane default for wc_uri ("trunk")


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2731 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-05 18:43:30 +00:00
Giel van Schijndel 59c1b8fc11 * Add AutoRevision to raw makefile system
* Set raw makefiles up to use AutoRevision to generate src/autorevision.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2722 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-05 02:29:46 +00:00
Giel van Schijndel 71a6991cd7 * Add a new revision info extraction class (subclass of RevisionExtractor): RevConfigFile
* This class extracts revision info from a "var=value" style text file (can be used in tarballs)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2721 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-05 01:41:59 +00:00
Giel van Schijndel eebb1dd97f * Add struct RevisionInformation to bind all revision info together
* Add a new subclass of RevisionExtractor: RevSVNVersionQuery
  * This subclass will use "svnversion" to additionally detect mixed revisions, modifications and switched paths in working copies
 * Add the "low revision", modification and switch state to the output


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2720 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 23:08:17 +00:00
Giel van Schijndel 39e6d26a1f * Add an abstract base class for the extraction of revision information: RevisionExtractor
* This class uses the "Chain of Responsibility" pattern to delegate a task the current subclass cannot perform to a successor in the chain
 * Make QuerySVN() and ParseFile() part of subclasses derived from RevisionExtractor
  * Also make these functions function properly in the chain of responsibility


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2716 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 18:20:00 +00:00
Giel van Schijndel 7191ed7e92 * Set LANG=C in AutoRevision before executing "svn info" rather than the non-portable LANG=en_US
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2656 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 15:40:34 +00:00
Giel van Schijndel ac60bfc81f * Modify function QuerySvn such that we take advantage of std::string's interface rather than using low-level (i.e. character-level) string manipulations (e.g. remove a whole chunk at the end of a string rather than a separate character every time)
* Allow the #definition of SVN_AUTOREVISION_STATIC before #include AutoRevision's output file
   * When #defined to "static" it will mark all variables created in AutoRevision as static
 * Additionally detect the "base-uri" of a working copy (e.g. "trunk", "branches/2.0", etc.) and dump it in the output header file


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2624 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-25 20:42:03 +00:00
Giel van Schijndel 9c3db2f6e6 * Add building of Autorevision to the automake build-system
* Make the automake build-system use Autorevision to produce src/autorevision.h
   * Add it to the clean-local target as well!
 * Ignore src/autorevision.h (in "svn status")


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2579 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-21 18:53:24 +00:00
Giel van Schijndel ae8c4b6d2f Autorevision:
* Make function WriteOutput const-correct
 * Mark global variables static
 * Add commandline option "+cstr" which results in Autorevision adding a C-style string into the produced header file
 * When no revision information could be extracted from a working copy give an error message
 * Add some comments
 * Move some variables into a more local scope
 * Don't use member function .close() on iostreams just before leaving scope (the destructor will take care of that!)
 * Don't write the header file in binary mode
 * Fix handling of do_translate
 * Now DO dump revision date as well
 * Add double-quotes around strings


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2578 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-21 17:02:16 +00:00
Giel van Schijndel 355c7a6b0b Autorevision:
* Use C++ iostreams for output as well as input (which was already being used)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2577 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-21 15:50:50 +00:00
Giel van Schijndel 4849d5bf94 * Use revision 3545 (in the Code::Blocks repository) of autorevision instead; it doesn't depend on TinyXML
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2576 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-21 15:11:43 +00:00
Giel van Schijndel 2ebe3ddc28 * Add a build-time tool "autorevision", which I copied from the Code::Blocks project (GPLv2+)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2575 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-21 14:33:16 +00:00