2004-08-31 11:27:00 +02:00
|
|
|
AC_PREREQ(2.59)
|
|
|
|
|
|
|
|
AC_INIT(fixincludes, [ ])
|
|
|
|
AC_CONFIG_SRCDIR(inclhack.def)
|
|
|
|
AC_CONFIG_AUX_DIR(..)
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
AC_PROG_CC
|
|
|
|
|
2004-11-05 05:49:19 +01: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 11:27:00 +02:00
|
|
|
# Choose one or two-process fix methodology. Systems that cannot handle
|
|
|
|
# bi-directional pipes must use the two process method.
|
|
|
|
#
|
2004-10-15 09:58:38 +02:00
|
|
|
AC_ARG_ENABLE([twoprocess],
|
|
|
|
[ --enable-twoprocess Use a separate process to apply the fixes],
|
2004-10-27 16:42:56 +02:00
|
|
|
[if test "x$enable_twoprocess" = xyes; then
|
2004-10-15 09:58:38 +02:00
|
|
|
TARGET=twoprocess
|
|
|
|
else
|
|
|
|
TARGET=oneprocess
|
|
|
|
fi],
|
|
|
|
[case $host in
|
2004-08-31 11:27:00 +02:00
|
|
|
i?86-*-msdosdjgpp* | \
|
2004-10-15 09:58:38 +02:00
|
|
|
i?86-*-mingw32* | \
|
2004-08-31 11:27:00 +02:00
|
|
|
*-*-beos* )
|
|
|
|
TARGET=twoprocess
|
|
|
|
;;
|
|
|
|
|
2004-10-15 09:58:38 +02:00
|
|
|
* )
|
2004-08-31 11:27:00 +02:00
|
|
|
TARGET=oneprocess
|
|
|
|
;;
|
2004-10-15 09:58:38 +02:00
|
|
|
esac])
|
|
|
|
AC_SUBST(TARGET)
|
2004-08-31 11:27:00 +02:00
|
|
|
|
2004-10-15 09:58:38 +02: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 11:27:00 +02:00
|
|
|
;;
|
|
|
|
esac
|
2004-10-15 09:58:38 +02:00
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED([EXE_EXT], "$ac_exeext",
|
|
|
|
[Defined to the executable file extension on the host system])
|
2004-08-31 11:27:00 +02: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-11 23:46:59 +02: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)
|
|
|
|
AC_CHECK_DECLS(m4_split(m4_normalize(abort errno fixincludes_UNLOCKED_FUNCS)))
|
2004-08-31 11:27:00 +02:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
gcc_AC_FUNC_MMAP_BLACKLIST
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
|
2005-03-21 18:50:19 +01:00
|
|
|
AC_CONFIG_FILES(Makefile mkheaders.almost:mkheaders.in)
|
2004-08-31 11:27:00 +02:00
|
|
|
AC_OUTPUT
|