* AC_MSG_CHECKING and AC_MSG_RESULT to print test results, on a single line,
whether or not the test succeeds. They obsolete AC_CHECKING and AC_VERBOSE.
* AC_SUBST_FILE, to insert one file into another.
-* AC_SUBST_DEFAULT, to copy a variable from the configure environment into
- Makefiles with a default fallback value.
** Changed macros:
* Many macros renamed, but old names are accepted for backward compatibility.
M4 environment variable to its path name.
)m4exit(2)])dnl
dnl
-define(AC_ACVERSION, 1.106)dnl
+define(AC_ACVERSION, 1.107)dnl
dnl This is defined by the --version option of the autoconf script.
ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
m4exit(0)])dnl
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
---enable/--with options recognized:$ac_help"
+--enable and --with options recognized:$ac_help"
changequote([, ])dnl
# Initialize some variables set by options.
AC_SUBST(prefix)dnl
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
+AC_SUBST(CFLAGS)dnl
+AC_SUBST(CXXFLAGS)dnl
+AC_SUBST(CPPFLAGS)dnl
+AC_SUBST(LDFLAGS)dnl
])dnl
dnl
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
divert(AC_DIVERSION_NORMAL)dnl
])])dnl
dnl
-dnl AC_SUBST_DEFAULT(VARIABLE [, DEFAULT-VALUE])
-AC_DEFUN(AC_SUBST_DEFAULT,
-[$1=${$1-"$2"}
-AC_SUBST($1)dnl
-])dnl
-dnl
dnl
dnl ### Printing messages
dnl
sed ${ac_max_here_lines}q conftest.vals >> ${CONFIG_STATUS}
echo 'CEOF
sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
mv conftest.out conftest.in
' >> ${CONFIG_STATUS}
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
mv conftest.tail conftest.vals
done
rm -f conftest.vals
ac_cv_prog_gcc=no
fi])dnl
AC_MSG_RESULT($ac_cv_prog_gcc)
-if test $ac_cv_prog_gcc = yes; then GCC=yes; else GCC= ; fi
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ test "${CFLAGS+set}" = set || CFLAGS='-g -O'
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS='-g'
+fi
])dnl
dnl
AC_DEFUN(AC_PROG_CXX,
else
ac_cv_prog_gxx=no
fi])dnl
-if test $ac_cv_prog_gxx = yes; then GXX=yes; else GXX= ; fi
+if test $ac_cv_prog_gxx = yes; then
+ GXX=yes
+ test "${CXXFLAGS+set}" = set || CXXFLAGS='-g -O'
+else
+ GXX=
+ test "${CXXFLAGS+set}" = set || CXXFLAGS='-g'
+fi
])dnl
dnl
AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$x_libraries"
- AC_HAVE_LIBRARY(ICE, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lICE"])
- AC_HAVE_LIBRARY(SM, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM"])
+ AC_CHECK_LIB(ICE, IceConnectionNumbers, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lICE"])
+ AC_CHECK_LIB(SM, SmcOpenConnection, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM"])
LDFLAGS="$ac_save_LDFLAGS"
# Check for system-dependent libraries X programs must link with.
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT.
# Not sure which flavor of 386 Unix this is, but it seems harmless to
# check for it.
- AC_HAVE_LIBRARY(nsl, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
+ AC_CHECK_LIB(nsl, main, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
# lieder@skyler.mavd.honeywell.com says without -lsocket,
# socket/setsockopt and other routines are undefined under SCO ODT 2.0.
@c @setchapternewpage odd
@c %**end of header
-@set EDITION 1.106
-@set VERSION 1.106
+@set EDITION 1.107
+@set VERSION 1.107
@set UPDATED August 1994
@iftex
@defmac AC_PROG_CC
@maindex PROG_CC
-If @code{gcc} is found, set @code{make} variable @code{CC} to
-@samp{gcc}, and set shell variable @code{GCC} to @samp{yes}. Otherwise
-set @code{GCC} to be empty.
+Determine a C compiler to use. If @code{CC} is not already set in the
+environment, check for @code{gcc}, and use @code{cc} if it's not found.
+Set @code{make} variable @code{CC} to the name of the compiler found.
+Set shell variable @code{GCC} to @samp{yes} if it found the GNU C
+compiler, empty otherwise, and if @code{make} variable @code{CFLAGS} was
+not already set, set it to @samp{-g -O} for the GNU C compiler or
+@samp{-g} for other compilers.
@end defmac
@defmac AC_PROG_CC_C_O
Determine a C++ compiler to use. Check if the environment variable
@var{CXX} or @var{CCC} (in that order) is set; if so, set @code{make}
variable @code{CXX} to its value. Otherwise search for a C++ compiler
-under likely names (@code{c++}, @code{g++}, @code{gcc}, and @code{CC}).
-If none of those checks succeed, as a last resort set @code{CXX} to
-@code{gcc}. Also set shell variable @code{GXX} to @samp{yes} if it
-found the GNU C++ compiler, empty otherwise.
+under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and
+@code{cxx}). If none of those checks succeed, as a last resort set
+@code{CXX} to @code{gcc}. Also set shell variable @code{GXX} to
+@samp{yes} if it found the GNU C++ compiler, empty otherwise, and if
+@code{make} variable @code{CXXFLAGS} was not already set, set it to
+@samp{-g -O} for the GNU C++ compiler or @samp{-g} for other compilers.
@end defmac
@defmac AC_PROG_CXXCPP
@example
@group
#if HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
+# include <sys/types.h>
+# include <unistd.h>
#endif
#ifdef _POSIX_VERSION
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
# define alloca __builtin_alloca
-#else /* not __GNUC__ */
+#else
# if HAVE_ALLOCA_H
# include <alloca.h>
-# else /* not HAVE_ALLOCA_H */
+# else
# ifdef _AIX
#pragma alloca
-# else /* not _AIX */
+# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
-# endif /* not defined(alloca) */
-# endif /* not _AIX */
-# endif /* not HAVE_ALLOCA_H */
-#endif /* not __GNUC__ */
+# endif
+# endif
+# endif
+#endif
@end group
@end example
@end defmac
@example
#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
+# include <sys/time.h>
+# include <time.h>
#else
-#include <time.h>
-#endif
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
#endif
@end example
@end defmac
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 uses @code{CPPFLAGS}, but not @code{CFLAGS},
-because -g, -O, etc. are not valid options to many C preprocessors.
+because @samp{-g}, @samp{-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{]})
@end example
@end defmac
-@defmac AC_SUBST_DEFAULT (@var{variable}, @var{default-value})
-@maindex SUBST_DEFAULT
-Like @code{AC_SUBST}, but if @var{variable} is not set in the
-environment when @code{configure} is run, give it the value
-@var{default-value}. @var{default-value} is evaluated in shell double
-quotes, so it may refer to other variables or even the output of a
-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
-
@defmac AC_SUBST_FILE (@var{variable})
@maindex SUBST_FILE
Substitute the contents of the file named by shell variable
@example
@group
#if STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
#endif
@end group
@end example
@end defvar
@defvar CFLAGS
-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.
+Debugging and optimization options for the C compiler. If it is not set
+in the environment when @code{configure} runs, the default value is set
+by @code{AC_PROG_CC} (empty if you don't). @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
+miscellaneous options for the C preprocessor and compiler. If it is not
+set in the environment when @code{configure} runs, the default value is
+empty. @code{configure} uses this variable when compiling or
preprocessing programs to test for C features.
@end defvar
@defvar CXXFLAGS
-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.
+Debugging and optimization options for the C++ compiler. If it is not
+set in the environment when @code{configure} runs, the default value is
+set by @code{AC_PROG_CXX} (empty if you don't). @code{configure} uses
+this variable when compiling programs to test for C++ features.
@end defvar
@defvar DEFS
@defvar LDFLAGS
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
+linker. If it is not set in the environment when @code{configure} runs,
+the default value is empty. @code{configure} uses this variable when
linking programs to test for C features.
@end defvar
@c @setchapternewpage odd
@c %**end of header
-@set EDITION 1.106
-@set VERSION 1.106
+@set EDITION 1.107
+@set VERSION 1.107
@set UPDATED August 1994
@iftex
@defmac AC_PROG_CC
@maindex PROG_CC
-If @code{gcc} is found, set @code{make} variable @code{CC} to
-@samp{gcc}, and set shell variable @code{GCC} to @samp{yes}. Otherwise
-set @code{GCC} to be empty.
+Determine a C compiler to use. If @code{CC} is not already set in the
+environment, check for @code{gcc}, and use @code{cc} if it's not found.
+Set @code{make} variable @code{CC} to the name of the compiler found.
+Set shell variable @code{GCC} to @samp{yes} if it found the GNU C
+compiler, empty otherwise, and if @code{make} variable @code{CFLAGS} was
+not already set, set it to @samp{-g -O} for the GNU C compiler or
+@samp{-g} for other compilers.
@end defmac
@defmac AC_PROG_CC_C_O
Determine a C++ compiler to use. Check if the environment variable
@var{CXX} or @var{CCC} (in that order) is set; if so, set @code{make}
variable @code{CXX} to its value. Otherwise search for a C++ compiler
-under likely names (@code{c++}, @code{g++}, @code{gcc}, and @code{CC}).
-If none of those checks succeed, as a last resort set @code{CXX} to
-@code{gcc}. Also set shell variable @code{GXX} to @samp{yes} if it
-found the GNU C++ compiler, empty otherwise.
+under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and
+@code{cxx}). If none of those checks succeed, as a last resort set
+@code{CXX} to @code{gcc}. Also set shell variable @code{GXX} to
+@samp{yes} if it found the GNU C++ compiler, empty otherwise, and if
+@code{make} variable @code{CXXFLAGS} was not already set, set it to
+@samp{-g -O} for the GNU C++ compiler or @samp{-g} for other compilers.
@end defmac
@defmac AC_PROG_CXXCPP
@example
@group
#if HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
+# include <sys/types.h>
+# include <unistd.h>
#endif
#ifdef _POSIX_VERSION
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
# define alloca __builtin_alloca
-#else /* not __GNUC__ */
+#else
# if HAVE_ALLOCA_H
# include <alloca.h>
-# else /* not HAVE_ALLOCA_H */
+# else
# ifdef _AIX
#pragma alloca
-# else /* not _AIX */
+# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
-# endif /* not defined(alloca) */
-# endif /* not _AIX */
-# endif /* not HAVE_ALLOCA_H */
-#endif /* not __GNUC__ */
+# endif
+# endif
+# endif
+#endif
@end group
@end example
@end defmac
@example
#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
+# include <sys/time.h>
+# include <time.h>
#else
-#include <time.h>
-#endif
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
#endif
@end example
@end defmac
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 uses @code{CPPFLAGS}, but not @code{CFLAGS},
-because -g, -O, etc. are not valid options to many C preprocessors.
+because @samp{-g}, @samp{-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{]})
@end example
@end defmac
-@defmac AC_SUBST_DEFAULT (@var{variable}, @var{default-value})
-@maindex SUBST_DEFAULT
-Like @code{AC_SUBST}, but if @var{variable} is not set in the
-environment when @code{configure} is run, give it the value
-@var{default-value}. @var{default-value} is evaluated in shell double
-quotes, so it may refer to other variables or even the output of a
-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
-
@defmac AC_SUBST_FILE (@var{variable})
@maindex SUBST_FILE
Substitute the contents of the file named by shell variable
@example
@group
#if STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
#endif
@end group
@end example
@end defvar
@defvar CFLAGS
-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.
+Debugging and optimization options for the C compiler. If it is not set
+in the environment when @code{configure} runs, the default value is set
+by @code{AC_PROG_CC} (empty if you don't). @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
+miscellaneous options for the C preprocessor and compiler. If it is not
+set in the environment when @code{configure} runs, the default value is
+empty. @code{configure} uses this variable when compiling or
preprocessing programs to test for C features.
@end defvar
@defvar CXXFLAGS
-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.
+Debugging and optimization options for the C++ compiler. If it is not
+set in the environment when @code{configure} runs, the default value is
+set by @code{AC_PROG_CXX} (empty if you don't). @code{configure} uses
+this variable when compiling programs to test for C++ features.
@end defvar
@defvar DEFS
@defvar LDFLAGS
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
+linker. If it is not set in the environment when @code{configure} runs,
+the default value is empty. @code{configure} uses this variable when
linking programs to test for C features.
@end defvar
M4 environment variable to its path name.
)m4exit(2)])dnl
dnl
-define(AC_ACVERSION, 1.106)dnl
+define(AC_ACVERSION, 1.107)dnl
dnl This is defined by the --version option of the autoconf script.
ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
m4exit(0)])dnl
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
---enable/--with options recognized:$ac_help"
+--enable and --with options recognized:$ac_help"
changequote([, ])dnl
# Initialize some variables set by options.
AC_SUBST(prefix)dnl
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
+AC_SUBST(CFLAGS)dnl
+AC_SUBST(CXXFLAGS)dnl
+AC_SUBST(CPPFLAGS)dnl
+AC_SUBST(LDFLAGS)dnl
])dnl
dnl
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
divert(AC_DIVERSION_NORMAL)dnl
])])dnl
dnl
-dnl AC_SUBST_DEFAULT(VARIABLE [, DEFAULT-VALUE])
-AC_DEFUN(AC_SUBST_DEFAULT,
-[$1=${$1-"$2"}
-AC_SUBST($1)dnl
-])dnl
-dnl
dnl
dnl ### Printing messages
dnl
sed ${ac_max_here_lines}q conftest.vals >> ${CONFIG_STATUS}
echo 'CEOF
sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
mv conftest.out conftest.in
' >> ${CONFIG_STATUS}
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
mv conftest.tail conftest.vals
done
rm -f conftest.vals
ac_cv_prog_gcc=no
fi])dnl
AC_MSG_RESULT($ac_cv_prog_gcc)
-if test $ac_cv_prog_gcc = yes; then GCC=yes; else GCC= ; fi
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ test "${CFLAGS+set}" = set || CFLAGS='-g -O'
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS='-g'
+fi
])dnl
dnl
AC_DEFUN(AC_PROG_CXX,
else
ac_cv_prog_gxx=no
fi])dnl
-if test $ac_cv_prog_gxx = yes; then GXX=yes; else GXX= ; fi
+if test $ac_cv_prog_gxx = yes; then
+ GXX=yes
+ test "${CXXFLAGS+set}" = set || CXXFLAGS='-g -O'
+else
+ GXX=
+ test "${CXXFLAGS+set}" = set || CXXFLAGS='-g'
+fi
])dnl
dnl
AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$x_libraries"
- AC_HAVE_LIBRARY(ICE, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lICE"])
- AC_HAVE_LIBRARY(SM, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM"])
+ AC_CHECK_LIB(ICE, IceConnectionNumbers, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lICE"])
+ AC_CHECK_LIB(SM, SmcOpenConnection, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM"])
LDFLAGS="$ac_save_LDFLAGS"
# Check for system-dependent libraries X programs must link with.
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT.
# Not sure which flavor of 386 Unix this is, but it seems harmless to
# check for it.
- AC_HAVE_LIBRARY(nsl, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
+ AC_CHECK_LIB(nsl, main, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
# lieder@skyler.mavd.honeywell.com says without -lsocket,
# socket/setsockopt and other routines are undefined under SCO ODT 2.0.