[neon/backports-focal/libgwenhywfar/Neon/release] /: New upstream version 5.7.1

Micha Lenk null at kde.org
Mon Sep 27 15:37:13 BST 2021


Git commit 97c020d0944d7ebdbb23cbb4eb04e0b9d33498b8 by Micha Lenk.
Committed on 11/09/2021 at 17:34.
Pushed by jriddell into branch 'Neon/release'.

New upstream version 5.7.1

M  +263  -283  ChangeLog
M  +3    -3    Makefile.in
M  +17   -47   TODO
M  +2    -2    admin/Makefile.in
M  +2    -2    checks/Makefile.in
M  +3    -3    configure
M  +3    -3    configure.ac
M  +2    -2    data/Makefile.in
M  +2    -2    doc/Makefile.in
M  +2    -2    doc/dialog/Makefile.in
M  +2    -2    doc/dialog/images/Makefile.in
M  +2    -2    doc/inherit/Makefile.in
M  +2    -2    gui/Makefile.in
M  +2    -2    gui/cocoa/Makefile.in
M  +2    -2    gui/cpp/Makefile.in
M  +2    -2    gui/fox16/Makefile.in
M  +2    -2    gui/gtk2/Makefile.in
M  +2    -2    gui/gtk3/Makefile.in
M  +2    -2    gui/qt4/Makefile.in
M  +2    -2    gui/qt5/Makefile.in
M  +2    -2    gui/testdialogs/Makefile.in
M  +1    -1    gwenhywfar.spec
M  +2    -2    m4/Makefile.in
M  +2    -2    plugins/Makefile.in
M  +2    -2    plugins/configmgr/Makefile.in
M  +2    -2    plugins/configmgr/dir/Makefile.in
M  +2    -2    plugins/ct/Makefile.in
M  +2    -2    plugins/ct/ohbci/Makefile.in
M  +2    -2    plugins/dbio/Makefile.in
M  +2    -2    plugins/dbio/csv/Makefile.in
M  +2    -2    plugins/dbio/olddb/Makefile.in
M  +2    -2    plugins/dbio/xmldb/Makefile.in
M  +2    -2    po/Makefile.in
M  +2    -2    src/Makefile.in
M  +2    -2    src/base/Makefile.in
M  +2    -2    src/crypt3/Makefile.in
M  +2    -2    src/cryptmsg/Makefile.in
M  +2    -2    src/crypttoken/Makefile.in
M  +2    -2    src/gui/Makefile.in
M  +16   -7    src/gui/gui_passwd.c
M  +5    -0    src/gwenhywfarapi.h
M  +2    -2    src/html/Makefile.in
M  +2    -2    src/os/Makefile.in
M  +2    -2    src/os/posix/Makefile.in
M  +2    -2    src/os/windows/Makefile.in
M  +1    -1    src/os/windows/gwenthread.c
M  +2    -2    src/parser/Makefile.in
M  +2    -2    src/parser/text.c
M  +4    -4    src/ressource.rc
M  +2    -2    src/sar/Makefile.in
M  +2    -2    src/sio/Makefile.in
M  +3    -4    src/sio/syncio_tls.c
M  +2    -2    src/test_framework/Makefile.in
M  +4    -4    src/version.h
M  +2    -2    src/xmlcmd/Makefile.in
M  +2    -2    test/Makefile.in
M  +2    -2    tools/Makefile.in
M  +2    -2    tools/gcttool/Makefile.in
M  +2    -2    tools/gsa/Makefile.in
M  +5    -3    tools/gwenbuild/Makefile.am
M  +9    -6    tools/gwenbuild/Makefile.in
M  +0    -1    tools/gwenbuild/README
M  +1    -1    tools/gwenbuild/buildctx/Makefile.am
M  +3    -3    tools/gwenbuild/buildctx/Makefile.in
M  +41   -0    tools/gwenbuild/buildctx/buildcmd.c
M  +4    -0    tools/gwenbuild/buildctx/buildcmd.h
M  +6    -3    tools/gwenbuild/builders/Makefile.am
M  +10   -6    tools/gwenbuild/builders/Makefile.in
A  +223  -0    tools/gwenbuild/builders/gbuilderdescr.c  *
A  +40   -0    tools/gwenbuild/builders/gbuilderdescr.h  *
C  +16   -7    tools/gwenbuild/builders/gbuilderdescr_p.h [from: tools/gwenbuild/types/gwenbuild_p.h - 051% similarity]
M  +1    -1    tools/gwenbuild/builders/genericbuilder.c
M  +2    -0    tools/gwenbuild/builders/genericbuilder.h
M  +2    -2    tools/gwenbuild/builders/posix/Makefile.in
M  +21   -7    tools/gwenbuild/builders/posix/staticlib.gwb
M  +2    -2    tools/gwenbuild/builders/windows/Makefile.in
M  +12   -7    tools/gwenbuild/builders/windows/staticlib.gwb
A  +181  -0    tools/gwenbuild/c_dist.c  *
C  +5    -9    tools/gwenbuild/c_dist.h [from: tools/gwenbuild/types/gwenbuild_p.h - 068% similarity]
M  +2    -100  tools/gwenbuild/c_install.c
M  +69   -0    tools/gwenbuild/c_setup.c
M  +18   -2    tools/gwenbuild/main.c
M  +1    -1    tools/gwenbuild/parser/Makefile.am
M  +3    -3    tools/gwenbuild/parser/Makefile.in
M  +12   -1    tools/gwenbuild/parser/p_dependencies.c
M  +4    -0    tools/gwenbuild/parser/p_project.c
M  +5    -80   tools/gwenbuild/parser/p_target.c
M  +152  -11   tools/gwenbuild/parser/parser.c
M  +7    -0    tools/gwenbuild/parser/parser.h
M  +2    -2    tools/gwenbuild/templates/Makefile.in
M  +1    -1    tools/gwenbuild/tools/Makefile.am
M  +3    -3    tools/gwenbuild/tools/Makefile.in
M  +3    -1    tools/gwenbuild/types/Makefile.am
M  +4    -4    tools/gwenbuild/types/Makefile.in
M  +87   -0    tools/gwenbuild/types/context.c
M  +4    -0    tools/gwenbuild/types/context.h
M  +84   -8    tools/gwenbuild/types/gwenbuild.c
M  +11   -0    tools/gwenbuild/types/gwenbuild.h
M  +3    -0    tools/gwenbuild/types/gwenbuild_p.h
M  +26   -0    tools/gwenbuild/types/keyvaluepair.c
M  +5    -0    tools/gwenbuild/types/keyvaluepair.h
M  +121  -0    tools/gwenbuild/types/project.c
M  +3    -0    tools/gwenbuild/types/project.h
M  +21   -0    tools/gwenbuild/types/target.c
M  +220  -0    tools/gwenbuild/utils.c
M  +9    -0    tools/gwenbuild/utils.h
M  +2    -2    tools/typemaker/Makefile.in
M  +2    -2    tools/typemaker2/Makefile.in
M  +2    -2    tools/typemaker2/types/Makefile.in
M  +2    -0    tools/typemaker2/types/c/Makefile.am
M  +4    -2    tools/typemaker2/types/c/Makefile.in
A  +7    -0    tools/typemaker2/types/c/uint16_t.tm2
A  +175  -0    tools/typemaker2/types/c/uint16_t_array.tm2
M  +2    -2    tools/xmlmerge/Makefile.in

The files marked with a * at the end have a non valid license. Please read: https://community.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


https://invent.kde.org/neon/backports-focal/libgwenhywfar/commit/97c020d0944d7ebdbb23cbb4eb04e0b9d33498b8

diff --git a/ChangeLog b/ChangeLog
index 28a6d6a..a5b9828 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,483 +1,463 @@
 ------------------------------------------------------------------
-2021-02-15 20:30:41 +0100 Martin Preuss
-Prepared release 5.6.0.
+2021-09-10 14:10:13 +0200 Martin Preuss
+Prepared release 5.7.1.
 
 ------------------------------------------------------------------
-2021-02-15 18:50:59 +0100 Martin Preuss
-XmlCmd: Parse "time" data.
+2021-09-05 19:33:35 +0200 Martin Preuss
+GUI: Remove bad pin also from password cache.
 
 ------------------------------------------------------------------
-2021-02-15 14:35:01 +0100 Martin Preuss
-Increased version.
+2021-09-02 16:32:44 +0200 Martin Preuss
+TODO: Added entry.
 
 ------------------------------------------------------------------
-2021-02-15 14:34:53 +0100 Martin Preuss
-XML: Added flag "GWEN_XML_FLAGS_SGML" to be used for AqBankings XML importer.
+2021-09-02 16:32:32 +0200 Martin Preuss
+tm2: Add types uint16_t and uint16_t_array.
 
 ------------------------------------------------------------------
-2021-02-14 17:46:48 +0100 Christian Stimming
-Fix missing windows callback qualifiers for cgui
-Following up on f1cee59a now also for cgui.c
+2020-09-10 01:14:16 +0200 Ralf Habacker
+On Mingw use '/' as dir separator to avoid compile errors
+This fixes the following error:
+   transaction.c:12:10: fatal error: .\..._p.h: No such file or directory
 
 ------------------------------------------------------------------
-2021-02-14 17:44:51 +0100 Christian Stimming
-Fix compiler warnings/errors on windows
-The threadRun function must return an integer, not a pointer.
-Include <winsock2.h> requests to be included before <windows.h>.
+2021-04-17 18:46:26 +0200 Ralf Habacker
+Fix finding of ca-bundle.crt on Windows
+In case of not using system certificates the bundled certificate should be
+searched and added.
 
 ------------------------------------------------------------------
-2021-02-13 02:16:22 +0100 Martin Preuss
-Released version 5.5.1
+2021-06-25 02:15:51 +0200 Martin Preuss
+gwenbuild: Add help entry "-d".
 
 ------------------------------------------------------------------
-2021-02-13 00:39:44 +0100 Martin Preuss
-Prepared release 5.5.1.
+2021-06-25 02:15:28 +0200 Martin Preuss
+gwbuild: keep permissions when writing file via <writeFile>.
 
 ------------------------------------------------------------------
-2021-02-11 12:52:11 -0800 John Ralls
-Consistently use GWENHYWFAR_CB in callback decls and defs.
-To permit successful compilation on Microsoft Windows.
-
-Fixes https://www.aquamaniac.de/rdm/issues/231
+2021-05-16 23:24:13 +0200 Christian Stimming
+minor windows fix (but more windows issues still remain)
 
 ------------------------------------------------------------------
-2021-02-09 16:33:57 -0800 John Ralls
-Correct type mismatch for _threadRun_cb.
-Fixes https://www.aquamaniac.de/rdm/issues/230
+2021-05-16 23:21:18 +0200 Christian Stimming
+Add include flags for out-of-source build
 
 ------------------------------------------------------------------
-2021-02-07 00:39:26 +0100 Martin Preuss
-Released 5.5.0stable.
+2021-05-16 23:13:24 +0200 Christian Stimming
+Windows: Fix erroneous assignment statement
+At least the compiler shows it as warning, from c7e26c35
 
 ------------------------------------------------------------------
-2021-02-07 00:21:18 +0100 Martin Preuss
-Prepared release 5.5.0stable.
+2021-05-06 21:36:25 +0200 Martin Preuss
+Added some ideas to TODO.
 
 ------------------------------------------------------------------
-2021-02-06 21:52:19 +0100 Martin Preuss
-OS: Windows stuff can now be compiled again.
+2021-05-06 17:28:02 +0200 Martin Preuss
+gwenbuild: Check for "required" flag when checking dependencies.
 
 ------------------------------------------------------------------
-2021-02-06 00:13:51 +0100 Martin Preuss
-GWEN_DATE: Major speedup.
-The function GWEN_Date_fromString() is very often called by Aqfinance
-so a speedup here improves the overall performance of AqFinance, too.
+2021-05-06 17:27:30 +0200 Martin Preuss
+gwenbuild: Decreased verbosity.
 
 ------------------------------------------------------------------
-2021-02-06 00:11:43 +0100 Martin Preuss
-Build: Moved header files to installable section.
+2021-05-06 17:03:46 +0200 Martin Preuss
+gwenbuild: Added template for convenience libraries.
 
 ------------------------------------------------------------------
-2021-02-06 00:10:51 +0100 Martin Preuss
-GWEN_IdList64: Make argument to GWEN_IdList64_Iterator_new() const.
-From now on GWEN_IdList64_Iterator_new() will no longer attach to the
-original list which makes it possible to change the argument to const.
-This also means that the iterator class can be used even in multithreaded
-environments.
-
-This represents an API change, however, no code so far relied on the fact
-that GWEN_IdList64_Iterator_new() used to call GWEN_IdList64_Attach().
+2021-05-06 17:03:26 +0200 Martin Preuss
+gwenbuild: Accept "<data>" also inside "<project>".
 
 ------------------------------------------------------------------
-2021-02-04 22:53:47 +0100 Martin Preuss
-Added a test for nogui code and multi-threading.
+2021-05-01 13:48:26 +0200 Martin Preuss
+gwenbuild: Fixed targt type staticLib.
+Use a small helper script to create a non-flat ar lib.
 
 ------------------------------------------------------------------
-2021-02-04 22:53:16 +0100 Martin Preuss
-Fixed a bug in nogui.c.
-Loghook needs to return "1" for handled messages, otherwise GWEN_GUI
-will fallback to printing the log message by itself.
+2021-04-22 00:17:17 +0200 Martin Preuss
+gwenbuild: Fixed linking against internal static libs.
 
 ------------------------------------------------------------------
-2021-02-04 22:03:17 +0100 Martin Preuss
-Fixed a makefile target.
+2021-04-21 23:29:25 +0200 Martin Preuss
+gwenbuild: More work on static libs.
+Need to rebuild installable static libs because "ar Trc" creates flat
+archives which only refer to included subfolders. We need to unpack and
+repack such an archive for exports.
 
 ------------------------------------------------------------------
-2021-02-04 22:03:01 +0100 Martin Preuss
-Fixed a compiler warning.
+2021-04-21 23:13:29 +0200 Martin Preuss
+gwenbuild: Read GenericBuilders only once. Add "--static" arg for setup.
 
 ------------------------------------------------------------------
-2021-02-04 22:02:48 +0100 Martin Preuss
-Added GWEN_NoGui_new() which returns a GUI implementation which does nothing.
-Use this as a template for your own implementation of as a simple
-implementation for side-threads.
+2021-04-20 23:37:56 +0200 Martin Preuss
+gwenbuild: Write context to file.
+Will be used later to show some infos like defines used in folders etc.
 
 ------------------------------------------------------------------
-2021-02-04 22:01:08 +0100 Martin Preuss
-No longer directly use global variable gwenhywfar_gui.
-We now use a thread-local variable, so a thread can set its own GUI
-implementation.
-
-The reason is that most X11 GUIs down allow any thread of a process other
-than the main thread to access the graphical interface. If a thread function
-uses other GWEN functions which might call GUI functions this would be a
-problem.
-
-With thread-local variables each thread can have its own GUI, side-threads
-might want to use e.g. the GUI implementation from GWEN_NoGui_new().
+2021-04-20 21:39:08 +0200 Martin Preuss
+text: Improved error message.
 
 ------------------------------------------------------------------
-2021-02-04 21:56:35 +0100 Martin Preuss
-Fixed typos.
+2021-04-20 00:01:08 +0200 Martin Preuss
+gwenbuild: Allow for "<extradist>" also inside <project>.
+This allows to distribute README etc in the root folder where there is not
+yet a target defined.
 
 ------------------------------------------------------------------
-2021-02-04 18:00:27 +0100 Martin Preuss
-Started reworking GWEN_GUI.
-Split gui.c into multiple files to get an overview.
+2021-04-19 23:49:32 +0200 Martin Preuss
+gwenbuild: Added command to generate a package tarball.
+Creates a folder and copies files markes as "DIST" into it.
+Next step will be to create the tarball from it and delete the dist folder.
 
 ------------------------------------------------------------------
-2021-02-04 17:59:08 +0100 Martin Preuss
-Added class GWEN_THREADLOCALDATA.
-For now only implemented for POSIX systems using pthread.
-Started implementation for Windows (not tested, yet).
+2021-04-19 19:13:54 +0200 Martin Preuss
+gwenbuild: Add 0BUILD files to project  file list.
 
 ------------------------------------------------------------------
-2021-02-03 21:05:34 +0100 Martin Preuss
-Added axm_pthread.m4 (copied from aclocal-1.15).
+2021-04-18 23:58:54 +0200 Martin Preuss
+Released 5.7.0beta.
 
 ------------------------------------------------------------------
-2021-02-03 20:56:40 +0100 Martin Preuss
-Use AX_PTHREAD instead of ACX_PTHREAD (the latter doesn't seem to exist on my jenkins machine).
+2021-04-18 21:30:50 +0200 Martin Preuss
+gwenbuild: Also use ldflags. Use cflags/ldflags in tryCompile/tryLink.
 
 ------------------------------------------------------------------
-2021-02-03 20:28:23 +0100 Martin Preuss
-Fixed some compiler warnings.
+2021-04-18 21:13:53 +0200 Martin Preuss
+gwenbuild: More tweaking of builder definitions.
+Crosscompiling for Windows works now using mingw.
 
 ------------------------------------------------------------------
-2021-02-03 20:07:43 +0100 Martin Preuss
-Add PTHREAD_CFLAGS to libgwenhywfar_la_LIBADD.
-This adds "-pthread" to CFLAGS, which should have been done by
-ACX_PTHREAD (seems to be a known problem).
+2021-04-18 20:55:26 +0200 Martin Preuss
+gwenbuild: Create different builders for different target systems.
+Cross-compiling for Windows on Linux now creates binaries.
 
 ------------------------------------------------------------------
-2021-02-03 20:02:20 +0100 Martin Preuss
-OS: Added first thread implementation for Windows (not tested, yet).
+2021-04-18 00:40:55 +0200 Martin Preuss
+gwenbuild: Updated README.
 
 ------------------------------------------------------------------
-2021-02-03 19:21:56 +0100 Martin Preuss
-OS: Started implementing GWEN_Thread
-This will probably first be used in AqDatabase.
+2021-04-18 00:36:16 +0200 Martin Preuss
+gwenbuild: Use existing build command list instead of creating an returning new ones.
+Also allow to differentiate between error adding dependencies and simply
+empty dependency list (e.g. when requesting to build a file which is a
+non-generated source file).
 
 ------------------------------------------------------------------
-2021-01-13 23:59:20 +0100 Martin Preuss
-Incremented version.
+2021-04-18 00:17:20 +0200 Martin Preuss
+gwenbuild: Fixed dependency tracking.
 
 ------------------------------------------------------------------
-2020-12-01 00:34:02 +0100 Martin Preuss
-SIO: Added call to gnutls_server_name_set(), should enable SNI.
-Setting the server name should enable SNI extension in GnuTLS according
-to the GnuTLS APIDOC.
+2021-04-18 00:15:27 +0200 Martin Preuss
+PATH: Fixed some bugs in GWEN_Path_GetPathBetween().
 
-If this extension is not available (or hostnam not set) then the resulting
-error is ignored for now. The result of this will be a warning from GnuTLS
-that the received certificate was not issued for the connected host.
+------------------------------------------------------------------
+2021-04-17 16:50:14 +0200 Martin Preuss
+gwenbuild: Improved <BuildFiles> code.
+Can now also select matching files from the project file list. This will
+be needed for gettext-related commands.
 
 ------------------------------------------------------------------
-2020-11-30 00:57:06 +0100 Martin Preuss
-Export mutex functions.
+2021-04-17 13:04:31 +0200 Martin Preuss
+SIO: Try to set "HOST:" header in HTTP session.
 
 ------------------------------------------------------------------
-2020-11-27 22:20:49 +0100 Martin Preuss
-Typemaker2: Added getters for virtual functions.
+2021-04-17 01:07:31 +0200 Martin Preuss
+gwenbuild: Fixed a bug in option parser.
+Was not expanding variables. Now AqFinance can be completely compiled and
+installed, and the installed version works!
 
 ------------------------------------------------------------------
-2020-10-11 14:38:41 +0200 Martin Preuss
-Merge branch 'rel-5.4.1'
+2021-04-17 01:06:53 +0200 Martin Preuss
+pathmanager: Increased verbosity.
+This can be helpfull when checking for bad paths.
 
 ------------------------------------------------------------------
-2020-10-11 14:38:23 +0200 Martin Preuss
-Prepared release 5.4.1.
+2021-04-17 00:07:35 +0200 Martin Preuss
+gwenbuild: Removed no longer needed fields.
 
 ------------------------------------------------------------------
-2020-08-16 13:49:08 +0200 Martin Preuss
-BUILD: Removed missing file.
+2021-04-17 00:07:18 +0200 Martin Preuss
+gwenbuild: Added missing includes.
 
 ------------------------------------------------------------------
-2020-08-04 21:45:32 +0200 Martin Preuss
-Merge remote-tracking branch 'origin/rework_ssl_m4'
+2021-04-16 23:56:43 +0200 Martin Preuss
+gwenbuild: split main.c into multiple files. Easier to maintain.
 
 ------------------------------------------------------------------
-2020-08-02 21:48:05 +0200 Micha Lenk
-Switch to pkg-config for detecting OpenSSL properties
+2021-04-16 23:01:06 +0200 Martin Preuss
+gwenbuild: Created a subfolder for types.
 
 ------------------------------------------------------------------
-2020-08-02 21:41:58 +0200 Micha Lenk
-Drop unused $(ssl_includes) from tools/gsa/ CPPFLAGS
+2021-04-16 22:16:35 +0200 Martin Preuss
+gwenbuild: Removed unneeded code, fixed a bug on the way.
 
 ------------------------------------------------------------------
-2020-08-02 21:12:51 +0200 Micha Lenk
-Cleanup unused autoconf variables GWEN_CRYPTO and USE_CRYPT
+2021-04-16 22:13:11 +0200 Martin Preuss
+gwenbuild: Removed disabled code.
 
 ------------------------------------------------------------------
-2020-08-02 20:58:01 +0200 Micha Lenk
-Drop $ssl_libraries and $ssl_lib from PROG_LIBRARIES
-The only code that makes use of OpenSSL is in gcttool, and this makes use of
-$ssl_libraries and $ssl_lib directly.
+2021-04-16 22:11:25 +0200 Martin Preuss
+gwenbuild: Fixed dependency problems with missing destination file and symlinks.
 
 ------------------------------------------------------------------
-2020-07-12 00:23:40 +0200 Martin Preuss
-Merge branch 'rel-5.4.0'
-Prepared release 5.4.0.
+2021-04-16 21:00:14 +0200 Martin Preuss
+gwenbuild: Add property "requiredVersion" to <gwbuild>.
 
 ------------------------------------------------------------------
-2020-07-11 23:51:31 +0200 Martin Preuss
-Prepared release 5.4.0.
+2021-04-16 20:24:32 +0200 Martin Preuss
+Merge branch 'mp-202102-gwenbuild'
+gwenbuild now works with AqBanking and especially with AqFinance. Needs more refinement but works.
 
 ------------------------------------------------------------------
-2020-07-03 17:27:53 +0200 Martin Preuss
-Fixed a compiler warning.
+2021-04-16 20:19:21 +0200 Martin Preuss
+gwenbuild: Added help string.
 
 ------------------------------------------------------------------
-2020-07-03 17:27:39 +0200 Martin Preuss
-Increased version.
+2021-04-16 17:17:17 +0200 Martin Preuss
+gwenbuild: Added command "clean" (-c).
+This command deletes all generated files (except config.h, that is).
 
 ------------------------------------------------------------------
-2020-07-03 17:07:39 +0200 Martin Preuss
-Merge branch 'mp-202004-with_libxml'
+2021-04-16 17:16:33 +0200 Martin Preuss
+gwenbuild: Increased verbosity.
+Dependency tracking now uses DBG_INFO to allow for debugging of issues.
 
 ------------------------------------------------------------------
-2020-07-03 15:40:09 +0200 Martin Preuss
-TEST: Added another test for pss.
+2021-04-16 16:11:41 +0200 Martin Preuss
+gwenbuild: Added module for CXX apps.
+Probably not needed as gcc seems to figure out when to link-in c++ code.
 
 ------------------------------------------------------------------
-2020-07-03 15:39:39 +0200 Martin Preuss
-XMLCMD: Also check for empty string in _dbIfNotHasCharData()
-- also fixed some typos
+2021-04-15 14:39:40 +0200 Martin Preuss
+gwenbuild: Improved install command.
 
 ------------------------------------------------------------------
-2020-05-13 15:46:44 +0200 Martin Preuss
-BUILD: Add libxml2 libs.
+2021-04-15 13:58:59 +0200 Martin Preuss
+gwenbuild: Implemented install.
 
 ------------------------------------------------------------------
-2020-05-13 15:46:22 +0200 Martin Preuss
-typemaker2: Fixed a bug in int_array description.
+2021-04-15 13:58:37 +0200 Martin Preuss
+syncio: Add function GWEN_SyncIo_Helper_CopyFile().
 
 ------------------------------------------------------------------
-2020-05-12 15:37:44 +0200 Martin Preuss
-os: Use read/write instead of recv/send for non-sockets.
+2021-04-15 12:41:27 +0200 Martin Preuss
+gwenbuild: Prepared command "-i": Install.
 
 ------------------------------------------------------------------
-2020-05-12 14:09:25 +0200 Martin Preuss
-GUI: Dont ask for TAN in non-interactive mode (fixes #129).
+2021-04-15 12:28:33 +0200 Martin Preuss
+gwenbuild: Fixed dependency tracking.
+Only check dependencies and file dates when running the first sub command.
+If it is decided that a rebuild is needed all subsequent sub commands need
+to be executed in any case without further checking.
 
 ------------------------------------------------------------------
-2020-05-07 10:09:32 +0200 Łukasz Wojniłowicz
-Set dylib extension for cmake files on macOS
+2021-04-15 12:16:40 +0200 Martin Preuss
+gwenbuild: Added command "-r": Repeat setup.
+This command repeats the setup process using the same arguments given to the
+last full setup.
 
 ------------------------------------------------------------------
-2020-05-07 17:21:30 +0200 Łukasz Wojniłowicz
-Require only QtCore QtGui and QtWidgets
-This makes possible to build gwenhywfar on systems that don't have e.g.
-QtQml compiled.
+2021-04-15 12:11:47 +0200 Martin Preuss
+gwenbuild: Write install file list. Promoted some functions to API functions.
 
 ------------------------------------------------------------------
-2020-05-03 20:54:55 +0200 Christian Stimming
-Fix mingw compiler error about mismatching declaration
+2021-04-14 23:46:33 +0200 Martin Preuss
+gwenbuild: Allow for flag "GENERATED" to be specified in "<data>".
 
 ------------------------------------------------------------------
-2020-04-19 03:15:27 +0200 Martin Preuss
-xmlcmd: LibXML2 version of toDb finished but yet untested.
+2021-04-14 22:59:53 +0200 Martin Preuss
+gwenbuild: Added support for loadable modules.
 
 ------------------------------------------------------------------
-2020-04-18 20:41:01 +0200 Martin Preuss
-Started adding an XMLCMD implementation using libxml2.
+2021-04-14 00:17:43 +0200 Martin Preuss
+gwenbuild: Fixed dependecy handling.
 
 ------------------------------------------------------------------
-2020-04-18 18:10:48 +0200 Martin Preuss
-Merge branch 'mp-202004-xmlcmd'
-Added module xmlcmd.
+2021-04-13 11:24:05 +0200 Martin Preuss
+gwenbuild: Some ideas for next changes.
 
 ------------------------------------------------------------------
-2020-04-18 17:48:25 +0200 Martin Preuss
-Fixed a bug in new code.
+2021-04-13 10:31:12 +0200 Martin Preuss
+gwenbuild: Disable unlink for now, will work on it later.
 
 ------------------------------------------------------------------
-2020-04-18 17:20:06 +0200 Martin Preuss
-More generic approach to using XML as command language.
-Internally xml2db already was a generic approach but the API wasn't
-exposed so far.
+2021-04-13 01:48:47 +0200 Martin Preuss
+gwenbuild: Add flags to delete output files before build.
+No longer need a "rm" subcommand which might fail and print a confusing
+error message.
 
-Now this can also be used to write other XML-driven parsers.
+------------------------------------------------------------------
+2021-04-13 01:00:25 +0200 Martin Preuss
+gwenbuild: Added entry to TODO chapter.
 
 ------------------------------------------------------------------
-2020-04-16 23:04:32 +0200 Martin Preuss
-Result of "make format".
+2021-04-13 01:00:09 +0200 Martin Preuss
+gwenbuild: Only call GWEN_XMLNode_SetCharValue() with nonempty values.
 
 ------------------------------------------------------------------
-2020-04-16 23:04:13 +0200 Martin Preuss
-Export symbols GWEN_Crypt_KeySym_GetKeyDataPtr and GWEN_Crypt_KeySym_GetKeyDataLen
+2021-04-13 00:59:38 +0200 Martin Preuss
+gwenbuild: Add files from <writeFile> to project file list.
+This makes sure that gwenbuild knows that the written file is generated.
 
 ------------------------------------------------------------------
-2020-04-16 23:03:42 +0200 Martin Preuss
-Added some tests needed to hunt a problem in AqBanking.
+2021-04-12 22:39:54 +0200 Martin Preuss
+gwenbuild: Add more generated files to output of tm2builder.
+This makes sure gwenbuild knows that the header files build by the
+tm2builder are also generated files.
 
 ------------------------------------------------------------------
-2020-04-06 21:30:45 +0200 Martin Preuss
-Merge branch 'maint'
-Released 5.3.0.
+2021-04-12 21:36:06 +0200 Martin Preuss
+gwenbuild: Fixed handling of files, now allowing for relative paths in 0BUILD files.
+This allows to use generated files from subfolders. For example AqBanking
+uses hbcixml to merge multiple files inside folders into single files.
+Those files then are merged a folder above to generate one single XML file
+containing all the files in the subfolders. Therefore we must be able to
+specify subfolders in the <input> section of <buildFiles>.
 
 ------------------------------------------------------------------
-2020-04-06 21:29:13 +0200 Martin Preuss
-Merge branch 'rel-5.3.0' into maint
+2021-04-12 19:57:39 +0200 Martin Preuss
+gwenbuild: Added function GWB_File_List2_GetOrCreateFile().
+This function checks for subfolders in fname.
 
 ------------------------------------------------------------------
-2020-04-06 21:24:04 +0200 Martin Preuss
-Prepared release 5.3.0.
+2021-04-11 19:12:49 +0200 Martin Preuss
+gwenbuild: Updated TODO part.
 
 ------------------------------------------------------------------
-2020-04-05 23:28:58 +0200 Martin Preuss
-Incremented version (latest AqBanking sources depend on new code).
+2021-04-11 19:11:15 +0200 Martin Preuss
+gwenbuild: Current status.
 
 ------------------------------------------------------------------
-2020-04-05 01:54:54 +0200 Martin Preuss
-typemaker2: Fixed a bug.
+2021-04-11 18:43:24 +0200 Martin Preuss
+gwenbuild: Added and tested builder for C++ files.
 
 ------------------------------------------------------------------
-2020-04-05 01:54:40 +0200 Martin Preuss
-Added missing export modifier.
+2021-04-11 17:41:52 +0200 Martin Preuss
+gwenbuild: Improved custom target handling.
 
 ------------------------------------------------------------------
-2020-04-05 01:54:21 +0200 Martin Preuss
-Addition to xml2db: xml_fromdb
-This can now be used by AqBanking to create SEPA files using the XML
-imexporter.
+2021-04-11 17:41:35 +0200 Martin Preuss
+PARSER: Allow for empty index spec ("[]") to specify all values of a DB var.
+The function GWEN_Text_ReplaceVars() replaces all occurrences of variable
+specs (like in "$(thisVar)") with their values.
 
-Added function GWEN_XmlFromDb().
+There was already the possibility to use and index to specify which value
+to use (default being "0" meaning first value).
 
-------------------------------------------------------------------
-2020-02-16 18:33:51 +0100 Martin Preuss
-Only install ca-bundle.crt if needed (fixes #197).
+You can now tell the function to use all values of a GWEN_DB variable
+separated by space.
 
-------------------------------------------------------------------
-2020-02-12 22:24:16 +0100 Martin Preuss
-Merge branch 'master' into maint
-Latest release.
+E.g. $(thisVar[0]) means use value "0" of a variable, $(thisVar[]) means
+write all values. See GWEN_DB_GetCharValue().
 
 ------------------------------------------------------------------
-2020-02-12 22:21:05 +0100 Martin Preuss
-Prepared release 5.2.0.
+2021-04-11 14:24:04 +0200 Martin Preuss
+gwenbuild: Fixed a bug.
 
 ------------------------------------------------------------------
-2020-02-10 23:54:28 +0100 Martin Preuss
-Fixed another error.
+2021-04-11 14:23:54 +0200 Martin Preuss
+gwenbuild: Added "<checkProgs>".
+Can now look for programs within a given path (or default $PATH) and even
+under different names.
 
 ------------------------------------------------------------------
-2020-02-10 23:50:29 +0100 Martin Preuss
-Added file to .gitignore.
+2021-04-11 01:48:20 +0200 Martin Preuss
+gwenbuild: Add version tag to project (e.g. "stable").
 
 ------------------------------------------------------------------
-2020-02-10 23:50:17 +0100 Martin Preuss
-Fixed an error.
+2021-04-11 00:30:55 +0200 Martin Preuss
+gwenbuild: Fixed a bug (definePrefix is a property, not a full separate element).
 
 ------------------------------------------------------------------
-2020-02-10 23:45:39 +0100 Martin Preuss
-buffer: Added function GWEN_Buffer_AppendArgs().
-Also reorganized test code a bit. Now the test function headers are only
-included by gwentest.c (like "buffer-t.h" et al).
+2021-04-11 00:30:18 +0200 Martin Preuss
+gwenbuild: Only add real source files to project source file list.
 
 ------------------------------------------------------------------
-2020-02-09 17:32:40 +0100 Martin Preuss
-multicache: Added some functions.
-- GWEN_MultiCache_Type_GetIdsInCache()
-- GWEN_MultiCache_GetUsageString()
+2021-04-11 00:29:35 +0200 Martin Preuss
+gwenbuild: Decreased verbosity.
 
 ------------------------------------------------------------------
-2020-02-04 23:46:00 +0100 Ralf Habacker
-Add version info in gui related shared libraries
-Distributions manage package dependencies based on the
-filename of shared libraries (at least with openSUSE,
-which I know of), which doesn't work in the case of
-the gwengui-xxx libraries, because they don't contain
-any or always the same version information (=0).
-
-This can lead to the installation of an unsuitable
-version if two sources are configured on one
-installation containing different versions of
-gwenhywfar.
-
-To avoid this, the libraries mentioned above will
-receive appropriate version information with this
-commit.
+2021-04-11 00:29:04 +0200 Martin Preuss
+gwenbuild: Increased verbosity. Fixed a bug.
+Current build dir is "." because it is relative to the folder we are
+running the builder tools (like gcc etc) in.
 
 ------------------------------------------------------------------
-2020-01-26 13:55:44 +0100 Martin Preuss
-Merge branch 'master' into maint
-Released 5.1.3.
+2021-04-11 00:27:37 +0200 Martin Preuss
+gwenbuild: Parse <SetVar> also in <dependencies> element.
 
 ------------------------------------------------------------------
-2020-01-26 13:37:29 +0100 Martin Preuss
-Prepared release 5.1.3.
+2021-04-11 00:26:44 +0200 Martin Preuss
+gwenbuild: Accept *.xml files for typemaker2, too.
 
 ------------------------------------------------------------------
-2020-01-26 13:23:09 +0100 Martin Preuss
-TODO: Just some thoughts...
+2021-04-09 23:36:09 +0200 Martin Preuss
+gwenbuild: Improved tool handling.
 
 ------------------------------------------------------------------
-2020-01-26 00:01:34 +0100 Martin Preuss
-Decreased verbosity.
+2021-04-08 23:23:43 +0200 Martin Preuss
+gwenbuild: First successful runs with dependency chacking.
 
 ------------------------------------------------------------------
-2020-01-17 21:46:11 +0100 Martin Preuss
-Doxyfile: Increased DOT_GRAPH_MAX_NODES to 100.
+2021-04-08 15:54:56 +0200 Martin Preuss
+gwenbuild: Before building repeat setup if 0BUILD files have changed.
 
 ------------------------------------------------------------------
-2020-01-17 21:44:06 +0100 Martin Preuss
-Merge branch 'master' into maint (released Gwenhywfar 5.1.2).
+2021-04-08 15:53:51 +0200 Martin Preuss
+gwenbuild: Add symlinks to list of output files for shared lib targets.
 
 ------------------------------------------------------------------
-2020-01-17 20:23:41 +0100 Martin Preuss
-Result of "make format".
+2021-04-08 00:39:30 +0200 Martin Preuss
+gwenbuild: Prepared installing of files, rebuilt main.c.
 
 ------------------------------------------------------------------
-2020-01-17 20:02:48 +0100 Martin Preuss
-Change default prefix to "/usr/local".
+2021-04-05 23:34:30 +0200 Martin Preuss
+gwenbuild: Write file list after "gwbuild setup".
 
 ------------------------------------------------------------------
-2020-01-17 19:22:22 +0100 Martin Preuss
-Added xml.out to .gitignore.
+2021-04-05 21:46:18 +0200 Martin Preuss
+gwenbuild: Also read "<data>" elements.
 
 ------------------------------------------------------------------
-2020-01-17 19:21:36 +0100 Martin Preuss
-Minor modification of one test.
+2021-04-05 21:45:59 +0200 Martin Preuss
+gwenbuild: Removed <options>, <option> can now occurr directly below <project>.
 
 ------------------------------------------------------------------
-2020-01-17 19:21:04 +0100 Martin Preuss
-XML: Improved format of written XML documents, simplified code.
+2021-04-05 21:45:00 +0200 Martin Preuss
+gwenbuild: Added <checkCompiler>.
+IS currently used to determine whether symbol visibility is supported.
 
 ------------------------------------------------------------------
-2020-01-17 19:17:21 +0100 Martin Preuss
-DB: Fixed a bug in GWEN_DB_WriteVarValueToBuffer()
-Was not handling "name" as full path.
+2021-04-05 21:43:55 +0200 Martin Preuss
+gwenbuild: Fixed a buf in cbuilder.gwb.
 
 ------------------------------------------------------------------
-2020-01-16 15:15:06 +0100 Martin Preuss
-Fixed a bug (created files had no file access rights: #178).
+2021-04-05 17:53:18 +0200 Martin Preuss
+gwenbuild: Added some introductory text to README. Removed no longer needed texts.
 
 ------------------------------------------------------------------
-2020-01-16 15:14:25 +0100 Martin Preuss
-Incremented version.
+2021-04-05 17:52:46 +0200 Martin Preuss
+gwenbuild: Allow to read and store pkg-config variables for dependencies.
 
 ------------------------------------------------------------------
-2020-01-13 21:20:27 +0100 Martin Preuss
-Applied a patch provided by pkzw via bug ticket #130.
-Should fix the problem with Cortal Consors sending a problematic HIPINS
-segment.
+2021-04-05 17:52:06 +0200 Martin Preuss
+gwenbuild: Add option to "setup" command to dump generated context.
 
 ------------------------------------------------------------------
-2020-01-12 23:40:32 +0100 Martin Preuss
-Merge branch 'master' into maint
+2021-04-05 17:51:28 +0200 Martin Preuss
+gwenbuild: Added "rm" commands to sharedlib.gwb
 
 ------------------------------------------------------------------
-2020-01-12 23:37:24 +0100 Martin Preuss
-Prepared release 5.1.0.
-Added a function which is needed by AqBanking to automatically import
-old settings into AqBanking6, so the API changed by an addition, thus
-incrementing the minor version number is already necessary.
+2021-04-05 17:50:57 +0200 Martin Preuss
+gwenbuild: Fixed a bug in app.gwb.
+Don't link against whole archive (this is only needed for libs).
 
 ------------------------------------------------------------------
-2020-01-12 23:10:47 +0100 Martin Preuss
-Incremented version number (need to do SO_VERSION+, SO_AGE+ before next release).
+2021-04-05 17:49:54 +0200 Martin Preuss
+gwenbuild: Fixed a bug in GWB_Builder_AddRelativeFolderToBuffer().
+Don't return an empty path. If it is empty return ".".
 
 ------------------------------------------------------------------
-2020-01-12 23:01:21 +0100 Martin Preuss
-Added function GWEN_SyncIo_Helper_WriteFile().
+2021-04-05 14:42:33 +0200 Martin Preuss
+gwenbuild: Delete output file in TmpLib before building.
+Otherwise sub-libraries are added every time a build is started resulting
+in duplicate objects in *.a libs.
diff --git a/Makefile.in b/Makefile.in
index 4acc3a2..fe32c5c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -209,8 +209,8 @@ am__DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.in \
 	$(srcdir)/gwenhywfar-config.in.in $(srcdir)/gwenhywfar.iss.in \
 	$(srcdir)/gwenhywfar.pc.in $(srcdir)/gwenhywfar.spec.in \
 	AUTHORS COPYING ChangeLog INSTALL NEWS README TODO compile \
-	config.guess config.rpath config.sub depcomp install-sh \
-	ltmain.sh missing
+	config.guess config.rpath config.sub install-sh ltmain.sh \
+	missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -1100,8 +1100,8 @@ maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
- at IF_MAKE_I18N_FILES_FALSE@uninstall-local:
 @IF_MAKE_I18N_FILES_FALSE at install-data-local:
+ at IF_MAKE_I18N_FILES_FALSE@uninstall-local:
 clean: clean-recursive
 
 clean-am: clean-generic clean-libtool mostlyclean-am
diff --git a/TODO b/TODO
index 0063aad..9c3b9d7 100644
--- a/TODO
+++ b/TODO
@@ -1,13 +1,21 @@
 
-idList64:
- - add GWEN_IdList64_dup()
-
-
-modtest:
- - create a new module test
-   - use logger hook
-   - allow submodule tests
-
+typemaker2:
+ - add a field annotoations (e.g. "personal data")
+
+logger:
+ - finer granularity for loglevels
+   - introduce subdomains
+     - gwenhywfar/syncio
+     - gwenhywfar/http
+     - gwenhywfar/gui
+     - etc
+   - GWEN_Logger_CreateSubDomains(maindomain, "syncio,http,gui,db,xml,crypt", logLevel)
+   - GWEN_Logger_SetupSubDomains(maindomain, "syncio=notice,http=debug,gui=info", defaultLogLevel)
+   - in source files, e.g. syncio_http:
+     #ifdef   GWEN_LOGDOMAIN
+     # undef  GWEN_LOGDOMAIN
+     # define GWEN_LOGDOMAIN "gwenhywfar/http"
+     #endif
 
 sio:
  - ssl_cert_descr -> typemaker2
@@ -66,41 +74,3 @@ while ((dent = readdir(d)) != NULL) {
 closedir(d);
 
 
-
-0  10
-1  19
-2  35
-3  67
-4  91
-5 115
-6 247
-
-insert 39
-total 7
-
-1. 0???: pos 0:10, smaller, set to 1, okay? no, keep at 0
-2. 00??: pos 0:10, smaller, set to 1, okay? yes, set to 1
-3. 010?: pos 4: 81, bigger, set to 0
-4. 0100: pos 4: 81, bigger, set to 0
--> 4: insert before position 4
-
-
-# approach: determine the highest entry smaller than the new value
-1. 1???: pos 8: overflow, set to 0
-2. 01??: pos 4: 91, bigger, set to 0
-3. 001?: pos 2: 35, smaller, keep at 1
-4. 0011: pos 3: 67, bigger, set to 0
--> 0010: 2 (+1 is the position)
-
-
-insert 75
-
-1. 1???: pos 8, overflow ->0
-2. 01??: pos 4: 91, bigger ->0
-3. 001?: pos 2: 35, smaller ->1
-4. 0011: pos 3: 67, smaller ->1
--> 0011: 3 (+1 is the position)
-
-
-
-
diff --git a/admin/Makefile.in b/admin/Makefile.in
index 1b2ea3e..ed8c1ce 100644
--- a/admin/Makefile.in
+++ b/admin/Makefile.in
@@ -463,9 +463,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign admin/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu admin/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign admin/Makefile
+	  $(AUTOMAKE) --gnu admin/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/checks/Makefile.in b/checks/Makefile.in
index d229ccd..62643a6 100644
--- a/checks/Makefile.in
+++ b/checks/Makefile.in
@@ -692,9 +692,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign checks/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu checks/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign checks/Makefile
+	  $(AUTOMAKE) --gnu checks/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/configure b/configure
index 20dd9e3..2997914 100755
--- a/configure
+++ b/configure
@@ -2919,9 +2919,9 @@ ac_config_headers="$ac_config_headers config.h"
 #
 GWENHYWFAR_VERSION_MAJOR=5
 GWENHYWFAR_VERSION_MINOR=7
-GWENHYWFAR_VERSION_PATCHLEVEL=0
+GWENHYWFAR_VERSION_PATCHLEVEL=1
 GWENHYWFAR_VERSION_BUILD=0
-GWENHYWFAR_VERSION_TAG="beta"
+GWENHYWFAR_VERSION_TAG="stable"
 
 
 
@@ -2931,7 +2931,7 @@ GWENHYWFAR_VERSION_TAG="beta"
 #
 GWENHYWFAR_SO_CURRENT="86"
 GWENHYWFAR_SO_AGE="7"
-GWENHYWFAR_SO_REVISION="0"
+GWENHYWFAR_SO_REVISION="1"
 GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
 
 
diff --git a/configure.ac b/configure.ac
index ca0cef2..04e7d67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,10 +29,10 @@ AC_CONFIG_HEADERS([config.h])
 #
 GWENHYWFAR_VERSION_MAJOR=5
 GWENHYWFAR_VERSION_MINOR=7
-GWENHYWFAR_VERSION_PATCHLEVEL=0
+GWENHYWFAR_VERSION_PATCHLEVEL=1
 GWENHYWFAR_VERSION_BUILD=0
 dnl "stable", "rcX", "betaX", "cvs"
-GWENHYWFAR_VERSION_TAG="beta"
+GWENHYWFAR_VERSION_TAG="stable"
 
 
 
@@ -42,7 +42,7 @@ GWENHYWFAR_VERSION_TAG="beta"
 #
 GWENHYWFAR_SO_CURRENT="86"
 GWENHYWFAR_SO_AGE="7"
-GWENHYWFAR_SO_REVISION="0"
+GWENHYWFAR_SO_REVISION="1"
 GWENHYWFAR_SO_EFFECTIVE="`echo \$(($GWENHYWFAR_SO_CURRENT-$GWENHYWFAR_SO_AGE))`"
 
 
diff --git a/data/Makefile.in b/data/Makefile.in
index 7d2507e..89bbe8d 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -443,9 +443,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign data/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign data/Makefile
+	  $(AUTOMAKE) --gnu data/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 89d85f6..b34f8a0 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -479,9 +479,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign doc/Makefile
+	  $(AUTOMAKE) --gnu doc/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/doc/dialog/Makefile.in b/doc/dialog/Makefile.in
index 7fac4a3..4ea2098 100644
--- a/doc/dialog/Makefile.in
+++ b/doc/dialog/Makefile.in
@@ -475,9 +475,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/dialog/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/dialog/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign doc/dialog/Makefile
+	  $(AUTOMAKE) --gnu doc/dialog/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/doc/dialog/images/Makefile.in b/doc/dialog/images/Makefile.in
index ed93fae..913bad7 100644
--- a/doc/dialog/images/Makefile.in
+++ b/doc/dialog/images/Makefile.in
@@ -435,9 +435,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/dialog/images/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/dialog/images/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign doc/dialog/images/Makefile
+	  $(AUTOMAKE) --gnu doc/dialog/images/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/doc/inherit/Makefile.in b/doc/inherit/Makefile.in
index f506145..7cd32c0 100644
--- a/doc/inherit/Makefile.in
+++ b/doc/inherit/Makefile.in
@@ -685,9 +685,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/inherit/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/inherit/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign doc/inherit/Makefile
+	  $(AUTOMAKE) --gnu doc/inherit/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/Makefile.in b/gui/Makefile.in
index fc1053f..afb3411 100644
--- a/gui/Makefile.in
+++ b/gui/Makefile.in
@@ -469,9 +469,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/Makefile
+	  $(AUTOMAKE) --gnu gui/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/cocoa/Makefile.in b/gui/cocoa/Makefile.in
index aca4c58..27745bf 100644
--- a/gui/cocoa/Makefile.in
+++ b/gui/cocoa/Makefile.in
@@ -617,9 +617,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/cocoa/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/cocoa/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/cocoa/Makefile
+	  $(AUTOMAKE) --gnu gui/cocoa/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/cpp/Makefile.in b/gui/cpp/Makefile.in
index 42b33f6..149c817 100644
--- a/gui/cpp/Makefile.in
+++ b/gui/cpp/Makefile.in
@@ -527,9 +527,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/cpp/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/cpp/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/cpp/Makefile
+	  $(AUTOMAKE) --gnu gui/cpp/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/fox16/Makefile.in b/gui/fox16/Makefile.in
index 7687e39..8621052 100644
--- a/gui/fox16/Makefile.in
+++ b/gui/fox16/Makefile.in
@@ -552,9 +552,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/fox16/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/fox16/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/fox16/Makefile
+	  $(AUTOMAKE) --gnu gui/fox16/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/gtk2/Makefile.in b/gui/gtk2/Makefile.in
index f6508c4..7f947ff 100644
--- a/gui/gtk2/Makefile.in
+++ b/gui/gtk2/Makefile.in
@@ -559,9 +559,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/gtk2/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/gtk2/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/gtk2/Makefile
+	  $(AUTOMAKE) --gnu gui/gtk2/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/gtk3/Makefile.in b/gui/gtk3/Makefile.in
index 8f0f251..5a7bc17 100644
--- a/gui/gtk3/Makefile.in
+++ b/gui/gtk3/Makefile.in
@@ -559,9 +559,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/gtk3/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/gtk3/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/gtk3/Makefile
+	  $(AUTOMAKE) --gnu gui/gtk3/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/qt4/Makefile.in b/gui/qt4/Makefile.in
index 879cff8..9479ba3 100644
--- a/gui/qt4/Makefile.in
+++ b/gui/qt4/Makefile.in
@@ -583,9 +583,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/qt4/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/qt4/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/qt4/Makefile
+	  $(AUTOMAKE) --gnu gui/qt4/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/qt5/Makefile.in b/gui/qt5/Makefile.in
index d028e7e..f73a9c1 100644
--- a/gui/qt5/Makefile.in
+++ b/gui/qt5/Makefile.in
@@ -581,9 +581,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/qt5/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/qt5/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/qt5/Makefile
+	  $(AUTOMAKE) --gnu gui/qt5/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gui/testdialogs/Makefile.in b/gui/testdialogs/Makefile.in
index 1aca0ab..67516e3 100644
--- a/gui/testdialogs/Makefile.in
+++ b/gui/testdialogs/Makefile.in
@@ -478,9 +478,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/testdialogs/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/testdialogs/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign gui/testdialogs/Makefile
+	  $(AUTOMAKE) --gnu gui/testdialogs/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/gwenhywfar.spec b/gwenhywfar.spec
index eaa5460..0d95fac 100644
--- a/gwenhywfar.spec
+++ b/gwenhywfar.spec
@@ -3,7 +3,7 @@
 
 
 %define name gwenhywfar
-%define version 5.7.0beta
+%define version 5.7.1
 %define rpm_cxxflags \"-O2 -march=i486 -mcpu=i586\"
 %define rpm_cflags \"-O2 -march=i486 -mcpu=i586\"
 
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 2b36fe2..3e369bf 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -429,9 +429,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign m4/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign m4/Makefile
+	  $(AUTOMAKE) --gnu m4/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/Makefile.in b/plugins/Makefile.in
index a7354e0..e883f18 100644
--- a/plugins/Makefile.in
+++ b/plugins/Makefile.in
@@ -470,9 +470,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/Makefile
+	  $(AUTOMAKE) --gnu plugins/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/configmgr/Makefile.in b/plugins/configmgr/Makefile.in
index b00c000..a5211a0 100644
--- a/plugins/configmgr/Makefile.in
+++ b/plugins/configmgr/Makefile.in
@@ -469,9 +469,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/configmgr/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/configmgr/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/configmgr/Makefile
+	  $(AUTOMAKE) --gnu plugins/configmgr/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/configmgr/dir/Makefile.in b/plugins/configmgr/dir/Makefile.in
index bada69b..1eba6e0 100644
--- a/plugins/configmgr/dir/Makefile.in
+++ b/plugins/configmgr/dir/Makefile.in
@@ -515,9 +515,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/configmgr/dir/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/configmgr/dir/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/configmgr/dir/Makefile
+	  $(AUTOMAKE) --gnu plugins/configmgr/dir/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/ct/Makefile.in b/plugins/ct/Makefile.in
index a01a109..6deffe1 100644
--- a/plugins/ct/Makefile.in
+++ b/plugins/ct/Makefile.in
@@ -469,9 +469,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/ct/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/ct/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/ct/Makefile
+	  $(AUTOMAKE) --gnu plugins/ct/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/ct/ohbci/Makefile.in b/plugins/ct/ohbci/Makefile.in
index 519fd0c..9df912c 100644
--- a/plugins/ct/ohbci/Makefile.in
+++ b/plugins/ct/ohbci/Makefile.in
@@ -514,9 +514,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/ct/ohbci/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/ct/ohbci/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/ct/ohbci/Makefile
+	  $(AUTOMAKE) --gnu plugins/ct/ohbci/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/dbio/Makefile.in b/plugins/dbio/Makefile.in
index 7455c56..51760df 100644
--- a/plugins/dbio/Makefile.in
+++ b/plugins/dbio/Makefile.in
@@ -470,9 +470,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/dbio/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/dbio/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/dbio/Makefile
+	  $(AUTOMAKE) --gnu plugins/dbio/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/dbio/csv/Makefile.in b/plugins/dbio/csv/Makefile.in
index f5bdbee..f511551 100644
--- a/plugins/dbio/csv/Makefile.in
+++ b/plugins/dbio/csv/Makefile.in
@@ -515,9 +515,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/dbio/csv/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/dbio/csv/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/dbio/csv/Makefile
+	  $(AUTOMAKE) --gnu plugins/dbio/csv/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/dbio/olddb/Makefile.in b/plugins/dbio/olddb/Makefile.in
index 594e7aa..00786fe 100644
--- a/plugins/dbio/olddb/Makefile.in
+++ b/plugins/dbio/olddb/Makefile.in
@@ -515,9 +515,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/dbio/olddb/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/dbio/olddb/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/dbio/olddb/Makefile
+	  $(AUTOMAKE) --gnu plugins/dbio/olddb/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/plugins/dbio/xmldb/Makefile.in b/plugins/dbio/xmldb/Makefile.in
index 534c496..95df5d7 100644
--- a/plugins/dbio/xmldb/Makefile.in
+++ b/plugins/dbio/xmldb/Makefile.in
@@ -515,9 +515,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign plugins/dbio/xmldb/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/dbio/xmldb/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign plugins/dbio/xmldb/Makefile
+	  $(AUTOMAKE) --gnu plugins/dbio/xmldb/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/po/Makefile.in b/po/Makefile.in
index 4d42686..2b9d3aa 100644
--- a/po/Makefile.in
+++ b/po/Makefile.in
@@ -409,9 +409,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign po/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu po/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign po/Makefile
+	  $(AUTOMAKE) --gnu po/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/Makefile.in b/src/Makefile.in
index 35d6a5e..d83f6d6 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -798,9 +798,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/Makefile
+	  $(AUTOMAKE) --gnu src/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/base/Makefile.in b/src/base/Makefile.in
index 4611599..efa5aa2 100644
--- a/src/base/Makefile.in
+++ b/src/base/Makefile.in
@@ -619,9 +619,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/base/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/base/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/base/Makefile
+	  $(AUTOMAKE) --gnu src/base/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/crypt3/Makefile.in b/src/crypt3/Makefile.in
index 6b03e4c..17f4205 100644
--- a/src/crypt3/Makefile.in
+++ b/src/crypt3/Makefile.in
@@ -544,9 +544,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/crypt3/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/crypt3/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/crypt3/Makefile
+	  $(AUTOMAKE) --gnu src/crypt3/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/cryptmsg/Makefile.in b/src/cryptmsg/Makefile.in
index fc42528..c4d9847 100644
--- a/src/cryptmsg/Makefile.in
+++ b/src/cryptmsg/Makefile.in
@@ -520,9 +520,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/cryptmsg/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cryptmsg/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/cryptmsg/Makefile
+	  $(AUTOMAKE) --gnu src/cryptmsg/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/crypttoken/Makefile.in b/src/crypttoken/Makefile.in
index 8aa089e..630cd23 100644
--- a/src/crypttoken/Makefile.in
+++ b/src/crypttoken/Makefile.in
@@ -541,9 +541,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/crypttoken/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/crypttoken/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/crypttoken/Makefile
+	  $(AUTOMAKE) --gnu src/crypttoken/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/gui/Makefile.in b/src/gui/Makefile.in
index 5d861ca..f81f1cb 100644
--- a/src/gui/Makefile.in
+++ b/src/gui/Makefile.in
@@ -554,9 +554,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gui/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gui/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/gui/Makefile
+	  $(AUTOMAKE) --gnu src/gui/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/gui/gui_passwd.c b/src/gui/gui_passwd.c
index 32255db..18a4f03 100644
--- a/src/gui/gui_passwd.c
+++ b/src/gui/gui_passwd.c
@@ -234,16 +234,25 @@ static int GWENHYWFAR_CB GWEN_Gui_Internal_SetPasswordStatus(GWEN_GUI *gui,
     GWEN_Gui__HashPair(token, pin, hbuf);
     if (status==GWEN_Gui_PasswordStatus_Bad) {
       GWEN_StringList_AppendString(gui->badPasswords,
-                                   GWEN_Buffer_GetStart(hbuf),
-                                   0, 1);
+				   GWEN_Buffer_GetStart(hbuf),
+				   0, 1);
       /* remove from permanent passwd storage */
       if (gui->passwdStore) {
-        int rv;
+	int rv;
 
-        rv=GWEN_PasswordStore_SetPassword(gui->passwdStore, token, NULL);
-        if (rv<0) {
-          DBG_WARN(GWEN_LOGDOMAIN, "Could not remove password from storage (%d)", rv);
-        }
+	rv=GWEN_PasswordStore_SetPassword(gui->passwdStore, token, NULL);
+	if (rv<0) {
+	  DBG_WARN(GWEN_LOGDOMAIN, "Could not remove password from storage (%d)", rv);
+	}
+      }
+
+      if (gui->dbPasswords) {
+	GWEN_BUFFER *buf;
+
+	buf=GWEN_Buffer_new(0, 256, 0, 1);
+	GWEN_Text_EscapeToBufferTolerant(token, buf);
+
+	GWEN_DB_DeleteVar(gui->dbPasswords, GWEN_Buffer_GetStart(buf));
       }
     }
     else if (status==GWEN_Gui_PasswordStatus_Ok ||
diff --git a/src/gwenhywfarapi.h b/src/gwenhywfarapi.h
index 826d66e..3b60b15 100644
--- a/src/gwenhywfarapi.h
+++ b/src/gwenhywfarapi.h
@@ -90,8 +90,13 @@
 #endif
 
 #if GWENHYWFAR_SYS_IS_WINDOWS
+#ifdef __MINGW32__
+# define GWEN_DIR_SEPARATOR           '/'
+# define GWEN_DIR_SEPARATOR_S         "/"
+#else
 # define GWEN_DIR_SEPARATOR           '\\'
 # define GWEN_DIR_SEPARATOR_S         "\\"
+#endif
 # define GWEN_SEARCHPATH_SEPARATOR    ';'
 # define GWEN_SEARCHPATH_SEPARATOR_S  ";"
 #else
diff --git a/src/html/Makefile.in b/src/html/Makefile.in
index be7c8d9..d811a59 100644
--- a/src/html/Makefile.in
+++ b/src/html/Makefile.in
@@ -551,9 +551,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/html/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/html/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/html/Makefile
+	  $(AUTOMAKE) --gnu src/html/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/os/Makefile.in b/src/os/Makefile.in
index 12f8a19..1a28800 100644
--- a/src/os/Makefile.in
+++ b/src/os/Makefile.in
@@ -570,9 +570,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/os/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/os/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/os/Makefile
+	  $(AUTOMAKE) --gnu src/os/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/os/posix/Makefile.in b/src/os/posix/Makefile.in
index 06d3f4c..06c0001 100644
--- a/src/os/posix/Makefile.in
+++ b/src/os/posix/Makefile.in
@@ -537,9 +537,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/os/posix/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/os/posix/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/os/posix/Makefile
+	  $(AUTOMAKE) --gnu src/os/posix/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/os/windows/Makefile.in b/src/os/windows/Makefile.in
index 24be3ee..0efe034 100644
--- a/src/os/windows/Makefile.in
+++ b/src/os/windows/Makefile.in
@@ -544,9 +544,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/os/windows/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/os/windows/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/os/windows/Makefile
+	  $(AUTOMAKE) --gnu src/os/windows/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/os/windows/gwenthread.c b/src/os/windows/gwenthread.c
index 70f9d7b..e79ec69 100644
--- a/src/os/windows/gwenthread.c
+++ b/src/os/windows/gwenthread.c
@@ -172,7 +172,7 @@ int GWEN_Thread_Join(GWEN_THREAD *thr)
   }
 
   CloseHandle(thr->threadHandle);
-  thr->threadHandle==NULL;
+  thr->threadHandle = NULL;
 
   return 0;
 }
diff --git a/src/parser/Makefile.in b/src/parser/Makefile.in
index 0ac96e6..b1094ca 100644
--- a/src/parser/Makefile.in
+++ b/src/parser/Makefile.in
@@ -553,9 +553,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/parser/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/parser/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/parser/Makefile
+	  $(AUTOMAKE) --gnu src/parser/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/parser/text.c b/src/parser/text.c
index f04df60..2816ace 100644
--- a/src/parser/text.c
+++ b/src/parser/text.c
@@ -2173,8 +2173,8 @@ int GWEN_Text_ReplaceVars(const char *s, GWEN_BUFFER *dbuf, GWEN_TEXT_REPLACE_VA
         }
       }
       else {
-        DBG_ERROR(GWEN_LOGDOMAIN, "Bad variable string in code");
-        return GWEN_ERROR_BAD_DATA;
+	DBG_ERROR(GWEN_LOGDOMAIN, "Bad variable string in code \"%s\" (rest:\"%s\")", s, p);
+	return GWEN_ERROR_BAD_DATA;
       }
       p++;
     }
diff --git a/src/ressource.rc b/src/ressource.rc
index 05908f1..07675b7 100644
--- a/src/ressource.rc
+++ b/src/ressource.rc
@@ -43,8 +43,8 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
 // Version
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 5, 7, 0, 0
- PRODUCTVERSION 5, 7, 0, 0
+ FILEVERSION 5, 7, 1, 0
+ PRODUCTVERSION 5, 7, 1, 0
  FILEFLAGSMASK 0x3fL
  FILEFLAGS 0x0L
  FILEOS 0x40004L      // Windows NT
@@ -58,14 +58,14 @@ BEGIN
             //VALUE "Comments", "\0"
             VALUE "CompanyName", " Aquamaniac\0"
             VALUE "FileDescription", "Multi purpose library\0"
-            VALUE "FileVersion", "v5.7.0beta\0"
+            VALUE "FileVersion", "v5.7.1\0"
             VALUE "InternalName", "Gwenhywfar\0"
             VALUE "LegalCopyright", "Copyright � 2003 by Martin Preuss\0"
             VALUE "LegalTrademarks", "Aquamaniac\0"
             VALUE "OriginalFilename", "GWENHYWFAR32.DLL\0"
             //VALUE "PrivateBuild", "\0"
             VALUE "ProductName", "Gwenhywfar\0"
-            VALUE "ProductVersion", "v5.7.0beta-0\0"
+            VALUE "ProductVersion", "v5.7.1stable-0\0"
             VALUE "Author", "Martin Preuss\0"
             VALUE "Email", "martin at libchipcard.de\0"
             VALUE "Homepage", "http://gwenhywfar.sf.net/\0"
diff --git a/src/sar/Makefile.in b/src/sar/Makefile.in
index 41a55ea..d8b0df1 100644
--- a/src/sar/Makefile.in
+++ b/src/sar/Makefile.in
@@ -522,9 +522,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/sar/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/sar/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/sar/Makefile
+	  $(AUTOMAKE) --gnu src/sar/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/sio/Makefile.in b/src/sio/Makefile.in
index 74ce385..44dd3e4 100644
--- a/src/sio/Makefile.in
+++ b/src/sio/Makefile.in
@@ -535,9 +535,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/sio/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/sio/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/sio/Makefile
+	  $(AUTOMAKE) --gnu src/sio/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/sio/syncio_tls.c b/src/sio/syncio_tls.c
index 53c9707..d5715c7 100644
--- a/src/sio/syncio_tls.c
+++ b/src/sio/syncio_tls.c
@@ -504,6 +504,8 @@ int GWEN_SyncIo_Tls_Prepare(GWEN_SYNCIO *sio)
 
   /* find default trust file if none is selected */
   if (lflags & GWEN_SYNCIO_TLS_FLAGS_ADD_TRUSTED_CAS) {
+    int trustFileSet=0;
+
 #if GWEN_TLS_USE_SYSTEM_CERTIFICATES
     /* disable setting of default trust file as discussed on aqbanking-users.
      * The rationale is that without this file being set gnutls should behave
@@ -512,9 +514,6 @@ int GWEN_SyncIo_Tls_Prepare(GWEN_SYNCIO *sio)
      * distribution. On Windows the default CA store should be used (if given
      * "--with-default-trust-store-file" to "./configure" of GNUTLS).
      */
-    int trustFileSet=0;
-
-
     if (trustFileSet==0) {
       /* Adds the system's default trusted CAs in order to verify client or server certificates. */
       rv=gnutls_certificate_set_x509_system_trust(xio->credentials);
@@ -526,6 +525,7 @@ int GWEN_SyncIo_Tls_Prepare(GWEN_SYNCIO *sio)
         trustFileSet=1;
       }
     }
+#endif
 
     /* try to find OpenSSL certificates */
 # ifdef OS_WIN32
@@ -633,7 +633,6 @@ int GWEN_SyncIo_Tls_Prepare(GWEN_SYNCIO *sio)
     if (trustFileSet==0) {
       DBG_WARN(GWEN_LOGDOMAIN, "No default bundle file found");
     }
-#endif
   }
 
   /* possibly set trust file */
diff --git a/src/test_framework/Makefile.in b/src/test_framework/Makefile.in
index a3b3c28..a17c47d 100644
--- a/src/test_framework/Makefile.in
+++ b/src/test_framework/Makefile.in
@@ -518,9 +518,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/test_framework/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/test_framework/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/test_framework/Makefile
+	  $(AUTOMAKE) --gnu src/test_framework/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/src/version.h b/src/version.h
index 747e4ee..45720de 100644
--- a/src/version.h
+++ b/src/version.h
@@ -32,11 +32,11 @@
 #define GWEN_VERSION_MAJOR 5
 #define GWENHYWFAR_VERSION_MAJOR 5
 #define GWENHYWFAR_VERSION_MINOR 7
-#define GWENHYWFAR_VERSION_PATCHLEVEL 0
+#define GWENHYWFAR_VERSION_PATCHLEVEL 1
 #define GWENHYWFAR_VERSION_BUILD 0
-#define GWENHYWFAR_VERSION_TAG "beta"
-#define GWENHYWFAR_VERSION_FULL_STRING "5.7.0beta-0"
-#define GWENHYWFAR_VERSION_STRING "5.7.0"
+#define GWENHYWFAR_VERSION_TAG "stable"
+#define GWENHYWFAR_VERSION_FULL_STRING "5.7.1stable-0"
+#define GWENHYWFAR_VERSION_STRING "5.7.1"
 
 #define GWENHYWFAR_SO_EFFECTIVE 79
 #define GWENHYWFAR_SO_EFFECTIVE_STR "79"
diff --git a/src/xmlcmd/Makefile.in b/src/xmlcmd/Makefile.in
index 3082ca8..6fcc890 100644
--- a/src/xmlcmd/Makefile.in
+++ b/src/xmlcmd/Makefile.in
@@ -521,9 +521,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/xmlcmd/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xmlcmd/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/xmlcmd/Makefile
+	  $(AUTOMAKE) --gnu src/xmlcmd/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/test/Makefile.in b/test/Makefile.in
index 1dcfcfe..d165248 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -484,9 +484,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign test/Makefile
+	  $(AUTOMAKE) --gnu test/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 74d12e6..f04e72e 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -469,9 +469,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/Makefile
+	  $(AUTOMAKE) --gnu tools/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gcttool/Makefile.in b/tools/gcttool/Makefile.in
index 073efe5..ec2c493 100644
--- a/tools/gcttool/Makefile.in
+++ b/tools/gcttool/Makefile.in
@@ -508,9 +508,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gcttool/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gcttool/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gcttool/Makefile
+	  $(AUTOMAKE) --gnu tools/gcttool/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gsa/Makefile.in b/tools/gsa/Makefile.in
index fe0fe6f..0aeda9e 100644
--- a/tools/gsa/Makefile.in
+++ b/tools/gsa/Makefile.in
@@ -491,9 +491,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gsa/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gsa/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gsa/Makefile
+	  $(AUTOMAKE) --gnu tools/gsa/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/Makefile.am b/tools/gwenbuild/Makefile.am
index 62520ae..4d0a504 100644
--- a/tools/gwenbuild/Makefile.am
+++ b/tools/gwenbuild/Makefile.am
@@ -1,7 +1,7 @@
 SUBDIRS=types parser tools buildctx builders templates
 
 
-INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I$(gwenhywfar_symlinkdir)
+INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 
 
 
@@ -13,7 +13,8 @@ gwbuild_SOURCES=\
   c_prepare.c \
   c_build.c \
   c_install.c \
-  c_clean.c
+  c_clean.c \
+  c_dist.c
   
 noinst_HEADERS=\
   utils.h \
@@ -21,7 +22,8 @@ noinst_HEADERS=\
   c_prepare.h \
   c_build.h \
   c_install.h \
-  c_clean.h
+  c_clean.h \
+  c_dist.h
 
 
 gwbuild_LDADD = \
diff --git a/tools/gwenbuild/Makefile.in b/tools/gwenbuild/Makefile.in
index e1a94d0..553e680 100644
--- a/tools/gwenbuild/Makefile.in
+++ b/tools/gwenbuild/Makefile.in
@@ -115,7 +115,7 @@ am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
 am_gwbuild_OBJECTS = main.$(OBJEXT) utils.$(OBJEXT) c_setup.$(OBJEXT) \
 	c_prepare.$(OBJEXT) c_build.$(OBJEXT) c_install.$(OBJEXT) \
-	c_clean.$(OBJEXT)
+	c_clean.$(OBJEXT) c_dist.$(OBJEXT)
 gwbuild_OBJECTS = $(am_gwbuild_OBJECTS)
 am__DEPENDENCIES_1 =
 gwbuild_DEPENDENCIES =  \
@@ -500,7 +500,7 @@ with_gui_gtk2 = @with_gui_gtk2@
 with_gui_gtk3 = @with_gui_gtk3@
 with_gui_qt4 = @with_gui_qt4@
 SUBDIRS = types parser tools buildctx builders templates
-INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I$(gwenhywfar_symlinkdir)
+INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 gwbuild_SOURCES = \
   main.c \
   utils.c \
@@ -508,7 +508,8 @@ gwbuild_SOURCES = \
   c_prepare.c \
   c_build.c \
   c_install.c \
-  c_clean.c
+  c_clean.c \
+  c_dist.c
 
 noinst_HEADERS = \
   utils.h \
@@ -516,7 +517,8 @@ noinst_HEADERS = \
   c_prepare.h \
   c_build.h \
   c_install.h \
-  c_clean.h
+  c_clean.h \
+  c_dist.h
 
 gwbuild_LDADD = \
   $(top_builddir)/src/$(gwenhywfar_internal_libname) \
@@ -540,9 +542,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -622,6 +624,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/c_build.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/c_clean.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/c_dist.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/c_install.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/c_prepare.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/c_setup.Po at am__quote@
diff --git a/tools/gwenbuild/README b/tools/gwenbuild/README
index da68d36..5ab2ca9 100644
--- a/tools/gwenbuild/README
+++ b/tools/gwenbuild/README
@@ -116,7 +116,6 @@ TODO:
 - shared vs. static
 - commands
   - cppcheck
-  - format (astyle)
   
 
 -s           setup build environment
diff --git a/tools/gwenbuild/buildctx/Makefile.am b/tools/gwenbuild/buildctx/Makefile.am
index 75a48fb..179618a 100644
--- a/tools/gwenbuild/buildctx/Makefile.am
+++ b/tools/gwenbuild/buildctx/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 
 
 
diff --git a/tools/gwenbuild/buildctx/Makefile.in b/tools/gwenbuild/buildctx/Makefile.in
index 8952694..5191a61 100644
--- a/tools/gwenbuild/buildctx/Makefile.in
+++ b/tools/gwenbuild/buildctx/Makefile.in
@@ -449,7 +449,7 @@ with_gui_fox16 = @with_gui_fox16@
 with_gui_gtk2 = @with_gui_gtk2@
 with_gui_gtk3 = @with_gui_gtk3@
 with_gui_qt4 = @with_gui_qt4@
-INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 noinst_LTLIBRARIES = libgwb_build.la
 libgwb_build_la_SOURCES = \
  buildcmd.c \
@@ -483,9 +483,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/buildctx/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/buildctx/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/buildctx/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/buildctx/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/buildctx/buildcmd.c b/tools/gwenbuild/buildctx/buildcmd.c
index 03d1ab1..77b5021 100644
--- a/tools/gwenbuild/buildctx/buildcmd.c
+++ b/tools/gwenbuild/buildctx/buildcmd.c
@@ -504,6 +504,47 @@ void _readFileIdsFromXml(GWEN_XMLNODE *xmlNode,
 
 
 
+void GWB_BuildCmd_List2_WriteXml(const GWB_BUILD_CMD_LIST2 *cmdList, GWEN_XMLNODE *xmlNode, const char *groupName)
+{
+  GWB_BUILD_CMD_LIST2_ITERATOR *it;
+
+  it=GWB_BuildCmd_List2_First(cmdList);
+  if (it) {
+    GWB_BUILD_CMD *cmd;
+
+    cmd=GWB_BuildCmd_List2Iterator_Data(it);
+    while(cmd) {
+      GWEN_XMLNODE *entryNode;
+
+      entryNode=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, groupName);
+      GWB_BuildCmd_toXml(cmd, entryNode);
+      GWEN_XMLNode_AddChild(xmlNode, entryNode);
+      cmd=GWB_BuildCmd_List2Iterator_Next(it);
+    }
+    GWB_BuildCmd_List2Iterator_free(it);
+  }
+}
+
+
+
+void GWB_BuildCmd_List_WriteXml(const GWB_BUILD_CMD_LIST *cmdList, GWEN_XMLNODE *xmlNode, const char *groupName)
+{
+  GWB_BUILD_CMD *cmd;
+
+  cmd=GWB_BuildCmd_List_First(cmdList);
+  while(cmd) {
+    GWEN_XMLNODE *entryNode;
+
+    entryNode=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, groupName);
+    GWB_BuildCmd_toXml(cmd, entryNode);
+    GWEN_XMLNode_AddChild(xmlNode, entryNode);
+    cmd=GWB_BuildCmd_List_Next(cmd);
+  }
+}
+
+
+
+
 void GWB_BuildCmd_List2_FreeAll(GWB_BUILD_CMD_LIST2 *cmdList)
 {
   if (cmdList) {
diff --git a/tools/gwenbuild/buildctx/buildcmd.h b/tools/gwenbuild/buildctx/buildcmd.h
index 794beb8..2e39953 100644
--- a/tools/gwenbuild/buildctx/buildcmd.h
+++ b/tools/gwenbuild/buildctx/buildcmd.h
@@ -85,6 +85,10 @@ void GWB_BuildCmd_toXml(const GWB_BUILD_CMD *bcmd, GWEN_XMLNODE *xmlNode);
 GWB_BUILD_CMD *GWB_BuildCmd_fromXml(GWEN_XMLNODE *xmlNode, GWB_FILE_LIST2 *fileList);
 
 
+void GWB_BuildCmd_List_WriteXml(const GWB_BUILD_CMD_LIST *cmdList, GWEN_XMLNODE *xmlNode, const char *groupName);
+void GWB_BuildCmd_List2_WriteXml(const GWB_BUILD_CMD_LIST2 *cmdList, GWEN_XMLNODE *xmlNode, const char *groupName);
+
+
 void GWB_BuildCmd_List2_FreeAll(GWB_BUILD_CMD_LIST2 *cmdList);
 
 
diff --git a/tools/gwenbuild/builders/Makefile.am b/tools/gwenbuild/builders/Makefile.am
index 42bf515..a3db030 100644
--- a/tools/gwenbuild/builders/Makefile.am
+++ b/tools/gwenbuild/builders/Makefile.am
@@ -1,6 +1,6 @@
 SUBDIRS=posix windows
 
-INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 
 DEFS=-DBUILDERDATADIR=\"$(datadir)/gwenhywfar/gwenbuild/builders\"
 
@@ -8,12 +8,15 @@ DEFS=-DBUILDERDATADIR=\"$(datadir)/gwenhywfar/gwenbuild/builders\"
 noinst_LTLIBRARIES=libgwb_builders.la
 
 libgwb_builders_la_SOURCES=\
- genericbuilder.c
+ genericbuilder.c \
+ gbuilderdescr.c
 
 
 noinst_HEADERS=\
  genericbuilder.h \
- genericbuilder_p.h
+ genericbuilder_p.h \
+ gbuilderdescr.h \
+ gbuilderdescr_p.h
 
 
 builderdatadir=$(datadir)/gwenhywfar/gwenbuild/builders
diff --git a/tools/gwenbuild/builders/Makefile.in b/tools/gwenbuild/builders/Makefile.in
index b234fb0..fab4f9a 100644
--- a/tools/gwenbuild/builders/Makefile.in
+++ b/tools/gwenbuild/builders/Makefile.in
@@ -113,7 +113,7 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 libgwb_builders_la_LIBADD =
-am_libgwb_builders_la_OBJECTS = genericbuilder.lo
+am_libgwb_builders_la_OBJECTS = genericbuilder.lo gbuilderdescr.lo
 libgwb_builders_la_OBJECTS = $(am_libgwb_builders_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -521,14 +521,17 @@ with_gui_gtk2 = @with_gui_gtk2@
 with_gui_gtk3 = @with_gui_gtk3@
 with_gui_qt4 = @with_gui_qt4@
 SUBDIRS = posix windows
-INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 noinst_LTLIBRARIES = libgwb_builders.la
 libgwb_builders_la_SOURCES = \
- genericbuilder.c
+ genericbuilder.c \
+ gbuilderdescr.c
 
 noinst_HEADERS = \
  genericbuilder.h \
- genericbuilder_p.h
+ genericbuilder_p.h \
+ gbuilderdescr.h \
+ gbuilderdescr_p.h
 
 builderdatadir = $(datadir)/gwenhywfar/gwenbuild/builders
 dist_builderdata_DATA = \
@@ -557,9 +560,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/builders/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/builders/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/builders/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/builders/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -598,6 +601,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gbuilderdescr.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/genericbuilder.Plo at am__quote@
 
 .c.o:
diff --git a/tools/gwenbuild/builders/gbuilderdescr.c b/tools/gwenbuild/builders/gbuilderdescr.c
new file mode 100644
index 0000000..39419db
--- /dev/null
+++ b/tools/gwenbuild/builders/gbuilderdescr.c
@@ -0,0 +1,223 @@
+/***************************************************************************
+    begin       : Mon Feb 08 2021
+    copyright   : (C) 2021 by Martin Preuss
+    email       : martin at libchipcard.de
+
+ ***************************************************************************
+ *          Please see toplevel file COPYING for license details           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "gwenbuild/builders/gbuilderdescr_p.h"
+#include "gwenbuild/parser/parser.h"
+
+#include <gwenhywfar/debug.h>
+#include <gwenhywfar/memory.h>
+#include <gwenhywfar/text.h>
+#include <gwenhywfar/directory.h>
+
+
+
+GWEN_LIST_FUNCTIONS(GWB_GBUILDER_DESCR, GWB_GBuilderDescr)
+
+
+
+static void _readSettingsFromXml(GWB_GBUILDER_DESCR *descr);
+GWB_GBUILDER_DESCR *_readFromFile(const char *fileName);
+
+
+
+
+
+GWB_GBUILDER_DESCR *GWB_GBuilderDescr_new(GWEN_XMLNODE *xmlNode)
+{
+  GWB_GBUILDER_DESCR *descr;
+  const char *s;
+
+  s=GWEN_XMLNode_GetProperty(xmlNode, "name", NULL);
+  if (!(s && *s)) {
+    DBG_ERROR(NULL, "No builder name in XML builder description");
+    return NULL;
+  }
+
+  GWEN_NEW_OBJECT(GWB_GBUILDER_DESCR, descr);
+  GWEN_LIST_INIT(GWB_GBUILDER_DESCR, descr);
+  descr->builderName=strdup(s);
+  descr->xmlDescr=xmlNode;
+
+  _readSettingsFromXml(descr);
+
+  return descr;
+}
+
+
+
+void _readSettingsFromXml(GWB_GBUILDER_DESCR *descr)
+{
+  GWEN_XMLNODE *nInputFiles;
+
+  nInputFiles=GWEN_XMLNode_FindFirstTag(descr->xmlDescr, "inputFiles", NULL, NULL);
+  if (nInputFiles) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_FindFirstTag(nInputFiles, "acceptedInputTypes", NULL, NULL);
+    if (n)
+      descr->acceptedInputTypes=GWB_Parser_ReadXmlDataIntoStringList(NULL, n);
+
+    n=GWEN_XMLNode_FindFirstTag(nInputFiles, "acceptedInputFiles", NULL, NULL);
+    if (n)
+      descr->acceptedInputExt=GWB_Parser_ReadXmlDataIntoStringList(NULL, n);
+  }
+}
+
+
+
+void GWB_GBuilderDescr_free(GWB_GBUILDER_DESCR *descr)
+{
+  if (descr) {
+    GWEN_LIST_FINI(GWB_GBUILDER_DESCR, descr);
+
+    free(descr->builderName);
+    GWEN_XMLNode_free(descr->xmlDescr);
+    GWEN_StringList_free(descr->acceptedInputTypes);
+    GWEN_StringList_free(descr->acceptedInputExt);
+
+    GWEN_FREE_OBJECT(descr);
+  }
+}
+
+
+
+const char *GWB_GBuilderDescr_GetBuilderName(const GWB_GBUILDER_DESCR *descr)
+{
+  return descr->builderName;
+}
+
+
+
+GWEN_XMLNODE *GWB_GBuilderDescr_GetXmlDescr(const GWB_GBUILDER_DESCR *descr)
+{
+  return descr->xmlDescr;
+}
+
+
+
+GWEN_STRINGLIST *GWB_GBuilderDescr_GetAcceptedInputTypes(const GWB_GBUILDER_DESCR *descr)
+{
+  return descr->acceptedInputTypes;
+}
+
+
+
+GWEN_STRINGLIST *GWB_GBuilderDescr_GetAcceptedInputExt(const GWB_GBUILDER_DESCR *descr)
+{
+  return descr->acceptedInputExt;
+}
+
+
+
+
+
+GWB_GBUILDER_DESCR *_readFromFile(const char *fileName)
+{
+  GWEN_XMLNODE *xmlRoot;
+  GWEN_XMLNODE *xmlDescr;
+  GWB_GBUILDER_DESCR *descr;
+  int rv;
+
+  xmlRoot=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "root");
+  rv=GWEN_XML_ReadFile(xmlRoot, fileName, GWEN_XML_FLAGS_DEFAULT | GWEN_XML_FLAGS_SIMPLE);
+  if (rv<0) {
+    DBG_ERROR(NULL, "No builder description found in file \"%s\" (%d)", fileName, rv);
+    return NULL;
+  }
+
+  xmlDescr=GWEN_XMLNode_FindFirstTag(xmlRoot, "GwenBuilder", NULL, NULL);
+  if (xmlDescr==NULL) {
+    DBG_ERROR(NULL, "No <GwenBuilder> element found in file \"%s\"", fileName);
+    GWEN_XMLNode_free(xmlRoot);
+    return NULL;
+  }
+  GWEN_XMLNode_UnlinkChild(xmlRoot, xmlDescr);
+  GWEN_XMLNode_free(xmlRoot);
+
+  descr=GWB_GBuilderDescr_new(xmlDescr);
+  if (descr==NULL) {
+    DBG_ERROR(NULL, "Error in file \"%s\"", fileName);
+    GWEN_XMLNode_free(xmlDescr);
+    return NULL;
+  }
+
+  return descr;
+}
+
+
+
+GWB_GBUILDER_DESCR_LIST *GWB_GBuilderDescr_ReadAll(const char *folder)
+{
+  GWEN_STRINGLIST *sl;
+  GWEN_STRINGLISTENTRY *se;
+  GWB_GBUILDER_DESCR_LIST *descrList;
+  int rv;
+
+  sl=GWEN_StringList_new();
+  rv=GWEN_Directory_GetMatchingFilesRecursively(folder, sl, "*.gwb");
+  if (rv<0) {
+    DBG_ERROR(NULL, "here (%d)", rv);
+    GWEN_StringList_free(sl);
+    return NULL;
+  }
+
+  descrList=GWB_GBuilderDescr_List_new();
+  se=GWEN_StringList_FirstEntry(sl);
+  while(se) {
+    const char *s;
+
+    s=GWEN_StringListEntry_Data(se);
+    if (s && *s) {
+      GWB_GBUILDER_DESCR *descr;
+
+      DBG_INFO(NULL, "Reading builder descr file \"%s\"", s);
+      descr=_readFromFile(s);
+      if (descr==NULL) {
+        DBG_ERROR(NULL, "Error reading description from file \"%s\", ignoring", s);
+      }
+      else
+        GWB_GBuilderDescr_List_Add(descr, descrList);
+    }
+
+    se=GWEN_StringListEntry_Next(se);
+  }
+  GWEN_StringList_free(sl);
+
+  return descrList;
+}
+
+
+
+GWB_GBUILDER_DESCR *GWB_GBuilderDescr_List_GetByName(const GWB_GBUILDER_DESCR_LIST *descrList, const char *name)
+{
+  GWB_GBUILDER_DESCR *descr;
+
+  descr=GWB_GBuilderDescr_List_First(descrList);
+  while(descr) {
+    if (descr->builderName && strcasecmp(descr->builderName, name)==0)
+      return descr;
+    descr=GWB_GBuilderDescr_List_Next(descr);
+  }
+
+  return NULL;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/gwenbuild/builders/gbuilderdescr.h b/tools/gwenbuild/builders/gbuilderdescr.h
new file mode 100644
index 0000000..212ede8
--- /dev/null
+++ b/tools/gwenbuild/builders/gbuilderdescr.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+    begin       : Mon Feb 08 2021
+    copyright   : (C) 2021 by Martin Preuss
+    email       : martin at libchipcard.de
+
+ ***************************************************************************
+ *          Please see toplevel file COPYING for license details           *
+ ***************************************************************************/
+
+#ifndef GWBUILD_GBUILDER_DESCR_H
+#define GWBUILD_GBUILDER_DESCR_H
+
+
+
+#include <gwenhywfar/db.h>
+#include <gwenhywfar/xml.h>
+#include <gwenhywfar/list1.h>
+#include <gwenhywfar/stringlist.h>
+
+
+
+typedef struct GWB_GBUILDER_DESCR GWB_GBUILDER_DESCR;
+GWEN_LIST_FUNCTION_DEFS(GWB_GBUILDER_DESCR, GWB_GBuilderDescr)
+
+
+GWB_GBUILDER_DESCR *GWB_GBuilderDescr_new(GWEN_XMLNODE *xmlNode);
+void GWB_GBuilderDescr_free(GWB_GBUILDER_DESCR *descr);
+
+const char *GWB_GBuilderDescr_GetBuilderName(const GWB_GBUILDER_DESCR *descr);
+GWEN_XMLNODE *GWB_GBuilderDescr_GetXmlDescr(const GWB_GBUILDER_DESCR *descr);
+
+GWEN_STRINGLIST *GWB_GBuilderDescr_GetAcceptedInputTypes(const GWB_GBUILDER_DESCR *descr);
+GWEN_STRINGLIST *GWB_GBuilderDescr_GetAcceptedInputExt(const GWB_GBUILDER_DESCR *descr);
+
+
+GWB_GBUILDER_DESCR_LIST *GWB_GBuilderDescr_ReadAll(const char *folder);
+GWB_GBUILDER_DESCR *GWB_GBuilderDescr_List_GetByName(const GWB_GBUILDER_DESCR_LIST *descrList, const char *name);
+
+
+#endif
diff --git a/tools/gwenbuild/types/gwenbuild_p.h b/tools/gwenbuild/builders/gbuilderdescr_p.h
similarity index 51%
copy from tools/gwenbuild/types/gwenbuild_p.h
copy to tools/gwenbuild/builders/gbuilderdescr_p.h
index d06aa08..1cced3c 100644
--- a/tools/gwenbuild/types/gwenbuild_p.h
+++ b/tools/gwenbuild/builders/gbuilderdescr_p.h
@@ -7,20 +7,29 @@
  *          Please see toplevel file COPYING for license details           *
  ***************************************************************************/
 
-#ifndef GWBUILD_GWENBUILD_P_H
-#define GWBUILD_GWENBUILD_P_H
+#ifndef GWBUILD_GBUILDER_DESCR_P_H
+#define GWBUILD_GBUILDER_DESCR_P_H
 
 
-#include "gwenbuild/types/gwenbuild.h"
+#include "gwenbuild/builders/gbuilderdescr.h"
 
+#include <gwenhywfar/db.h>
+#include <gwenhywfar/stringlist.h>
 
 
-struct GWENBUILD {
-  GWEN_STRINGLIST *buildFilenameList;
 
-  char *targetSystem;
-  int targetIsWindows;
+typedef struct GWB_GBUILDER_DESCR GWB_GBUILDER_DESCR;
+struct GWB_GBUILDER_DESCR {
+  GWEN_LIST_ELEMENT(GWB_GBUILDER_DESCR)
+
+  char *builderName;
+  GWEN_XMLNODE *xmlDescr;
+
+  GWEN_STRINGLIST *acceptedInputTypes;
+  GWEN_STRINGLIST *acceptedInputExt;
 };
 
 
+
+
 #endif
diff --git a/tools/gwenbuild/builders/genericbuilder.c b/tools/gwenbuild/builders/genericbuilder.c
index 6fa450f..75cb204 100644
--- a/tools/gwenbuild/builders/genericbuilder.c
+++ b/tools/gwenbuild/builders/genericbuilder.c
@@ -156,7 +156,7 @@ GWB_BUILDER *GWB_GenericBuilder_new(GWENBUILD *gwenbuild, GWB_CONTEXT *context,
 
 
 
-void _freeData(GWEN_UNUSED void *bp, void *p)
+void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
 {
   GWB_BUILDER_GENERIC *xbuilder;
 
diff --git a/tools/gwenbuild/builders/genericbuilder.h b/tools/gwenbuild/builders/genericbuilder.h
index 525d4c6..9d91d04 100644
--- a/tools/gwenbuild/builders/genericbuilder.h
+++ b/tools/gwenbuild/builders/genericbuilder.h
@@ -19,6 +19,8 @@
 
 GWB_BUILDER *GWB_GenericBuilder_Factory(GWENBUILD *gwenbuild, GWB_CONTEXT *context, const char *builderName);
 
+GWB_BUILDER *GWB_GenericBuilder_new(GWENBUILD *gwenbuild, GWB_CONTEXT *context, GWEN_XMLNODE *xmlDescr);
+
 
 
 #endif
diff --git a/tools/gwenbuild/builders/posix/Makefile.in b/tools/gwenbuild/builders/posix/Makefile.in
index 43938c8..0238a48 100644
--- a/tools/gwenbuild/builders/posix/Makefile.in
+++ b/tools/gwenbuild/builders/posix/Makefile.in
@@ -451,9 +451,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/builders/posix/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/builders/posix/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/builders/posix/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/builders/posix/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/builders/posix/staticlib.gwb b/tools/gwenbuild/builders/posix/staticlib.gwb
index b339591..79ca702 100644
--- a/tools/gwenbuild/builders/posix/staticlib.gwb
+++ b/tools/gwenbuild/builders/posix/staticlib.gwb
@@ -8,7 +8,7 @@
   </inputFiles>
 
   <outputFiles>
-    <file type="staticlib">
+    <file type="tmplib">
       lib$(target_name).a
     </file>
   </outputFiles>
@@ -17,25 +17,39 @@
     -l$(target_name)
   </targetLinkSpecs>
   
-  <buildCommands>
-    <cmd tool="$(ar)">
+  <buildCommands deleteOutFileFirst="TRUE" checkDates="FALSE" >
+    <cmd tool="$(GWBUILD_TOOL_AR)" >
       <args>
-        <fixed>rc</fixed>
+        <fixed>Trc</fixed>
         <blank/>
         <outputFiles index="0" />
         <blank/>
         <inputFiles match="*.o" />
+        <inputFiles match="*.a" />
       </args>
+      <mainOutputFile index="0" />
+      <buildMessage>Linking 'lib$(target_name).a'</buildMessage>
     </cmd>
 
-    <cmd tool="$(ranlib)">
+    <cmd tool="$(topbuilddir)/staticlibhelper.sh" >
       <args>
+        <fixed>$(GWBUILD_TOOL_AR)</fixed>
+        <blank/>
         <outputFiles index="0" />
       </args>
+      <buildMessage>Finally linking 'lib$(target_name).a'</buildMessage>
     </cmd>
 
-  </buildCommands>
-  
+    <cmd tool="$(GWBUILD_TOOL_RANLIB)">
+      <args>
+        <outputFiles index="0" />
+      </args>
+      <mainOutputFile index="0" />
+      <buildMessage>Indexing 'lib$(target_name).a'</buildMessage>
+    </cmd>
 
+  </buildCommands>
 
 </GwenBuilder>
+
+
diff --git a/tools/gwenbuild/builders/windows/Makefile.in b/tools/gwenbuild/builders/windows/Makefile.in
index d572597..c9dad27 100644
--- a/tools/gwenbuild/builders/windows/Makefile.in
+++ b/tools/gwenbuild/builders/windows/Makefile.in
@@ -451,9 +451,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/builders/windows/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/builders/windows/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/builders/windows/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/builders/windows/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/builders/windows/staticlib.gwb b/tools/gwenbuild/builders/windows/staticlib.gwb
index b339591..a59cd43 100644
--- a/tools/gwenbuild/builders/windows/staticlib.gwb
+++ b/tools/gwenbuild/builders/windows/staticlib.gwb
@@ -8,7 +8,7 @@
   </inputFiles>
 
   <outputFiles>
-    <file type="staticlib">
+    <file type="tmplib">
       lib$(target_name).a
     </file>
   </outputFiles>
@@ -17,25 +17,30 @@
     -l$(target_name)
   </targetLinkSpecs>
   
-  <buildCommands>
-    <cmd tool="$(ar)">
+  <buildCommands deleteOutFileFirst="TRUE" checkDates="TRUE" >
+    <cmd tool="$(GWBUILD_TOOL_AR)" >
       <args>
-        <fixed>rc</fixed>
+        <fixed>Trc</fixed>
         <blank/>
         <outputFiles index="0" />
         <blank/>
         <inputFiles match="*.o" />
+        <inputFiles match="*.a" />
       </args>
+      <mainOutputFile index="0" />
+      <buildMessage>Linking 'lib$(target_name).a'</buildMessage>
     </cmd>
 
-    <cmd tool="$(ranlib)">
+    <cmd tool="$(GWBUILD_TOOL_RANLIB)">
       <args>
         <outputFiles index="0" />
       </args>
+      <mainOutputFile index="0" />
+      <buildMessage>Indexing 'lib$(target_name).a'</buildMessage>
     </cmd>
 
   </buildCommands>
-  
-
 
 </GwenBuilder>
+
+
diff --git a/tools/gwenbuild/c_dist.c b/tools/gwenbuild/c_dist.c
new file mode 100644
index 0000000..4ab85d0
--- /dev/null
+++ b/tools/gwenbuild/c_dist.c
@@ -0,0 +1,181 @@
+/***************************************************************************
+    begin       : Mon Feb 08 2021
+    copyright   : (C) 2021 by Martin Preuss
+    email       : martin at libchipcard.de
+
+ ***************************************************************************
+ *          Please see toplevel file COPYING for license details           *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+
+#include "c_dist.h"
+#include "utils.h"
+
+#include <gwenhywfar/debug.h>
+#include <gwenhywfar/directory.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+
+
+static int _writeDistFiles(const char *initialSourceDir, const GWB_FILE_LIST2 *fileList, const char *folder);
+
+
+
+
+int GWB_MkDist()
+{
+  GWB_FILE_LIST2 *projectFileList;
+  GWEN_XMLNODE *xmlProjectInfo;
+  GWEN_BUFFER *nameBuf;
+  const char *initialSourceDir;
+  const char *projectName;
+  int versionMajor;
+  int versionMinor;
+  int versionPatchlevel;
+  int versionBuild;
+  const char *versionTag;
+  int rv;
+
+  projectFileList=GWB_Utils_ReadFileList2(".gwbuild.files");
+  if (projectFileList==NULL) {
+    DBG_ERROR(NULL, "No file list read.");
+    return GWEN_ERROR_GENERIC;
+  }
+
+  xmlProjectInfo=GWB_Utils_ReadProjectInfoFromFile(".gwbuild.projectinfo");
+  if (xmlProjectInfo==NULL) {
+    DBG_ERROR(NULL, "Error reading project info.");
+    GWB_File_List2_free(projectFileList);
+    return GWEN_ERROR_GENERIC;
+  }
+
+  initialSourceDir=GWEN_XMLNode_GetCharValue(xmlProjectInfo, "initialSourceDir", NULL);
+  projectName=GWEN_XMLNode_GetCharValue(xmlProjectInfo, "projectName", NULL);
+  versionMajor=GWEN_XMLNode_GetIntValue(xmlProjectInfo, "versionMajor", 0);
+  versionMinor=GWEN_XMLNode_GetIntValue(xmlProjectInfo, "versionMinor", 0);
+  versionPatchlevel=GWEN_XMLNode_GetIntValue(xmlProjectInfo, "versionPatchlevel", 0);
+  versionBuild=GWEN_XMLNode_GetIntValue(xmlProjectInfo, "versionBuild", 0);
+  versionTag=GWEN_XMLNode_GetCharValue(xmlProjectInfo, "versionTag", NULL);
+  if (!(projectName && *projectName)) {
+    DBG_ERROR(NULL, "Missing project name in project info file");
+    GWEN_XMLNode_free(xmlProjectInfo);
+    GWB_File_List2_free(projectFileList);
+    return GWEN_ERROR_GENERIC;
+  }
+
+  nameBuf=GWEN_Buffer_new(0, 256, 0, 1);
+  if (versionBuild>0)
+    GWEN_Buffer_AppendArgs(nameBuf,
+			   "%s-%d.%d.%d.%d%s",
+			   projectName,
+			   versionMajor, versionMinor, versionPatchlevel, versionBuild,
+			   versionTag?versionTag:"");
+  else
+    GWEN_Buffer_AppendArgs(nameBuf,
+			   "%s-%d.%d.%d%s",
+			   projectName,
+			   versionMajor, versionMinor, versionPatchlevel,
+			   versionTag?versionTag:"");
+
+  rv=_writeDistFiles(initialSourceDir, projectFileList, GWEN_Buffer_GetStart(nameBuf));
+  if (rv<0) {
+    DBG_ERROR(NULL, "Error copying files into dist folder \"%s\"",
+	      GWEN_Buffer_GetStart(nameBuf));
+    GWEN_Buffer_free(nameBuf);
+    GWEN_XMLNode_free(xmlProjectInfo);
+    GWB_File_List2_free(projectFileList);
+    return rv;
+  }
+  GWEN_Buffer_free(nameBuf);
+  GWEN_XMLNode_free(xmlProjectInfo);
+  GWB_File_List2_free(projectFileList);
+
+
+  return 0;
+}
+
+
+
+int _writeDistFiles(const char *initialSourceDir,
+		    const GWB_FILE_LIST2 *fileList,
+		    const char *folder)
+{
+  GWB_FILE_LIST2_ITERATOR *it;
+
+  it=GWB_File_List2_First(fileList);
+  if (it) {
+    GWB_FILE *file;
+    GWEN_BUFFER *sourceNameBuf;
+    GWEN_BUFFER *destNameBuf;
+
+    sourceNameBuf=GWEN_Buffer_new(0, 256, 0, 1);
+    destNameBuf=GWEN_Buffer_new(0, 256, 0, 1);
+    file=GWB_File_List2Iterator_Data(it);
+    while(file) {
+      uint32_t flags;
+      const char *s;
+
+      flags=GWB_File_GetFlags(file);
+      if (flags & GWB_FILE_FLAGS_DIST) {
+	int rv;
+
+	/* generate source path */
+	if (!(flags & GWB_FILE_FLAGS_GENERATED)) {
+	  GWEN_Buffer_AppendString(sourceNameBuf, initialSourceDir);
+	  GWEN_Buffer_AppendString(sourceNameBuf, GWEN_DIR_SEPARATOR_S);
+	}
+	s=GWB_File_GetFolder(file);
+	if (s && *s) {
+	  GWEN_Buffer_AppendString(sourceNameBuf, s);
+	  GWEN_Buffer_AppendString(sourceNameBuf, GWEN_DIR_SEPARATOR_S);
+	}
+	GWEN_Buffer_AppendString(sourceNameBuf, GWB_File_GetName(file));
+
+	/* generate target path */
+	GWEN_Buffer_AppendString(destNameBuf, folder);
+	GWEN_Buffer_AppendString(destNameBuf, GWEN_DIR_SEPARATOR_S);
+	if (s && *s) {
+	  GWEN_Buffer_AppendString(destNameBuf, s);
+	  GWEN_Buffer_AppendString(destNameBuf, GWEN_DIR_SEPARATOR_S);
+	}
+	GWEN_Buffer_AppendString(destNameBuf, GWB_File_GetName(file));
+
+	fprintf(stdout, "Moving file '%s' into dist folder\n", GWEN_Buffer_GetStart(sourceNameBuf));
+	rv=GWB_Utils_CopyFile(GWEN_Buffer_GetStart(sourceNameBuf), GWEN_Buffer_GetStart(destNameBuf));
+	if (rv<0) {
+	  DBG_ERROR(NULL, "Error copying \"%s\" into dist folder (%d)",
+		    GWEN_Buffer_GetStart(sourceNameBuf), rv);
+	  GWEN_Buffer_free(sourceNameBuf);
+	  GWEN_Buffer_free(destNameBuf);
+	  return rv;
+	}
+
+	GWEN_Buffer_Reset(sourceNameBuf);
+	GWEN_Buffer_Reset(destNameBuf);
+      }
+
+      file=GWB_File_List2Iterator_Next(it);
+    }
+    GWEN_Buffer_free(sourceNameBuf);
+    GWEN_Buffer_free(destNameBuf);
+    GWB_File_List2Iterator_free(it);
+  }
+
+  return 0;
+
+}
+
+
+
+
diff --git a/tools/gwenbuild/types/gwenbuild_p.h b/tools/gwenbuild/c_dist.h
similarity index 68%
copy from tools/gwenbuild/types/gwenbuild_p.h
copy to tools/gwenbuild/c_dist.h
index d06aa08..0d47c66 100644
--- a/tools/gwenbuild/types/gwenbuild_p.h
+++ b/tools/gwenbuild/c_dist.h
@@ -7,20 +7,16 @@
  *          Please see toplevel file COPYING for license details           *
  ***************************************************************************/
 
-#ifndef GWBUILD_GWENBUILD_P_H
-#define GWBUILD_GWENBUILD_P_H
+#ifndef GWBUILD_C_DIST_H
+#define GWBUILD_C_DIST_H
 
 
-#include "gwenbuild/types/gwenbuild.h"
+#include <gwenhywfar/db.h>
 
 
+int GWB_MkDist(void);
 
-struct GWENBUILD {
-  GWEN_STRINGLIST *buildFilenameList;
-
-  char *targetSystem;
-  int targetIsWindows;
-};
 
 
 #endif
+
diff --git a/tools/gwenbuild/c_install.c b/tools/gwenbuild/c_install.c
index 5fa77f1..58c4959 100644
--- a/tools/gwenbuild/c_install.c
+++ b/tools/gwenbuild/c_install.c
@@ -18,18 +18,6 @@
 #include <gwenhywfar/debug.h>
 #include <gwenhywfar/directory.h>
 
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-
-
-
-static int _copyFile(const char *sSrcPath, const char *sDestPath);
-
 
 
 
@@ -61,7 +49,8 @@ int GWB_InstallFiles(const char *fileName, const char *destDir)
       sDestPath=GWEN_Buffer_GetStart(destPathBuf);
     }
 
-    rv=_copyFile(sSrcPath, sDestPath);
+    fprintf(stdout, "Installing file '%s'\n", sSrcPath);
+    rv=GWB_Utils_CopyFile(sSrcPath, sDestPath);
     if (rv<0) {
       fprintf(stderr, "ERROR: Error installing file \"%s\"\n", sSrcPath);
       GWEN_Buffer_free(destPathBuf);
@@ -78,92 +67,5 @@ int GWB_InstallFiles(const char *fileName, const char *destDir)
 
 
 
-int _copyFile(const char *sSrcPath, const char *sDestPath)
-{
-  int rv;
-  struct stat st;
-
-  if (lstat(sSrcPath, &st)==-1) {
-    DBG_ERROR(NULL, "ERROR: stat(%s): %s", sSrcPath, strerror(errno));
-    return GWEN_ERROR_GENERIC;
-  }
-
-  if ((st.st_mode & S_IFMT)==S_IFLNK) {
-    char *symlinkbuf;
-    int bufSizeNeeded;
-
-    /* copy symlink */
-    fprintf(stdout, "Installing symlink '%s'\n", sSrcPath);
-    if (st.st_size==0)
-      bufSizeNeeded=256;
-    else
-      bufSizeNeeded=st.st_size+1;
-    symlinkbuf=(char*) malloc(bufSizeNeeded);
-    assert(symlinkbuf);
-    rv=readlink(sSrcPath, symlinkbuf, bufSizeNeeded);
-    if (rv==-1) {
-      DBG_ERROR(NULL, "ERROR: readlink(%s): %s", sSrcPath, strerror(errno));
-      free(symlinkbuf);
-      return GWEN_ERROR_GENERIC;
-    }
-    else if (rv==bufSizeNeeded) {
-      DBG_ERROR(NULL, "Buffer too small (%d)", bufSizeNeeded);
-      free(symlinkbuf);
-      return GWEN_ERROR_GENERIC;
-    }
-
-    rv=GWEN_Directory_GetPath(sDestPath,
-                              GWEN_DIR_FLAGS_PUBLIC_PATH | GWEN_DIR_FLAGS_PUBLIC_NAME |
-                              GWEN_PATH_FLAGS_VARIABLE|
-                              GWEN_PATH_FLAGS_CHECKROOT);
-    if (rv<0) {
-      DBG_INFO(NULL, "here (%d)", rv);
-      free(symlinkbuf);
-      return rv;
-    }
-    unlink(sDestPath);
-    rv=symlink(symlinkbuf, sDestPath);
-    if (rv==-1) {
-      DBG_ERROR(NULL, "ERROR: symlink(%s): %s", sSrcPath, strerror(errno));
-      free(symlinkbuf);
-      return GWEN_ERROR_GENERIC;
-    }
-  }
-  else if ((st.st_mode & S_IFMT)==S_IFREG) {
-    mode_t newMode=0;
-
-    fprintf(stdout, "Installing file '%s'\n", sSrcPath);
-    rv=GWEN_Directory_GetPath(sDestPath,
-                              GWEN_DIR_FLAGS_PUBLIC_PATH | GWEN_DIR_FLAGS_PUBLIC_NAME |
-                              GWEN_PATH_FLAGS_VARIABLE|
-                              GWEN_PATH_FLAGS_CHECKROOT);
-    if (rv<0) {
-      DBG_INFO(NULL, "here (%d)", rv);
-      return rv;
-    }
-  
-    rv=GWEN_SyncIo_Helper_CopyFile(sSrcPath, sDestPath);
-    if (rv<0) {
-      DBG_INFO(NULL, "here (%d)", rv);
-      return rv;
-    }
-
-    newMode=S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
-    if (st.st_mode & S_IXUSR)
-      newMode|=S_IXUSR|S_IXGRP|S_IXOTH;
-    rv=chmod(sDestPath, newMode);
-    if (rv<0) {
-      DBG_ERROR(NULL, "ERROR: chmod(%s): %s", sSrcPath, strerror(errno));
-      return rv;
-    }
-  }
-  else {
-    DBG_ERROR(NULL, "Unhandled file type \"%s\"", sSrcPath);
-  }
-
-  return 0;
-}
-
-
 
 
diff --git a/tools/gwenbuild/c_setup.c b/tools/gwenbuild/c_setup.c
index dd43d8c..8e36871 100644
--- a/tools/gwenbuild/c_setup.c
+++ b/tools/gwenbuild/c_setup.c
@@ -21,6 +21,10 @@
 #include <gwenhywfar/directory.h>
 #include <gwenhywfar/text.h>
 
+#include <sys/stat.h>
+#include <errno.h>
+#include <unistd.h>
+
 
 
 static int _prepareContextForSetup(GWB_CONTEXT *firstContext, GWEN_DB_NODE *dbArgs);
@@ -32,6 +36,7 @@ static int _getToolPath(GWEN_DB_NODE *dbVars, const char *sTarget, const GWEN_ST
 static void _copySomeEnvironmentVariablesToDb(GWEN_DB_NODE *db);
 static void _copyEnvironmentVariableToDb(GWEN_DB_NODE *db, const char *envName, const char *dbVarName);
 static GWB_KEYVALUEPAIR_LIST *_readOptionsFromDb(GWEN_DB_NODE *db);
+static int _writeStaticLibHelper(const char *fileName);
 
 
 
@@ -63,6 +68,9 @@ int GWB_Setup(GWEN_DB_NODE *dbArgs)
 
 
   gwenbuild=GWBUILD_new();
+  if (GWEN_DB_GetIntValue(dbArgs, "static", 0, 0))
+    GWBUILD_AddFlags(gwenbuild, GWENBUILD_FLAGS_STATIC);
+
   firstContext=GWB_Context_new(gwenbuild);
   rv=_prepareContextForSetup(firstContext, dbArgs);
   if (rv<0) {
@@ -114,6 +122,30 @@ int GWB_Setup(GWEN_DB_NODE *dbArgs)
     return 3;
   }
 
+#if 0
+  rv=GWB_Utils_WriteProjectToFile(project, ".gwbuild.project");
+  if (rv<0) {
+    fprintf(stderr, "ERROR: Error writing project to file.\n");
+    return 3;
+  }
+#endif
+
+  rv=GWB_Utils_WriteProjectInfoToFile(project, ".gwbuild.projectinfo");
+  if (rv<0) {
+    fprintf(stderr, "ERROR: Error writing project info to file.\n");
+    return 3;
+  }
+
+
+  rv=GWB_Utils_WriteContextTreeToFile(GWB_Project_GetRootContext(project),
+                                      ".gwbuild.ctxtree");
+
+  rv=_writeStaticLibHelper("staticlibhelper.sh");
+  if (rv<0) {
+    fprintf(stderr, "ERROR: Error writing staticlibhelper.\n");
+    return 3;
+  }
+
 
   if (doDump) {
     GWB_Project_Dump(project, 2, 1);
@@ -194,6 +226,11 @@ void _determineTarget(GWB_CONTEXT *context, GWEN_DB_NODE *dbArgs)
     sTargetSystem=GWBUILD_GetHostSystem();
   }
 
+  if (GWBUILD_GetFlags(gwenbuild) & GWENBUILD_FLAGS_STATIC)
+    GWEN_DB_SetCharValue(dbVars, GWEN_DB_FLAGS_OVERWRITE_VARS, "GWBUILD_LIBTYPE", "staticlib");
+  else
+    GWEN_DB_SetCharValue(dbVars, GWEN_DB_FLAGS_OVERWRITE_VARS, "GWBUILD_LIBTYPE", "sharedlib");
+
   GWEN_DB_SetCharValue(dbVars, GWEN_DB_FLAGS_OVERWRITE_VARS, "GWBUILD_SYSTEM", sTargetSystem);
   GWBUILD_SetTargetSystem(gwenbuild, sTargetSystem);
   GWBUILD_SetTargetIsWindows(gwenbuild, (strcasecmp(sTargetSystem, "windows")==0)?1:0);
@@ -366,3 +403,35 @@ GWB_KEYVALUEPAIR_LIST *_readOptionsFromDb(GWEN_DB_NODE *db)
 
   return kvpList;
 }
+
+
+
+int _writeStaticLibHelper(const char *fileName)
+{
+  int rv;
+  static char *staticLibHelperContent=
+    "#!/bin/sh\n"
+    "\n"
+    "TOOL=$1\n"
+    "LIB=$2\n"
+    "\n"
+    "$TOOL -t $LIB | xargs ar rvs $LIB.new && mv -v $LIB.new $LIB";
+
+  unlink(fileName);
+  rv=GWEN_SyncIo_Helper_WriteFile(fileName, (const uint8_t*) staticLibHelperContent, strlen(staticLibHelperContent));
+  if (rv<0) {
+    DBG_ERROR(NULL, "Error writing static lib helper to \"%s\" (%d)", fileName, rv);
+    return rv;
+  }
+  if (chmod(fileName, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP)==-1) {
+    DBG_ERROR(NULL, "Error on chmod(%s): %s", fileName, strerror(errno));
+    return GWEN_ERROR_GENERIC;
+  }
+
+  return 0;
+}
+
+
+
+
+
diff --git a/tools/gwenbuild/main.c b/tools/gwenbuild/main.c
index e4e08a7..35aace3 100644
--- a/tools/gwenbuild/main.c
+++ b/tools/gwenbuild/main.c
@@ -19,6 +19,7 @@
 #include "c_build.h"
 #include "c_install.h"
 #include "c_clean.h"
+#include "c_dist.h"
 
 #include <gwenhywfar/gwenhywfar.h>
 #include <gwenhywfar/cgui.h>
@@ -46,6 +47,7 @@
 #define ARGS_COMMAND_REPEAT_SETUP   0x0008
 #define ARGS_COMMAND_INSTALL        0x0010
 #define ARGS_COMMAND_CLEAN          0x0020
+#define ARGS_COMMAND_DIST           0x0040
 
 
 
@@ -159,7 +161,7 @@ int main(int argc, char **argv)
   commands|=GWEN_DB_GetIntValue(dbArgs, "build", 0, 0)?ARGS_COMMAND_BUILD:0;
   commands|=GWEN_DB_GetIntValue(dbArgs, "install", 0, 0)?ARGS_COMMAND_INSTALL:0;
   commands|=GWEN_DB_GetIntValue(dbArgs, "clean", 0, 0)?ARGS_COMMAND_CLEAN:0;
-
+  commands|=GWEN_DB_GetIntValue(dbArgs, "dist", 0, 0)?ARGS_COMMAND_DIST:0;
 
   if (commands & ARGS_COMMAND_SETUP) {
     rv=GWB_Setup(dbArgs);
@@ -201,6 +203,14 @@ int main(int argc, char **argv)
     }
   }
 
+  if (commands & ARGS_COMMAND_DIST) {
+    rv=GWB_MkDist();
+    if (rv!=0) {
+      fprintf(stderr, "ERROR: Error on creating dist file.\n");
+      return rv;
+    }
+  }
+
   if (commands & ARGS_COMMAND_CLEAN) {
     rv=GWB_Clean(".gwbuild.files");
     if (rv!=0) {
@@ -284,6 +294,8 @@ int _readArgsIntoDb(int argc, char **argv, GWEN_DB_NODE *db)
         }
         else if (strcmp(s, "--dump")==0)
           GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "dump", 1);
+        else if (strcmp(s, "--static")==0)
+          GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "static", 1);
 	else if (strcmp(s, "--help")==0) {
 	  GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "help", 1);
 	  help=1;
@@ -300,6 +312,8 @@ int _readArgsIntoDb(int argc, char **argv, GWEN_DB_NODE *db)
           GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "install", 1);
         else if (strcmp(s, "-c")==0)
           GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "clean", 1);
+        else if (strcmp(s, "-d")==0)
+          GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "dist", 1);
         else if (strncmp(s, "-j", 2)==0) {
           /* jobs */
           s+=2;
@@ -390,12 +404,14 @@ void _printHelpScreen()
 	  "-i           install files\n"
 	  "-c           cleanup; delete generated files\n"
 	  "-r           repeat setup command using the same arguments given to last setup\n"
+	  "-d           make distribution folder (you need to run tar yourself for now)\n"
 	  "-Oname=value specify options (can occur multiple times)\n"
 	  "-Bname       Only run commands for the given build (mostly used with\n"
 	  "             'tm2builder')\n"
 	  "-Lname       Set loglevel (debug, info, notice, warn, error)\n"
 	  "-Cname       Crosscompile for given environment (e-g- 'x86_64-w64-mingw32')\n"
-	  "-jvalue      Use the given number of parallel process for building\n"
+          "-jvalue      Use the given number of parallel process for building\n"
+          "--static     Generate static libs for InstallLibrary targets\n"
 	 );
 }
 
diff --git a/tools/gwenbuild/parser/Makefile.am b/tools/gwenbuild/parser/Makefile.am
index 68c642e..d16371b 100644
--- a/tools/gwenbuild/parser/Makefile.am
+++ b/tools/gwenbuild/parser/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 
 
 
diff --git a/tools/gwenbuild/parser/Makefile.in b/tools/gwenbuild/parser/Makefile.in
index d4b9cf0..b30a6d7 100644
--- a/tools/gwenbuild/parser/Makefile.in
+++ b/tools/gwenbuild/parser/Makefile.in
@@ -451,7 +451,7 @@ with_gui_fox16 = @with_gui_fox16@
 with_gui_gtk2 = @with_gui_gtk2@
 with_gui_gtk3 = @with_gui_gtk3@
 with_gui_qt4 = @with_gui_qt4@
-INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 noinst_LTLIBRARIES = libgwb_parser.la
 libgwb_parser_la_SOURCES = \
  parser.c \
@@ -492,9 +492,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/parser/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/parser/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/parser/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/parser/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/parser/p_dependencies.c b/tools/gwenbuild/parser/p_dependencies.c
index 667fea3..0ca5417 100644
--- a/tools/gwenbuild/parser/p_dependencies.c
+++ b/tools/gwenbuild/parser/p_dependencies.c
@@ -102,10 +102,12 @@ int _parseChildNodes(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XML
 int _parseDep(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode)
 {
   int rv;
+  const char *s;
   const char *sId;
   const char *sName;
   const char *sMinVersion;
   const char *sMaxVersion;
+  int required;
 
   rv=GWEN_XMLNode_ExpandProperties(xmlNode, GWB_Context_GetVars(currentContext));
   if (rv<0) {
@@ -125,6 +127,9 @@ int _parseDep(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode)
     return GWEN_ERROR_GENERIC;
   }
 
+  s=GWEN_XMLNode_GetProperty(xmlNode, "required", "FALSE");
+  required=(strcasecmp(s, "TRUE")==0)?1:0;
+
   sMinVersion=GWEN_XMLNode_GetProperty(xmlNode, "minversion", NULL);
   sMaxVersion=GWEN_XMLNode_GetProperty(xmlNode, "maxversion", NULL);
 
@@ -156,7 +161,13 @@ int _parseDep(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode)
       }
     }
   }
-  else if (rv!=GWEN_ERROR_NOT_FOUND) {
+  else if (rv==GWEN_ERROR_NOT_FOUND) {
+    if (required) {
+      DBG_ERROR(NULL, "Dependency \"%s\" not found but required", sName);
+      return rv;
+    }
+  }
+  else {
     DBG_INFO(NULL, "here (%d)", rv);
     return rv;
   }
diff --git a/tools/gwenbuild/parser/p_project.c b/tools/gwenbuild/parser/p_project.c
index 9cc2af8..29e3e00 100644
--- a/tools/gwenbuild/parser/p_project.c
+++ b/tools/gwenbuild/parser/p_project.c
@@ -145,6 +145,10 @@ int _parseChildNodes(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XML
         rv=_parseDefine(project, currentContext, n);
       else if (strcasecmp(name, "buildFiles")==0)
         rv=GWB_ParseBuildFiles(project, currentContext, n);
+      else if (strcasecmp(name, "extradist")==0)
+        rv=GWB_Parser_ParseSourcesOrHeaders(project, currentContext, n, 1, 0);
+      else if (strcasecmp(name, "data")==0)
+        rv=GWB_Parser_ParseSourcesOrHeaders(project, currentContext, n, 1, 0);
       else if (strcasecmp(name, "subdirs")==0)
         rv=GWB_Parser_ParseSubdirs(project, currentContext, n, _parseChildNodes);
       else
diff --git a/tools/gwenbuild/parser/p_target.c b/tools/gwenbuild/parser/p_target.c
index 3b7fd10..ad8c7ee 100644
--- a/tools/gwenbuild/parser/p_target.c
+++ b/tools/gwenbuild/parser/p_target.c
@@ -24,7 +24,6 @@
 
 static GWB_TARGET *_readTarget(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode);
 static int _parseChildNodes(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode);
-static int _parseSourcesOrHeaders(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode, int alwaysDist, int isSource);
 static int _parseUsedTargets(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode);
 static int _parseIncludes(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode);
 static int _parseLibraries(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode);
@@ -146,11 +145,13 @@ int _parseChildNodes(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XML
       if (strcasecmp(name, "subdirs")==0)
         rv=GWB_Parser_ParseSubdirs(project, currentContext, n, _parseChildNodes);
       else if (strcasecmp(name, "sources")==0)
-        rv=_parseSourcesOrHeaders(project, currentContext, n, 1, 1);
+        rv=GWB_Parser_ParseSourcesOrHeaders(project, currentContext, n, 1, 1);
       else if (strcasecmp(name, "headers")==0)
-        rv=_parseSourcesOrHeaders(project, currentContext, n, 1, 0);
+        rv=GWB_Parser_ParseSourcesOrHeaders(project, currentContext, n, 1, 0);
       else if (strcasecmp(name, "data")==0)
-        rv=_parseSourcesOrHeaders(project, currentContext, n, 1, 0);
+        rv=GWB_Parser_ParseSourcesOrHeaders(project, currentContext, n, 1, 0);
+      else if (strcasecmp(name, "extradist")==0)
+        rv=GWB_Parser_ParseSourcesOrHeaders(project, currentContext, n, 1, 0);
       else if (strcasecmp(name, "useTargets")==0)
         rv=_parseUsedTargets(currentContext, n);
       else if (strcasecmp(name, "includes")==0)
@@ -179,82 +180,6 @@ int _parseChildNodes(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XML
 
 
 
-int _parseSourcesOrHeaders(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode, int alwaysDist, int isSource)
-{
-  GWB_TARGET *target;
-  uint32_t flags=0;
-  int rv;
-  const char *s;
-  const char *installPath;
-  const char *fileType;
-  const char *currentFolder;
-  const char *builder;
-  GWEN_STRINGLIST *fileNameList;
-
-  target=GWB_Context_GetCurrentTarget(currentContext);
-  if (target==NULL) {
-    DBG_ERROR(NULL, "No target in current context, SNH!");
-    return GWEN_ERROR_INTERNAL;
-  }
-
-  rv=GWEN_XMLNode_ExpandProperties(xmlNode, GWB_Context_GetVars(currentContext));
-  if (rv<0) {
-    DBG_INFO(NULL, "here (%d)", rv);
-    return rv;
-  }
-
-  currentFolder=GWB_Context_GetCurrentRelativeDir(currentContext);
-
-  fileType=GWEN_XMLNode_GetProperty(xmlNode, "type", NULL);
-  builder=GWEN_XMLNode_GetProperty(xmlNode, "builder", NULL);
-
-  installPath=GWEN_XMLNode_GetProperty(xmlNode, "install", NULL);
-  if (installPath && *installPath)
-    flags|=GWB_FILE_FLAGS_INSTALL;
-
-  s=GWEN_XMLNode_GetProperty(xmlNode, "generated", "FALSE");
-  if (s && *s && (strcasecmp(s, "true")==0 || strcasecmp(s, "yes")==0))
-    flags|=GWB_FILE_FLAGS_GENERATED;
-
-  s=GWEN_XMLNode_GetProperty(xmlNode, "dist", alwaysDist?"TRUE":"FALSE");
-  if (s && *s && (strcasecmp(s, "true")==0 || strcasecmp(s, "yes")==0))
-    flags|=GWB_FILE_FLAGS_DIST;
-
-  fileNameList=GWB_Parser_ReadXmlDataIntoStringList(GWB_Context_GetVars(currentContext), xmlNode);
-  if (fileNameList) {
-    GWEN_STRINGLISTENTRY *se;
-
-    se=GWEN_StringList_FirstEntry(fileNameList);
-    while(se) {
-      const char *sFileName;
-
-      sFileName=GWEN_StringListEntry_Data(se);
-      if (sFileName && *sFileName) {
-        GWB_FILE *file;
-
-        file=GWB_File_List2_GetOrCreateFile(GWB_Project_GetFileList(project), currentFolder, sFileName);
-        GWB_File_AddFlags(file, flags);
-        if (installPath)
-          GWB_File_SetInstallPath(file, installPath);
-        if (fileType)
-          GWB_File_SetFileType(file, fileType);
-        if (builder)
-          GWB_File_SetBuilder(file, builder);
-        if (isSource)
-          GWB_Context_AddSourceFile(currentContext, file);
-        //GWB_Target_AddSourceFile(target, file);
-      }
-
-      se=GWEN_StringListEntry_Next(se);
-    }
-    GWEN_StringList_free(fileNameList);
-  }
-
-  return 0;
-}
-
-
-
 int _parseUsedTargets(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode)
 {
   GWB_TARGET *target;
diff --git a/tools/gwenbuild/parser/parser.c b/tools/gwenbuild/parser/parser.c
index 2f6ab59..1d05f95 100644
--- a/tools/gwenbuild/parser/parser.c
+++ b/tools/gwenbuild/parser/parser.c
@@ -27,6 +27,11 @@
 #include <string.h>
 #include <ctype.h>
 
+#include <sys/types.h> /* for stat, chmod */
+#include <sys/stat.h>
+#include <unistd.h>
+
+
 
 
 static int _parseSubdir(GWB_PROJECT *project, GWB_CONTEXT *currentContext, const char *sFolder, GWB_PARSER_PARSE_ELEMENT_FN fn);
@@ -42,6 +47,9 @@ static void _appendVarValue(GWEN_DB_NODE *db, const char *name, const char *newV
 static int _readVersion(const char *s);
 static int _readIntUntilPoint(const char **s);
 
+static int _getFilePermissions(const char *fname);
+static int _setFilePermissions(const char *fname, int perms);
+
 
 
 
@@ -53,6 +61,7 @@ GWB_PROJECT *GWB_Parser_ReadBuildTree(GWENBUILD *gwbuild,
   GWEN_XMLNODE *xmlNewFile;
   GWEN_XMLNODE *xmlProject;
   GWB_PROJECT *project;
+  GWB_FILE *file;
   int rv;
 
   GWB_Context_SetInitialSourceDir(currentContext, srcDir);
@@ -73,6 +82,11 @@ GWB_PROJECT *GWB_Parser_ReadBuildTree(GWENBUILD *gwbuild,
   }
 
   project=GWB_Project_new(gwbuild, currentContext);
+  file=GWB_File_List2_GetOrCreateFile(GWB_Project_GetFileList(project),
+                                      GWB_Context_GetCurrentRelativeDir(currentContext),
+                                      GWB_PARSER_FILENAME);
+  GWB_File_AddFlags(file, GWB_FILE_FLAGS_DIST);
+
   if (givenOptionList)
     GWB_Project_SetGivenOptionList(project, givenOptionList);
 
@@ -161,7 +175,7 @@ GWEN_XMLNODE *GWB_Parser_ReadBuildFile(GWENBUILD *gwbuild, const GWB_CONTEXT *cu
   DBG_DEBUG(NULL, "Reading file %s", GWEN_Buffer_GetStart(fileNameBuf));
   rv=GWEN_XML_ReadFile(xmlDocNode, GWEN_Buffer_GetStart(fileNameBuf), GWEN_XML_FLAGS_DEFAULT);
   if (rv<0) {
-    DBG_INFO(NULL, "here %d)", rv);
+    DBG_ERROR(NULL, "Error in XML file \"%s\" (%d)", GWEN_Buffer_GetStart(fileNameBuf), rv);
     GWEN_Buffer_free(fileNameBuf);
     return NULL;
   }
@@ -301,7 +315,7 @@ GWEN_STRINGLIST *GWB_Parser_ReadXmlDataIntoStringList(GWEN_DB_NODE *db, GWEN_XML
 
     sl=GWEN_StringList_fromString(GWEN_Buffer_GetStart(buf), " ", 1);
     if (sl==NULL) {
-      DBG_ERROR(NULL, "Could not generate string list from data [%s]", GWEN_Buffer_GetStart(buf));
+      DBG_INFO(NULL, "Could not generate string list from data [%s]", GWEN_Buffer_GetStart(buf));
       GWEN_Buffer_free(buf);
       return NULL;
     }
@@ -329,12 +343,17 @@ GWEN_BUFFER *GWB_Parser_ReadXmlDataIntoBufferAndExpand(GWEN_DB_NODE *db, GWEN_XM
       GWEN_BUFFER *buf;
 
       buf=GWEN_Buffer_new(0, 256, 0, 1);
-      rv=GWEN_DB_ReplaceVars(db, s, buf);
-      if(rv<0) {
-        DBG_INFO(NULL, "here (%d)", rv);
-        GWEN_Buffer_free(buf);
-        return NULL;
+      if (db) {
+	rv=GWEN_DB_ReplaceVars(db, s, buf);
+	if(rv<0) {
+	  DBG_INFO(NULL, "here (%d)", rv);
+	  GWEN_Buffer_free(buf);
+	  return NULL;
+	}
       }
+      else
+	GWEN_Buffer_AppendString(buf, s);
+
       if (GWEN_Buffer_GetUsedBytes(buf)==0) {
         GWEN_Buffer_free(buf);
         return NULL;
@@ -419,6 +438,7 @@ int _parseSubdir(GWB_PROJECT *project, GWB_CONTEXT *currentContext, const char *
   GWB_CONTEXT *newContext;
   GWEN_XMLNODE *xmlNewFile;
   int rv;
+  GWB_FILE *file;
 
   newContext=GWB_Parser_CopyContextForSubdir(currentContext, sFolder);
 
@@ -430,6 +450,12 @@ int _parseSubdir(GWB_PROJECT *project, GWB_CONTEXT *currentContext, const char *
     return GWEN_ERROR_BAD_DATA;
   }
 
+  file=GWB_File_List2_GetOrCreateFile(GWB_Project_GetFileList(project),
+                                      GWB_Context_GetCurrentRelativeDir(newContext),
+                                      GWB_PARSER_FILENAME);
+  GWB_File_AddFlags(file, GWB_FILE_FLAGS_DIST);
+
+
   rv=fn(project, newContext, xmlNewFile);
   if (rv<0) {
     DBG_INFO(NULL, "here (%d)", rv);
@@ -690,6 +716,7 @@ int _parseWriteFile(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLN
   GWEN_BUFFER *fileBufferIn;
   GWEN_BUFFER *fileBufferOut;
   GWB_FILE *file;
+  int sourceFilePerms;
   int rv;
 
   fileName=GWEN_XMLNode_GetProperty(xmlNode, "name", NULL);
@@ -708,6 +735,14 @@ int _parseWriteFile(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLN
   GWEN_Buffer_AppendString(fileNameBuffer, fileName);
   GWEN_Buffer_AppendString(fileNameBuffer, ".in");
 
+  rv=_getFilePermissions(GWEN_Buffer_GetStart(fileNameBuffer));
+  if (rv<0) {
+    DBG_ERROR(NULL, "Could not read permissions for \"%s\" (%d)", GWEN_Buffer_GetStart(fileNameBuffer), rv);
+    GWEN_Buffer_free(fileNameBuffer);
+    return rv;
+  }
+  sourceFilePerms=rv;
+
   fileBufferIn=GWEN_Buffer_new(0, 256, 0, 1);
 
   rv=GWEN_SyncIo_Helper_ReadFile(GWEN_Buffer_GetStart(fileNameBuffer), fileBufferIn);
@@ -735,7 +770,16 @@ int _parseWriteFile(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLN
                                   (const uint8_t*)GWEN_Buffer_GetStart(fileBufferOut),
                                   GWEN_Buffer_GetUsedBytes(fileBufferOut));
   if (rv<0) {
-    DBG_ERROR(NULL, "Could not write \"%sh\" (%d)", fileName, rv);
+    DBG_ERROR(NULL, "Could not write \"%s\" (%d)", fileName, rv);
+    GWEN_Buffer_free(fileBufferOut);
+    GWEN_Buffer_free(fileBufferIn);
+    GWEN_Buffer_free(fileNameBuffer);
+    return rv;
+  }
+
+  rv=_setFilePermissions(fileName, sourceFilePerms);
+  if (rv<0) {
+    DBG_ERROR(NULL, "Could not set perms for \"%s\" (%d)", fileName, rv);
     GWEN_Buffer_free(fileBufferOut);
     GWEN_Buffer_free(fileBufferIn);
     GWEN_Buffer_free(fileNameBuffer);
@@ -752,9 +796,10 @@ int _parseWriteFile(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLN
   GWEN_Buffer_Reset(fileNameBuffer);
   GWEN_Buffer_AppendString(fileNameBuffer, fileName);
   GWEN_Buffer_AppendString(fileNameBuffer, ".in");
-  GWB_File_List2_GetOrCreateFile(GWB_Project_GetFileList(project),
-                                 GWB_Context_GetCurrentRelativeDir(currentContext),
-                                 GWEN_Buffer_GetStart(fileNameBuffer));
+  file=GWB_File_List2_GetOrCreateFile(GWB_Project_GetFileList(project),
+                                      GWB_Context_GetCurrentRelativeDir(currentContext),
+                                      GWEN_Buffer_GetStart(fileNameBuffer));
+  GWB_File_AddFlags(file, GWB_FILE_FLAGS_DIST);
 
   GWEN_Buffer_free(fileBufferOut);
   GWEN_Buffer_free(fileBufferIn);
@@ -765,6 +810,32 @@ int _parseWriteFile(GWB_PROJECT *project, GWB_CONTEXT *currentContext, GWEN_XMLN
 
 
 
+int _getFilePermissions(const char *fname)
+{
+  struct stat st;
+
+  if (lstat(fname, &st) == -1) {
+    DBG_ERROR(NULL, "Error on stat(\"%s\"): %d (%s)", fname, errno, strerror(errno));
+    return GWEN_ERROR_IO;
+  }
+
+  return (int)((st.st_mode & ~S_IFMT));
+}
+
+
+
+int _setFilePermissions(const char *fname, int perms)
+{
+  if (chmod(fname, perms) == -1) {
+    DBG_ERROR(NULL, "Error on chmod(\"%s\"): %d (%s)", fname, errno, strerror(errno));
+    return GWEN_ERROR_IO;
+  }
+
+  return 0;
+}
+
+
+
 void _appendVarValue(GWEN_DB_NODE *db, const char *name, const char *newValue)
 {
   const char *s;
@@ -903,4 +974,74 @@ int GWB_Parser_ParseWellKnownElements(GWB_PROJECT *project, GWB_CONTEXT *current
 
 
 
+int GWB_Parser_ParseSourcesOrHeaders(GWB_PROJECT *project,
+                                     GWB_CONTEXT *currentContext,
+                                     GWEN_XMLNODE *xmlNode,
+                                     int alwaysDist,
+                                     int isSource)
+{
+  uint32_t flags=0;
+  int rv;
+  const char *s;
+  const char *installPath;
+  const char *fileType;
+  const char *currentFolder;
+  const char *builder;
+  GWEN_STRINGLIST *fileNameList;
+
+  rv=GWEN_XMLNode_ExpandProperties(xmlNode, GWB_Context_GetVars(currentContext));
+  if (rv<0) {
+    DBG_INFO(NULL, "here (%d)", rv);
+    return rv;
+  }
+
+  currentFolder=GWB_Context_GetCurrentRelativeDir(currentContext);
+
+  fileType=GWEN_XMLNode_GetProperty(xmlNode, "type", NULL);
+  builder=GWEN_XMLNode_GetProperty(xmlNode, "builder", NULL);
+
+  installPath=GWEN_XMLNode_GetProperty(xmlNode, "install", NULL);
+  if (installPath && *installPath)
+    flags|=GWB_FILE_FLAGS_INSTALL;
+
+  s=GWEN_XMLNode_GetProperty(xmlNode, "generated", "FALSE");
+  if (s && *s && (strcasecmp(s, "true")==0 || strcasecmp(s, "yes")==0))
+    flags|=GWB_FILE_FLAGS_GENERATED;
+
+  s=GWEN_XMLNode_GetProperty(xmlNode, "dist", alwaysDist?"TRUE":"FALSE");
+  if (s && *s && (strcasecmp(s, "true")==0 || strcasecmp(s, "yes")==0))
+    flags|=GWB_FILE_FLAGS_DIST;
+
+  fileNameList=GWB_Parser_ReadXmlDataIntoStringList(GWB_Context_GetVars(currentContext), xmlNode);
+  if (fileNameList) {
+    GWEN_STRINGLISTENTRY *se;
+
+    se=GWEN_StringList_FirstEntry(fileNameList);
+    while(se) {
+      const char *sFileName;
+
+      sFileName=GWEN_StringListEntry_Data(se);
+      if (sFileName && *sFileName) {
+        GWB_FILE *file;
+
+        file=GWB_File_List2_GetOrCreateFile(GWB_Project_GetFileList(project), currentFolder, sFileName);
+        GWB_File_AddFlags(file, flags);
+        if (installPath)
+          GWB_File_SetInstallPath(file, installPath);
+        if (fileType)
+          GWB_File_SetFileType(file, fileType);
+        if (builder)
+          GWB_File_SetBuilder(file, builder);
+        if (isSource)
+          GWB_Context_AddSourceFile(currentContext, file);
+      }
+
+      se=GWEN_StringListEntry_Next(se);
+    }
+    GWEN_StringList_free(fileNameList);
+  }
+
+  return 0;
+}
+
 
diff --git a/tools/gwenbuild/parser/parser.h b/tools/gwenbuild/parser/parser.h
index 9bc04ed..add0f49 100644
--- a/tools/gwenbuild/parser/parser.h
+++ b/tools/gwenbuild/parser/parser.h
@@ -45,6 +45,13 @@ int GWB_Parser_ParseSubdirs(GWB_PROJECT *project, GWB_CONTEXT *currentContext, G
 //int GWB_Parser_ParseSetVar(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode);
 int GWB_Parser_ParseWriteFile(GWB_CONTEXT *currentContext, GWEN_XMLNODE *xmlNode);
 
+int GWB_Parser_ParseSourcesOrHeaders(GWB_PROJECT *project,
+                                     GWB_CONTEXT *currentContext,
+                                     GWEN_XMLNODE *xmlNode,
+                                     int alwaysDist,
+                                     int isSource);
+
+
 void GWB_Parser_SetItemValue(GWEN_DB_NODE *db, const char *sId, const char *suffix, const char *value);
 
 int GWB_Parser_ReplaceVarsBetweenAtSigns(const char *s, GWEN_BUFFER *dbuf, GWEN_DB_NODE *db);
diff --git a/tools/gwenbuild/templates/Makefile.in b/tools/gwenbuild/templates/Makefile.in
index b407819..21ec0bd 100644
--- a/tools/gwenbuild/templates/Makefile.in
+++ b/tools/gwenbuild/templates/Makefile.in
@@ -443,9 +443,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/templates/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/templates/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/templates/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/templates/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/tools/Makefile.am b/tools/gwenbuild/tools/Makefile.am
index 3c827e8..8947768 100644
--- a/tools/gwenbuild/tools/Makefile.am
+++ b/tools/gwenbuild/tools/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 
 
 
diff --git a/tools/gwenbuild/tools/Makefile.in b/tools/gwenbuild/tools/Makefile.in
index a35e298..32d01c1 100644
--- a/tools/gwenbuild/tools/Makefile.in
+++ b/tools/gwenbuild/tools/Makefile.in
@@ -448,7 +448,7 @@ with_gui_fox16 = @with_gui_fox16@
 with_gui_gtk2 = @with_gui_gtk2@
 with_gui_gtk3 = @with_gui_gtk3@
 with_gui_qt4 = @with_gui_qt4@
-INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 noinst_LTLIBRARIES = libgwb_tools.la
 libgwb_tools_la_SOURCES = \
  trycompile.c \
@@ -471,9 +471,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/tools/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/tools/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/tools/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/types/Makefile.am b/tools/gwenbuild/types/Makefile.am
index 29203bc..0caad4b 100644
--- a/tools/gwenbuild/types/Makefile.am
+++ b/tools/gwenbuild/types/Makefile.am
@@ -1,4 +1,6 @@
-INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES=@all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
+
+DEFS=-DBUILDERDATADIR=\"$(datadir)/gwenhywfar/gwenbuild/builders\"
 
 
 
diff --git a/tools/gwenbuild/types/Makefile.in b/tools/gwenbuild/types/Makefile.in
index 742a68b..4e76950 100644
--- a/tools/gwenbuild/types/Makefile.in
+++ b/tools/gwenbuild/types/Makefile.in
@@ -207,7 +207,7 @@ CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
+DEFS = -DBUILDERDATADIR=\"$(datadir)/gwenhywfar/gwenbuild/builders\"
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 DOXYGEN_DEFINE = @DOXYGEN_DEFINE@
@@ -449,7 +449,7 @@ with_gui_fox16 = @with_gui_fox16@
 with_gui_gtk2 = @with_gui_gtk2@
 with_gui_gtk3 = @with_gui_gtk3@
 with_gui_qt4 = @with_gui_qt4@
-INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(gwenhywfar_symlinkdir)
+INCLUDES = @all_includes@ -I$(top_builddir) -I../ -I../../ -I$(top_srcdir)/tools -I$(gwenhywfar_symlinkdir)
 noinst_LTLIBRARIES = libgwb_types.la
 libgwb_types_la_SOURCES = \
   builder.c \
@@ -493,9 +493,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/gwenbuild/types/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/gwenbuild/types/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/gwenbuild/types/Makefile
+	  $(AUTOMAKE) --gnu tools/gwenbuild/types/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/gwenbuild/types/context.c b/tools/gwenbuild/types/context.c
index df9b3af..ca3c801 100644
--- a/tools/gwenbuild/types/context.c
+++ b/tools/gwenbuild/types/context.c
@@ -26,6 +26,7 @@ GWEN_TREE2_FUNCTIONS(GWB_CONTEXT, GWB_Context)
 
 
 static char *_combinedString(const char *string1, const char *string2, const char delim);
+static void _exportDbToXml(GWEN_DB_NODE *db, GWEN_XMLNODE *xmlNode);
 
 
 
@@ -508,6 +509,92 @@ char *_combinedString(const char *string1, const char *string2, const char delim
 
 
 
+void GWB_Context_toXml(const GWB_CONTEXT *ctx, GWEN_XMLNODE *xmlNode, int withDb)
+{
+  const GWB_CONTEXT *ctxChild;
+
+  if (ctx->initialSourceDir)
+    GWEN_XMLNode_SetCharValue(xmlNode, "initialSourceDir", ctx->initialSourceDir);
+  if (ctx->currentRelativeDir)
+    GWEN_XMLNode_SetCharValue(xmlNode, "currentRelativeDir", ctx->currentRelativeDir);
+  if (ctx->topBuildDir)
+    GWEN_XMLNode_SetCharValue(xmlNode, "topBuildDir", ctx->topBuildDir);
+  if (ctx->topSourceDir)
+    GWEN_XMLNode_SetCharValue(xmlNode, "topSourceDir", ctx->topSourceDir);
+  if (ctx->currentBuildDir)
+    GWEN_XMLNode_SetCharValue(xmlNode, "currentBuildDir", ctx->currentBuildDir);
+  if (ctx->currentSourceDir)
+    GWEN_XMLNode_SetCharValue(xmlNode, "currentSourceDir", ctx->currentSourceDir);
+  if (ctx->compilerFlags)
+    GWEN_XMLNode_SetCharValue(xmlNode, "compilerFlags", ctx->compilerFlags);
+  if (ctx->linkerFlags)
+    GWEN_XMLNode_SetCharValue(xmlNode, "linkerFlags", ctx->linkerFlags);
+
+  if (ctx->includeList) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "includeList");
+    GWB_KeyValuePair_List_WriteXml(ctx->includeList, n, "Include");
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+
+  if (ctx->defineList) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "defineList");
+    GWB_KeyValuePair_List_WriteXml(ctx->defineList, n, "Define");
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+
+  if (withDb && ctx->vars) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "Vars");
+    _exportDbToXml(ctx->vars, n);
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+
+  ctxChild=GWB_Context_Tree2_GetFirstChild(ctx);
+  if (ctxChild) {
+    GWEN_XMLNODE *nTree;
+
+    nTree=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "Children");
+    while(ctxChild) {
+      GWEN_XMLNODE *n;
+
+      n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "Child");
+      GWB_Context_toXml(ctxChild, n, 0); /* only write db for root context */
+      GWEN_XMLNode_AddChild(nTree, n);
+      ctxChild=GWB_Context_Tree2_GetNext(ctxChild);
+    }
+    GWEN_XMLNode_AddChild(xmlNode, nTree);
+  }
+}
+
+
+
+void _exportDbToXml(GWEN_DB_NODE *db, GWEN_XMLNODE *xmlNode)
+{
+  GWEN_BUFFER *dbuf;
+  int rv;
+
+  dbuf=GWEN_Buffer_new(0, 256, 0, 1);
+  rv=GWEN_DB_WriteToBuffer(db, dbuf, GWEN_DB_FLAGS_DEFAULT);
+  if (rv<0) {
+    DBG_ERROR(NULL, "here (%d)", rv);
+    GWEN_Buffer_free(dbuf);
+  }
+  else {
+    GWEN_XMLNODE *xmlData;
+
+    xmlData=GWEN_XMLNode_new(GWEN_XMLNodeTypeData, GWEN_Buffer_GetStart(dbuf));
+    GWEN_XMLNode_AddChild(xmlNode, xmlData);
+    GWEN_Buffer_free(dbuf);
+  }
+}
+
+
+
 void GWB_Context_Dump(const GWB_CONTEXT *ctx, int indent)
 {
   if (ctx) {
diff --git a/tools/gwenbuild/types/context.h b/tools/gwenbuild/types/context.h
index 9d695b9..9ece378 100644
--- a/tools/gwenbuild/types/context.h
+++ b/tools/gwenbuild/types/context.h
@@ -25,6 +25,7 @@ GWEN_TREE2_FUNCTION_DEFS(GWB_CONTEXT, GWB_Context)
 
 #include <gwenhywfar/stringlist.h>
 #include <gwenhywfar/db.h>
+#include <gwenhywfar/xml.h>
 
 
 
@@ -32,6 +33,9 @@ GWB_CONTEXT *GWB_Context_new(GWENBUILD *gwenbuild);
 GWB_CONTEXT *GWB_Context_dup(const GWB_CONTEXT *originalCtx);
 void GWB_Context_free(GWB_CONTEXT *ctx);
 
+void GWB_Context_toXml(const GWB_CONTEXT *ctx, GWEN_XMLNODE *xmlNode, int withDb);
+
+
 GWENBUILD *GWB_Context_GetGwenbuild(const GWB_CONTEXT *ctx);
 
 const char *GWB_Context_GetCurrentRelativeDir(const GWB_CONTEXT *ctx);
diff --git a/tools/gwenbuild/types/gwenbuild.c b/tools/gwenbuild/types/gwenbuild.c
index 0180f95..56983b7 100644
--- a/tools/gwenbuild/types/gwenbuild.c
+++ b/tools/gwenbuild/types/gwenbuild.c
@@ -37,6 +37,8 @@
 static GWB_BUILDER *_genBuilderForSourceFile(GWENBUILD *gwenbuild, GWB_CONTEXT *context, GWB_FILE *file);
 static GWB_BUILDER *_genBuilderForTarget(GWB_PROJECT *project, GWB_TARGET *target);
 
+static GWB_BUILDER *_getBuilderByName(GWENBUILD *gwenbuild, GWB_CONTEXT *context, const char *builderName);
+
 static int _addOrBuildTargetSources(GWB_PROJECT *project, GWB_TARGET *target);
 static int _addSourcesOrMkBuildersAndGetTheirOutputs(GWB_PROJECT *project, 
                                                      GWB_TARGET *target,
@@ -71,6 +73,7 @@ void GWBUILD_free(GWENBUILD *gwenbuild)
 {
   if (gwenbuild) {
     GWEN_StringList_free(gwenbuild->buildFilenameList);
+    GWB_GBuilderDescr_List_free(gwenbuild->builderDescrList);
 
     GWEN_FREE_OBJECT(gwenbuild);
   }
@@ -78,6 +81,34 @@ void GWBUILD_free(GWENBUILD *gwenbuild)
 
 
 
+uint32_t GWBUILD_GetFlags(const GWENBUILD *gwenbuild)
+{
+  return gwenbuild->flags;
+}
+
+
+
+void GWBUILD_SetFlags(GWENBUILD *gwenbuild, uint32_t f)
+{
+  gwenbuild->flags=f;
+}
+
+
+
+void GWBUILD_AddFlags(GWENBUILD *gwenbuild, uint32_t f)
+{
+  gwenbuild->flags|=f;
+}
+
+
+
+void GWBUILD_DelFlags(GWENBUILD *gwenbuild, uint32_t f)
+{
+  gwenbuild->flags&=~f;
+}
+
+
+
 const char *GWBUILD_GetTargetSystem(const GWENBUILD *gwenbuild)
 {
   return gwenbuild->targetSystem;
@@ -1001,6 +1032,50 @@ void GWBUILD_AddFilesFromStringList(GWB_FILE_LIST2 *mainFileList,
 
 
 
+void _readBuilderDescrList(GWENBUILD *gwenbuild)
+{
+  GWEN_BUFFER *nameBuf;
+
+  nameBuf=GWEN_Buffer_new(0, 256, 0, 1);
+  GWEN_Buffer_AppendString(nameBuf, BUILDERDATADIR GWEN_DIR_SEPARATOR_S);
+  if (GWBUILD_GetTargetIsWindows(gwenbuild))
+    GWEN_Buffer_AppendString(nameBuf, "windows");
+  else
+    GWEN_Buffer_AppendString(nameBuf, "posix");
+
+  gwenbuild->builderDescrList=GWB_GBuilderDescr_ReadAll(GWEN_Buffer_GetStart(nameBuf));
+  GWEN_Buffer_free(nameBuf);
+}
+
+
+
+GWB_BUILDER *_getBuilderByName(GWENBUILD *gwenbuild, GWB_CONTEXT *context, const char *builderName)
+{
+  GWB_GBUILDER_DESCR *descr;
+  GWEN_XMLNODE *xmlDescr;
+  GWB_BUILDER *builder;
+
+  if (gwenbuild->builderDescrList==NULL)
+    _readBuilderDescrList(gwenbuild);
+
+  descr=GWB_GBuilderDescr_List_GetByName(gwenbuild->builderDescrList, builderName);
+  if (descr==NULL) {
+    DBG_ERROR(NULL, "Builder \"%s\" not found", builderName);
+    return NULL;
+  }
+
+  xmlDescr=GWEN_XMLNode_dup(GWB_GBuilderDescr_GetXmlDescr(descr));
+  builder=GWB_GenericBuilder_new(gwenbuild, context, xmlDescr);
+  if (builder==NULL) {
+    DBG_ERROR(NULL, "Error instantiating builder \"%s\"", builderName);
+    return NULL;
+  }
+
+  return builder;
+}
+
+
+
 /*
  * --------------------------------------------------------------------------------------------
  * Add new targets or known source types below.
@@ -1044,7 +1119,7 @@ GWB_BUILDER *_genBuilderForSourceFile(GWENBUILD *gwenbuild, GWB_CONTEXT *context
   }
 
   DBG_INFO(NULL, "Selected builder type is for file \%s\" is \"%s\"", name, builderName);
-  builder=GWB_GenericBuilder_Factory(gwenbuild, context, builderName);
+  builder=_getBuilderByName(gwenbuild, context, builderName);
   if (builder==NULL) {
     DBG_ERROR(NULL, "Could not create builder for type \"%s\"", ext);
     return NULL;
@@ -1069,24 +1144,25 @@ GWB_BUILDER *_genBuilderForTarget(GWB_PROJECT *project, GWB_TARGET *target)
   case GWBUILD_TargetType_None:
     break;
   case GWBUILD_TargetType_InstallLibrary:
-    /* TODO: take project's "shared" attribute into account */
-    //builder=GWB_SharedLibBuilder_new(gwenbuild, GWB_Target_GetContext(target));
-    builder=GWB_GenericBuilder_Factory(gwenbuild, GWB_Target_GetContext(target), "sharedlib");
+    if (GWBUILD_GetFlags(gwenbuild) & GWENBUILD_FLAGS_STATIC)
+      builder=_getBuilderByName(gwenbuild, GWB_Target_GetContext(target), "staticlib");
+    else
+      builder=_getBuilderByName(gwenbuild, GWB_Target_GetContext(target), "sharedlib");
     break;
   case GWBUILD_TargetType_ConvenienceLibrary:
     //builder=GWEN_TmpLibBuilder_new(gwenbuild, GWB_Target_GetContext(target));
-    builder=GWB_GenericBuilder_Factory(gwenbuild, GWB_Target_GetContext(target), "tmplib");
+    builder=_getBuilderByName(gwenbuild, GWB_Target_GetContext(target), "tmplib");
     break;
   case GWBUILD_TargetType_Program:
-    builder=GWB_GenericBuilder_Factory(gwenbuild, GWB_Target_GetContext(target), "app");
+    builder=_getBuilderByName(gwenbuild, GWB_Target_GetContext(target), "app");
     break;
   case GWBUILD_TargetType_CxxProgram:
-    builder=GWB_GenericBuilder_Factory(gwenbuild, GWB_Target_GetContext(target), "cxxapp");
+    builder=_getBuilderByName(gwenbuild, GWB_Target_GetContext(target), "cxxapp");
     break;
   case GWBUILD_TargetType_Objects:
     break;
   case GWBUILD_TargetType_Module:
-    builder=GWB_GenericBuilder_Factory(gwenbuild, GWB_Target_GetContext(target), "module");
+    builder=_getBuilderByName(gwenbuild, GWB_Target_GetContext(target), "module");
     break;
   }
   if (builder==NULL) {
diff --git a/tools/gwenbuild/types/gwenbuild.h b/tools/gwenbuild/types/gwenbuild.h
index f18afc3..da60328 100644
--- a/tools/gwenbuild/types/gwenbuild.h
+++ b/tools/gwenbuild/types/gwenbuild.h
@@ -28,12 +28,17 @@ typedef enum {
 
 
 
+#define GWENBUILD_FLAGS_STATIC 0x0001
+
+
+
 #include "gwenbuild/types/keyvaluepair.h"
 #include "gwenbuild/types/file.h"
 #include "gwenbuild/types/target.h"
 #include "gwenbuild/types/project.h"
 #include "gwenbuild/buildctx/buildctx.h"
 #include "gwenbuild/types/option.h"
+#include "gwenbuild/builders/gbuilderdescr.h"
 
 #include <gwenhywfar/db.h>
 #include <gwenhywfar/xml.h>
@@ -48,6 +53,12 @@ GWENBUILD *GWBUILD_new(void);
 void GWBUILD_free(GWENBUILD *gwenbuild);
 
 
+uint32_t GWBUILD_GetFlags(const GWENBUILD *gwenbuild);
+void GWBUILD_SetFlags(GWENBUILD *gwenbuild, uint32_t f);
+void GWBUILD_AddFlags(GWENBUILD *gwenbuild, uint32_t f);
+void GWBUILD_DelFlags(GWENBUILD *gwenbuild, uint32_t f);
+
+
 const char *GWBUILD_GetTargetSystem(const GWENBUILD *gwenbuild);
 void GWBUILD_SetTargetSystem(GWENBUILD *gwenbuild, const char *s);
 
diff --git a/tools/gwenbuild/types/gwenbuild_p.h b/tools/gwenbuild/types/gwenbuild_p.h
index d06aa08..9c41407 100644
--- a/tools/gwenbuild/types/gwenbuild_p.h
+++ b/tools/gwenbuild/types/gwenbuild_p.h
@@ -20,6 +20,9 @@ struct GWENBUILD {
 
   char *targetSystem;
   int targetIsWindows;
+
+  GWB_GBUILDER_DESCR_LIST *builderDescrList;
+  uint32_t flags;
 };
 
 
diff --git a/tools/gwenbuild/types/keyvaluepair.c b/tools/gwenbuild/types/keyvaluepair.c
index 3ab8bc5..ae56bea 100644
--- a/tools/gwenbuild/types/keyvaluepair.c
+++ b/tools/gwenbuild/types/keyvaluepair.c
@@ -227,3 +227,29 @@ int GWB_KeyValuePair_List_WriteAllPairsToBuffer(const GWB_KEYVALUEPAIR_LIST *kvp
 
 
 
+void GWB_KeyValuePair_toXml(const GWB_KEYVALUEPAIR *kvp, GWEN_XMLNODE *xmlNode)
+{
+  if (kvp->key)
+    GWEN_XMLNode_SetCharValue(xmlNode, "key", kvp->key);
+  if (kvp->value)
+    GWEN_XMLNode_SetCharValue(xmlNode, "value", kvp->value);
+}
+
+
+
+void GWB_KeyValuePair_List_WriteXml(const GWB_KEYVALUEPAIR_LIST *kvpList, GWEN_XMLNODE *xmlNode, const char *groupName)
+{
+  GWB_KEYVALUEPAIR *kvp;
+
+  kvp=GWB_KeyValuePair_List_First(kvpList);
+  while(kvp) {
+    GWEN_XMLNODE *entryNode;
+
+    entryNode=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, groupName);
+    GWB_KeyValuePair_toXml(kvp, entryNode);
+    GWEN_XMLNode_AddChild(xmlNode, entryNode);
+    kvp=GWB_KeyValuePair_List_Next(kvp);
+  }
+}
+
+
diff --git a/tools/gwenbuild/types/keyvaluepair.h b/tools/gwenbuild/types/keyvaluepair.h
index 385dbe7..1fcd8e2 100644
--- a/tools/gwenbuild/types/keyvaluepair.h
+++ b/tools/gwenbuild/types/keyvaluepair.h
@@ -13,6 +13,7 @@
 
 #include <gwenhywfar/list1.h>
 #include <gwenhywfar/buffer.h>
+#include <gwenhywfar/xml.h>
 
 
 typedef struct GWB_KEYVALUEPAIR GWB_KEYVALUEPAIR;
@@ -63,5 +64,9 @@ int GWB_KeyValuePair_List_WriteAllPairsToBuffer(const GWB_KEYVALUEPAIR_LIST *kvp
                                                 const char *delim,
                                                 GWEN_BUFFER *destBuf);
 
+void GWB_KeyValuePair_toXml(const GWB_KEYVALUEPAIR *kvp, GWEN_XMLNODE *xmlNode);
+
+void GWB_KeyValuePair_List_WriteXml(const GWB_KEYVALUEPAIR_LIST *kvpList, GWEN_XMLNODE *xmlNode, const char *groupName);
+
 
 #endif
diff --git a/tools/gwenbuild/types/project.c b/tools/gwenbuild/types/project.c
index 26e88f4..0916d28 100644
--- a/tools/gwenbuild/types/project.c
+++ b/tools/gwenbuild/types/project.c
@@ -15,6 +15,14 @@
 #include "gwenbuild/types/project_p.h"
 
 #include <gwenhywfar/memory.h>
+#include <gwenhywfar/debug.h>
+
+
+
+
+static void _writeFileFlagsToXml(uint32_t flags, GWEN_XMLNODE *xmlNode, const char *varName);
+/* static uint32_t _readFlagsFromChar(const char *flagsAsText); */
+
 
 
 
@@ -394,6 +402,119 @@ void GWB_Project_AddExplicitBuild(GWB_PROJECT *project, GWB_BUILD_CMD *bcmd)
 
 
 
+void GWB_Project_toXml(const GWB_PROJECT *project, GWEN_XMLNODE *xmlNode)
+{
+  if (project->projectName)
+    GWEN_XMLNode_SetCharValue(xmlNode, "projectName", project->projectName);
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionMajor", project->versionMajor);
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionMinor", project->versionMinor);
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionPatchlevel", project->versionPatchlevel);
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionBuild", project->versionBuild);
+  if (project->versionTag)
+    GWEN_XMLNode_SetCharValue(xmlNode, "versionTag", project->versionTag);
+
+  GWEN_XMLNode_SetIntValue(xmlNode, "soVersionCurrent", project->soVersionCurrent);
+  GWEN_XMLNode_SetIntValue(xmlNode, "soVersionAge", project->soVersionAge);
+  GWEN_XMLNode_SetIntValue(xmlNode, "soVersionRevision", project->soVersionRevision);
+
+  _writeFileFlagsToXml(GWB_Project_GetFlags(project), xmlNode, "flags");
+
+  if (project->defineList) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "DefineList");
+    GWB_KeyValuePair_List_WriteXml(project->defineList, n, "Define");
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+
+  if (project->givenOptionList) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "GivenOptionList");
+    GWB_KeyValuePair_List_WriteXml(project->givenOptionList, n, "GivenOption");
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+
+  if (project->explicitBuildList) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "ExplicitBuildCmdList");
+    GWB_BuildCmd_List_WriteXml(project->explicitBuildList, n, "BuildCmd");
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+
+  if (project->fileList) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "FileList");
+    GWB_File_List2_WriteXml(project->fileList, n, "File");
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+
+}
+
+
+
+void _writeFileFlagsToXml(uint32_t flags, GWEN_XMLNODE *xmlNode, const char *varName)
+{
+  if (flags) {
+    GWEN_BUFFER *dbuf;
+
+    dbuf=GWEN_Buffer_new(0, 256, 0, 1);
+
+    if (flags & GWB_PROJECT_FLAGS_SHARED) {
+      if (GWEN_Buffer_GetUsedBytes(dbuf))
+        GWEN_Buffer_AppendString(dbuf, " ");
+      GWEN_Buffer_AppendString(dbuf, "SHARED");
+    }
+
+    if (flags & GWB_PROJECT_FLAGS_CONFIG_H) {
+      if (GWEN_Buffer_GetUsedBytes(dbuf))
+        GWEN_Buffer_AppendString(dbuf, " ");
+      GWEN_Buffer_AppendString(dbuf, "CONFIG_H");
+    }
+
+    if (GWEN_Buffer_GetUsedBytes(dbuf))
+      GWEN_XMLNode_SetCharValue(xmlNode, varName, GWEN_Buffer_GetStart(dbuf));
+    GWEN_Buffer_free(dbuf);
+  }
+}
+
+
+#if 0
+uint32_t _readFlagsFromChar(const char *flagsAsText)
+{
+  GWEN_STRINGLIST *sl;
+  uint32_t flags=0;
+
+  sl=GWEN_StringList_fromString(flagsAsText, " ", 1);
+  if (sl) {
+    GWEN_STRINGLISTENTRY *se;
+
+    se=GWEN_StringList_FirstEntry(sl);
+    while(se) {
+      const char *s;
+
+      s=GWEN_StringListEntry_Data(se);
+      if (s && *s) {
+        if (strcasecmp(s, "SHARED")==0)
+          flags|=GWB_PROJECT_FLAGS_SHARED;
+        else if (strcasecmp(s, "CONFIG_H")==0)
+          flags|=GWB_PROJECT_FLAGS_CONFIG_H;
+        else {
+          DBG_ERROR(NULL, "Unexpected PROJECT flag \"%s\"", s);
+        }
+      }
+      se=GWEN_StringListEntry_Next(se);
+    }
+    GWEN_StringList_free(sl);
+  }
+
+  return flags;
+}
+#endif
+
+
 
 
 
diff --git a/tools/gwenbuild/types/project.h b/tools/gwenbuild/types/project.h
index 726edda..9d7ab75 100644
--- a/tools/gwenbuild/types/project.h
+++ b/tools/gwenbuild/types/project.h
@@ -87,6 +87,9 @@ GWB_BUILD_CMD_LIST *GWB_Project_GetExplicitBuildList(const GWB_PROJECT *project)
 void GWB_Project_AddExplicitBuild(GWB_PROJECT *project, GWB_BUILD_CMD *bcmd);
 
 
+void GWB_Project_toXml(const GWB_PROJECT *project, GWEN_XMLNODE *xmlNode);
+
+
 void GWB_Project_Dump(const GWB_PROJECT *project, int indent, int fullDump);
 
 
diff --git a/tools/gwenbuild/types/target.c b/tools/gwenbuild/types/target.c
index 17914be..e7ede6f 100644
--- a/tools/gwenbuild/types/target.c
+++ b/tools/gwenbuild/types/target.c
@@ -284,6 +284,27 @@ void GWB_Target_AddExplicitBuild(GWB_TARGET *target, GWB_BUILD_CMD *bcmd)
 
 
 
+void GWB_Target_toXml(const GWB_TARGET *target, GWEN_XMLNODE *xmlNode)
+{
+  if (target->id)
+    GWEN_XMLNode_SetCharValue(xmlNode, "id", target->id);
+  if (target->name)
+    GWEN_XMLNode_SetCharValue(xmlNode, "name", target->name);
+  GWEN_XMLNode_SetIntValue(xmlNode, "soVersionCurrent", target->soVersionCurrent);
+  GWEN_XMLNode_SetIntValue(xmlNode, "soVersionAge", target->soVersionAge);
+  GWEN_XMLNode_SetIntValue(xmlNode, "soVersionRevision", target->soVersionRevision);
+
+  if (target->sourceFileList) {
+    GWEN_XMLNODE *n;
+
+    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "SourceFileList");
+    GWB_File_List2_WriteXml(target->sourceFileList, n, "File");
+    GWEN_XMLNode_AddChild(xmlNode, n);
+  }
+}
+
+
+
 
 
 void GWB_Target_Dump(const GWB_TARGET *target, int indent, int fullDump)
diff --git a/tools/gwenbuild/utils.c b/tools/gwenbuild/utils.c
index 9fd81f4..8a0ae97 100644
--- a/tools/gwenbuild/utils.c
+++ b/tools/gwenbuild/utils.c
@@ -15,12 +15,23 @@
 #include "utils.h"
 
 #include <gwenhywfar/debug.h>
+#include <gwenhywfar/directory.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
 
 
 
 static GWB_KEYVALUEPAIR_LIST *_generateInstallList(const GWB_FILE_LIST2 *fileList, const char *initialSourceDir);
 static int _filesChanged(const char *fileName, GWEN_STRINGLIST *slFileNameList);
 static GWEN_STRINGLIST *_readBuildFileList(const char *fileName);
+static void _writeProjectNameAndVersionToXml(const GWB_PROJECT *project, GWEN_XMLNODE *xmlNode);
 
 
 
@@ -391,3 +402,212 @@ GWEN_STRINGLIST *_readBuildFileList(const char *fileName)
 }
 
 
+
+int GWB_Utils_WriteProjectToFile(const GWB_PROJECT *project, const char *fileName)
+{
+  GWEN_XMLNODE *xmlRoot;
+  GWEN_XMLNODE *xmlProject;
+  int rv;
+
+  xmlRoot=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "root");
+  xmlProject=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "Project");
+  GWB_Project_toXml(project, xmlProject);
+  GWEN_XMLNode_AddChild(xmlRoot, xmlProject);
+
+  rv=GWEN_XMLNode_WriteFile(xmlRoot, fileName, GWEN_XML_FLAGS_DEFAULT | GWEN_XML_FLAGS_SIMPLE);
+  GWEN_XMLNode_free(xmlRoot);
+  if (rv<0) {
+    DBG_ERROR(NULL, "Error writing project to file \"%s\" (%d)", fileName, rv);
+    return rv;
+  }
+
+  return 0;
+}
+
+
+
+int GWB_Utils_WriteContextTreeToFile(const GWB_CONTEXT *ctx, const char *fileName)
+{
+  GWEN_XMLNODE *xmlRoot;
+  GWEN_XMLNODE *xmlContext;
+  int rv;
+
+  xmlRoot=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "root");
+  xmlContext=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "ContextTree");
+  GWB_Context_toXml(ctx, xmlContext, 1);
+  GWEN_XMLNode_AddChild(xmlRoot, xmlContext);
+
+  rv=GWEN_XMLNode_WriteFile(xmlRoot, fileName, GWEN_XML_FLAGS_DEFAULT | GWEN_XML_FLAGS_SIMPLE);
+  GWEN_XMLNode_free(xmlRoot);
+  if (rv<0) {
+    DBG_ERROR(NULL, "Error writing context tree to file \"%s\" (%d)", fileName, rv);
+    return rv;
+  }
+
+  return 0;
+}
+
+
+
+int GWB_Utils_CopyFile(const char *sSrcPath, const char *sDestPath)
+{
+  int rv;
+  struct stat st;
+
+  if (lstat(sSrcPath, &st)==-1) {
+    DBG_ERROR(NULL, "ERROR: stat(%s): %s", sSrcPath, strerror(errno));
+    return GWEN_ERROR_GENERIC;
+  }
+
+  if ((st.st_mode & S_IFMT)==S_IFLNK) {
+    char *symlinkbuf;
+    int bufSizeNeeded;
+
+    /* copy symlink */
+    if (st.st_size==0)
+      bufSizeNeeded=256;
+    else
+      bufSizeNeeded=st.st_size+1;
+    symlinkbuf=(char*) malloc(bufSizeNeeded);
+    assert(symlinkbuf);
+    rv=readlink(sSrcPath, symlinkbuf, bufSizeNeeded);
+    if (rv==-1) {
+      DBG_ERROR(NULL, "ERROR: readlink(%s): %s", sSrcPath, strerror(errno));
+      free(symlinkbuf);
+      return GWEN_ERROR_GENERIC;
+    }
+    else if (rv==bufSizeNeeded) {
+      DBG_ERROR(NULL, "Buffer too small (%d)", bufSizeNeeded);
+      free(symlinkbuf);
+      return GWEN_ERROR_GENERIC;
+    }
+
+    rv=GWEN_Directory_GetPath(sDestPath,
+                              GWEN_DIR_FLAGS_PUBLIC_PATH | GWEN_DIR_FLAGS_PUBLIC_NAME |
+                              GWEN_PATH_FLAGS_VARIABLE|
+                              GWEN_PATH_FLAGS_CHECKROOT);
+    if (rv<0) {
+      DBG_INFO(NULL, "here (%d)", rv);
+      free(symlinkbuf);
+      return rv;
+    }
+    unlink(sDestPath);
+    rv=symlink(symlinkbuf, sDestPath);
+    if (rv==-1) {
+      DBG_ERROR(NULL, "ERROR: symlink(%s): %s", sSrcPath, strerror(errno));
+      free(symlinkbuf);
+      return GWEN_ERROR_GENERIC;
+    }
+  }
+  else if ((st.st_mode & S_IFMT)==S_IFREG) {
+    mode_t newMode=0;
+
+    rv=GWEN_Directory_GetPath(sDestPath,
+                              GWEN_DIR_FLAGS_PUBLIC_PATH | GWEN_DIR_FLAGS_PUBLIC_NAME |
+                              GWEN_PATH_FLAGS_VARIABLE|
+                              GWEN_PATH_FLAGS_CHECKROOT);
+    if (rv<0) {
+      DBG_INFO(NULL, "here (%d)", rv);
+      return rv;
+    }
+  
+    rv=GWEN_SyncIo_Helper_CopyFile(sSrcPath, sDestPath);
+    if (rv<0) {
+      DBG_INFO(NULL, "here (%d)", rv);
+      return rv;
+    }
+
+    newMode=S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
+    if (st.st_mode & S_IXUSR)
+      newMode|=S_IXUSR|S_IXGRP|S_IXOTH;
+    rv=chmod(sDestPath, newMode);
+    if (rv<0) {
+      DBG_ERROR(NULL, "ERROR: chmod(%s): %s", sSrcPath, strerror(errno));
+      return rv;
+    }
+  }
+  else {
+    DBG_ERROR(NULL, "Unhandled file type \"%s\"", sSrcPath);
+  }
+
+  return 0;
+}
+
+
+
+int GWB_Utils_WriteProjectInfoToFile(const GWB_PROJECT *project, const char *fileName)
+{
+  GWB_CONTEXT *rootContext;
+  GWEN_XMLNODE *xmlRoot;
+  GWEN_XMLNODE *xmlProject;
+  const char *initialSourceDir;
+  int rv;
+
+  rootContext=GWB_Project_GetRootContext(project);
+  initialSourceDir=GWB_Context_GetInitialSourceDir(rootContext);
+
+  xmlRoot=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "root");
+  xmlProject=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "ProjectInfo");
+  if (initialSourceDir && *initialSourceDir)
+    GWEN_XMLNode_SetCharValue(xmlProject, "initialSourceDir", initialSourceDir);
+  _writeProjectNameAndVersionToXml(project, xmlProject);
+  GWEN_XMLNode_AddChild(xmlRoot, xmlProject);
+
+  rv=GWEN_XMLNode_WriteFile(xmlRoot, fileName, GWEN_XML_FLAGS_DEFAULT | GWEN_XML_FLAGS_SIMPLE);
+  GWEN_XMLNode_free(xmlRoot);
+  if (rv<0) {
+    DBG_ERROR(NULL, "Error writing project to file \"%s\" (%d)", fileName, rv);
+    return rv;
+  }
+
+  return 0;
+}
+
+
+
+void _writeProjectNameAndVersionToXml(const GWB_PROJECT *project, GWEN_XMLNODE *xmlNode)
+{
+  const char *s;
+  s=GWB_Project_GetProjectName(project);
+  if (s)
+    GWEN_XMLNode_SetCharValue(xmlNode, "projectName", s);
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionMajor", GWB_Project_GetVersionMajor(project));
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionMinor", GWB_Project_GetVersionMinor(project));
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionPatchlevel", GWB_Project_GetVersionPatchlevel(project));
+  GWEN_XMLNode_SetIntValue(xmlNode, "versionBuild", GWB_Project_GetVersionBuild(project));
+  s=GWB_Project_GetVersionTag(project);
+  if (s)
+    GWEN_XMLNode_SetCharValue(xmlNode, "versionTag", s);
+
+}
+
+
+
+GWEN_XMLNODE *GWB_Utils_ReadProjectInfoFromFile(const char *fileName)
+{
+  GWEN_XMLNODE *xmlRoot;
+  GWEN_XMLNODE *xmlProjectInfo;
+  int rv;
+
+  xmlRoot=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "root");
+  rv=GWEN_XML_ReadFile(xmlRoot, fileName, GWEN_XML_FLAGS_DEFAULT | GWEN_XML_FLAGS_SIMPLE);
+  if (rv<0) {
+    DBG_ERROR(NULL, "Error reading project info from \"%s\"", fileName);
+    GWEN_XMLNode_free(xmlRoot);
+    return NULL;
+  }
+
+  xmlProjectInfo=GWEN_XMLNode_FindFirstTag(xmlRoot, "ProjectInfo", NULL, NULL);
+  if (xmlProjectInfo) {
+    GWEN_XMLNode_UnlinkChild(xmlRoot, xmlProjectInfo);
+    GWEN_XMLNode_free(xmlRoot);
+    return xmlProjectInfo;
+  }
+
+  GWEN_XMLNode_free(xmlRoot);
+  return NULL;
+}
+
+
+
+
diff --git a/tools/gwenbuild/utils.h b/tools/gwenbuild/utils.h
index b06d672..246cb46 100644
--- a/tools/gwenbuild/utils.h
+++ b/tools/gwenbuild/utils.h
@@ -23,8 +23,17 @@ int GWB_Utils_WriteBuildFileList(const GWENBUILD *gwenbuild, const char *fileNam
 int GWB_Utils_WriteInstallFileList(const GWB_PROJECT *project, const char *fileName);
 GWB_KEYVALUEPAIR_LIST *GWB_Utils_ReadInstallFileList(const char *fileName);
 
+int GWB_Utils_WriteProjectToFile(const GWB_PROJECT *project, const char *fileName);
+
+int GWB_Utils_WriteContextTreeToFile(const GWB_CONTEXT *ctx, const char *fileName);
+
+int GWB_Utils_WriteProjectInfoToFile(const GWB_PROJECT *project, const char *fileName);
+GWEN_XMLNODE *GWB_Utils_ReadProjectInfoFromFile(const char *fileName);
+
+
 int GWB_Utils_BuildFilesChanged(const char *fileName);
 
+int GWB_Utils_CopyFile(const char *sSrcPath, const char *sDestPath);
 
 
 
diff --git a/tools/typemaker/Makefile.in b/tools/typemaker/Makefile.in
index df257fe..1d05924 100644
--- a/tools/typemaker/Makefile.in
+++ b/tools/typemaker/Makefile.in
@@ -479,9 +479,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/typemaker/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/typemaker/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/typemaker/Makefile
+	  $(AUTOMAKE) --gnu tools/typemaker/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/typemaker2/Makefile.in b/tools/typemaker2/Makefile.in
index c48001d..fed9077 100644
--- a/tools/typemaker2/Makefile.in
+++ b/tools/typemaker2/Makefile.in
@@ -575,9 +575,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/typemaker2/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/typemaker2/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/typemaker2/Makefile
+	  $(AUTOMAKE) --gnu tools/typemaker2/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/typemaker2/types/Makefile.in b/tools/typemaker2/types/Makefile.in
index 1ad66f6..21e0257 100644
--- a/tools/typemaker2/types/Makefile.in
+++ b/tools/typemaker2/types/Makefile.in
@@ -469,9 +469,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/typemaker2/types/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/typemaker2/types/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/typemaker2/types/Makefile
+	  $(AUTOMAKE) --gnu tools/typemaker2/types/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/typemaker2/types/c/Makefile.am b/tools/typemaker2/types/c/Makefile.am
index 8237d05..47f4861 100644
--- a/tools/typemaker2/types/c/Makefile.am
+++ b/tools/typemaker2/types/c/Makefile.am
@@ -16,6 +16,8 @@ dist_typedata_DATA=\
   list1_base.tm2 \
   list2_base.tm2 \
   struct_base.tm2 \
+  uint16_t.tm2 \
+  uint16_t_array.tm2 \
   uint32_t.tm2 \
   uint32_t_array.tm2 \
   uint64_t.tm2 \
diff --git a/tools/typemaker2/types/c/Makefile.in b/tools/typemaker2/types/c/Makefile.in
index 6e24aa7..04b6a74 100644
--- a/tools/typemaker2/types/c/Makefile.in
+++ b/tools/typemaker2/types/c/Makefile.in
@@ -443,6 +443,8 @@ dist_typedata_DATA = \
   list1_base.tm2 \
   list2_base.tm2 \
   struct_base.tm2 \
+  uint16_t.tm2 \
+  uint16_t_array.tm2 \
   uint32_t.tm2 \
   uint32_t_array.tm2 \
   uint64_t.tm2 \
@@ -473,9 +475,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/typemaker2/types/c/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/typemaker2/types/c/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/typemaker2/types/c/Makefile
+	  $(AUTOMAKE) --gnu tools/typemaker2/types/c/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
diff --git a/tools/typemaker2/types/c/uint16_t.tm2 b/tools/typemaker2/types/c/uint16_t.tm2
new file mode 100644
index 0000000..c305013
--- /dev/null
+++ b/tools/typemaker2/types/c/uint16_t.tm2
@@ -0,0 +1,7 @@
+<?xml?>
+
+<tm2>
+  <typedef id="uint16_t" lang="c" extends="int_base">
+    <identifier>uint16_t</identifier>
+  </typedef>
+</tm2>
diff --git a/tools/typemaker2/types/c/uint16_t_array.tm2 b/tools/typemaker2/types/c/uint16_t_array.tm2
new file mode 100644
index 0000000..91928f4
--- /dev/null
+++ b/tools/typemaker2/types/c/uint16_t_array.tm2
@@ -0,0 +1,175 @@
+<?xml?>
+
+<tm2>
+
+  <typedef id="uint16_t_array" type="array" basetype="uint16_t" lang="c" >
+    <identifier>uint16_t</identifier>
+
+    <codedefs>
+
+      <codedef id="construct">
+        <code>
+          memset($(dst), 0, ($(maxlen))*4);
+        </code>
+      </codedef>
+
+      <codedef id="destruct">
+        <code>
+        </code>
+      </codedef>
+
+      <codedef id="assign">
+        <code>
+          $(dst)=$(src);
+        </code>
+      </codedef>
+
+      <codedef id="dup">
+        <code>
+          memmove($(dst), $(src), ($(maxlen))*4);
+        </code>
+      </codedef>
+
+      <codedef id="compare">
+        <code>
+          if (*($(dst)) && *($(src)))
+            $(retval)=memcmp($(src), $(dst), ($(maxlen))*4);
+          else if ($(src))
+            $(retval)=1;
+          else if ($(dst))
+            $(retval)=-1;
+          else
+            $(retval)=0;
+        </code>
+      </codedef>
+
+      <codedef id="toXml">
+        <code>
+        </code>
+      </codedef>
+
+      <codedef id="fromXml">
+        <code>
+        </code>
+      </codedef>
+
+      <codedef id="toDb">
+        <code>
+        </code>
+      </codedef>
+
+
+
+      <codedef id="fromDb">
+        <code>
+        </code>
+      </codedef>
+
+
+
+      <codedef id="toObject">
+        <code>
+        </code>
+      </codedef>
+
+
+
+      <codedef id="fromObject">
+        <code>
+        </code>
+      </codedef>
+
+
+
+      <codedef id="toHashString">
+        <code>
+        </code>
+      </codedef>
+
+    </codedefs>
+
+
+
+    <inlines>
+
+      <inline loc="end" access="public">
+        <typeFlagsMask></typeFlagsMask>
+        <typeFlagsValue></typeFlagsValue>
+        <content>
+           $(api) $(member_basetype_type) $(struct_prefix)_Get$(nameWithCapital)At(const $(struct_type) *p_struct, int idx);
+        </content>
+      </inline>
+   
+      <inline loc="code">
+        <typeFlagsMask></typeFlagsMask>
+        <typeFlagsValue></typeFlagsValue>
+        <content>
+           $(member_basetype_type) $(struct_prefix)_Get$(nameWithCapital)At(const $(struct_type) *p_struct, int idx) {
+             if (p_struct && (idx < $(maxlen)))
+               return p_struct->$(name)[idx];
+
+             return 0;
+           }
+        </content>
+      </inline>
+
+
+      <inline loc="end" access="public">
+        <typeFlagsMask></typeFlagsMask>
+        <typeFlagsValue></typeFlagsValue>
+        <content>
+           $(api) int $(struct_prefix)_Set$(nameWithCapital)At($(struct_type) *p_struct, int idx, $(member_basetype_type) v);
+        </content>
+      </inline>
+   
+      <inline loc="code">
+        <typeFlagsMask></typeFlagsMask>
+        <typeFlagsValue></typeFlagsValue>
+        <content>
+           int $(struct_prefix)_Set$(nameWithCapital)At($(struct_type) *p_struct, int idx, $(member_basetype_type) v) {
+             if (p_struct && (idx < $(maxlen))) {
+                p_struct->$(name)[idx]=v;
+               return 0;
+             }
+             return GWEN_ERROR_INVALID;
+           }
+        </content>
+      </inline>
+
+
+      <inline loc="end" access="public">
+        <typeFlagsMask></typeFlagsMask>
+        <typeFlagsValue></typeFlagsValue>
+        <content>
+           $(api) void $(struct_prefix)_Preset$(nameWithCapital)($(struct_type) *p_struct, $(member_basetype_type) v);
+        </content>
+      </inline>
+   
+      <inline loc="code">
+        <typeFlagsMask></typeFlagsMask>
+        <typeFlagsValue></typeFlagsValue>
+        <content>
+           void $(struct_prefix)_Preset$(nameWithCapital)($(struct_type) *p_struct, $(member_basetype_type) v) {
+             int i;
+             
+             for(i=0; i < $(maxlen); i++)
+               p_struct->$(name)[i]=v;
+           }
+        </content>
+      </inline>
+
+    </inlines>
+
+
+
+    <defaults>
+      <!-- defaults flags etc for member declarations of this type -->
+      <default>NULL</default>
+      <setflags>const dup</setflags>
+      <getflags>const</getflags>
+      <dupflags>const</dupflags>
+    </defaults>
+    
+  </typedef>
+
+</tm2>
diff --git a/tools/xmlmerge/Makefile.in b/tools/xmlmerge/Makefile.in
index 1b086e1..aa05484 100644
--- a/tools/xmlmerge/Makefile.in
+++ b/tools/xmlmerge/Makefile.in
@@ -477,9 +477,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/xmlmerge/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/xmlmerge/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign tools/xmlmerge/Makefile
+	  $(AUTOMAKE) --gnu tools/xmlmerge/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \



More information about the Neon-commits mailing list