首页 > 代码库 > automake (>=1.14) error: but option ‘subdir-objects’ is disabled

automake (>=1.14) error: but option ‘subdir-objects’ is disabled

What steps will reproduce the problem?

1. With automake >=1.14, ./autogen.sh fails


This is due to a change in the way automake sets subdir-objects as the default: See <a href="https://github.com/sugarlabs/automake/blob/master/PLANS/subdir-objects.txt" rel="nofollow">https://github.com/sugarlabs/automake/blob/master/PLANS/subdir-objects.txt</a>


======================

automake: warnings are treated as errors

third_party/Makefile.am:81: warning: source file ‘$(googletest)/src/gtest.cc‘ is in a subdirectory,

third_party/Makefile.am:81: 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.

===============


Updating configure.ac to replace AM_INIT_AUTOMAKE(-Wall -Werror) with AM_INIT_AUTOMAKE(-Wall -Werror subdir-objects) resolves the autogen.sh problem, however it leads to a build problem. "Makefile:771: gtest-1.6.0/src/.deps/gtest-death-test.Plo: No such file or directory", etc... Examining the two versions of third_party/Makefile shows that indeed a Makefile change occurs. "include ./$(DEPDIR)/gtest-death-test.Plo" is replaced by "include $(googletest)/src/$(DEPDIR)/gtest-death-test.Plo".


So it would seem that gtest‘s location is no longer acceptable to automake.


automake (>=1.14) error: but option ‘subdir-objects’ is disabled