I did once use an 'acinclude' tool to help copying macros from my personal ac-archive to the various projects. The name stems from writing out to acinclude.m4. It was based on an old version of 'aclocal'. It had too much difference to care for an updated version.
In the meantime we find that 'aclocal' is happy to m4_include macros from a local subdirectory m4/. So it is a better way to populate this subdirectory from the ac-archive. This time I am making it up as a patch over standard 'aclocal' - it just adds a few options that imitate automake options "-a" and "-c". As a nicety a tool 'aclocaldir' ending with '*dir' will imply "-a". It works unexpectingly well for the small size of the patch. I can add -I /my/ac-archive to get all the ax_* macros and if I do forget about the path (or work on a system without one) it will only update the automake macros being used with leaving the extra ax-macros as they had been distributed. The standard aclocal.m4 shrinks to a few lines. have fun, -- guido http://google.de/search?q=guidod GCS/E/S/P C++/++++$ ULHS L++w- N++@ s+:a d->++ r+@>+++ y++ (geekcode)
--- /usr/bin/aclocal 2006-04-23 02:59:36.000000000 +0200 +++ /my/bin/aclocaldir 2006-05-24 03:02:21.000000000 +0200 @@ -59,7 +59,18 @@ my $configure_ac; # Output file name. -$output_file = 'aclocal.m4'; +my $output_file = 'aclocal.m4'; + +# Output directory name. +my $output_dir = 'm4'; + +# TRUE if missing macro files should be installed. +my $add_missing = 0; + +# TRUE if we should copy missing files; otherwise symlink if possible. +my $copy_missing = 0; + +$add_missing = 1 if $0 =~ /dir$/; # Modification time of the youngest dependency. $greatest_mtime = 0; @@ -455,6 +466,7 @@ { my ($output_file, @macros) = @_; my $output = ''; + my @outputfiles = (); my %files = (); # Get the list of files containing definitions for the macros used. @@ -490,12 +502,47 @@ # Otherwise, simply include the file. $output .= "m4_include([$file])\n"; } + push @outputfiles, $file; } # Nothing to output?! # FIXME: Shouldn't we diagnose this? return if ! length ($output); + if ($add_missing || $copy_missing) + { + print STDERR "aclocal: writing to $output_dir\n" if $verbose; + for my $file (@outputfiles) + { + my $fullfile = File::Spec->canonpath ("$output_dir/" + . basename ($file)); + # Install the missing file. Symlink if we + # can, copy if we must. Note: delete the file + # first, in case it is a dangling symlink. + $message = "installing `$fullfile'"; + # Windows Perl will hang if we try to delete a + # file that doesn't exist. + unlink ($fullfile) if -f $fullfile; + if (! $copy_missing) + { + print STDERR "aclocal: symlink '$fullfile' -> '$file'\n" + if $verbose; + if (! symlink ($file, $fullfile)) + { + print $message, "; error while making link: $!"; + } + } + else + { + print STDERR "aclocal: create '$fullfile' <- '$file'\n" + if $verbose; + my $out = new Automake::XFile "> $fullfile"; + print $out $file_contents{$file}; + } + } + return; + } + # We used to print `# $output_file generated automatically etc.' But # this creates spurious differences when using autoreconf. Autoreconf # creates aclocal.m4t and then rename it to aclocal.m4, but the @@ -555,10 +602,13 @@ Generate `aclocal.m4' by scanning `configure.ac' or `configure.in' --acdir=DIR directory holding config files + -a, --add-missing add missing macro files to package + -c, --copy copy missing files (default is symlink) --help print this help, then exit -I DIR add directory to search list for .m4 files --force always update output file --output=FILE put output in FILE (default aclocal.m4) + --output-dir=DIR put output in DIR (default m4/) --print-ac-dir print name of directory holding m4 files --verbose don't be silent --version print version number, then exit @@ -585,6 +635,18 @@ { $output_file = $1; } + elsif ($arglist[0] =~/^--output-dir=(.+)$/) + { + $output_dir = $1; + } + elsif ($arglist[0] eq '--add-missing' || $arglist[0] eq '-a') + { + $add_missing = 1; + } + elsif ($arglist[0] eq '--copy' || $arglist[0] eq '-c') + { + $copy_missing = 1; + } elsif ($arglist[0] eq '-I') { shift (@arglist);