automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_CONFIG_LIBOBJ_DIR


From: Russ Allbery
Subject: AC_CONFIG_LIBOBJ_DIR
Date: Tue, 15 Aug 2006 10:19:10 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)

A while back, I asked about Automake support for AC_CONFIG_LIBOBJ_DIR in
the context of using Automake to support a non-recursive build of a
package.  The result of the discussion was that Automake required some
functionality that was new in Autoconf 2.60 in order to support this
properly.

Since then, Autoconf 2.60 has been released, so I want to inquire again
about the status of this support.  Right now, one of my packages will only
build properly with a patched Automake because of this missing feature,
and I'd like to get back to using a standard Automake release.

My hope is that, in a package that uses AC_CONFIG_LIBOBJ_DIR to say that
replacement functions are in the subdirectory util, I'll be able to say:

    util_libutil_la_LIBADD = $(LTLIBOBJS)

in the top-level Makefile.am and have the right things happen.  Currently,
in order to make this work properly, I have to add:

    MOSTLYCLEANFILES = $(LIBOBJS) $(LTLIBOBJS)

since otherwise those objects aren't removed, use code like this in
configure.ac since AC_CONFIG_LIBOBJ_DIR isn't supported:

    AC_CHECK_FUNC([asprintf], [], [AC_LIBOBJ([util/asprintf])])
    AC_CHECK_FUNC([setenv], [], [AC_LIBOBJ([util/setenv])])
    AC_CHECK_FUNC([strlcat], [], [AC_LIBOBJ([util/strlcat])])
    AC_CHECK_FUNC([strlcpy], [], [AC_LIBOBJ([util/strlcpy])])

and apply the patch below to Automake so that it will accept those paths.

--- automake1.9-1.9.6/lib/Automake/FileUtils.pm.orig    2005-05-14 
13:21:06.000000000 -0700
+++ automake1.9-1.9.6/lib/Automake/FileUtils.pm 2006-03-29 20:46:43.000000000 
-0800
@@ -339,6 +339,16 @@
   my ($dirname, $file_name) = @_;
   return 0 unless -f "$dirname/$file_name";
 
+  # It's possible that the file name won't be a simple file name and
+  # instead will include a directory component.  In that case, we have
+  # to figure out what the real directory is.
+  if ($file_name =~ m%/%)
+    {
+      my $partial_dir;
+      ($partial_dir, $file_name) = ($file_name =~ m%^(.*)/([^/]*)%);
+      $dirname = "$dirname/$partial_dir";
+    }
+
   # The file appears to exist, however it might be a mirage if the
   # system is case insensitive.  Let's browse the directory and check
   # whether the file is really in.  We maintain a cache of directories

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]