Similarly, the $(mkinstallscripts) make variable is not defined anymore;
one should use $(MKDIR_P) instead.
+* The $(INCLUDES) variable is not anymore passed to the invocations of
+ compilers with a C-like preprocessing step (as are for example C, C++,
+ Objective C, preprocessed assembler ...). One should just use
+ $(AM_CPPFLAGS) instead, which has been supported and recommended for
+ a long time.
+
-----
Copyright (C) 2012 Free Software Foundation, Inc.
'flags' => ['CFLAGS', 'CPPFLAGS'],
'ccer' => 'CC',
'compiler' => 'COMPILE',
- 'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
+ 'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
'lder' => 'CCLD',
'ld' => '$(CC)',
'linker' => 'LINK',
'link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'CXX',
'flags' => ['CXXFLAGS', 'CPPFLAGS'],
- 'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
+ 'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
'ccer' => 'CXX',
'compiler' => 'CXXCOMPILE',
'compile_flag' => '-c',
'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'OBJC',
'flags' => ['OBJCFLAGS', 'CPPFLAGS'],
- 'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
+ 'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
'ccer' => 'OBJC',
'compiler' => 'OBJCCOMPILE',
'compile_flag' => '-c',
'link' => '$(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'OBJCXX',
'flags' => ['OBJCXXFLAGS', 'CPPFLAGS'],
- 'compile' => '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
+ 'compile' => '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
'ccer' => 'OBJCXX',
'compiler' => 'OBJCXXCOMPILE',
'compile_flag' => '-c',
'link' => '$(UPCLD) $(AM_UPCFLAGS) $(UPCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'UPC',
'flags' => ['UPCFLAGS', 'CPPFLAGS'],
- 'compile' => '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
+ 'compile' => '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
'ccer' => 'UPC',
'compiler' => 'UPCCOMPILE',
'compile_flag' => '-c',
'config_vars' => ['CCAS', 'CCASFLAGS'],
'flags' => ['CCASFLAGS'],
- # Users can set AM_CCASFLAGS to include DEFS, INCLUDES,
+ # Users can set AM_CCASFLAGS to include, say, DEFS,
# or anything else required. They can also set CCAS.
# Or simply use Preprocessed Assembler.
'compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
'autodep' => 'CCAS',
'flags' => ['CCASFLAGS', 'CPPFLAGS'],
- 'compile' => '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
+ 'compile' => '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
'ccer' => 'CPPAS',
'compiler' => 'CPPASCOMPILE',
'compile_flag' => '-c',
'flags' => ['FCFLAGS', 'CPPFLAGS'],
'ccer' => 'PPFC',
'compiler' => 'PPFCCOMPILE',
- 'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
+ 'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'FC',
# Preprocessed Fortran 77
#
# The current support for preprocessing Fortran 77 just involves
-# 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').
+# 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 for 'make'
+# Version 3.76 Beta" (specifically, from info file '(make)Catalogue
+# of Rules').
#
# A better approach would be to write an Autoconf test
# (i.e. AC_PROG_FPP) for a Fortran 77 preprocessor, because not all
'flags' => ['FFLAGS', 'CPPFLAGS'],
'ccer' => 'PPF77',
'compiler' => 'PPF77COMPILE',
- 'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
+ 'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'F77',
}
}
- # Catch some obsolete variables.
- msg_var ('obsolete', 'INCLUDES',
- "'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')")
- if var ('INCLUDES');
-
# 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. It is more fully documented elsewhere.
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{INCLUDES}, @code{CPPFLAGS}
-and @code{AM_CPPFLAGS} are also used.
+@code{DEFS}, @code{DEFAULT_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) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)@*
-$(AM_FFLAGS) $(FFLAGS)}
+@code{$(F77) -F $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)}
@item .r
@code{$(F77) -F $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)}
@code{$(F77) -c $(AM_FFLAGS) $(FFLAGS)}
@item .F
-@code{$(F77) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)@*
-$(AM_FFLAGS) $(FFLAGS)}
+@code{$(F77) -c $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)}
@item .r
@code{$(F77) -c $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)}
sc_no_brace_variable_expansions \
sc_rm_minus_f \
sc_no_for_variable_in_macro \
+sc_old_includes_vars \
sc_mkinstalldirs \
sc_pre_normal_post_install_uninstall \
sc_perl_no_undef \
exit 1; \
else :; fi
+## Older, deprecated, and now invalid aliases for $(AM_CPPFLAGS).
+sc_old_includes_vars:
+ @files="\
+ $(xtests) \
+ $(pms) \
+ $(ams) \
+ $(srcdir)/automake.in \
+ $(srcdir)/doc/*.texi \
+ "; \
+ if grep -E '\bINCLUDES\b' $$files; then \
+ echo '$$(INCLUDES) is deprecated, use $$(AM_CPPFLAGS) instead' >&2; \
+ exit 1; \
+ else :; fi
+
## The script and variable 'mkinstalldirs' are obsolete.
sc_mkinstalldirs:
@files="\
cat > Makefile.am << 'END'
if CHECK
-INCLUDES = abc
+AM_CPPFLAGS = abc
endif
-INCLUDES += def
+AM_CPPFLAGS += def
END
$ACLOCAL
# We expect the following diagnostic:
#
-# Makefile.am:4: cannot apply '+=' because 'INCLUDES' is not defined in
+# Makefile.am:4: cannot apply '+=' because 'AM_CPPFLAGS' is not defined in
# Makefile.am:4: the following conditions:
# Makefile.am:4: !CHECK
-# Makefile.am:4: either define 'INCLUDES' in these conditions, or use
+# Makefile.am:4: either define 'AM_CPPFLAGS' in these conditions, or use
# Makefile.am:4: '+=' in the same conditions as the definitions.
# Is !CHECK mentioned?
# Is there only one missing condition?
test `grep ': ' stderr | wc -l` = 1
-# By the way, Automake should suggest using AM_CPPFLAGS,
-# because INCLUDES is an obsolete name.
-grep AM_CPPFLAGS stderr
-
-# A way to suppress the obsolete warning is to use
-# -Wno-obsolete:
-echo 'AUTOMAKE_OPTIONS = -Wno-obsolete' >> Makefile.am
-AUTOMAKE_fails
-grep AM_CPPFLAGS stderr && Exit 1
-# !CHECK should still be mentioned.
-grep ':.*!CHECK$' stderr
-
:
cat >>configure.ac <<END
AC_CONFIG_FILES([sub/Makefile])
+AM_CONDITIONAL([COND_FALSE], [false])
AC_OUTPUT
END
# These two Makefile contain the same errors, but have different
# warnings disabled.
-cat >Makefile.am <<END
-AUTOMAKE_OPTIONS = -Wno-obsolete
-INCLUDES = -Ifoo
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = -Wno-unsupported
+if COND_FALSE
+AUTOMAKE_OPTIONS += no-dependencies
+endif
foo_SOURCES = unused
SUBDIRS = sub
END
-cat >sub/Makefile.am <<END
+cat > sub/Makefile.am << 'END'
AUTOMAKE_OPTIONS = -Wno-syntax
-INCLUDES = -Ifoo
+if COND_FALSE
+AUTOMAKE_OPTIONS += no-dependencies
+endif
foo_SOURCES = unused
END
$ACLOCAL
AUTOMAKE_fails
# The expected diagnostic is
-# Makefile.am:3: warning: variable 'foo_SOURCES' is defined but no program or
-# library has 'foo' as canonical name (possible typo)
-# sub/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS'
+# automake: warnings are treated as errors
+# Makefile.am:5: warning: variable 'foo_SOURCES' is defined but no program or
+# Makefile.am:5: library has 'foo' as canonical name (possible typo)
+# sub/Makefile.am:1: warning: 'AUTOMAKE_OPTIONS' cannot have conditional contents
grep '^Makefile.am:.*foo_SOURCES' stderr
-grep '^sub/Makefile.am:.*INCLUDES' stderr
+grep '^sub/Makefile.am:.*AUTOMAKE_OPTIONS' stderr
grep '^sub/Makefile.am:.*foo_SOURCES' stderr && Exit 1
-grep '^Makefile.am:.*INCLUDES' stderr && Exit 1
+grep '^Makefile.am:.*AUTOMAKE_OPTIONS' stderr && Exit 1
# Only three lines of warnings.
test `grep -v 'warnings are treated as errors' stderr | wc -l` = 3
-# On fast machines the autom4te.cache created during the above run of
-# $AUTOMAKE is likely to have the same time stamp as the configure.ac
-# created below; thus causing traces for the old configure.ac to be
-# used. We could do '$sleep', but it's faster to erase the
-# directory. (Erase autom4te*.cache, not autom4te.cache, because some
-# bogus installations of Autoconf use a versioned cache).
rm -rf autom4te*.cache
# If we add a global -Wnone, all warnings should disappear.
END
$ACLOCAL
$AUTOMAKE
+
+:
. ./defs || Exit 1
-echo AC_OUTPUT>>configure.ac
+echo AC_OUTPUT >> configure.ac
: > Makefile.am
./configure
$MAKE
-cat >Makefile.am <<END
+cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = -Werror
-INCLUDES = -Ifoo
foo_SOURCES = unused
END