Commit Graph

154 Commits (cb279c37c469c1bb9659ee88a952c79aa7879336)

Author SHA1 Message Date
Giel van Schijndel 3ca7c41f58 Don't add %valprefix to %max
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5490 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 11:13:01 +00:00
Giel van Schijndel dc0aa99fac Allow empty value prefixes as well (using the %valprefix directive)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5486 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:23:19 +00:00
Giel van Schijndel b1d12b5a1a * Add a new enum-level qualifier: %valprefix; this changes the default prefix (which is just the enum's name with '_' appended) prefixed to all enum values
* Add a new enum that uses this: COMPONENT_TYPE


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5484 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 21:24:39 +00:00
Giel van Schijndel 87ad15af6a * Add a new struct-level directive: %suffix
- This directive adds a suffix to the names of structs (in the generated C code) and the subclasses that inherit from that struct
 * Use %suffix instead of %prefix in test_code.tpl


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5483 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 21:11:24 +00:00
Giel van Schijndel 2a11247d7e Add a new enum-level directive: %max "param":
* This will add an enumerator to the end of the generated C enum code with "param" as its name (prefixed by the enum's name of course)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5482 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 21:02:58 +00:00
Giel van Schijndel eb7bd7be49 Update test_code.tpl as well to match r5480's change in syntax
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5481 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:52:57 +00:00
Giel van Schijndel 118a83f42a Slight change in syntax to not require (and disallow) a semi-colon after struct-level directives that open a new scope (terminated with "end\;"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5480 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:52:09 +00:00
Giel van Schijndel c7f60d7e7d #include "lib/sqlite3/sqlite3.h" in generated SQLite loading code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5479 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:44:14 +00:00
Giel van Schijndel 82a2aea03f c_structdef_cg.pm: Fix an error where we forgot to use the \{"name"\} member of the hash thus resulting in bad code being generated
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5478 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:43:26 +00:00
Dennis Schridde c2f5375cb2 Remove crossbuild hacks, which probably not worked like that on Windows anyway.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5477 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:17:13 +00:00
Dennis Schridde 022315eef0 Hardcode top_srcdir to make building from non-topdir possible, dont depend on the touch command, fix LDFLAGS to not depend on the removed TARGET variable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5476 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:10:16 +00:00
Giel van Schijndel b5ff9610ea * Remove TODO comment about needing to add an IMD_Model type, because that type already exists
* Add a comment, describing the `flameModel` field


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5465 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 11:03:39 +00:00
Giel van Schijndel a80776b9fa don't use the file header template if it isn't available in the c_structdef code generator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5464 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 10:58:13 +00:00
Giel van Schijndel c5b87954bc Add a new field type to the mini database scheme meta language: C-only-field
* This is a dummy type that causes the rest of the line to be included literally in the struct's definition
 * Use this field type to add ppIMDList (member var of BODY_STATS in statsdef.h)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5460 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 20:47:17 +00:00
Giel van Schijndel 1170798c66 Add a field to hold a component's body points (COMPONENT now fully matches COMPONENT_STATS from statsdef.h)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5458 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:17:19 +00:00
Giel van Schijndel c6c5c981e6 Remove all TECH_LEVEL related cruft from the code as it's read from the stats files but unused throughout the rest of the code.
Read into a temporary dummy variable when loading stats.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5453 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 18:28:37 +00:00
Giel van Schijndel 44f3bf5f69 Only declare the function name of the %loadFunc directive to be declared in the file where the %loadFunc directive is located.
Don't declare the return type and parameter list to originate from the "original" source file.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5452 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 17:55:18 +00:00
Giel van Schijndel be7aef1a17 Convert dashes (-) to undersquores (_) as well in header guards (fixes a syntax error with C's preprocessor)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5451 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 17:45:56 +00:00
Giel van Schijndel db03e5b276 include (perl directive "require") code generators from the same directory as the language parser
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5450 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 17:15:44 +00:00
Giel van Schijndel 2e3280a845 Pass the output file as a command line parameter (and fall back to stdout if none is provided)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5446 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 16:05:41 +00:00
Giel van Schijndel c8dbcd6d2d * Don't refer to a "flame IMD" when loading an IMD_Model, refer to "the IMD for field \"$fieldName\"" instead
* Reference records by their ID number (unique_inheritance_id) instead of some user-code dependent function

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5444 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 15:30:13 +00:00
Giel van Schijndel 03cf003811 * Add line information to the AST of %preLoadTable and %postLoadRow struct-level directives
* Use these line numbers in the output of the SQLite C loading code generator to produce #line directives

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5443 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 15:25:46 +00:00
Giel van Schijndel d3c8f34aaf Add function prototypes for the SQLite DB load functions (declared using %loadFunc) to the struct definition header
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5442 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 15:25:42 +00:00
Giel van Schijndel 052c32e8ec Slightly rework c_structdef_cg.pm's header-template processing code to be more similar to c_sqliteload_cg.pm's header-template processing code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5441 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 15:02:10 +00:00
Giel van Schijndel df7b09c6fa Wrap the "header/start/leader" template contents in #line directives for the SQLite C code generator's output
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5440 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 15:01:02 +00:00
Giel van Schijndel f8f4ce0854 Make sure to count __all__ lines, also those who start a new "scope" (anything that finishes with "end")
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5439 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 14:58:04 +00:00
Giel van Schijndel 3b57831282 * Add line numbers to the AST for %loadFunc directives
* Utilize these line numbers to generate #line directives in the output file


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5438 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 14:47:16 +00:00
Giel van Schijndel 1ceafee327 Add line-counting code to the mini database scheme meta language parser
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5437 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 14:36:27 +00:00
Giel van Schijndel 46fc5cc97e * Make it possible to use forward declarations to the generated struct types
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5436 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 13:59:23 +00:00
Giel van Schijndel 707d5cf718 * Print from a template for the C struct definition code generator as well
* Add a template for the struct definition header; adds some #include directives required to be able to compile the generated header


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5435 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 13:57:26 +00:00
Giel van Schijndel 2d1b9d8694 Only shift the next parameter from ARGV if there are more than one (1) left in the C SQLite code generator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5434 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 13:49:49 +00:00
Giel van Schijndel 74784e3f6e Add two new struct-level directives to the mini database scheme meta language:
* %preLoadTable which specifies a code block to be executed just __before__ loading in all rows in a database
 * %postLoadRow which specifies a code block to be executed after every row has been succesfully loaded in a struct


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5433 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 13:09:53 +00:00
Giel van Schijndel 2b6b037ade * Rename and modify the SQL SELECT statement code generator to a code generator that produces C code for loading in the contents of database tables
* Add a template file which is used by this new code generator as a file "header"
 * Add a new struct-level directive to the mini database meta scheme language: %loadFunc which specifies that the above code generator should generate a loading function for this type plus what its name should be
 * Add a new entry for this code generator to the Makefile for testing purposes


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5432 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 13:04:10 +00:00
Giel van Schijndel 40742f8d8a Give the code generators the ability to process command line arguments (before the parsing begins)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5431 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 12:46:53 +00:00
Giel van Schijndel 3f0b1959f2 For struct-fields of an enum type store references to the enum instead of just their name
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5430 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 12:16:55 +00:00
Giel van Schijndel 40b6a5acf7 Don't store the name of the struct we inherit from in the "inherit" field, instead store a reference to that struct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5419 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 11:37:23 +00:00
Dennis Schridde 302a557478 Rename "raw" Makefiles to "win32" Makefiles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5402 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:29:04 +00:00
Dennis Schridde bb9e24cf3f Reduce "raw" Makefiles to "win32" Makefiles by removing logic from configure.mk
Command variables stay, but DIRSEP variable got removed

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5401 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:28:50 +00:00
Giel van Schijndel c07a24b90a Add some basic syntax/semantics checking to the parser of the database schema meta language.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5383 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 13:53:09 +00:00
Giel van Schijndel 191a130f86 Add a new field qualifier to the meta database schema language:
* "optional" which specfies that the given field is optional and can thus be NULL.
 * Only allow this keyword for the string and IMD_model types

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5381 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 12:51:09 +00:00
Giel van Schijndel af1b99b30d Line out the field names correctly with the rest of the struct definitions
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5380 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 12:51:06 +00:00
Giel van Schijndel abad9943c6 In the %field hash store the field-qualifiers as an array instead of storing only a single qualifier.
This will allow for adding multiple qualifiers to the same field later on.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5379 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-04 12:50:58 +00:00
Giel van Schijndel f31772dda3 Add IMD_model as a dedicated type to the mini-meta database schema language
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5376 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 23:21:45 +00:00
Giel van Schijndel 0c28d0493f Fix a syntax error introduced in r5374
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5375 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 22:14:41 +00:00
Giel van Schijndel 6e853b04d1 Don't print directly from the code generators, instead append to an output string for printing at a later time.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5374 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 21:51:23 +00:00
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