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

Re: [Nbd] [PATCH v2 1/6] build: Silence autogen.sh warnings



On Mon, Oct 17, 2016 at 03:23:35PM -0500, Eric Blake wrote:
> Starting from a fresh git checkout, running ./autogen.sh gives a
> couple of warnings on my Fedora 24 build tools, one from libtool:
> 
> libtoolize: Consider adding '-I support' to ACLOCAL_AMFLAGS in Makefile.am.
> 
> and one from automake:
> 
> tests/run/Makefile.am:4: warning: source file '$(top_srcdir)/cliserv.c' is in a subdirectory,
> tests/run/Makefile.am:4: but option 'subdir-objects' is disabled
> automake: warning: possible forward-incompatibility.
> automake: At least a source file is in a subdirectory, but the 'subdir-objects'
> automake: automake option hasn't been enabled.  For now, the corresponding output
> automake: object file(s) will be placed in the top-level directory.  However,
> automake: this behaviour will change in future Automake versions: they will
> automake: unconditionally cause object files to be placed in the same subdirectory
> automake: of the corresponding sources.
> automake: You are advised to start using 'subdir-objects' option throughout your
> automake: project, to avoid future incompatibilities.
> 
> Following the advice almost works, except that automake 1.15 still
> has a nasty bug (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928)
> where use of $(foo) in a _SOURCES variable coupled with subdir-objects
> creates a directory with a literal name $(foo) rather than the intended
> name.  But as long as we only care about $(srcdir) (or parent
> directories), the solution is to just not use $(srcdir) in _SOURCES,
> and instead open-code the traversal to the desired files.

The reason for using $(top_srcdir) is so that VPATH builds don't go
bollocks. Did you do a "make distcheck" with this?

Also, did you check that this doesn't break on older automake versions?
(not critical, but I just recently cherry-picked two commits from Josef
to allow building on CentOS 6, would be silly if we lose that again...)

> I also noticed that the build was already leaving behind an untracked
> manpage.log file, in addition to the new .dirstamp witness file created
> by our new use of subdir-objects.

I don't see any manpage.log files, but I guess that has to do with
different versions of docbook-sgml.

> Signed-off-by: Eric Blake <eblake@...696...>
> ---
>  .gitignore            | 2 ++
>  Makefile.am           | 1 +
>  configure.ac          | 2 +-
>  tests/run/Makefile.am | 2 +-
>  4 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/.gitignore b/.gitignore
> index b8163e0..b005b11 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,4 +1,5 @@
>  .deps
> +.dirstamp
>  Makefile
>  autom4te.cache
>  autoscan.log
> @@ -38,6 +39,7 @@ install-sh
>  configure
>  man/*.sh
>  man/*.sh.in
> +man/manpage.log
>  make-integrityhuge
>  nbd-trdump
>  missing
> diff --git a/Makefile.am b/Makefile.am
> index 32774e3..c1740d6 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1,3 +1,4 @@
> +ACLOCAL_AMFLAGS = -I support
>  SUBDIRS = . man doc tests systemd gznbd
>  bin_PROGRAMS = nbd-server nbd-trdump
>  sbin_PROGRAMS = @NBD_CLIENT_NAME@
> diff --git a/configure.ac b/configure.ac
> index 83e4f91..ce225a6 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -11,7 +11,7 @@ m4_define([serial_tests], [
>                awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
>    ])
>  ])
> -AM_INIT_AUTOMAKE(foreign dist-xz serial_tests)
> +AM_INIT_AUTOMAKE(foreign dist-xz serial_tests subdir-objects)
>  AM_MAINTAINER_MODE([enable])
>  AC_CONFIG_MACRO_DIR([support])
>  LT_INIT
> diff --git a/tests/run/Makefile.am b/tests/run/Makefile.am
> index c9cfa8f..b790c3f 100644
> --- a/tests/run/Makefile.am
> +++ b/tests/run/Makefile.am
> @@ -1,7 +1,7 @@
>  TESTS_ENVIRONMENT=$(srcdir)/simple_test
>  TESTS = cfg1 cfgmulti cfgnew cfgsize write flush integrity dirconfig list rowrite tree rotree unix integrityhuge
>  check_PROGRAMS = nbd-tester-client
> -nbd_tester_client_SOURCES = nbd-tester-client.c $(top_srcdir)/cliserv.h $(top_srcdir)/netdb-compat.h $(top_srcdir)/cliserv.c
> +nbd_tester_client_SOURCES = nbd-tester-client.c ../../cliserv.h ../../netdb-compat.h ../../cliserv.c
>  nbd_tester_client_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@
>  nbd_tester_client_CPPFLAGS = -I$(top_srcdir)
>  nbd_tester_client_LDADD = @GLIB_LIBS@
> -- 
> 2.7.4
> 
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most 
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Nbd-general mailing list
> Nbd-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nbd-general
> 

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12



Reply to: