Since INCLUDES and AM_CPPFLAGS can be both used at the same time in a
single project, and interact in a non-obvious way, switching away from
INCLUDES is, unfortunately, not simply a matter of doing a mindless
INCLUDES -> AM_CPPFLAGS substitution. In fact, the transition from a
"INCLUDES + CPPFLAGS" setup to a "AM_CPPFLAGS only" setup could cause
subtle bugs to sneak into the build systems of the client packages
doing the transition. Forcing this risk upon our users is definitely
not worth the small enhancement in consistency and cleanliness that
the removal of INCLUDES would give us.
For a more extended rationale and related discussions, see:
<http://lists.gnu.org/archive/html/automake/2013-02/msg00001.html>
This change basically reverts commit
v1.13-8-g880595d.
* automake.in: Re-introduce support for INCLUDES (its use will cause
warnings in the 'obsolete' category rather than fatal errors).
* doc/automake.texi: Adjust to re-add mention of INCLUDES.
* t/includes-no-more.sh: Rename ...
* t/includes-deprecation.sh: ... like this, and adjust.
* t/list-of-tests.mk: Update.
* t/warnopts.sh: Minor fixlet while at it.
Suggested-by: Peter Rosin <peda@lysator.liu.se>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
been removed. It should be safe to simply remove any definition
of it you have in your Makefiles.
- - Support for the long-obsolete $(INCLUDES) variable has been finally
- removed, in favour of the modern equivalent $(AM_CPPFLAGS).
-
* Removed support for obsolete platforms:
- Support for automatic dependency tracking with the SGI C/C++ compilers
qw{
$(DEFS)
$(DEFAULT_INCLUDES)
+ $(INCLUDES)
$(AM_CPPFLAGS)
$(CPPFLAGS)
};
'config_vars' => ['CCAS', 'CCASFLAGS'],
'flags' => ['CCASFLAGS'],
- # Users can set AM_CCASFLAGS to include $(DEFS) or
- # or anything else required. They can also set CCAS.
- # Or simply use Preprocessed Assembler.
+ # Users can set AM_CCASFLAGS to include $(DEFS),
+ # $(INCLUDES), or anything else required. They can also
+ # set CCAS. Or simply use Preprocessed Assembler.
'compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
'ccer' => 'CCAS',
'compiler' => 'CCASCOMPILE',
# Preprocessed Fortran 77
#
# The current support for preprocessing Fortran 77 just involves
-# passing "$(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)"
-# as additional flags to the Fortran 77 compiler, since this is
-# how GNU Make does it; see the "GNU Make Manual, Edition 0.51
+# passing "$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)
+# $(CPPFLAGS)" as additional flags to the Fortran 77 compiler, since
+# this is how GNU Make does it; see the "GNU Make Manual, Edition 0.51
# for 'make' Version 3.76 Beta" (specifically, from info file
# '(make)Catalogue of Rules').
#
}
# Catch some obsolete variables.
- reject_var 'INCLUDES', "'INCLUDES' is the obsolete name for " .
- "'AM_CPPFLAGS' (or '*_CPPFLAGS')";
- if (my $amflags = var ('ACLOCAL_AMFLAGS'))
+ if (my $ovar = var ('ACLOCAL_AMFLAGS'))
{
- msg_var 'obsolete', $amflags,
+ msg_var 'obsolete', $ovar,
"'ACLOCAL_AMFLAGS' is deprecated; use 'AC_CONFIG_MACRO_DIRS'"
. " in configure.ac instead";
}
+ if (my $ovar = var ('INCLUDES'))
+ {
+ msg_var 'obsolete', $ovar,
+ "'INCLUDES' is deprecated; you should use 'AM_CPPFLAGS'"
+ . " (or '*_CPPFLAGS') instead"
+ }
# Must do this after reading .am file.
define_variable ('subdir', $relative_dir, INTERNAL);
@code{AM_CPPFLAGS} is ignored in preference to a per-executable (or
per-library) @code{_CPPFLAGS} variable if it is defined.
+@item INCLUDES
+This does the same job as @code{AM_CPPFLAGS} (or any per-target
+@code{_CPPFLAGS} variable if it is used). It is an older name for the
+same functionality. This variable is deprecated; we suggest using
+@code{AM_CPPFLAGS} and per-target @code{_CPPFLAGS} instead.
+
@item AM_CFLAGS
This is the variable the @file{Makefile.am} author can use to pass
in additional C compiler flags. In some situations, this is
particular it must accept @option{-c} and @option{-o}. The values of
@code{CCASFLAGS} and @code{AM_CCASFLAGS} (or its per-target
definition) is passed to the compilation. For preprocessed files,
-@code{DEFS}, @code{DEFAULT_INCLUDES}, @code{CPPFLAGS} and
-@code{AM_CPPFLAGS} are also used.
+@code{DEFS}, @code{DEFAULT_INCLUDES}, @code{INCLUDES}, @code{CPPFLAGS}
+and @code{AM_CPPFLAGS} are also used.
The autoconf macro @code{AM_PROG_AS} will define @code{CCAS} and
@code{CCASFLAGS} for you (unless they are already set, it simply sets
@table @file
@item .F
-@code{$(F77) -F $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS)@*
+@code{$(F77) -F $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)@*
$(AM_FFLAGS) $(FFLAGS)}
@item .r
@code{$(F77) -c $(AM_FFLAGS) $(FFLAGS)}
@item .F
-@code{$(F77) -c $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS)@*
+@code{$(F77) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)@*
$(AM_FFLAGS) $(FFLAGS)}
@item .r
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Support for $(INCLUDES) has been removed.
+# Support for $(INCLUDES) is deprecated.
. test-init.sh
echo AC_PROG_CC >> configure.ac
+$ACLOCAL
+
cat > Makefile.am << 'END'
bin_PROGRAMS = foo
INCLUDES = -DFOO
END
-$ACLOCAL
-AUTOMAKE_fails -Wnone -Wno-error
-grep "^Makefile\\.am:2:.* 'INCLUDES'.* obsolete.* 'AM_CPPFLAGS'" stderr
+AUTOMAKE_fails -Wnone -Wobsolete
+grep "^Makefile\\.am:2:.* 'INCLUDES'.* deprecated.* 'AM_CPPFLAGS'" stderr
+AUTOMAKE_run -Wall -Wno-obsolete
+test ! -s stderr
+
+echo 'AC_SUBST([INCLUDES])' >> configure.ac
+sed '/^INCLUDES/d' Makefile.am > t && mv -f t Makefile.am
+
+AUTOMAKE_run -Wno-error
+grep "^configure\\.ac:5:.* 'INCLUDES'.* deprecated.* 'AM_CPPFLAGS'" stderr
:
t/help-upc.sh \
t/hfs.sh \
t/implicit.sh \
-t/includes-no-more.sh \
+t/includes-deprecation.sh \
t/init.sh \
t/init2.sh \
t/insh2.sh \
rm -rf autom4te*.cache
# If we add a global -Wnone, all warnings should disappear.
-cat >configure.ac <<END
-AC_INIT([warnopts], [1.0])
-AM_INIT_AUTOMAKE([-Wnone])
-AC_CONFIG_FILES([Makefile sub/Makefile])
-AC_OUTPUT
-END
+sed 's/^AM_INIT_AUTOMAKE/AM_INIT_AUTOMAKE([-Wnone])/' configure.ac > t
+mv -f t configure.ac
$ACLOCAL
$AUTOMAKE