Hi! Noob question. I have a Makefile.am that looks like this:
--8<---------------cut here---------------start------------->8--- pkglibdir = $(versiondir)$(libdir)/ganeti myexeclibdir = $(pkglibdir) bindir = $(versiondir)/$(BINDIR) sbindir = $(versiondir)$(SBINDIR) mandir = $(versionedsharedir)/root$(MANDIR) pythondir = $(versionedsharedir) pkgpythondir = $(versionedsharedir)/ganeti pkgpython_rpc_stubdir = $(versionedsharedir)/ganeti/rpc/stub gntpythondir = $(versionedsharedir) pkgpython_bindir = $(versionedsharedir) gnt_python_sbindir = $(versionedsharedir) tools_pythondir = $(versionedsharedir) --8<---------------cut here---------------end--------------->8--- (from https://github.com/ganeti/ganeti/blob/master/Makefile.am) It works fine. Great, even. Locally, I have patched it with a new configure flag that introduces a USE_VERSION_LINKS variable, and tried changing the code above to read: --8<---------------cut here---------------start------------->8--- if USE_VERSION_LINKS pkglibdir = $(versiondir)$(libdir)/ganeti myexeclibdir = $(pkglibdir) bindir = $(versiondir)/$(BINDIR) sbindir = $(versiondir)$(SBINDIR) mandir = $(versionedsharedir)/root$(MANDIR) pythondir = $(versionedsharedir) pkgpythondir = $(versionedsharedir)/ganeti pkgpython_rpc_stubdir = $(versionedsharedir)/ganeti/rpc/stub gntpythondir = $(versionedsharedir) pkgpython_bindir = $(versionedsharedir) gnt_python_sbindir = $(versionedsharedir) tools_pythondir = $(versionedsharedir) else myexeclibdir = $(pkglibdir) pkgpython_rpc_stubdir = $(pkgpythondir)/rpc/stub gntpythondir = $(sbindir) pkgpython_bindir = $(pkglibdir) gnt_python_sbindir = $(sbindir) tools_pythondir = $(pkglibdir) versionedsharedir = $(pkglibdir) versiondir = endif --8<---------------cut here---------------end--------------->8--- It works, but now 'autoreconf' is throwing warnings: --8<---------------cut here---------------start------------->8--- autoreconf: running: automake --add-missing --copy --force-missing Makefile.am:86: warning: pkglibdir was already defined in condition TRUE, which includes condition USE_VERSION_LINKS ... /gnu/store/1l38jl5mhkb1ypw922njxmnsb6w8zwaw-automake-1.16.2/share/automake-1.16/am/header-vars.am: ... 'pkglibdir' previously defined here Makefile.am:88: warning: bindir was already defined in condition TRUE, which includes condition USE_VERSION_LINKS ... configure.ac:12: ... 'bindir' previously defined here Makefile.am:89: warning: sbindir was already defined in condition TRUE, which includes condition USE_VERSION_LINKS ... configure.ac:12: ... 'sbindir' previously defined here Makefile.am:90: warning: mandir was already defined in condition TRUE, which includes condition USE_VERSION_LINKS ... configure.ac:12: ... 'mandir' previously defined here Makefile.am:91: warning: pythondir was already defined in condition TRUE, which includes condition USE_VERSION_LINKS ... configure.ac:905: ... 'pythondir' previously defined here Makefile.am:92: warning: pkgpythondir was already defined in condition TRUE, which includes condition USE_VERSION_LINKS ... configure.ac:905: ... 'pkgpythondir' previously defined here autoreconf: Leaving directory `.' --8<---------------cut here---------------end--------------->8--- What would be the "correct" way to deal with this?