gob-dx.git
6 months agoBump dxcommon to pull in build portability improvements. master
Nick Bowler [Sun, 14 Mar 2021 18:20:21 +0000 (14:20 -0400)]
Bump dxcommon to pull in build portability improvements.

6 months agoFix testsuite on ancient GLib.
Nick Bowler [Wed, 3 Mar 2021 07:00:49 +0000 (02:00 -0500)]
Fix testsuite on ancient GLib.

Some test cases use private data members and these fail with glib-2.0
as this feature was added somewhere around glib-2.4 or so.  Since the
program itself works fine with glib-2.0, add a configure check to skip
affected tests in this scenario.

6 months agoAvoid more GLib deprecation warnings.
Nick Bowler [Wed, 3 Mar 2021 06:30:01 +0000 (01:30 -0500)]
Avoid more GLib deprecation warnings.

The g_string_sprintf and g_string_sprintfa macros throw deprecation
warnings with recent GLib versions.  It seems these have been simple
shims over g_string_printf and g_string_append_printf, respectively,
since approximately forever ago (before GLib 2.0).  Should be safe
to just switch, then.

6 months agoUse the option generator script from dxcommon.
Nick Bowler [Wed, 3 Mar 2021 05:58:42 +0000 (00:58 -0500)]
Use the option generator script from dxcommon.

This script simplifies maintenance of long option lists and
the --help text a lot.

6 months agoConvert command-line options processing to getopt_long.
Nick Bowler [Wed, 3 Mar 2021 04:36:07 +0000 (23:36 -0500)]
Convert command-line options processing to getopt_long.

Instead of a hand-written command-line options parser, let's use
getopt_long which is hopefully a bit more straightforward to modify.

Care has been taken to preserve the current option semantics as
closely as possible, including the weird --m4 option behaviour.

The Gnulib getopt-gnu module is used for portability.

6 months agoMake --no-gnu suppress get_type function attributes.
Nick Bowler [Tue, 11 Feb 2020 05:23:29 +0000 (00:23 -0500)]
Make --no-gnu suppress get_type function attributes.

For some reason the G_GNUC_CONST / G_GNUC_PURE attributes on generated
get_type function declarations are not currently covered by the --no-gnu
option.  This seems unexpected, so let's get those suppressed.

19 months agoExpand --no-touch-headers to include the private header.
Nick Bowler [Tue, 11 Feb 2020 01:46:42 +0000 (20:46 -0500)]
Expand --no-touch-headers to include the private header.

It seems incredibly bizarre that --no-touch-headers does not impact
generation of the private header file.  Even though this behaviour
is documented in the man page, I'm going to go out on a limb and
posit that nobody using this option wants or relies on the current
behaviour.  So let's just change it to make sense.

19 months agoImprove --version output.
Nick Bowler [Tue, 11 Feb 2020 01:37:12 +0000 (20:37 -0500)]
Improve --version output.

A program's version text, when requested by the user, is not an error
message.  Kind of silly to direct it to the standard error stream.

Adjust the program so that version text goes to standard output, and
format the message to be consistent with the GNU coding standards.

19 months agoMake --help output go to standard output.
Nick Bowler [Tue, 11 Feb 2020 01:33:54 +0000 (20:33 -0500)]
Make --help output go to standard output.

A program's help text, when requested by the user, is not an error
message.  Kind of silly to direct it to the standard error stream.

Adjust the program so that help text goes to standard output, which
is consistent with the GNU coding standards.

For actual errors, print a simplified usage message to standard
error instead of the full help text because otherwise the actual
error message is going to scroll right off the screen.

19 months agoAdd test cases for various command-line options.
Nick Bowler [Tue, 11 Feb 2020 01:27:12 +0000 (20:27 -0500)]
Add test cases for various command-line options.

Looking through the gob2 --help output, add test coverage for most of
the options listed there.  This has revealed several bugs or at least
surprising behaviour, and several of these test cases are currently
xfailing as a result.

19 months agoFix error message from 'make html' with no perl.
Nick Bowler [Thu, 13 Feb 2020 04:11:29 +0000 (23:11 -0500)]
Fix error message from 'make html' with no perl.

When the missing tool error messages were adjusted to cover missing
flex, the rule to build HTML documentation (which depends on perl)
got missed.  Redo the error message for this rule in a similar sytle.

19 months agoExport GIT_DIR in generate-changelog rule.
Nick Bowler [Wed, 12 Feb 2020 00:27:58 +0000 (19:27 -0500)]
Export GIT_DIR in generate-changelog rule.

We set GIT_DIR in this build rule, but since it's not exported in the
rule none of the commands will see it under normal circumstances.

Easily fixed.

19 months agoUse G_ADD_PRIVATE et al. when available.
Nick Bowler [Sun, 9 Feb 2020 02:20:16 +0000 (21:20 -0500)]
Use G_ADD_PRIVATE et al. when available.

As of GLib 2.58, using g_type_class_add_private has been deprecated;
it seems that type implementations are expected to use the G_ADD_PRIVATE
or G_ADD_PRIVATE_DYNAMIC macros.

Now that we use G_DEFINE_TYPE_xxx, it is reasonably straightforward
to do this.  Fall back to the old method for older GLib where these
macros are not available.

19 months agoUse G_DEFINE_xxx type macros in output files.
Nick Bowler [Sun, 9 Feb 2020 01:04:26 +0000 (20:04 -0500)]
Use G_DEFINE_xxx type macros in output files.

The G_DEFINE_TYPE_EXTENDED and G_DEFINE_DYNAMIC_TYPE_EXTENDED can be
used to produce the default get_type implementations.  They produce
almost identical code to what we already generate in GOB, except that
we can now automatically pick up any improvements made in GLib.  For
example, with modern GLib the G_DEFINE_TYPE_EXTENDED will produce a
thread-safe get_type implementation which is a nice bonus.

These macros do not support the "prealloc" attribute so setting this
in gob will no longer do anything.  According to the documentation, this
has been a no-op in GLib itself since 2.10, and it appears to just be
for performance tuning anyway, so I doubt anyone cares.

The generated output will fall back to the original method when these
macros are not available.

19 months agoClean up get_type implementations a bit.
Nick Bowler [Sat, 8 Feb 2020 17:06:09 +0000 (12:06 -0500)]
Clean up get_type implementations a bit.

To simplify future code using the G_DEFINE_TYPE_xxx macros, move all
the interface registration out of the get_type/register_type functions
and into a separate function.

And while we are doing this, factor out some common code between the
different add_xxx_get_type functions.

Should be no functional change.

19 months agoAdd simple test cases using private data members.
Nick Bowler [Fri, 7 Feb 2020 20:22:09 +0000 (15:22 -0500)]
Add simple test cases using private data members.

19 months agoBump dxcommon for build system improvements.
Nick Bowler [Sat, 8 Feb 2020 16:16:03 +0000 (11:16 -0500)]
Bump dxcommon for build system improvements.

19 months agoInclude <config.h> in test cases.
Nick Bowler [Sat, 8 Feb 2020 16:03:19 +0000 (11:03 -0500)]
Include <config.h> in test cases.

Even the test cases need to include <config.h>, as they may need
definitions from the configure run in order to work correctly.

In particular, with old GLib the tests can hit the G_INLINE_FUNC bug
which is detected and worked around by configure via <config.h>.

19 months agoMinor testsuite cleanup.
Nick Bowler [Sat, 8 Feb 2020 15:51:25 +0000 (10:51 -0500)]
Minor testsuite cleanup.

In the interface tests we have a macro to generate the GTypeModule for
a dynamic type, let's make that usable for the dynamic type registration
test as well.

19 months agoEnsure all sources include <config.h> first.
Nick Bowler [Fri, 7 Feb 2020 04:20:16 +0000 (23:20 -0500)]
Ensure all sources include <config.h> first.

Best practice with Autoconf is that <config.h> must be included before
any standard header, because configure tests may define macros to
influence those headers.

Now that we depend on flex we can use a %top block to achieve this in
the scanner.

19 months agoRequire flex to build the scanner.
Nick Bowler [Fri, 7 Feb 2020 03:26:38 +0000 (22:26 -0500)]
Require flex to build the scanner.

There is not much point in compatibility with various lex incarnations,
since the generated files are distributed and the user does not need
any lex tool to simply build from a tarball.

This additionally avoids a problem with AC_PROG_LEX which can hard-fail
the configure run when the selected lex command is not working, even
if the tool is not needed for the build.  Now, a fatal error will only
be generated if the tool is required at make time.

19 months agoAdd missing <stdlib.h> includes in test cases.
Nick Bowler [Fri, 7 Feb 2020 02:30:00 +0000 (21:30 -0500)]
Add missing <stdlib.h> includes in test cases.

It seems that current versions of GLib expose EXIT_FAILURE and
EXIT_SUCCESS (possibly via indirect <stdlib.h> includes).  But this
is not the case in older versions and some tests fail as a result
due to the missing macro definitions.  Easily fixed.

19 months agoAvoid GLib deprecation warnings when building gob.
Nick Bowler [Fri, 7 Feb 2020 02:27:40 +0000 (21:27 -0500)]
Avoid GLib deprecation warnings when building gob.

The g_strdown functions are deprecated in GLib, we already have a
gob_strdown function which does the same thing with g_ascii_tolower,
but it seems a couple spots were missed.

There is also a call to g_strcasecmp which can be replaced by
g_ascii_strcasecmp.

19 months agoImplement chaining of interface methods.
Nick Bowler [Thu, 6 Feb 2020 05:08:08 +0000 (00:08 -0500)]
Implement chaining of interface methods.

GObject interface methods are very similar to virtual methods.  A class
may wish to override some or all of the interface methods implemented
in a parent class.  When doing so, it can be useful to call the parent
class implementation to offload some of the work.

For ordinary virtual methods, using the "override" keyword causes a
PARENT_HANDLER macro to be defined which can call up to the parent
class implementation.  Let's do exactly the same thing for interface
methods, and expose the parent interface structures (in case the user
wishes to call up to different methods).

19 months agoFix dynamic interface implementation.
Nick Bowler [Thu, 6 Feb 2020 05:07:44 +0000 (00:07 -0500)]
Fix dynamic interface implementation.

When a dynamic type implements an interface and derives from a type
which implements the same interface, the g_type_module_add_interface
function does not actually work: no interface will be added to the
dynamic type in this case.

The bug is in the GTypeModule class implementation in gobject,
the actual type system has no such limitation.  It is reasonably
straightforward to hack around the problem in GOB.

19 months agoExpand the interface implementation test cases.
Nick Bowler [Thu, 6 Feb 2020 05:05:59 +0000 (00:05 -0500)]
Expand the interface implementation test cases.

Test interface implementation for both dynamic and static types,
and test implementing the same interface in two classes, when one
class derives from another.

The cases where a dynamic class derives from another and both
implement the same interface are currently xfailing, as this
functionality is actually busted.

19 months agoUpdate NEWS to describe new features.
Nick Bowler [Tue, 4 Feb 2020 05:21:30 +0000 (00:21 -0500)]
Update NEWS to describe new features.

And add a distcheck-hook to check that the NEWS file describes the
current package version.

19 months agoGenerate ChangeLog from git at packaging time.
Nick Bowler [Tue, 4 Feb 2020 05:12:51 +0000 (00:12 -0500)]
Generate ChangeLog from git at packaging time.

Import the gitlog-to-changelog script from gnulib and add rules to
generate an up-to-date changelog from the git history, if available,
when running 'make dist'.

The ChangeLog is otherwise taken from srcdir as usual, so that
modified versions can be prepared from a release tarball without
requiring the full git history.  In this scenario, the ChangeLog
would have to be manually edited.

In case the ChangeLog generation fails, a distcheck-hook is added to
hopefully catch issues before releasing tarballs with a broken
ChangeLog.

19 months agoReplace GOB2_CHECK with the version from dxcommon.
Nick Bowler [Mon, 27 Jan 2020 23:16:15 +0000 (18:16 -0500)]
Replace GOB2_CHECK with the version from dxcommon.

Other than the name, the DX_PROG_GOB2 macro from dxcommon can work as
a drop-in replacement for GOB2_CHECK and has a much more robust version
check.

So let's drop the current macro and install a renamed DX_PROG_GOB2
macro instead.

19 months agoAdd a test case which runs the GOB2_CHECK macro.
Nick Bowler [Mon, 27 Jan 2020 22:46:19 +0000 (17:46 -0500)]
Add a test case which runs the GOB2_CHECK macro.

The shipped macro is actually busted because the version in this git
repo is 2.0.20a and the --version output parsing explodes badly.

Before fixing the macro, let's add a test which runs a basic test of
the macro against the just-compiled gob2 version.

2 years agoAdd support for simple dynamic types.
Nick Bowler [Mon, 25 Feb 2019 04:56:34 +0000 (23:56 -0500)]
Add support for simple dynamic types.

Defining types in runtime-loaded modules requires a slightly different
get_type implementation, and the type registration is done explicitly
using a different API.  It's an extra pile of GObject boilerplate which
is a good fit for GOB to generate.

Add a (dynamic) flag which can be put on any class definition which
causes gob to spit out these alternate implementations.

2 years agoPull in dxcommon for library tests.
Nick Bowler [Thu, 21 Feb 2019 16:26:58 +0000 (11:26 -0500)]
Pull in dxcommon for library tests.

Use the glib tests from dxcommon and hook up an initial Autotest-based
test suite which attempts to replicate the functionality of the old
(very basic) test functions.

2 years agoBuild with libtool.
Nick Bowler [Thu, 21 Feb 2019 16:15:06 +0000 (11:15 -0500)]
Build with libtool.

We link against glib, which is built using libtool, so using libtool
ourselves gives better results "out of the box".  For example, if glib
is installed to a non-standard location libtool will automatically add
appropriate rpath options when linking.

2 years agoModernize build system a bit.
Nick Bowler [Tue, 19 Feb 2019 21:40:10 +0000 (16:40 -0500)]
Modernize build system a bit.

Mostly rewrite the build system bits with the following changes:

 - Convert to a non-recursive Automake setup.
 - Convert to standard Automake variables where practical.
 - Add rules to regenerate treefuncs as required.
 - Avoid BUILT_SOURCES by adding accurate prerequisites.
 - Remove NOINSTGLOB functionality as it seems pointless.
 - Properly hook generated HTML documentation into Automake.
 - Remove test bits for now, will be reintroduced later.
 - Simplify configure.ac.

2 years agoRemove and ignore generated files from the repository.
Nick Bowler [Tue, 19 Feb 2019 17:47:57 +0000 (12:47 -0500)]
Remove and ignore generated files from the repository.

Except leave treefuncs in place as the current build system has no
rules to regenerate it automatically...

2 years agoRelease 2.0.20 upstream-2.x v2.0.20
George Lebl [Sun, 15 Dec 2013 05:43:00 +0000 (21:43 -0800)]
Release 2.0.20

2 years agoRelease 2.0.19 v2.0.19
George Lebl [Wed, 19 Dec 2012 12:19:00 +0000 (04:19 -0800)]
Release 2.0.19

2 years agoRelease 2.0.18 v2.0.18
George Lebl [Fri, 7 Jan 2011 04:33:00 +0000 (20:33 -0800)]
Release 2.0.18

2 years agoRelease 2.0.17 v2.0.17
George Lebl [Sat, 3 Apr 2010 06:03:00 +0000 (22:03 -0800)]
Release 2.0.17

2 years agoRelease 2.0.16 v2.0.16
George Lebl [Wed, 22 Jul 2009 01:31:00 +0000 (17:31 -0800)]
Release 2.0.16

2 years agoRelease 2.0.15 v2.0.15
George Lebl [Wed, 21 Nov 2007 14:32:00 +0000 (06:32 -0800)]
Release 2.0.15

2 years agoRelease 2.0.14 v2.0.14
George Lebl [Fri, 6 Jan 2006 03:09:00 +0000 (19:09 -0800)]
Release 2.0.14

2 years agoRelease 2.0.13 v2.0.13
George Lebl [Sat, 17 Dec 2005 05:24:00 +0000 (21:24 -0800)]
Release 2.0.13

2 years agoRelease 2.0.12 v2.0.12
George Lebl [Sat, 23 Jul 2005 06:15:00 +0000 (22:15 -0800)]
Release 2.0.12

2 years agoRelease 2.0.11 v2.0.11
George Lebl [Wed, 27 Oct 2004 09:33:00 +0000 (01:33 -0800)]
Release 2.0.11

2 years agoRelease 2.0.10 v2.0.10
George Lebl [Thu, 23 Sep 2004 10:27:00 +0000 (02:27 -0800)]
Release 2.0.10

2 years agoRelease 2.0.9 v2.0.9
George Lebl [Tue, 20 Jul 2004 02:45:00 +0000 (18:45 -0800)]
Release 2.0.9

2 years agoRelease 2.0.8 v2.0.8
George Lebl [Sat, 12 Jun 2004 08:19:00 +0000 (00:19 -0800)]
Release 2.0.8

2 years agoRelease 2.0.7 v2.0.7
George Lebl [Wed, 31 Mar 2004 11:34:00 +0000 (03:34 -0800)]
Release 2.0.7

2 years agoRelease 2.0.6 v2.0.6
George Lebl [Wed, 21 May 2003 03:25:00 +0000 (19:25 -0800)]
Release 2.0.6

2 years agoRelease 2.0.5 v2.0.5
George Lebl [Fri, 17 Jan 2003 05:47:00 +0000 (21:47 -0800)]
Release 2.0.5

2 years agoRelease 2.0.4 v2.0.4
George Lebl [Sat, 14 Dec 2002 03:26:00 +0000 (19:26 -0800)]
Release 2.0.4

2 years agoRelease 2.0.3 v2.0.3
George Lebl [Sat, 2 Nov 2002 09:19:00 +0000 (01:19 -0800)]
Release 2.0.3

2 years agoRelease 2.0.2 v2.0.2
George Lebl [Wed, 21 Aug 2002 03:53:00 +0000 (19:53 -0800)]
Release 2.0.2

2 years agoRelease 2.0.1 v2.0.1
George Lebl [Thu, 18 Jul 2002 03:51:00 +0000 (19:51 -0800)]
Release 2.0.1

2 years agoRelease 2.0.0 v2.0.0
George Lebl [Tue, 16 Jul 2002 06:18:00 +0000 (22:18 -0800)]
Release 2.0.0

2 years agoRelease 1.99.3 v1.99.3
George Lebl [Wed, 29 May 2002 06:09:00 +0000 (22:09 -0800)]
Release 1.99.3

2 years agoRelease 1.99.2 v1.99.2
George Lebl [Sat, 2 Feb 2002 08:11:00 +0000 (00:11 -0800)]
Release 1.99.2

2 years agoRelease 1.99.1 v1.99.1
George Lebl [Fri, 5 Oct 2001 10:59:00 +0000 (02:59 -0800)]
Release 1.99.1

2 years agoRelease 1.0.7 v1.0.7
George Lebl [Mon, 26 Feb 2001 08:10:00 +0000 (00:10 -0800)]
Release 1.0.7

2 years agoRelease 1.0.6 v1.0.6
George Lebl [Mon, 12 Feb 2001 06:41:00 +0000 (22:41 -0800)]
Release 1.0.6

2 years agoRelease 1.0.5 v1.0.5
George Lebl [Mon, 11 Sep 2000 15:07:00 +0000 (07:07 -0800)]
Release 1.0.5

2 years agoRelease 1.0.4 v1.0.4
George Lebl [Mon, 24 Jul 2000 16:16:00 +0000 (08:16 -0800)]
Release 1.0.4

2 years agoRelease 1.0.3 v1.0.3
George Lebl [Thu, 6 Jul 2000 19:42:00 +0000 (11:42 -0800)]
Release 1.0.3

2 years agoRelease 1.0.2 v1.0.2
George Lebl [Sat, 1 Jul 2000 06:51:00 +0000 (22:51 -0800)]
Release 1.0.2

2 years agoRelease 1.0.1 v1.0.1
George Lebl [Thu, 8 Jun 2000 08:48:00 +0000 (00:48 -0800)]
Release 1.0.1

2 years agoRelease 1.0.0 v1.0.0
George Lebl [Wed, 31 May 2000 19:07:00 +0000 (11:07 -0800)]
Release 1.0.0

2 years agoRelease 0.93.5 v0.93.5
George Lebl [Sun, 21 May 2000 11:30:00 +0000 (03:30 -0800)]
Release 0.93.5

2 years agoRelease 0.93.4 v0.93.4
George Lebl [Sun, 30 Apr 2000 07:51:00 +0000 (23:51 -0800)]
Release 0.93.4

2 years agoRelease 0.93.3 v0.93.3
George Lebl [Sun, 16 Apr 2000 16:16:00 +0000 (08:16 -0800)]
Release 0.93.3

2 years agoRelease 0.93.2 v0.93.2
George Lebl [Mon, 3 Apr 2000 11:12:00 +0000 (03:12 -0800)]
Release 0.93.2

2 years agoRelease 0.93.1 v0.93.1
George Lebl [Tue, 28 Mar 2000 06:23:00 +0000 (22:23 -0800)]
Release 0.93.1

2 years agoRelease 0.93.0 v0.93.0
George Lebl [Mon, 28 Feb 2000 20:15:00 +0000 (12:15 -0800)]
Release 0.93.0

2 years agoRelease 0.92.4 v0.92.4
George Lebl [Sat, 26 Feb 2000 08:36:00 +0000 (00:36 -0800)]
Release 0.92.4

2 years agoRelease 0.92.3 v0.92.3
George Lebl [Mon, 7 Feb 2000 20:14:00 +0000 (12:14 -0800)]
Release 0.92.3

2 years agoRelease 0.92.2 v0.92.2
George Lebl [Tue, 25 Jan 2000 16:17:00 +0000 (08:17 -0800)]
Release 0.92.2

2 years agoRelease 0.92.1 v0.92.1
George Lebl [Fri, 7 Jan 2000 10:55:00 +0000 (02:55 -0800)]
Release 0.92.1

2 years agoRelease 0.92.0 v0.92.0
George Lebl [Sat, 1 Jan 2000 10:49:00 +0000 (02:49 -0800)]
Release 0.92.0

2 years agoRelease 0.91.2 v0.91.2
George Lebl [Tue, 28 Dec 1999 16:36:00 +0000 (08:36 -0800)]
Release 0.91.2

2 years agoRelease 0.91.1 v0.91.1
George Lebl [Tue, 14 Dec 1999 17:38:00 +0000 (09:38 -0800)]
Release 0.91.1

2 years agoRelease 0.91.0 v0.91.0
George Lebl [Mon, 13 Dec 1999 17:48:00 +0000 (09:48 -0800)]
Release 0.91.0

2 years agoRelease 0.90.5 v0.90.5
George Lebl [Fri, 26 Nov 1999 06:12:00 +0000 (22:12 -0800)]
Release 0.90.5

2 years agoRelease 0.90.4 v0.90.4
George Lebl [Tue, 16 Nov 1999 19:00:00 +0000 (11:00 -0800)]
Release 0.90.4

2 years agoRelease 0.90.3 v0.90.3
George Lebl [Sun, 14 Nov 1999 10:36:00 +0000 (02:36 -0800)]
Release 0.90.3

2 years agoRelease 0.90.2 v0.90.2
George Lebl [Mon, 6 Sep 1999 15:14:00 +0000 (07:14 -0800)]
Release 0.90.2

2 years agoRelease 0.90.1 v0.90.1
George Lebl [Sun, 5 Sep 1999 10:38:00 +0000 (02:38 -0800)]
Release 0.90.1

2 years agoRelease 0.90.0 v0.90.0
George Lebl [Mon, 30 Aug 1999 06:51:00 +0000 (22:51 -0800)]
Release 0.90.0

2 years agoRelease 0.0.4 v0.0.4
George Lebl [Wed, 25 Aug 1999 13:58:00 +0000 (05:58 -0800)]
Release 0.0.4

2 years agoRelease 0.0.3 v0.0.3
George Lebl [Thu, 19 Aug 1999 05:21:00 +0000 (21:21 -0800)]
Release 0.0.3

2 years agoRelease 0.0.2 v0.0.2
George Lebl [Fri, 6 Aug 1999 23:51:00 +0000 (15:51 -0800)]
Release 0.0.2

2 years agoRelease 0.0.1 v0.0.1
George Lebl [Mon, 12 Jul 1999 18:12:00 +0000 (10:12 -0800)]
Release 0.0.1