]> git.draconx.ca Git - dxcommon.git/log
dxcommon.git
9 years agofix-ltdl: Fix order-only hack with FreeBSD make.
Nick Bowler [Sat, 22 Nov 2014 17:15:48 +0000 (12:15 -0500)]
fix-ltdl: Fix order-only hack with FreeBSD make.

FreeBSD make does not work well when undefined variables are used in
nested expansions.  When such an expansion appears in the prerequisites
of a target, FreeBSD make exits with a fatal error.  For example:

  A = $(var$(B))
  foo : $(A)

  % make
  Error expanding embedded variable.

This causes the order-only hack to fail because FreeBSD make does not
define .FEATURES.  The workaround is simple: add another variable which
is assigned the value of .FEATURES.  That variable can be used in the
nested expansion to avoid the error.

9 years agofix-gnulib: Fix order-only hack with FreeBSD make.
Nick Bowler [Sat, 22 Nov 2014 17:11:56 +0000 (12:11 -0500)]
fix-gnulib: Fix order-only hack with FreeBSD make.

FreeBSD make does not work well when undefined variables are used in
nested expansions.  When such an expansion appears in the prerequisites
of a target, FreeBSD make exits with a fatal error.  For example:

  A = $(var$(B))
  foo : $(A)

  % make
  Error expanding embedded variable.

This causes the order-only hack to fail because FreeBSD make does not
define .FEATURES.  The workaround is simple: add another variable which
is assigned the value of .FEATURES.  That variable can be used in the
nested expansion to avoid the error.

9 years agoImplement initial test suite.
Nick Bowler [Tue, 10 Mar 2015 04:10:49 +0000 (21:10 -0700)]
Implement initial test suite.

First stab at a new autotest-based test suite for dxcommon.  Start with
a simple test case to expose a longstanding problem in DX_BASEDIR.

9 years agofix-gnulib: Eliminate dependency on List::Compare.
Nick Bowler [Fri, 29 Aug 2014 23:33:32 +0000 (19:33 -0400)]
fix-gnulib: Eliminate dependency on List::Compare.

This library was hardly needed; the code is shorter without it.  Now the
script can run on a stock perl installation.

9 years agoImport GTK2 detection macro.
Nick Bowler [Mon, 9 Jun 2014 23:49:29 +0000 (19:49 -0400)]
Import GTK2 detection macro.

Now that we have this support we can start bringing in
other library tests.

9 years agoAdd libpng detection macro.
Nick Bowler [Mon, 9 Jun 2014 23:46:34 +0000 (19:46 -0400)]
Add libpng detection macro.

I've been carrying around library detection in individual projects for
too long.  This is a from-scratch rewrite of the core probing code but
the actual libpng test is basically the same as before.

The idea is to better leverage M4 macros to reduce duplication, so it
should be easy to add more libraries in the future.

10 years agofix-gnulib: Improve filename mangling.
Nick Bowler [Fri, 21 Jun 2013 19:58:49 +0000 (15:58 -0400)]
fix-gnulib: Improve filename mangling.

This corrects a problem with some of the make rules in the localcharset
module.  Some filenames were not being properly prefixed with lib/ while
others were, leading to some files not being built.

11 years agofix-gnulib: Add a call to AC_CONFIG_LIBOBJ_DIR
Nick Bowler [Wed, 13 Mar 2013 01:03:59 +0000 (21:03 -0400)]
fix-gnulib: Add a call to AC_CONFIG_LIBOBJ_DIR

For some reason, the alloca module uses Autoconf's stock LIBOBJ
machinery and things explode if AC_CONFIG_LIBOBJ_DIR is not set
correctly, because the Gnulib macros sure don't.

Add such a call to the included m4 fragment to fix things up.

The amount of magic and poor documentation around this feature is
astounding.

11 years agofix-gnulib: Strip out useless SUFFIXES assignments.
Nick Bowler [Tue, 12 Mar 2013 22:51:24 +0000 (18:51 -0400)]
fix-gnulib: Strip out useless SUFFIXES assignments.

These are useless because Automake handles trivial cases automatically.

11 years agoAdd some backwards-compatibility helpers for silent-rules.
Nick Bowler [Tue, 8 Jan 2013 23:54:41 +0000 (18:54 -0500)]
Add some backwards-compatibility helpers for silent-rules.

The silent-rules support in Automake has changed over the ages.  Most
glaringly, the output alignment changed between 1.11 and 1.12.  Add a
new macro, DX_AUTOMAKE_COMPAT, which is intended to capture the
compatibility hacks needed to support multiple versions of Automake.
Currently, this means that it will define a variable to help print
silent-rule output that maintains alignment, and it will AC_SUBST
compatible versions, if necessary, of variables substituted in later
versions of Automake's silent-rule support.

Update glconfig.mk to make use of the new feature.

11 years agoFix DX_EXPORTED_SH to AC_SUBST required variables.
Nick Bowler [Wed, 5 Dec 2012 23:22:44 +0000 (18:22 -0500)]
Fix DX_EXPORTED_SH to AC_SUBST required variables.

The exported.sh support wasn't really usable as-is since it was relying
on a symbol defined by cdecl99's configure.ac.  Bring that configuration
into the common macro.

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.