]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
add CPPFLAGS
authorDavid MacKenzie <djm@djmnet.org>
Thu, 25 Aug 1994 19:29:53 +0000 (19:29 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Thu, 25 Aug 1994 19:29:53 +0000 (19:29 +0000)
NEWS
TODO
acgeneral.m4
autoconf.texi
doc/autoconf.texi
doc/install.texi
install.texi
lib/autoconf/general.m4

diff --git a/NEWS b/NEWS
index 0f9c858967ee7f36bb843e8adb59d48a3d27fd57..26fdb0c2ed99585df99703464a402bf0a47f74ec 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -37,8 +37,8 @@ Major changes in release 2.0:
 * AC_OUTPUT allows the optional environment variable CONFIG_STATUS to
   override the file name "config.status".
 * AC_OUTPUT and AC_CONFIG_HEADER allow you to override the input-file names.
-* AC_OUTPUT automatically substitutes the values of CFLAGS, CXXFLAGS, and
-  LDFLAGS from the environment, with default values.
+* AC_OUTPUT automatically substitutes the values of CFLAGS, CXXFLAGS,
+  CPPFLAGS, and LDFLAGS from the environment, with default values.
 * AC_PROG_INSTALL looks for install.sh in the directory specified by
   AC_CONFIG_AUXDIR, or srcdir or srcdir/.. or srcdir/../.. by default.
 * AC_DEFINE, AC_DEFINE_UNQUOTED, and AC_SUBST are more robust and smaller.
diff --git a/TODO b/TODO
index 6b899d149258e4e5ec478f7fe0613fed2c56656b..c074f6710c60c97cf658b0cb0a50a8e104317e25 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,8 +9,6 @@ Required for 2.0:
 ------------------------------------------------------------------------------
 
 * Try it on Emacs configure.in, and adapt that to use the new features.
-Add equivalents of CFLAGS and LDFLAGS for the system to set,
-and which CPP will also use?
 
 ------------------------------------------------------------------------------
 
index dbe4a8f75e8a8af2a3b2932ab6be30d3e450b7f2..bd9550632414e83f1389ac237dc250383e2dd04f 100644 (file)
@@ -480,6 +480,7 @@ AC_SUBST(exec_prefix)dnl
 AC_SUBST(DEFS)dnl
 AC_SUBST_DEFAULT(CFLAGS, -g)dnl
 AC_SUBST_DEFAULT(CXXFLAGS, -g)dnl
+AC_SUBST_DEFAULT(CPPFLAGS, )dnl
 AC_SUBST_DEFAULT(LDFLAGS, )dnl
 ])dnl
 dnl
@@ -915,8 +916,8 @@ AC_DEFUN(AC_LANG_C,
 [define([AC_LANG], [C])dnl
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='${CPP}'
-ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
+ac_cpp='${CPP} $CPPFLAGS'
+ac_compile='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
 ])dnl
 dnl
 dnl AC_LANG_CPLUSPLUS()
@@ -924,8 +925,8 @@ AC_DEFUN(AC_LANG_CPLUSPLUS,
 [define([AC_LANG], [CPLUSPLUS])dnl
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='${CXXCPP}'
-ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
+ac_cpp='${CXXCPP} $CPPFLAGS'
+ac_compile='${CXX-gcc} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
 ])dnl
 dnl
 dnl Push the current language on a stack.
index 1e486addcf17dc125b9a21196d043e91a9bb09dc..01d0f9fc2527e08f4681e2ee7823dc003cd447a4 100644 (file)
@@ -1970,8 +1970,8 @@ shell commands @var{action-if-false}.
 
 This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending
 on which language is current, @pxref{Language Choice}), if it hasn't
-been called already.  It does not use @code{CFLAGS}, because -g, -O,
-etc. are not valid options to many C preprocessors. 
+been called already.  It uses @code{CPPFLAGS}, but not @code{CFLAGS},
+because -g, -O, etc. are not valid options to many C preprocessors.
 @end defmac
 
 @defmac AC_TRY_LINK (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@@ -1981,8 +1981,8 @@ Create a test C program to see whether a function whose body consists of
 @code{#include} statements needed by the code in @var{function-body}.
 If the file compiles and links successfully, run shell commands
 @var{action-if-found}, otherwise run @var{action-if-not-found}.  This
-macro uses @code{CFLAGS} and @code{LDFLAGS} and @code{LIBS} when
-compiling.
+macro uses @code{CFLAGS} or @code{CXXFLAGS}, @code{CPPFLAGS},
+@code{LDFLAGS}, and @code{LIBS} when compiling.
 @end defmac
 
 @defmac AC_TRY_RUN (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]})
@@ -1991,8 +1991,9 @@ compiling.
 backquote substitutions are performed.  If it compiles and links
 successfully and returns an exit status of 0 when executed, run shell
 commands @var{action-if-true}.  Otherwise run shell commands
-@var{action-if-false}.  This macro uses @code{CFLAGS} and @code{LDFLAGS}
-and @code{LIBS} when compiling.
+@var{action-if-false}.  This macro uses @code{CFLAGS} or
+@code{CXXFLAGS}, @code{CPPFLAGS}, @code{LDFLAGS}, and @code{LIBS} when
+compiling.
 
 If the C compiler being used does not produce executables that run on
 the system where @code{configure} is being run, then the test program is
@@ -2191,7 +2192,8 @@ set @var{variable} to that value (verbatim), otherwise set it to 1.
 @var{value} should not contain literal newlines, and if you are not
 using @code{AC_CONFIG_HEADER} it should not contain any @samp{#}
 characters, as @code{make} tends to eat them.  To use a shell variable
-as the value, use @code{AC_DEFINE_UNQUOTED} instead.
+or a value containing the @code{m4} quote characters @samp{[} or
+@samp{]}, use @code{AC_DEFINE_UNQUOTED} instead.
 
 @code{AC_OUTPUT} substitutes the values defined by this macro as the
 variable @code{DEFS} in the file(s) that it generates (typically
@@ -2303,6 +2305,7 @@ command.  As an example, Autoconf automatically calls this macro like this:
 @example
 AC_SUBST_DEFAULT(CFLAGS, -g)dnl
 AC_SUBST_DEFAULT(CXXFLAGS, -g)dnl
+AC_SUBST_DEFAULT(CPPFLAGS, )dnl
 AC_SUBST_DEFAULT(LDFLAGS, )dnl
 @end example
 @end defmac
@@ -3228,19 +3231,25 @@ directory, this is the same as @code{srcdir}.
 @end defvar
 
 @defvar CFLAGS
-Debugging, optimization, header file search directory, and other
-miscellaneous options for the C compiler.  The default value is
-@samp{-g} if it is not set in the environment when @code{configure} runs.
-@code{configure} uses this variable when compiling programs to test
-for C features.
+Debugging and optimization options for the C compiler.  The default
+value is @samp{-g} if it is not set in the environment when
+@code{configure} runs.  @code{configure} uses this variable when
+compiling programs to test for C features.
+@end defvar
+
+@defvar CPPFLAGS
+Header file search directory (@samp{-I@var{dir}}) and any other
+miscellaneous options for the C preprocessor and compiler.  The default
+value is empty if it is not set in the environment when @code{configure}
+runs.  @code{configure} uses this variable when compiling or
+preprocessing programs to test for C features.
 @end defvar
 
 @defvar CXXFLAGS
-Debugging, optimization, header file search directory, and other
-miscellaneous options for the C++ compiler.  The default value is
-@samp{-g} if it is not set in the environment when @code{configure} runs.
-@code{configure} uses this variable when compiling programs to test
-for C++ features.
+Debugging and optimization options for the C++ compiler.  The default
+value is @samp{-g} if it is not set in the environment when
+@code{configure} runs.  @code{configure} uses this variable when
+compiling programs to test for C++ features.
 @end defvar
 
 @defvar DEFS
@@ -3250,11 +3259,10 @@ is called, @code{configure} replaces @samp{@@DEFS@@} with
 @end defvar
 
 @defvar LDFLAGS
-Stripping, library search directories, and other miscellaneous options
-for the linker.  The default value is empty if it is not set in the
-environment when @code{configure} runs.
-@code{configure} uses this variable when linking programs to test
-for C features.
+Stripping (@samp{-s}) and any other miscellaneous options for the
+linker.  The default value is empty if it is not set in the environment
+when @code{configure} runs.  @code{configure} uses this variable when
+linking programs to test for C features.
 @end defvar
 
 @defvar LIBS
index 1e486addcf17dc125b9a21196d043e91a9bb09dc..01d0f9fc2527e08f4681e2ee7823dc003cd447a4 100644 (file)
@@ -1970,8 +1970,8 @@ shell commands @var{action-if-false}.
 
 This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending
 on which language is current, @pxref{Language Choice}), if it hasn't
-been called already.  It does not use @code{CFLAGS}, because -g, -O,
-etc. are not valid options to many C preprocessors. 
+been called already.  It uses @code{CPPFLAGS}, but not @code{CFLAGS},
+because -g, -O, etc. are not valid options to many C preprocessors.
 @end defmac
 
 @defmac AC_TRY_LINK (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@@ -1981,8 +1981,8 @@ Create a test C program to see whether a function whose body consists of
 @code{#include} statements needed by the code in @var{function-body}.
 If the file compiles and links successfully, run shell commands
 @var{action-if-found}, otherwise run @var{action-if-not-found}.  This
-macro uses @code{CFLAGS} and @code{LDFLAGS} and @code{LIBS} when
-compiling.
+macro uses @code{CFLAGS} or @code{CXXFLAGS}, @code{CPPFLAGS},
+@code{LDFLAGS}, and @code{LIBS} when compiling.
 @end defmac
 
 @defmac AC_TRY_RUN (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]})
@@ -1991,8 +1991,9 @@ compiling.
 backquote substitutions are performed.  If it compiles and links
 successfully and returns an exit status of 0 when executed, run shell
 commands @var{action-if-true}.  Otherwise run shell commands
-@var{action-if-false}.  This macro uses @code{CFLAGS} and @code{LDFLAGS}
-and @code{LIBS} when compiling.
+@var{action-if-false}.  This macro uses @code{CFLAGS} or
+@code{CXXFLAGS}, @code{CPPFLAGS}, @code{LDFLAGS}, and @code{LIBS} when
+compiling.
 
 If the C compiler being used does not produce executables that run on
 the system where @code{configure} is being run, then the test program is
@@ -2191,7 +2192,8 @@ set @var{variable} to that value (verbatim), otherwise set it to 1.
 @var{value} should not contain literal newlines, and if you are not
 using @code{AC_CONFIG_HEADER} it should not contain any @samp{#}
 characters, as @code{make} tends to eat them.  To use a shell variable
-as the value, use @code{AC_DEFINE_UNQUOTED} instead.
+or a value containing the @code{m4} quote characters @samp{[} or
+@samp{]}, use @code{AC_DEFINE_UNQUOTED} instead.
 
 @code{AC_OUTPUT} substitutes the values defined by this macro as the
 variable @code{DEFS} in the file(s) that it generates (typically
@@ -2303,6 +2305,7 @@ command.  As an example, Autoconf automatically calls this macro like this:
 @example
 AC_SUBST_DEFAULT(CFLAGS, -g)dnl
 AC_SUBST_DEFAULT(CXXFLAGS, -g)dnl
+AC_SUBST_DEFAULT(CPPFLAGS, )dnl
 AC_SUBST_DEFAULT(LDFLAGS, )dnl
 @end example
 @end defmac
@@ -3228,19 +3231,25 @@ directory, this is the same as @code{srcdir}.
 @end defvar
 
 @defvar CFLAGS
-Debugging, optimization, header file search directory, and other
-miscellaneous options for the C compiler.  The default value is
-@samp{-g} if it is not set in the environment when @code{configure} runs.
-@code{configure} uses this variable when compiling programs to test
-for C features.
+Debugging and optimization options for the C compiler.  The default
+value is @samp{-g} if it is not set in the environment when
+@code{configure} runs.  @code{configure} uses this variable when
+compiling programs to test for C features.
+@end defvar
+
+@defvar CPPFLAGS
+Header file search directory (@samp{-I@var{dir}}) and any other
+miscellaneous options for the C preprocessor and compiler.  The default
+value is empty if it is not set in the environment when @code{configure}
+runs.  @code{configure} uses this variable when compiling or
+preprocessing programs to test for C features.
 @end defvar
 
 @defvar CXXFLAGS
-Debugging, optimization, header file search directory, and other
-miscellaneous options for the C++ compiler.  The default value is
-@samp{-g} if it is not set in the environment when @code{configure} runs.
-@code{configure} uses this variable when compiling programs to test
-for C++ features.
+Debugging and optimization options for the C++ compiler.  The default
+value is @samp{-g} if it is not set in the environment when
+@code{configure} runs.  @code{configure} uses this variable when
+compiling programs to test for C++ features.
 @end defvar
 
 @defvar DEFS
@@ -3250,11 +3259,10 @@ is called, @code{configure} replaces @samp{@@DEFS@@} with
 @end defvar
 
 @defvar LDFLAGS
-Stripping, library search directories, and other miscellaneous options
-for the linker.  The default value is empty if it is not set in the
-environment when @code{configure} runs.
-@code{configure} uses this variable when linking programs to test
-for C features.
+Stripping (@samp{-s}) and any other miscellaneous options for the
+linker.  The default value is empty if it is not set in the environment
+when @code{configure} runs.  @code{configure} uses this variable when
+linking programs to test for C features.
 @end defvar
 
 @defvar LIBS
index 3621783adb52805c6b26378ff66d9d18cba66764..d2a2a6d26e8f9243f2250e5a47f9a239795a5f3b 100644 (file)
@@ -66,13 +66,13 @@ the @code{configure} script does not know about.  You can give
 environment.  Using a Bourne-compatible shell, you can do that on the
 command line like this:
 @example
-CC=c89 CFLAGS=-O2 LDFLAGS=-s LIBS=-lposix ./configure
+CC=c89 CFLAGS=-O2 CPPFLAGS=-I/usr/local/include LDFLAGS=-s LIBS=-lposix ./configure
 @end example
 
 @noindent
 Or on systems that have the @code{env} program, you can do it like this:
 @example
-env CC=c89 CFLAGS=-O2 LDFLAGS=-s LIBS=-lposix ./configure
+env CC=c89 CFLAGS=-O2 CPPFLAGS=-I/usr/local/include LDFLAGS=-s LIBS=-lposix ./configure
 @end example
 
 @node Build Directory
index 3621783adb52805c6b26378ff66d9d18cba66764..d2a2a6d26e8f9243f2250e5a47f9a239795a5f3b 100644 (file)
@@ -66,13 +66,13 @@ the @code{configure} script does not know about.  You can give
 environment.  Using a Bourne-compatible shell, you can do that on the
 command line like this:
 @example
-CC=c89 CFLAGS=-O2 LDFLAGS=-s LIBS=-lposix ./configure
+CC=c89 CFLAGS=-O2 CPPFLAGS=-I/usr/local/include LDFLAGS=-s LIBS=-lposix ./configure
 @end example
 
 @noindent
 Or on systems that have the @code{env} program, you can do it like this:
 @example
-env CC=c89 CFLAGS=-O2 LDFLAGS=-s LIBS=-lposix ./configure
+env CC=c89 CFLAGS=-O2 CPPFLAGS=-I/usr/local/include LDFLAGS=-s LIBS=-lposix ./configure
 @end example
 
 @node Build Directory
index dbe4a8f75e8a8af2a3b2932ab6be30d3e450b7f2..bd9550632414e83f1389ac237dc250383e2dd04f 100644 (file)
@@ -480,6 +480,7 @@ AC_SUBST(exec_prefix)dnl
 AC_SUBST(DEFS)dnl
 AC_SUBST_DEFAULT(CFLAGS, -g)dnl
 AC_SUBST_DEFAULT(CXXFLAGS, -g)dnl
+AC_SUBST_DEFAULT(CPPFLAGS, )dnl
 AC_SUBST_DEFAULT(LDFLAGS, )dnl
 ])dnl
 dnl
@@ -915,8 +916,8 @@ AC_DEFUN(AC_LANG_C,
 [define([AC_LANG], [C])dnl
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='${CPP}'
-ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
+ac_cpp='${CPP} $CPPFLAGS'
+ac_compile='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
 ])dnl
 dnl
 dnl AC_LANG_CPLUSPLUS()
@@ -924,8 +925,8 @@ AC_DEFUN(AC_LANG_CPLUSPLUS,
 [define([AC_LANG], [CPLUSPLUS])dnl
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='${CXXCPP}'
-ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
+ac_cpp='${CXXCPP} $CPPFLAGS'
+ac_compile='${CXX-gcc} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
 ])dnl
 dnl
 dnl Push the current language on a stack.