[Top][All Lists]

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

AC_LIBOBJ(subdir/file) doesn't work with non-recursive automake

From: Russ Allbery
Subject: AC_LIBOBJ(subdir/file) doesn't work with non-recursive automake
Date: Sat, 22 Apr 2006 19:05:11 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.18 (linux)

I originally submitted this as a Debian bug, but it's more relevant here.

I'm using Automake with a package that has its source in various
subdirectories but builds the whole package with a single non-recursive
Makefile, as mentioned in the Automake manual under Directories /
Alternative.  Everything works except that, after checking for a deficient
snprintf, I call AC_LIBOBJ([util/snprintf]).  This results in the
following error from Automake: required file `./util/snprintf.c' not found

even though the file exists.

The problem is in the dir_has_case_matching_file routine in
Automake/, which assumes that the file that it's passed is a
simple filename, or alternately is in require_file_internal in automake
itself, which doesn't detect this case.  A quick inspection of the former
routine reveals that it will never work if passed a filename like
util/snprintf.c (and a $dir of ., which is what happens in this case).

The attached patch works around this and shouldn't have any negative side
effects.  It may not be as clean as upstream wants, since it supports a
partial path as part of the filename, but the alternative of modifying
require_file_internal looked slightly more complex.

Let me know, though, if you'd rather have a patch for automake.

An even better solution would be for Automake to pay attention to
AC_CONFIG_LIBOBJ_DIR and look for AC_LIBOBJ files there.  As near as I can
tell, Automake currently ignores that setting.  I think this fix is
correct and should be used regardless of whether that bug is also fixed,

Russ Allbery (address@hidden)             <>

Attachment: automake-patch
Description: Text document

reply via email to

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