]> git.draconx.ca Git - dxcommon.git/log
dxcommon.git
11 years agoexported.sh: Improve error handling.
Nick Bowler [Wed, 29 Aug 2012 00:38:53 +0000 (20:38 -0400)]
exported.sh: Improve error handling.

Use the eval trick to handle errors from commands in the pipeline other
than the last.  In particular, we now detect if nm failed and return an
error status in this case.  While we're rewriting this code, replace
sort | uniq with sort -u as the latter should be fine according to
POSIX.  We can re-add the two-command version if it actually causes
problems.

11 years agoImport exported.sh from cdecl99.
Nick Bowler [Wed, 15 Aug 2012 20:46:33 +0000 (16:46 -0400)]
Import exported.sh from cdecl99.

This script is required for the glconfig.mk snippet to actually
work, but it somehow got forgotten when that snippet was imported.

Bring in the script, and add M4 plumbing to support finding auxilliary
files in the dxcommon source directory.  The result should be totally
automatic, although this unfortunately means that users of fix-gnulib.pl
that don't need or want to use glconfig.mk are stuck with some extra
dependencies (including libtool) to generate the exported.sh script.

Currently, I can't think of a way to keep the automatic glconfig.mk
support (i.e., the only thing users really have to do is include the
snippet for it to work) without this spurious dependency.  So things
may need to change later, but let's just get the support in for now.

11 years agoImport gettext m4/automake bits from cdecl99.
Nick Bowler [Sat, 28 Jul 2012 19:16:42 +0000 (15:16 -0400)]
Import gettext m4/automake bits from cdecl99.

These are pretty package-agnostic, and can be shared pretty easily.

11 years agofix-gnulib: Handle MOSTLYCLEANDIRS.
Nick Bowler [Tue, 24 Jul 2012 23:59:34 +0000 (19:59 -0400)]
fix-gnulib: Handle MOSTLYCLEANDIRS.

Usage of this variable suffers from similar problems as xxxCLEANFILES,
so fix it up in the same way by moving it to the end of the makefile
fragment.  The check needs to be improved a bit as the fragment contains
actual references to this variable, and only want to move the
assignments.

The variable also needs to be set before use, which strangely doesn't
actually happen in the fragment, even though this is a totally internal
thing...

11 years agofix-ltdl: Move all convenience libs to EXTRA_LTLIBRARIES only.
Nick Bowler [Sat, 12 May 2012 00:00:02 +0000 (20:00 -0400)]
fix-ltdl: Move all convenience libs to EXTRA_LTLIBRARIES only.

There's no reason to list these in noinst_LTLIBRARIES in a non-recursive
build, as they will be picked up correctly by ordinary prerequisites.

11 years agofix-ltdl: Delete libobj symlink before attempting to create it.
Nick Bowler [Fri, 11 May 2012 02:17:51 +0000 (22:17 -0400)]
fix-ltdl: Delete libobj symlink before attempting to create it.

There seems to be a (rare) race in parallel builds where make for some
reason decides to update the libobj symlink after it already exists,
which fails.  I can't reproduce the failure, but deleting the symlink
(if one exists) before creating it should avoid the issue.

11 years agofix-ltdl: New script to fix up nonrecursive libltdl.
Nick Bowler [Thu, 10 May 2012 22:11:33 +0000 (18:11 -0400)]
fix-ltdl: New script to fix up nonrecursive libltdl.

Similar in spirit to fix-gnulib, this one improves the nonrecursive
libltdl integration.

11 years agofix-gnulib: Fix up $(MKDIR_P) paths as well.
Nick Bowler [Thu, 10 May 2012 02:16:37 +0000 (22:16 -0400)]
fix-gnulib: Fix up $(MKDIR_P) paths as well.

Otherwise it will create the directory at the top level rather than
where it's going to write the output...

11 years agoMerge branch 'fix-gnulib' of /home/nbowler/projects/cdecl99
Nick Bowler [Thu, 10 May 2012 00:51:24 +0000 (20:51 -0400)]
Merge branch 'fix-gnulib' of /home/nbowler/projects/cdecl99

Import the fix-gnulib history from cdecl99.

* 'fix-gnulib' of /home/nbowler/projects/cdecl99:
  Better document fix-gnulib.
  Make fix-gnulib only need a single output file.
  Simplify glconfig include mechanism.
  Mangle spliced makefile lines in Gnulib correctly.
  Avoid gratuitous library dependencies linking gnulib.
  Rewrite Gnulib symbols to be in libcdecl's namespace.
  Split gnulib_headers into 3 variables.
  Move all Gnulib CLEANFILES variables to the end of the makefile.
  Handle gl_LIBOBJS/gl_LTLIBOBJS correctly.
  Eliminate use of BUILT_SOURCES from Gnulib.
  Integrate Gnulib non-recursively.

11 years agoInitial commit
Nick Bowler [Thu, 10 May 2012 00:08:12 +0000 (20:08 -0400)]
Initial commit

11 years agoBetter document fix-gnulib.
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.

11 years agoMake fix-gnulib only need a single output file.
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.

12 years agoSimplify glconfig include mechanism.
Nick Bowler [Sat, 25 Feb 2012 17:08:23 +0000 (12:08 -0500)]
Simplify glconfig include mechanism.

Instead of relying on include order to select the right config.h, modify
config.h to include the glconfig header conditionally.

This allows the use of Automake's default include paths again, and is
conceptually simpler.

12 years agoMangle spliced makefile lines in Gnulib correctly.
Nick Bowler [Sat, 22 Oct 2011 17:37:27 +0000 (13:37 -0400)]
Mangle spliced makefile lines in Gnulib correctly.

Otherwise, target and variable mangling may only apply to the first
line.

12 years agoAvoid gratuitous library dependencies linking gnulib.
Nick Bowler [Thu, 22 Sep 2011 00:58:27 +0000 (20:58 -0400)]
Avoid gratuitous library dependencies linking gnulib.

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.

12 years agoRewrite Gnulib symbols to be in libcdecl's namespace.
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.

12 years agoSplit gnulib_headers into 3 variables.
Nick Bowler [Wed, 21 Sep 2011 04:31:15 +0000 (00:31 -0400)]
Split gnulib_headers into 3 variables.

This will be useful for symbol mangling, where additional header files
may need to be added to various points in the dependency chain.

12 years agoMove all Gnulib CLEANFILES variables to the end of the makefile.
Nick Bowler [Mon, 19 Sep 2011 22:44:47 +0000 (18:44 -0400)]
Move all Gnulib CLEANFILES variables to the end of the makefile.

This makes the clean procedure independent of the configuration.

12 years agoHandle gl_LIBOBJS/gl_LTLIBOBJS correctly.
Nick Bowler [Mon, 19 Sep 2011 22:43:34 +0000 (18:43 -0400)]
Handle gl_LIBOBJS/gl_LTLIBOBJS correctly.

These AC_SUBSTed variables reference objects whose sources are located
in lib, thus they need to be rewritten like other AC_SUBSTed variables.

These objects also need the header dependencies like other objects.

12 years agoEliminate use of BUILT_SOURCES from Gnulib.
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.

12 years agoIntegrate Gnulib non-recursively.
Nick Bowler [Mon, 19 Sep 2011 01:46:14 +0000 (21:46 -0400)]
Integrate Gnulib non-recursively.

With a little bit of mangling, it's possible to make the makefile
fragment produced by gnulib-tool suitable for use in our non-recursive
makefile.