[sheepdog] [PATCH 1/2] configure: shut up autotool warning "but option 'subdir-objects' is disabled"

Liu Yuan namei.unix at gmail.com
Fri Mar 6 04:40:19 CET 2015


On Thu, Mar 05, 2015 at 12:16:51PM -0500, Alexander Guy wrote:
> On Thu, Mar 05, 2015 at 04:20:08PM +0800, Liu Yuan wrote:
> > From: Liu Yuan <liuyuan at cmss.chinamobile.com>
> > 
> > Signed-off-by: Liu Yuan <liuyuan at cmss.chinamobile.com>
> > ---
> >  configure.ac | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 9f2e7f3..cece3d8 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -24,7 +24,7 @@ m4_define([git_version],
> >  
> >  AC_INIT([sheepdog], m4_default(git_version, sheepdog_version),
> >  	[sheepdog at lists.wpkg.org])
> > -AM_INIT_AUTOMAKE([-Wno-portability])
> > +AM_INIT_AUTOMAKE([-Wno-portability, subdir-objects])
> >  
> >  AC_CONFIG_SRCDIR([dog/dog.c])
> >  AC_CONFIG_HEADER([include/config.h])
> > -- 
> > 1.9.1
> 
> Hello Liu,
>     I had the same subdir-objects change in a local branch, but
> hadn't submitted it because I ran into a problem with broken dependency
> generation causing distclean to break.  This in turn breaks other things
> (e.g. make deb).
> 
> I haven't had time to go through and figure out the right fix, but
> maybe the correction will be clear to you.  Reordering targets might
> cover-up the issue, but there's a deeper problem with where automake
> thinks dependencies should live for the unit tests.
> 
> For example, on a freshly checked-out sheepdog tree:
> 
> ./autogen.sh && ./configure && make distclean
> 
> make[2]: Leaving directory '/home/alexander/sandbox/sheepdog/tests/unit/mock'
> Making distclean in dog
> make[2]: Entering directory '/home/alexander/sandbox/sheepdog/tests/unit/dog'
> Makefile:555: ../../../dog/.deps/common.Po: No such file or directory
> make[2]: *** No rule to make target '../../../dog/.deps/common.Po'.  Stop.
> make[2]: Leaving directory '/home/alexander/sandbox/sheepdog/tests/unit/dog'
> Makefile:342: recipe for target 'distclean-recursive' failed
> make[1]: *** [distclean-recursive] Error 1
> make[1]: Leaving directory '/home/alexander/sandbox/sheepdog/tests/unit'
> Makefile:452: recipe for target 'distclean-recursive' failed
> make: *** [distclean-recursive] Error 1
> 
> The depedencies are removed before the unit tests get distcleaned, which
> causes make to fail.
> 
> There's also another interesting symptom caused by the use of
> $(top_srcdir) in automake *_SOURCES, e.g. inside
> sheepdog/tests/unit/dog/Makefile.am:
> 
> test_common_SOURCES     = test_common.c mock_dog.c                      \
>                           $(top_srcdir)/dog/common.c
> 
> 
> ... when used with subdir-objects, it's causing automake to create
> dependencies under a literal '$(top_srcdir)' directory:
> 
> $ (cd sheepdog/tests/unit/ && find . -type d)
> .
> ./dog
> ./dog/$(top_srcdir)
> ./dog/$(top_srcdir)/dog
> ./dog/$(top_srcdir)/dog/.deps
> ./dog/.deps
> ./mock
> ./sheep
> ./sheep/$(top_srcdir)
> ./sheep/$(top_srcdir)/sheep
> ./sheep/$(top_srcdir)/sheep/.deps
> ./sheep/$(top_srcdir)/sheep/cluster
> ./sheep/$(top_srcdir)/sheep/cluster/.deps
> ./sheep/.deps
> 
> .. which is clearly not right.
> 

Hi Alex,

   Thanks for your detailed analysis, unfortunately I am no guru on automake and
its friends. Everytime I make the patch for configure.ac I need to google it
first.

  Does disable unittest will workaround the make fail you mentioned?

Thanks,
Yuan



More information about the sheepdog mailing list