2004-08-31 17:27:00 +08:00
|
|
|
|
|
|
|
AC_INIT(fixincludes, [ ])
|
|
|
|
AC_CONFIG_SRCDIR(inclhack.def)
|
|
|
|
AC_CONFIG_AUX_DIR(..)
|
2008-09-07 05:50:14 +08:00
|
|
|
m4_sinclude(../libtool.m4)
|
2004-08-31 17:27:00 +08:00
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
AC_PROG_CC
|
2011-06-09 05:27:06 +08:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2008-09-07 03:57:26 +08:00
|
|
|
AC_PROG_SED
|
2004-08-31 17:27:00 +08:00
|
|
|
|
2005-07-16 22:17:51 +08:00
|
|
|
# Figure out what compiler warnings we can enable.
|
|
|
|
# See config/warnings.m4 for details.
|
|
|
|
|
|
|
|
ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
|
|
|
|
-Wmissing-prototypes -Wold-style-definition \
|
2006-05-17 08:31:31 +08:00
|
|
|
-Wmissing-format-attribute -Wno-overlength-strings])
|
2005-07-16 22:17:51 +08:00
|
|
|
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
|
|
|
|
|
|
|
|
# Only enable with --enable-werror-always until existing warnings are
|
|
|
|
# corrected.
|
|
|
|
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
|
|
|
|
|
2004-11-05 12:49:19 +08:00
|
|
|
# Determine the noncanonical target name, for directory use.
|
|
|
|
ACX_NONCANONICAL_TARGET
|
|
|
|
|
|
|
|
# Specify the local prefix
|
|
|
|
local_prefix=
|
|
|
|
AC_ARG_WITH(local-prefix,
|
|
|
|
[ --with-local-prefix=DIR specifies directory to put local include],
|
|
|
|
[case "${withval}" in
|
|
|
|
yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
|
|
|
|
no) ;;
|
|
|
|
*) local_prefix=$with_local_prefix ;;
|
|
|
|
esac])
|
|
|
|
|
|
|
|
# Default local prefix if it is empty
|
|
|
|
if test x$local_prefix = x; then
|
|
|
|
local_prefix=/usr/local
|
|
|
|
fi
|
|
|
|
|
2004-08-31 17:27:00 +08:00
|
|
|
# Choose one or two-process fix methodology. Systems that cannot handle
|
|
|
|
# bi-directional pipes must use the two process method.
|
|
|
|
#
|
2004-10-15 15:58:38 +08:00
|
|
|
AC_ARG_ENABLE([twoprocess],
|
|
|
|
[ --enable-twoprocess Use a separate process to apply the fixes],
|
2004-10-27 22:42:56 +08:00
|
|
|
[if test "x$enable_twoprocess" = xyes; then
|
2004-10-15 15:58:38 +08:00
|
|
|
TARGET=twoprocess
|
|
|
|
else
|
|
|
|
TARGET=oneprocess
|
|
|
|
fi],
|
|
|
|
[case $host in
|
2004-08-31 17:27:00 +08:00
|
|
|
i?86-*-msdosdjgpp* | \
|
2004-10-15 15:58:38 +08:00
|
|
|
i?86-*-mingw32* | \
|
2007-10-12 19:54:16 +08:00
|
|
|
x86_64-*-mingw32* | \
|
2012-04-24 17:24:55 +08:00
|
|
|
*-*-beos* | \
|
|
|
|
*-*-*vms*)
|
2004-08-31 17:27:00 +08:00
|
|
|
TARGET=twoprocess
|
|
|
|
;;
|
|
|
|
|
2004-10-15 15:58:38 +08:00
|
|
|
* )
|
2004-08-31 17:27:00 +08:00
|
|
|
TARGET=oneprocess
|
|
|
|
;;
|
2004-10-15 15:58:38 +08:00
|
|
|
esac])
|
|
|
|
AC_SUBST(TARGET)
|
2004-08-31 17:27:00 +08:00
|
|
|
|
2004-10-15 15:58:38 +08:00
|
|
|
if test $TARGET = twoprocess; then
|
|
|
|
AC_DEFINE(SEPARATE_FIX_PROC, 1,
|
|
|
|
[Define if testing and fixing are done by separate process])
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $host in
|
|
|
|
vax-dec-bsd* )
|
|
|
|
AC_DEFINE(exit, xexit, [Define to xexit if the host system does not support atexit])
|
|
|
|
AC_DEFINE(atexit, xatexit, [Define to xatexit if the host system does not support atexit])
|
2004-08-31 17:27:00 +08:00
|
|
|
;;
|
|
|
|
esac
|
2004-10-15 15:58:38 +08:00
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED([EXE_EXT], "$ac_exeext",
|
|
|
|
[Defined to the executable file extension on the host system])
|
2004-08-31 17:27:00 +08:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS([stddef.h stdlib.h strings.h unistd.h fcntl.h sys/file.h \
|
|
|
|
sys/stat.h])
|
configure.ac (fixincludes_UNLOCKED_FUNCS): New.
fixincludes:
* configure.ac (fixincludes_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for fixincludes_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.h.in: Regenerate.
gcc:
PR/17092
* configure.ac (gcc_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
libcpp:
* configure.ac (libcpp_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
From-SVN: r97986
2005-04-12 05:46:59 +08:00
|
|
|
define(fixincludes_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
|
|
|
|
ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
|
|
|
|
fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
|
|
|
|
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
|
|
|
|
putchar_unlocked putc_unlocked)
|
|
|
|
AC_CHECK_FUNCS(fixincludes_UNLOCKED_FUNCS)
|
2010-06-03 14:45:02 +08:00
|
|
|
AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, vasprintf])
|
|
|
|
AC_CHECK_DECLS(m4_split(m4_normalize(fixincludes_UNLOCKED_FUNCS)))
|
2004-08-31 17:27:00 +08:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
|
|
|
|
# Checks for library functions.
|
2012-05-30 03:28:57 +08:00
|
|
|
GCC_AC_FUNC_MMAP_BLACKLIST
|
2004-08-31 17:27:00 +08:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
|
|
|
AC_ARG_ENABLE(maintainer-mode,
|
|
|
|
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
|
|
|
(and sometimes confusing) to the casual installer],
|
|
|
|
USE_MAINTAINER_MODE=$enableval,
|
|
|
|
USE_MAINTAINER_MODE=no)
|
|
|
|
AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
|
|
|
if test "$USE_MAINTAINER_MODE" = yes; then
|
|
|
|
MAINT=
|
|
|
|
else
|
|
|
|
MAINT='#'
|
|
|
|
fi
|
|
|
|
AC_SUBST(MAINT)
|
2008-09-07 07:00:24 +08:00
|
|
|
AC_DEFINE_UNQUOTED([SED_PROGRAM], "${SED}",
|
2008-09-07 03:57:26 +08:00
|
|
|
[Defined to the best working sed program on the host system])
|
2004-08-31 17:27:00 +08:00
|
|
|
|
2017-01-17 17:38:48 +08:00
|
|
|
# Determine what GCC version number to use in filesystem paths.
|
|
|
|
GCC_BASE_VER
|
|
|
|
|
2004-08-31 17:27:00 +08:00
|
|
|
AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
|
2005-03-22 01:50:19 +08:00
|
|
|
AC_CONFIG_FILES(Makefile mkheaders.almost:mkheaders.in)
|
2004-08-31 17:27:00 +08:00
|
|
|
AC_OUTPUT
|