Commit 71b5d516 by Paolo Bonzini

Made fixincludes a toplevel build module.

toplevel:
2004-08-31  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.def (build_modules): Add fixincludes.
	(dependencies): Make gcc depend on fixincludes.
	* configure.in (build_tools): Add fixincludes.
	(build_configdirs): Always include build_libs.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

contrib:
2004-08-04  Paolo Bonzini  <bonzini@gnu.org>

	* gcc_update: Add fixincludes.

fixincludes:
2004-08-31  Paolo Bonzini  <bonzini@gnu.org>

	* .cvsignore: New.
	* Makefile.in: From gcc/fixinc/Makefile.in, making it fully
	autoconfiscated.
	* configure.ac: New.
	* config.h.in: Generate.
	* configure: Generate.
	* aclocal.m4: New.
	* fixlib.h: Remove inclusions of gcc files.
	* system.h: New.

	Other files copied from gcc/fixinc.

gcc:
2004-08-31  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in (build_subdir): New substitution.
	(fixinc.sh): Simplify heavily since fixincludes is already built.
	(stmp-fixinc): Depend on specs.ready.
	(install-mkheaders): Use new location of fixincludes.
	(clean): Do not descend into fixinc.
	(FORBUILD): Replace with ../$(build_subdir).
	* configure.ac (build_subdir): Substitute.
	(FORBUILD): Do not set.
	(all_outputs): Remove fixinc/Makefile.
	(default commands): Do not create links in fixinc.
	* mkfixinc.sh: New, from fixinc/mkfixinc.sh without
	the fixincludes configuration steps and substituting
	@FIXINCL@ in fixinc.in.
	* fixinc.in: New, from fixinc/fixincl.sh.

	* fixinc/*: Removed.

From-SVN: r86824
parent f7b0fb68
2004-08-26 Paolo Bonzini <bonzini@gnu.org>
2004-08-31 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (build_modules): Add fixincludes.
(dependencies): Make gcc depend on fixincludes.
* configure.in (build_tools): Add fixincludes.
(build_configdirs): Always include build_libs.
* Makefile.in: Regenerate.
* configure: Regenerate.
2004-08-30 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (bootstrap stages): Add 'lean' parameter.
* Makefile.tpl (configure-stageN-*, all-stageN-*): Turned into
......
......@@ -30,6 +30,8 @@ build_modules= { module= byacc; };
build_modules= { module= flex; };
build_modules= { module= m4; };
build_modules= { module= texinfo; };
build_modules= { module= fixincludes;
extra_configure_args='--target=$(target)'; };
host_modules= { module= ash; };
host_modules= { module= autoconf; };
......@@ -232,6 +234,7 @@ dependencies = { module=all-build-flex; on=all-build-byacc; };
dependencies = { module=all-build-flex; on=all-build-m4; };
dependencies = { module=all-build-libiberty; on=all-build-texinfo; };
dependencies = { module=all-build-m4; on=all-build-texinfo; };
dependencies = { module=all-build-fixincludes; on=all-build-libiberty; };
// Host modules specific to gcc.
dependencies = { module=configure-gcc; on=configure-intl; };
......@@ -244,6 +247,8 @@ dependencies = { module=all-gcc; on=all-build-texinfo; };
dependencies = { module=all-gcc; on=all-build-bison; };
dependencies = { module=all-gcc; on=all-build-byacc; };
dependencies = { module=all-gcc; on=all-build-flex; };
dependencies = { module=all-gcc; on=all-build-libiberty; };
dependencies = { module=all-gcc; on=all-build-fixincludes; };
dependencies = { module=all-gcc; on=all-binutils; };
dependencies = { module=all-gcc; on=all-gas; };
dependencies = { module=all-gcc; on=all-ld; };
......
......@@ -746,7 +746,8 @@ all-build: \
maybe-all-build-byacc \
maybe-all-build-flex \
maybe-all-build-m4 \
maybe-all-build-texinfo
maybe-all-build-texinfo \
maybe-all-build-fixincludes
.PHONY: all-host
all-host: \
maybe-all-ash \
......@@ -2454,6 +2455,71 @@ all-build-texinfo: configure-build-texinfo
$(MAKE) $(TARGET-build-texinfo))
@endif build-texinfo
.PHONY: configure-build-fixincludes maybe-configure-build-fixincludes
maybe-configure-build-fixincludes:
@if build-fixincludes
maybe-configure-build-fixincludes: configure-build-fixincludes
configure-build-fixincludes:
@test ! -f $(BUILD_SUBDIR)/fixincludes/Makefile || exit 0; \
$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/fixincludes ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
echo Configuring in $(BUILD_SUBDIR)/fixincludes; \
cd "$(BUILD_SUBDIR)/fixincludes" || exit 1; \
case $(srcdir) in \
/* | [A-Za-z]:[\\/]*) \
topdir=$(srcdir) ;; \
*) \
case "$(BUILD_SUBDIR)" in \
.) topdir="../$(srcdir)" ;; \
*) topdir="../../$(srcdir)" ;; \
esac ;; \
esac; \
if [ "$(srcdir)" = "." ] ; then \
if [ "$(BUILD_SUBDIR)" != "." ] ; then \
if $(SHELL) $$s/symlink-tree $${topdir}/fixincludes "no-such-file" ; then \
if [ -f Makefile ]; then \
if $(MAKE) distclean; then \
true; \
else \
exit 1; \
fi; \
else \
true; \
fi; \
else \
exit 1; \
fi; \
else \
true; \
fi; \
srcdiroption="--srcdir=."; \
libsrcdir="."; \
else \
srcdiroption="--srcdir=$${topdir}/fixincludes"; \
libsrcdir="$$s/fixincludes"; \
fi; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(BUILD_CONFIGARGS) $${srcdiroption} \
--with-build-subdir="$(BUILD_SUBDIR)" \
|| exit 1
@endif build-fixincludes
.PHONY: all-build-fixincludes maybe-all-build-fixincludes
maybe-all-build-fixincludes:
@if build-fixincludes
TARGET-build-fixincludes=all
maybe-all-build-fixincludes: all-build-fixincludes
all-build-fixincludes: configure-build-fixincludes
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/fixincludes && \
$(MAKE) $(TARGET-build-fixincludes))
@endif build-fixincludes
# --------------------------------------
# Modules which run on the host machine
......@@ -32087,6 +32153,7 @@ all-build-flex: maybe-all-build-byacc
all-build-flex: maybe-all-build-m4
all-build-libiberty: maybe-all-build-texinfo
all-build-m4: maybe-all-build-texinfo
all-build-fixincludes: maybe-all-build-libiberty
configure-gcc: maybe-configure-intl
configure-stage1-gcc: maybe-configure-stage1-intl
......@@ -32171,6 +32238,24 @@ all-stage4-gcc: maybe-all-build-flex
all-stageprofile-gcc: maybe-all-build-flex
all-stagefeedback-gcc: maybe-all-build-flex
all-prebootstrap: maybe-all-build-flex
all-gcc: maybe-all-build-libiberty
all-stage1-gcc: maybe-all-build-libiberty
all-stage2-gcc: maybe-all-build-libiberty
all-stage3-gcc: maybe-all-build-libiberty
all-stage4-gcc: maybe-all-build-libiberty
all-stageprofile-gcc: maybe-all-build-libiberty
all-stagefeedback-gcc: maybe-all-build-libiberty
all-prebootstrap: maybe-all-build-libiberty
all-gcc: maybe-all-build-fixincludes
all-stage1-gcc: maybe-all-build-fixincludes
all-stage2-gcc: maybe-all-build-fixincludes
all-stage3-gcc: maybe-all-build-fixincludes
all-stage4-gcc: maybe-all-build-fixincludes
all-stageprofile-gcc: maybe-all-build-fixincludes
all-stagefeedback-gcc: maybe-all-build-fixincludes
all-prebootstrap: maybe-all-build-fixincludes
all-gcc: maybe-all-binutils
all-stage1-gcc: maybe-all-stage1-binutils
......
......@@ -132,7 +132,7 @@ fi
build_libs="build-libiberty"
# these tools are built for the build environment
build_tools="build-texinfo build-byacc build-flex build-bison build-m4"
build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fixincludes"
# these libraries are used by various programs built for the host environment
#
......@@ -183,13 +183,7 @@ target_tools="target-examples target-groff target-gperf target-rda"
## ${target_configdirs} is directories we build using the target tools.
configdirs=`echo ${host_libs} ${host_tools}`
target_configdirs=`echo ${target_libraries} ${target_tools}`
# Only make build libraries if build != host.
if test ${host_alias} != ${build_alias} ; then
build_configdirs=`echo ${build_libs} ${build_tools}`
else
build_configdirs=`echo ${build_tools}`
fi
build_configdirs=`echo ${build_libs} ${build_tools}`
################################################################################
......
2004-08-04 Paolo Bonzini <bonzini@gnu.org>
* gcc_update: Add fixincludes.
2004-08-26 Matthias Klose <doko@debian.org>
* texi2pod.pl: keep references of the form @ref{...}, print them bold.
......@@ -16,7 +20,7 @@
* gcc_update (self): libjava/configure.in -> configure.ac. Automake
update done.
2004-08-04 Paolo Bonzini <gcc@gcc.gnu.org>
2004-08-04 Paolo Bonzini <bonzini@gnu.org>
* gcc_update: libjava/configure.ac -> configure.in. Automake
1.4 does not handle configure.ac properly.
......
......@@ -56,6 +56,9 @@ self=$0
# colon is stripped from the output.
files_and_dependencies () {
sed -e 's/ *#.*//' -e '/^$/d' -e 's/://' <<\EOF
# fixincludes
fixincludes/configure: fixincludes/configure.ac fixincludes/aclocal.m4
fixincludes/config.h.in: fixincludes/configure.ac fixincludes/aclocal.m4
# intl library
intl/plural.c: intl/plural.y
intl/configure: intl/configure.ac intl/aclocal.m4
......
autom4te.cache
2004-08-31 Paolo Bonzini <bonzini@gnu.org>
* .cvsignore: New.
* Makefile.in: From gcc/fixinc/Makefile.in, making it fully
autoconfiscated.
* configure.ac: New.
* config.h.in: Generate.
* configure: Generate.
* aclocal.m4: New.
* fixlib.h: Remove inclusions of gcc files.
* system.h: New.
Other files copied from gcc/fixinc.
# Makefile for GCC fixincludes.
# Makefile for fixincludes.
#
# Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
#This file is part of GCC.
#This file is part of fixincludes.
#GCC is free software; you can redistribute it and/or modify
#fixincludes is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.
#GCC is distributed in the hope that it will be useful,
#fixincludes is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with GCC; see the file COPYING. If not, write to
#along with fixincludes; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.
# The makefile built from this file lives in the fixinc subdirectory.
# Its purpose is to build the any-platforms fixinc.sh script.
SHELL=@SHELL@
# Some versions of `touch' (such as the version on Solaris 2.8)
......@@ -29,13 +26,15 @@ SHELL=@SHELL@
# in the kernel. So, we use `echo' instead.
STAMP = echo timestamp >
FL_LIST = $(CFLAGS) $(CPPFLAGS)
FIXINC_DEFS = -DIN_GCC -DHAVE_CONFIG_H $(FL_LIST) $(INCLUDES)
CC = @CC@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include
FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
# Directory where sources are, from where we are.
srcdir = @srcdir@
VPATH = $(srcdir)
subdir = fixinc
# End of variables for you to override.
......@@ -43,15 +42,8 @@ default : all
# Now figure out from those variables how to compile and link.
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order.
#
INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. \
-I$(srcdir)/../config -I$(srcdir)/../../include
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(FIXINC_DEFS) $<
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(FIXINC_CFLAGS) $<
# The only suffixes we want for implicit rules are .c and .o.
.SUFFIXES:
......@@ -65,34 +57,35 @@ INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. \
##
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
LIBERTY = ../../libiberty/libiberty.a
LIBIBERTY=../libiberty/libiberty.a
ALLOBJ = fixincl.o fixtests.o fixfixes.o server.o procopen.o \
fixlib.o ../build-errors.o
fixlib.o
TESTOBJ = fixincl.o fixlib.o fixtests.o
FIXOBJ = fixfixes.o fixlib.o
HDR = server.h fixlib.h
FI = fixincl@build_exeext@
AF = applyfix@build_exeext@
FI = fixincl@EXEEXT@
AF = applyfix@EXEEXT@
all : $(TARGETS)
all : @TARGET@
gen : $(srcdir)/fixincl.x
oneprocess : full-stamp
twoprocess : test-stamp $(AF)
full-stamp : $(ALLOBJ) $(LIBERTY)
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBERTY)
full-stamp : $(ALLOBJ) $(LIBIBERTY)
$(CC) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBIBERTY)
$(STAMP) $@
test-stamp : $(TESTOBJ) $(LIBERTY)
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBERTY)
test-stamp : $(TESTOBJ) $(LIBIBERTY)
$(CC) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBIBERTY)
$(STAMP) $@
$(AF): $(FIXOBJ) $(LIBERTY)
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBERTY)
$(AF): $(FIXOBJ) $(LIBIBERTY)
$(CC) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBIBERTY)
$(ALLOBJ) : $(HDR)
fixincl.o : fixincl.c $(srcdir)/fixincl.x
......@@ -111,21 +104,26 @@ clean:
maintainer-clean : clean
rm -f $(srcdir)/fixincl.x
# Build the executable and copy up into gcc dir.
# We still copy the script because we still have alternative scripts.
#
install-bin : $(TARGETS)
./fixincl -v < /dev/null
@if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; else : ; fi
@cp $(srcdir)/fixincl.sh ../fixinc.sh
chmod 755 ../fixinc.sh
Makefile: Makefile.in ../config.status
cd .. \
&& $(SHELL) ./config.status $(subdir)/Makefile
check : $(TARGETS)
Makefile: $(srcdir)/Makefile.in config.status
$(SHELL) ./config.status Makefile
config.h: stamp-h
stamp-h: $(srcdir)/config.h.in config.status
$(SHELL) ./config.status config.h
config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac
autoconf
$(srcdir)/config.h.in: @MAINT@ $(srcdir)/configure.ac
autoheader
$(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../gcc/aclocal.m4
cp $(srcdir)/../gcc/aclocal.m4 .
check : all
autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
$(SHELL) ./check.sh $(srcdir)/tests/base
@rm -f ./check.sh
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the declaration of `abort', and to 0 if you don't.
*/
#undef HAVE_DECL_ABORT
/* Define to 1 if you have the declaration of `errno', and to 0 if you don't.
*/
#undef HAVE_DECL_ERRNO
/* Define to 1 if you have the declaration of `fprintf_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FPRINTF_UNLOCKED
/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FPUTC_UNLOCKED
/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FPUTS_UNLOCKED
/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FWRITE_UNLOCKED
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_PUTC_UNLOCKED
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fprintf_unlocked' function. */
#undef HAVE_FPRINTF_UNLOCKED
/* Define to 1 if you have the `fputc_unlocked' function. */
#undef HAVE_FPUTC_UNLOCKED
/* Define to 1 if you have the `fputs_unlocked' function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define to 1 if you have the `fwrite_unlocked' function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if mmap with MAP_ANON(YMOUS) works. */
#undef HAVE_MMAP_ANON
/* Define if mmap of /dev/zero works. */
#undef HAVE_MMAP_DEV_ZERO
/* Define if read-only mmap of a plain file works. */
#undef HAVE_MMAP_FILE
/* Define to 1 if you have the `putc_unlocked' function. */
#undef HAVE_PUTC_UNLOCKED
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define if testing and fixing are done by separate process */
#undef SEPARATE_FIX_PROC
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to xatexit if the host system does not support atexit */
#undef atexit
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to xexit if the host system does not support atexit */
#undef exit
This source diff could not be displayed because it is too large. You can view the blob instead.
AC_PREREQ(2.59)
AC_INIT(fixincludes, [ ])
AC_CONFIG_SRCDIR(inclhack.def)
AC_CONFIG_AUX_DIR(..)
AC_CANONICAL_SYSTEM
AC_PROG_CC
# Choose one or two-process fix methodology. Systems that cannot handle
# bi-directional pipes must use the two process method.
#
case $host in
i?86-*-msdosdjgpp* | \
*-*-beos* )
TARGET=twoprocess
AC_DEFINE(SEPARATE_FIX_PROC, 1, [Define if testing and fixing are done by separate process])
;;
vax-dec-bsd* )
TARGET=oneprocess
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])
;;
* )
TARGET=oneprocess
;;
esac
AC_SUBST(TARGET)
# 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])
AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \
fwrite_unlocked fprintf_unlocked)
AC_CHECK_DECLS([abort, errno, putc_unlocked, fputc_unlocked,
fputs_unlocked, fwrite_unlocked, fprintf_unlocked])
# 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])
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
......@@ -28,8 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include <signal.h>
#include "xregex.h"
......
/* Get common system includes and various definitions and declarations based
on autoconf macros.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of libcpp (aka cpplib).
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#ifndef FIXINC_SYSTEM_H
#define FIXINC_SYSTEM_H
/* We must include stdarg.h before stdio.h. */
#include <stdarg.h>
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#include <stdio.h>
/* Define a generic NULL if one hasn't already been defined. */
#ifndef NULL
#define NULL 0
#endif
/* fixincludes is not a multi-threaded application and therefore we
do not have to use the locking functions. In fact, using the locking
functions can cause the compiler to be significantly slower under
I/O bound conditions (such as -g -O0 on very large source files).
HAVE_DECL_PUTC_UNLOCKED actually indicates whether or not the stdio
code is multi-thread safe by default. If it is set to 0, then do
not worry about using the _unlocked functions.
fputs_unlocked, fwrite_unlocked, and fprintf_unlocked are
extensions and need to be prototyped by hand (since we do not
define _GNU_SOURCE). */
#if defined HAVE_DECL_PUTC_UNLOCKED && HAVE_DECL_PUTC_UNLOCKED
# ifdef HAVE_PUTC_UNLOCKED
# undef putc
# define putc(C, Stream) putc_unlocked (C, Stream)
# endif
# ifdef HAVE_FPUTC_UNLOCKED
# undef fputc
# define fputc(C, Stream) fputc_unlocked (C, Stream)
# endif
# ifdef HAVE_FPUTS_UNLOCKED
# undef fputs
# define fputs(String, Stream) fputs_unlocked (String, Stream)
# if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
extern int fputs_unlocked (const char *, FILE *);
# endif
# endif
# ifdef HAVE_FWRITE_UNLOCKED
# undef fwrite
# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
extern int fwrite_unlocked (const void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FPRINTF_UNLOCKED
# undef fprintf
/* We can't use a function-like macro here because we don't know if
we have varargs macros. */
# define fprintf fprintf_unlocked
# if defined (HAVE_DECL_FPRINTF_UNLOCKED) && !HAVE_DECL_FPRINTF_UNLOCKED
extern int fprintf_unlocked (FILE *, const char *, ...);
# endif
# endif
#endif
/* ??? Glibc's fwrite/fread_unlocked macros cause
"warning: signed and unsigned type in conditional expression". */
#undef fread_unlocked
#undef fwrite_unlocked
#include <sys/types.h>
#include <errno.h>
#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
extern int errno;
#endif
/* Some of glibc's string inlines cause warnings. Plus we'd rather
rely on (and therefore test) GCC's string builtins. */
#define __NO_STRING_INLINES
#ifdef HAVE_STRING_H
# include <string.h>
#else
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#else
# ifdef HAVE_SYS_FILE_H
# include <sys/file.h>
# endif
#endif
/* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they
are defined to 0 then we must provide the relevant declaration
here. These checks will be in the undefined state while configure
is running so be careful to test "defined (HAVE_DECL_*)". */
#if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT
extern void abort (void);
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
/* Test if something is a normal file. */
#ifndef S_ISREG
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
/* Filename handling macros. */
#include "filenames.h"
/* Get libiberty declarations. */
#include "libiberty.h"
#include "safe-ctype.h"
#endif /* ! FIXINC_SYSTEM_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment