Nick Bowler [Tue, 30 Jun 2020 03:54:43 +0000 (23:54 -0400)]
Output copyright symbol directly, rather than via translations.
The "(C)" isn't really a translatable string. Instead of requiring
translations to deal with it, use Gnulib's str_iconv module to encode it
into the user's locale encoding. We fall back to (C) if that fails for
any reason, or if NLS is disabled.
Nick Bowler [Wed, 9 Jan 2013 00:01:53 +0000 (19:01 -0500)]
Fix silent-rules alignment in Automake 1.12.
Automake 1.12 changes the alignment of silent-rules output, which
looks ugly. Use the new compatibility helpers in dxcommon to fix
the alignment of flex/bison printouts in a backwards-compatible way.
Nick Bowler [Thu, 30 Aug 2012 00:29:03 +0000 (20:29 -0400)]
Add basic readline history support.
Bump gnulib as later versions include a free check for history.h
already, then implement a wrapper for add_history that should work
even when support is not available.
Nick Bowler [Wed, 29 Aug 2012 22:35:55 +0000 (18:35 -0400)]
Work around breakage caused by newer Bison versions.
Newer versions of GNU Bison automagically add a prototype for yyparse to
the header file, where previous versions did not. Unfortunately, the
use of yyscan_t in %parse-param causes a build failure now, as yyscan_t
is declared in scan.h. Moreover, since scan.h includes parse.h, we
cannot simply include scan.h in parse.h to get the type definition.
Work around the problem by declaring yyparse as taking a void *
directly.
Nick Bowler [Wed, 15 Aug 2012 00:34:44 +0000 (20:34 -0400)]
Workaround Gentoo's silly Automake wrapper in bootstrap.
It's pretty annoying when running bootstrap doesn't actually rebuild
using newly-installed tool versions. This happens because Gentoo's
automake wrapper script detects that stuff has been previously built
with a particular version of Automake, and runs that instead of the
latest.
Since we're going to recreate them anyway, delete the generated files so
that Gentoo's script picks the latest.
Nick Bowler [Wed, 15 Aug 2012 00:20:52 +0000 (20:20 -0400)]
Prevent gratuitous Automake failures.
Automake-1.12 introduces some new warnings, as well as fixing an earlier
bug that prevented -Wall from enabling all warnings. Since we were
using -Werror, this causes Automake to fail.
However, the warnings are gratuitous: some are warning about stuff
provided by libtool (which should be fixed in libtool, not worked
around in this package), and the others are warning about the non-
portability of (hopefully!) portable constructs. Most are automake
bug #9587 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9587>, but
Automake also warns about the $(.FEATURES) trick to use order-only
dependencies when available.
Nick Bowler [Sat, 28 Jul 2012 20:32:18 +0000 (16:32 -0400)]
Move some gettext bits to dxcommon.
Migrate the mostly-package-agnostic parts of the gettext support into
dxcommon, thus allowing these bits to be shared with other packages.
We remove the AC_CONFIG_MACRO_DIR from configure.ac because its
behaviour is not clearly specified, and it's not obvious how (if it's
even possible at all) one handles multiple directories containing macro
definitions. Moreover, even if this macro is specified you still need
to define ACLOCAL_AMFLAGS anyway, and this definition must be kept
consistent with the AC_CONFIG_MACRO_DIR usage.
In the end, it looks like the only thing AC_CONFIG_MACRO_DIR does is
silence a single warning from libtoolize, without doing anything else
meaningful. In light of the above, the warning seems preferable at
this time.
Nick Bowler [Thu, 10 May 2012 00:02:29 +0000 (20:02 -0400)]
Better document fix-gnulib.
Add a big blurb in the comments describing the main bits required to use
the script in a project. Also rename the header variables a bit so we
can ensure future compatibility with the documented behaviour.
Nick Bowler [Wed, 9 May 2012 23:59:32 +0000 (19:59 -0400)]
Make fix-gnulib only need a single output file.
We combine the Automake and M4 bits into a single polyglot that can be
interpreted by either, so all one needs to do is include the makefile
fragment in configure.ac. I've created a monster.
Nick Bowler [Sun, 18 Mar 2012 22:05:05 +0000 (18:05 -0400)]
Unbreak random array declarators.
Passing really big values to gsl_rng_uniform_int is not supported by the
library. Instead, add a function to generate any possible uintmax_t
value uniformly at random.
Nick Bowler [Sun, 18 Mar 2012 20:54:43 +0000 (16:54 -0400)]
Fix bogus switch cases in declgen.
One of the switch statements in declgen has completely bogus case
labels: '0', '1', ... instead of 0, 1, ...
Fix this up and also add a default: assert(0); which would have caught
this earlier. Improve the test case output when a randomdecl failure
causes the test to fail.
Also add a comment to the one switch statement in this file which
intentionally does not have a default: assert(0).
Nick Bowler [Sat, 3 Mar 2012 03:30:15 +0000 (22:30 -0500)]
Batch up crossparse tests to improve performance.
A significant portion of the crossparse test time is spent just starting
the program hundreds of times. Batch up the random declarations to
reduce this. This makes the test script somewhat more complex, but the
gain is significant: the test time (500 iterations) on my machine is
shortened from 7 seconds to a mere .7 seconds.
Nick Bowler [Wed, 29 Feb 2012 01:05:06 +0000 (20:05 -0500)]
Avoid recursively calling glthread_once in error init.
Apparently at least the GNU C library will deadlock when pthread_once is
called recursively on the same control variable. This behaviour of the
library doesn't seem to be consistent with the POSIX standard, but it's
easy enough to avoid in this instance.
This can all go away once all the error paths have been updated to
cdecl__set_error.
Nick Bowler [Sat, 25 Feb 2012 16:27:36 +0000 (11:27 -0500)]
Add missing test files to the distribution.
Oops; distcheck wasn't testing this (yet) so half the files in test/
were not actually included in the distribution.
Also switch to using check_LTLIBRARIES instead of EXTRA_LTLIBRARIES
because the latter does not clean properly for some reason (and the
former is more appropriate conceptually, anyway).
Nick Bowler [Sat, 25 Feb 2012 02:28:51 +0000 (21:28 -0500)]
Avoid per-target CFLAGS (for now).
There's no real reason to use per-target CFLAGS to specify $(GSL_CFLAGS)
only on libtest, as the flags will simply be harmless (and useless) on
other targets. Set them globally and completely avoid the mess
resulting from the use of per-target flags.
Nick Bowler [Sat, 25 Feb 2012 02:25:21 +0000 (21:25 -0500)]
Fix GSL detection when using the default --with-gsl=auto.
The use of a shell case statement was preventing the AC_REQUIRE macros
in DX_CHECK_GSL from working correctly in the second case. Switch to
AS_CASE to avoid the issue.
Nick Bowler [Sat, 25 Feb 2012 01:54:45 +0000 (20:54 -0500)]
Fix "make dist" permissions when using a read-only srcdir.
Apparently Automake copies permissions from the source directory, so
if you run "make dist" in a VPATH build from a read-only srcdir, the
resulting distdir will be read-only. Beyond the resulting tarball
permissions, this can actually cause dist hooks to fail in some
instances.
Add another dist hook which makes distdir user-writable.
Nick Bowler [Fri, 24 Feb 2012 02:51:26 +0000 (21:51 -0500)]
Try to fix explanations of "child" declarators in the manual.
The "child" relationship between declarators is somwhat unintuitive.
Try to explain it properly in the manual. It's still probably not too
helpful, but it's certainly better than the outright lies that are in
there currently.
Nick Bowler [Fri, 24 Feb 2012 02:31:58 +0000 (21:31 -0500)]
Fix spacing after qualified pointers when rendering C declarations.
We don't want to print spaces after pointer qualifiers all the time: in
particular, things like "type const pointer to array of int" would print
a space between the "const" and the ")", as in:
int (* const )[]
Fix that up by eliding the space if (a) the pointer has qualifiers, and
(b) the child is not a null declarator.
Nick Bowler [Tue, 29 Nov 2011 03:03:07 +0000 (22:03 -0500)]
Reduce "set +x" noise in (un)install targets.
By judicious use of subshells, we can eliminate the need to call
"set +x" explicitly, which should (slightly) reduce the noise of the
(un)install targets.
Nick Bowler [Sun, 20 Nov 2011 16:37:00 +0000 (11:37 -0500)]
Separate specifier handling from the output routines.
This moves all the code to handle redundant specifiers and multiple
orderings to the parser, so that the output routines just have to
print them out in order.
This will allow the output routines to be used by test generators.
Nick Bowler [Sat, 22 Oct 2011 23:53:38 +0000 (19:53 -0400)]
Make CDECL_SPEC_TYPE non-zero.
This allows us to meaningfully OR together the various CDECL_SPEC_
constants. A bit of code assumes that CDECL_SPEC_TYPE is zero, so that
needs to be fixed.
Nick Bowler [Tue, 4 Oct 2011 02:02:28 +0000 (22:02 -0400)]
Identify nonterminals in the manual's grammar in an alternate way.
Some output devices won't render .Va text differently from .Li text when
displaying the man page. This unfortunately means that nonterminals
look exactly the same as terminals in the grammar. Add brackets
around nonterminals (which are otherwise unused in the grammar) so
that it is readable on these devices, too.
Nick Bowler [Thu, 29 Sep 2011 01:57:23 +0000 (21:57 -0400)]
Start implementing proper error handling.
Since the library shouldn't be printing its own error messages, we need
a mechanism to propagate error details to the caller. Implement a
system using thread-local storage which tracks the most recent errors.
Nick Bowler [Thu, 29 Sep 2011 00:05:49 +0000 (20:05 -0400)]
Use (un)install-local to (un)install .mo files.
These install rules do not depend on any other installed file, so
there's no need to use the -hook versions which guarantee ordering.
Use -local instead.
libcdecl doesn't use the readline module at all, but libtool happily
pulls it in as a dependency. Handle library dependencies manually to
avoid this problem.
Nick Bowler [Wed, 21 Sep 2011 23:11:39 +0000 (19:11 -0400)]
Fix build with NLS disabled.
When NLS is disabled, we should not install any .mo files but we still
need to distribute the .po files. However, ALL_LINGUAS was not being
set in this case, so the POFILES was not set if NLS is disabled, causing
a distcheck failure.
Also fix a build error in this case due to a missing #include.
Nick Bowler [Wed, 21 Sep 2011 23:12:52 +0000 (19:12 -0400)]
Include config.h in scan.l.
This is required for things to work. Unfortunately, %top{...} appears
to be the only bit where config.h can be put in a flex scanner, as
headers are included before the first %{...} block is output. Thus, the
include ends up in the scan.h header file. Nevertheless, this should
not be a problem since config.h only defines macros.
Nick Bowler [Wed, 21 Sep 2011 04:51:17 +0000 (00:51 -0400)]
Rewrite Gnulib symbols to be in libcdecl's namespace.
The gnulib symbols are not properly prefixed for libcdecl internal
symbols (e.g. cdecl__blah). This *will* cause problems when statically
linking against both libcdecl and another library that uses the same
gnulib modules.
Unfortunately, there's no simple way to determine what symbols need
prefixing without compiling all the gnulib objects. The results can't
be distributed either, because they depend on the configuration. So,
limited to simple tools and portable make rules, we hack together a
"new" config.h at build time that defines object-like macros to rewrite
the symbols, carefully ensuring that header dependencies are correct.
Nick Bowler [Mon, 19 Sep 2011 03:01:18 +0000 (23:01 -0400)]
Eliminate use of BUILT_SOURCES from Gnulib.
As with recursive make, BUILT_SOURCES is harmful because of inadequate
dependency information. We can achieve a similar effect with by using
order-only dependencies: These force the headers to be up-to-date
before anything that might require them is built: but rebuilds are only
triggered based on the accurate dependency information generated by the
normal mechanisms.
Unfortunately, order-only dependencies are a GNU make feature, so we use
a hack which should fall back to ordinary dependencies on other make
implementations. The worst effect of using ordinary dependencies will
be that files might be needlessly rebuilt when a header changes.
Nick Bowler [Thu, 15 Sep 2011 01:10:19 +0000 (21:10 -0400)]
Enable i18n in Bison.
This makes us require library initialization. To avoid requiring an
explicit call, we implicitly initialize the library when it is first
required. Bring in Gnulib's threading library to do this in a
thread-safe manner when available.