• Georgi Kodinov's avatar
    Bug #43614: make distcheck failure (ndb/Makefile is made, but not subdirs of ndb) · 60beb4c3
    Georgi Kodinov authored
          
    There are some recursive targets that automake generates which reference
    DIST_SUBDIRS.  It's critical, then, for such subdirs to exist even if they
    won't be built as part of SUBDIRS.
    
    During a VPATH build, it is the configure script which creates the subdirs
    (when it processes the AC_CONFIG_FILES() for each subdir's Makefile).  If
    autoconf doesn't create a subdir's Makefile, then the recursive make will fail
    when it is unable to cd into that subdir.
    
    This isn't a problem in non-VPATH builds, because the subdirs are all present
    in the source tarball.  So the problem only shows up during 'make distcheck',
    which does a VPATH build.
    
    The fix is to look, when configure is being created by autoconf, for any
    plugin subdirectories.  These are the dynamic subdirectories which need to be
    handled specially.  It's enough to tell autoconf to generate a Makefile for
    any Makefile.am found in the plugin directory - all plugin subdirectories
    using automake (i.e., listed in the plugin's DIST_SUBDIRS) will have a
    Makefile.am.
    
    This is done by calling 'find'.  This means that 'find' must be in the PATH on
    the host that is running autoconf.  'find' is NOT needed when calling
    configure, so it is not an additional dependency for the user.
    
    Finally, ha_ndbcluster.m4 had called AC_CONFIG_FILES() on all those subdir
    Makefiles, but only when the plugin was actually being built.  So it didn't
    work in the case that NDB was not being built.  All of those Makefiles have to
    be removed from this static list, since the plugin machinery is now adding
    them automatically.  autoconf fails if a file is duplicated in
    AC_CONFIG_FILES().
    60beb4c3
ha_ndbcluster.m4 10.2 KB