From a45f25ece30e4101ae77c90d2270d253ea9a82ec Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 20 Jan 2013 11:01:01 -0500 Subject: Rename the make.h file to makeint.h for internal use only. --- ChangeLog | 5 + Makefile.am | 2 +- Makefile.ami | 44 ++-- SMakefile.template | 2 +- amiga.c | 2 +- ar.c | 2 +- arscan.c | 2 +- commands.c | 2 +- config.h-vms.template | 2 +- default.c | 2 +- dir.c | 2 +- expand.c | 2 +- file.c | 2 +- function.c | 4 +- getloadavg.c | 2 +- guile.c | 2 +- hash.c | 2 +- implicit.c | 2 +- job.c | 4 +- load.c | 2 +- main.c | 2 +- maintMakefile | 4 +- make.h | 642 ----------------------------------------------- make_msvc_net2003.vcproj | 2 +- makeint.h | 642 +++++++++++++++++++++++++++++++++++++++++++++++ misc.c | 2 +- read.c | 2 +- remake.c | 2 +- remote-cstms.c | 2 +- remote-stub.c | 2 +- rule.c | 2 +- signame.c | 2 +- strcache.c | 2 +- variable.c | 2 +- version.c | 2 +- vmsfunctions.c | 2 +- vpath.c | 4 +- w32/pathstuff.c | 2 +- w32/subproc/w32err.c | 2 +- 39 files changed, 708 insertions(+), 703 deletions(-) delete mode 100644 make.h create mode 100644 makeint.h diff --git a/ChangeLog b/ChangeLog index 48d4451..92302a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-20 Paul Smith + + * make.h: Rename to makeint.h. + * Many: Use the new name makeint.h. + 2013-01-19 Paul Smith * doc/make.texi (load Directive): Update to discuss location of diff --git a/Makefile.am b/Makefile.am index c5ea81f..5507750 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,7 +50,7 @@ endif EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c -noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \ +noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \ debug.h getopt.h gettext.h hash.h make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \ diff --git a/Makefile.ami b/Makefile.ami index 3a0313d..1dc98c3 100644 --- a/Makefile.ami +++ b/Makefile.ami @@ -134,7 +134,7 @@ srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \ $(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \ $(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \ $(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \ - $(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \ + $(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \ $(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in @@ -273,36 +273,36 @@ $(objs): config.h # Automatically generated dependencies will be put at the end of the file. # Automatically generated dependencies. -commands.o: commands.c make.h dep.h filedef.h variable.h job.h \ +commands.o: commands.c makeint.h dep.h filedef.h variable.h job.h \ commands.h -job.o: job.c make.h job.h filedef.h commands.h variable.h -dir.o: dir.c make.h -file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h -misc.o: misc.c make.h dep.h -main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \ +job.o: job.c makeint.h job.h filedef.h commands.h variable.h +dir.o: dir.c makeint.h +file.o: file.c makeint.h dep.h filedef.h job.h commands.h variable.h +misc.o: misc.c makeint.h dep.h +main.o: main.c makeint.h dep.h filedef.h variable.h job.h commands.h \ getopt.h -guile.o: guile.c make.h dep.h debug.h variable.h gmk-default.h -read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \ +guile.o: guile.c makeint.h dep.h debug.h variable.h gmk-default.h +read.o: read.c makeint.h dep.h filedef.h job.h commands.h variable.h \ glob/glob.h -remake.o: remake.c make.h filedef.h job.h commands.h dep.h -rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \ +remake.o: remake.c makeint.h filedef.h job.h commands.h dep.h +rule.o: rule.c makeint.h dep.h filedef.h job.h commands.h variable.h \ rule.h -implicit.o: implicit.c make.h rule.h dep.h filedef.h -default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \ +implicit.o: implicit.c makeint.h rule.h dep.h filedef.h +default.o: default.c makeint.h rule.h dep.h filedef.h job.h commands.h \ variable.h -variable.o: variable.c make.h dep.h filedef.h job.h commands.h \ +variable.o: variable.c makeint.h dep.h filedef.h job.h commands.h \ variable.h -expand.o: expand.c make.h filedef.h job.h commands.h variable.h -function.o: function.c make.h filedef.h variable.h dep.h job.h \ +expand.o: expand.c makeint.h filedef.h job.h commands.h variable.h +function.o: function.c makeint.h filedef.h variable.h dep.h job.h \ commands.h amiga.h -vpath.o: vpath.c make.h filedef.h variable.h -strcache.o: strcache.c make.h hash.h +vpath.o: vpath.c makeint.h filedef.h variable.h +strcache.o: strcache.c makeint.h hash.h version.o: version.c -ar.o: ar.c make.h filedef.h dep.h -arscan.o: arscan.c make.h +ar.o: ar.c makeint.h filedef.h dep.h +arscan.o: arscan.c makeint.h signame.o: signame.c signame.h -remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h +remote-stub.o: remote-stub.c makeint.h filedef.h job.h commands.h getopt.o: getopt.c getopt1.o : getopt1.c getopt.h getloadavg.o: getloadavg.c -amiga.o: amiga.c make.h variable.h amiga.h +amiga.o: amiga.c makeint.h variable.h amiga.h diff --git a/SMakefile.template b/SMakefile.template index ea737a4..15c5374 100644 --- a/SMakefile.template +++ b/SMakefile.template @@ -140,7 +140,7 @@ srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \ $(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \ $(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \ $(srcdir)commands.h $(srcdir)dep.h $(srcdir)file.h \ - $(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \ + $(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \ $(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in diff --git a/amiga.c b/amiga.c index 5732209..360d9f8 100644 --- a/amiga.c +++ b/amiga.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "variable.h" #include "amiga.h" #include diff --git a/ar.c b/ar.c index c57ed97..8eb4e83 100644 --- a/ar.c +++ b/ar.c @@ -15,7 +15,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #ifndef NO_ARCHIVES diff --git a/arscan.c b/arscan.c index 4fcf060..51c83b5 100644 --- a/arscan.c +++ b/arscan.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #ifdef HAVE_FCNTL_H #include diff --git a/commands.c b/commands.c index 5e02ee7..698816f 100644 --- a/commands.c +++ b/commands.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "dep.h" #include "filedef.h" #include "variable.h" diff --git a/config.h-vms.template b/config.h-vms.template index 1956cea..e5e623c 100644 --- a/config.h-vms.template +++ b/config.h-vms.template @@ -424,7 +424,7 @@ this program. If not, see . */ /* Define if using alloca.c. */ /* #undef C_ALLOCA */ -/* maybe this should be placed into make.h */ +/* maybe this should be placed into makeint.h */ #if defined(__VAX) && defined(__DECC) #define alloca(n) __ALLOCA(n) #endif diff --git a/default.c b/default.c index 2771809..9f02dd4 100644 --- a/default.c +++ b/default.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "filedef.h" #include "variable.h" #include "rule.h" diff --git a/dir.c b/dir.c index 7ab164f..69eeb48 100644 --- a/dir.c +++ b/dir.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "hash.h" #ifdef HAVE_DIRENT_H diff --git a/expand.c b/expand.c index f3b3164..cce3bcd 100644 --- a/expand.c +++ b/expand.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include diff --git a/file.c b/file.c index 896f7e2..b36edcb 100644 --- a/file.c +++ b/file.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include diff --git a/function.c b/function.c index 325d930..d1b00cc 100644 --- a/function.c +++ b/function.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "filedef.h" #include "variable.h" #include "dep.h" @@ -736,7 +736,7 @@ check_numeric (const char *s, const char *msg) strip_whitespace (&s, &end); for (; s <= end; ++s) - if (!ISDIGIT (*s)) /* ISDIGIT only evals its arg once: see make.h. */ + if (!ISDIGIT (*s)) /* ISDIGIT only evals its arg once: see makeint.h. */ break; if (s <= end || end - beg < 0) diff --git a/getloadavg.c b/getloadavg.c index d8f2acd..dfc2e4a 100644 --- a/getloadavg.c +++ b/getloadavg.c @@ -985,7 +985,7 @@ getloadavg (double loadavg[], int nelem) #endif /* ! HAVE_GETLOADAVG */ #ifdef TEST -#include "make.h" +#include "makeint.h" int main (int argc, char **argv) diff --git a/guile.c b/guile.c index 9c9d958..5a652d9 100644 --- a/guile.c +++ b/guile.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "debug.h" #include "dep.h" #include "variable.h" diff --git a/hash.c b/hash.c index e04b1bb..d1c2fac 100644 --- a/hash.c +++ b/hash.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "hash.h" #define CALLOC(t, n) ((t *) calloc (sizeof (t), (n))) diff --git a/implicit.c b/implicit.c index 060a80c..fce9c89 100644 --- a/implicit.c +++ b/implicit.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "filedef.h" #include "rule.h" #include "dep.h" diff --git a/job.c b/job.c index 970a2fc..aa8748f 100644 --- a/job.c +++ b/job.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include @@ -245,7 +245,7 @@ unsigned int jobserver_tokens = 0; #ifdef WINDOWS32 /* - * The macro which references this function is defined in make.h. + * The macro which references this function is defined in makeint.h. */ int w32_kill(pid_t pid, int sig) diff --git a/load.c b/load.c index 26432b7..3e06982 100644 --- a/load.c +++ b/load.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #if MAKE_LOAD diff --git a/main.c b/main.c index 54b2061..d06825e 100644 --- a/main.c +++ b/main.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "dep.h" #include "filedef.h" #include "variable.h" diff --git a/maintMakefile b/maintMakefile index a4fb2f1..bca38ce 100644 --- a/maintMakefile +++ b/maintMakefile @@ -203,11 +203,11 @@ changelog-check: fi # Verify that all source files using _() are listed in po/POTFILES.in. -# Ignore make.h; it defines _(). +# Ignore makeint.h; it defines _(). po-check: if test -f po/POTFILES.in; then \ grep '^[^#]' po/POTFILES.in | sort > $@-1; \ - $(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "make.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \ + $(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "makeint.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \ diff -u $@-1 $@-2 || exit 1; \ rm -f $@-1 $@-2; \ fi diff --git a/make.h b/make.h deleted file mode 100644 index 7bde58e..0000000 --- a/make.h +++ /dev/null @@ -1,642 +0,0 @@ -/* Miscellaneous global declarations and portability cruft for GNU Make. -Copyright (C) 1988-2012 Free Software Foundation, Inc. -This file is part of GNU Make. - -GNU Make 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 3 of the License, or (at your option) any later -version. - -GNU Make 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 -this program. If not, see . */ - -/* We use instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because make.h was found in $srcdir). */ -#include -#undef HAVE_CONFIG_H -#define HAVE_CONFIG_H 1 - -/* Specify we want GNU source code. This must be defined before any - system headers are included. */ - -#define _GNU_SOURCE 1 - -/* AIX requires this to be the first thing in the file. */ -#if HAVE_ALLOCA_H -# include -#else -# ifdef _AIX - #pragma alloca -# else -# if !defined(__GNUC__) && !defined(WINDOWS32) -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -/* Disable assert() unless we're a maintainer. - Some asserts are compute-intensive. */ -#ifndef MAKE_MAINTAINER_MODE -# define NDEBUG 1 -#endif - - -#ifdef CRAY -/* This must happen before #include so - that the declaration therein is changed. */ -# define signal bsdsignal -#endif - -/* If we're compiling for the dmalloc debugger, turn off string inlining. */ -#if defined(HAVE_DMALLOC_H) && defined(__GNUC__) -# define __NO_STRING_INLINES -#endif - -#include -#include -#include -#include -#include - -#ifdef HAVE_SYS_TIMEB_H -/* SCO 3.2 "devsys 4.2" has a prototype for 'ftime' in that bombs - unless has been included first. */ -# include -#endif -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include - -#ifndef errno -extern int errno; -#endif - -#ifndef isblank -# define isblank(c) ((c) == ' ' || (c) == '\t') -#endif - -#ifdef HAVE_UNISTD_H -# include -/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get - POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */ -# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS) -# define POSIX 1 -# endif -#endif - -/* Some systems define _POSIX_VERSION but are not really POSIX.1. */ -#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386))) -# undef POSIX -#endif - -#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE) -# define POSIX 1 -#endif - -#ifndef RETSIGTYPE -# define RETSIGTYPE void -#endif - -#ifndef sigmask -# define sigmask(sig) (1 << ((sig) - 1)) -#endif - -#ifndef HAVE_SA_RESTART -# define SA_RESTART 0 -#endif - -#ifdef HAVE_LIMITS_H -# include -#endif -#ifdef HAVE_SYS_PARAM_H -# include -#endif - -#ifndef PATH_MAX -# ifndef POSIX -# define PATH_MAX MAXPATHLEN -# endif -#endif -#ifndef MAXPATHLEN -# define MAXPATHLEN 1024 -#endif - -#ifdef PATH_MAX -# define GET_PATH_MAX PATH_MAX -# define PATH_VAR(var) char var[PATH_MAX] -#else -# define NEED_GET_PATH_MAX 1 -# define GET_PATH_MAX (get_path_max ()) -# define PATH_VAR(var) char *var = alloca (GET_PATH_MAX) -unsigned int get_path_max (void); -#endif - -#ifndef CHAR_BIT -# define CHAR_BIT 8 -#endif - -#ifndef USHRT_MAX -# define USHRT_MAX 65535 -#endif - -/* Nonzero if the integer type T is signed. - Use <= to avoid GCC warnings about always-false expressions. */ -#define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0) - -/* The minimum and maximum values for the integer type T. - Use ~ (t) 0, not -1, for portability to 1's complement hosts. */ -#define INTEGER_TYPE_MINIMUM(t) \ - (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) -#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) - -#ifndef CHAR_MAX -# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char) -#endif - -#ifdef STAT_MACROS_BROKEN -# ifdef S_ISREG -# undef S_ISREG -# endif -# ifdef S_ISDIR -# undef S_ISDIR -# endif -#endif /* STAT_MACROS_BROKEN. */ - -#ifndef S_ISREG -# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) -#endif -#ifndef S_ISDIR -# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif - -#ifdef VMS -# include -# include -# include -# include -/* Needed to use alloca on VMS. */ -# include -#endif - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ -# define __attribute__(x) -# endif -/* The __-protected variants of 'format' and 'printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif -#endif -#define UNUSED __attribute__ ((unused)) - -#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) -# include -# include -# define ANSI_STRING 1 -#else /* No standard headers. */ -# ifdef HAVE_STRING_H -# include -# define ANSI_STRING 1 -# else -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -# ifdef HAVE_STDLIB_H -# include -# else -void *malloc (int); -void *realloc (void *, int); -void free (void *); - -void abort (void) __attribute__ ((noreturn)); -void exit (int) __attribute__ ((noreturn)); -# endif /* HAVE_STDLIB_H. */ - -#endif /* Standard headers. */ - -/* These should be in stdlib.h. Make sure we have them. */ -#ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -#endif -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -#ifndef ANSI_STRING - -/* SCO Xenix has a buggy macro definition in . */ -#undef strerror -#if !defined(__DECC) -char *strerror (int errnum); -#endif - -#endif /* !ANSI_STRING. */ -#undef ANSI_STRING - -#if HAVE_INTTYPES_H -# include -#endif -#if HAVE_STDINT_H -# include -#endif -#define FILE_TIMESTAMP uintmax_t - -#if !defined(HAVE_STRSIGNAL) -char *strsignal (int signum); -#endif - -/* ISDIGIT offers the following features: - - Its arg may be any int or unsigned int; it need not be an unsigned char. - - It's guaranteed to evaluate its argument exactly once. - NOTE! Make relies on this behavior, don't change it! - - It's typically faster. - POSIX 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that - only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless - it's important to use the locale's definition of 'digit' even when the - host does not conform to POSIX. */ -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) - -/* Test if two strings are equal. Is this worthwhile? Should be profiled. */ -#define streq(a, b) \ - ((a) == (b) || \ - (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) - -/* Test if two strings are equal, but match case-insensitively on systems - which have case-insensitive filesystems. Should only be used for - filenames! */ -#ifdef HAVE_CASE_INSENSITIVE_FS -# define patheq(a, b) \ - ((a) == (b) \ - || (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \ - && (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1)))) -#else -# define patheq(a, b) streq(a, b) -#endif - -#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) - -#if defined(__GNUC__) || defined(ENUM_BITFIELDS) -# define ENUM_BITFIELD(bits) :bits -#else -# define ENUM_BITFIELD(bits) -#endif - -/* Handle gettext and locales. */ - -#if HAVE_LOCALE_H -# include -#else -# define setlocale(category, locale) -#endif - -#include - -#define _(msgid) gettext (msgid) -#define N_(msgid) gettext_noop (msgid) -#define S_(msg1,msg2,num) ngettext (msg1,msg2,num) - -/* Handle other OSs. - To overcome an issue parsing paths in a DOS/Windows environment when - built in a unix based environment, override the PATH_SEPARATOR_CHAR - definition unless being built for Cygwin. */ -#if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__) -# undef PATH_SEPARATOR_CHAR -# define PATH_SEPARATOR_CHAR ';' -#elif !defined(PATH_SEPARATOR_CHAR) -# if defined (VMS) -# define PATH_SEPARATOR_CHAR ',' -# else -# define PATH_SEPARATOR_CHAR ':' -# endif -#endif - -/* This is needed for getcwd() and chdir(), on some W32 systems. */ -#if defined(HAVE_DIRECT_H) -# include -#endif - -#ifdef WINDOWS32 -# include -# include -# define pipe(_p) _pipe((_p), 512, O_BINARY) -# define kill(_pid,_sig) w32_kill((_pid),(_sig)) - -void sync_Path_environment (void); -int w32_kill (pid_t pid, int sig); -char *end_of_token_w32 (const char *s, char stopchar); -int find_and_set_default_shell (const char *token); - -/* indicates whether or not we have Bourne shell */ -extern int no_default_sh_exe; - -/* is default_shell unixy? */ -extern int unixy_shell; -#endif /* WINDOWS32 */ - -#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) -# define SET_STACK_SIZE -#endif -#ifdef SET_STACK_SIZE -# include -extern struct rlimit stack_limit; -#endif - -struct floc - { - const char *filenm; - unsigned long lineno; - }; -#define NILF ((struct floc *)0) - -#define CSTRLEN(_s) (sizeof (_s)-1) -#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s) - - -/* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use - variadic versions of these functions. */ - -#if HAVE_STDARG_H || HAVE_VARARGS_H -# if HAVE_VPRINTF || HAVE_DOPRNT -# define USE_VARIADIC 1 -# endif -#endif - -#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H -const char *concat (unsigned int, ...); -void message (int prefix, const char *fmt, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -void error (const struct floc *flocp, const char *fmt, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -void fatal (const struct floc *flocp, const char *fmt, ...) - __attribute__ ((noreturn, __format__ (__printf__, 2, 3))); -#else -const char *concat (); -void message (); -void error (); -void fatal (); -#endif - -void die (int) __attribute__ ((noreturn)); -void log_working_directory (int); -void pfatal_with_name (const char *) __attribute__ ((noreturn)); -void perror_with_name (const char *, const char *); -void *xmalloc (unsigned int); -void *xcalloc (unsigned int); -void *xrealloc (void *, unsigned int); -char *xstrdup (const char *); -char *xstrndup (const char *, unsigned int); -char *find_next_token (const char **, unsigned int *); -char *next_token (const char *); -char *end_of_token (const char *); -void collapse_continuations (char *); -char *lindex (const char *, const char *, int); -int alpha_compare (const void *, const void *); -void print_spaces (unsigned int); -char *find_percent (char *); -const char *find_percent_cached (const char **); -FILE *open_tmpfile (char **, const char *); - -#ifndef NO_ARCHIVES -int ar_name (const char *); -void ar_parse_name (const char *, char **, char **); -int ar_touch (const char *); -time_t ar_member_date (const char *); - -typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated, - long int hdrpos, long int datapos, - long int size, long int date, int uid, - int gid, int mode, const void *arg); - -long int ar_scan (const char *archive, ar_member_func_t function, const void *arg); -int ar_name_equal (const char *name, const char *mem, int truncated); -#ifndef VMS -int ar_member_touch (const char *arname, const char *memname); -#endif -#endif - -int dir_file_exists_p (const char *, const char *); -int file_exists_p (const char *); -int file_impossible_p (const char *); -void file_impossible (const char *); -const char *dir_name (const char *); -void hash_init_directories (void); - -void define_default_variables (void); -void set_default_suffixes (void); -void install_default_suffix_rules (void); -void install_default_implicit_rules (void); - -void build_vpath_lists (void); -void construct_vpath_list (char *pattern, char *dirpath); -const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr, - unsigned int* vpath_index, unsigned int* path_index); -int gpath_search (const char *file, unsigned int len); - -void construct_include_path (const char **arg_dirs); - -void user_access (void); -void make_access (void); -void child_access (void); - -void close_stdout (void); - -char *strip_whitespace (const char **begpp, const char **endpp); - -/* String caching */ -void strcache_init (void); -void strcache_print_stats (const char *prefix); -int strcache_iscached (const char *str); -const char *strcache_add (const char *str); -const char *strcache_add_len (const char *str, unsigned int len); -int strcache_setbufsize (unsigned int size); - -/* Guile support */ -#ifdef HAVE_GUILE -int guile_gmake_setup (const struct floc *flocp); -#endif - -/* Loadable object support. Sets to the strcached name of the loaded file. */ -typedef int (*load_func_t)(const struct floc *flocp); -int load_file (const struct floc *flocp, const char **filename, int noerror); - -#ifdef HAVE_VFORK_H -# include -#endif - -/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, - because such systems often declare them in header files anyway. */ - -#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32) - -long int atol (); -# ifndef VMS -long int lseek (); -# endif - -#endif /* Not GNU C library or POSIX. */ - -#ifdef HAVE_GETCWD -# if !defined(VMS) && !defined(__DECC) -char *getcwd (); -# endif -#else -char *getwd (); -# define getcwd(buf, len) getwd (buf) -#endif - -#if !HAVE_STRCASECMP -# if HAVE_STRICMP -# define strcasecmp stricmp -# elif HAVE_STRCMPI -# define strcasecmp strcmpi -# else -/* Create our own, in misc.c */ -int strcasecmp (const char *s1, const char *s2); -# endif -#endif - -#if !HAVE_STRNCASECMP -# if HAVE_STRNICMP -# define strncasecmp strnicmp -# elif HAVE_STRNCMPI -# define strncasecmp strncmpi -# else -/* Create our own, in misc.c */ -int strncasecmp (const char *s1, const char *s2, int n); -# endif -#endif - -extern const struct floc *reading_file; -extern const struct floc **expanding_var; - -extern char **environ; - -extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag; -extern int print_data_base_flag, question_flag, touch_flag, always_make_flag; -extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag; -extern int print_version_flag, print_directory_flag, check_symlink_flag; -extern int warn_undefined_variables_flag, trace_flag, posix_pedantic; -extern int not_parallel, second_expansion, clock_skew_detected; -extern int rebuilding_makefiles, one_shell; - -/* can we run commands via 'sh -c xxx' or must we use batch files? */ -extern int batch_mode_shell; - -/* Resetting the command script introduction prefix character. */ -#define RECIPEPREFIX_NAME ".RECIPEPREFIX" -#define RECIPEPREFIX_DEFAULT '\t' -extern char cmd_prefix; - -extern unsigned int job_slots; -extern int job_fds[2]; -extern int job_rfd; -#ifndef NO_FLOAT -extern double max_load_average; -#else -extern int max_load_average; -#endif - -extern char *program; -extern char *starting_directory; -extern unsigned int makelevel; -extern char *version_string, *remote_description, *make_host; - -extern unsigned int commands_started; - -extern int handling_fatal_signal; - - -#ifndef MIN -#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) -#endif -#ifndef MAX -#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b)) -#endif - -#ifdef VMS -# define MAKE_SUCCESS 1 -# define MAKE_TROUBLE 2 -# define MAKE_FAILURE 3 -#else -# define MAKE_SUCCESS 0 -# define MAKE_TROUBLE 1 -# define MAKE_FAILURE 2 -#endif - -/* Set up heap debugging library dmalloc. */ - -#ifdef HAVE_DMALLOC_H -#include -#endif - -#ifndef initialize_main -# ifdef __EMX__ -# define initialize_main(pargc, pargv) \ - { _wildcard(pargc, pargv); _response(pargc, pargv); } -# else -# define initialize_main(pargc, pargv) -# endif -#endif - -#ifdef __EMX__ -# if !defined chdir -# define chdir _chdir2 -# endif -# if !defined getcwd -# define getcwd _getcwd2 -# endif - -/* NO_CHDIR2 causes make not to use _chdir2() and _getcwd2() instead of - chdir() and getcwd(). This avoids some error messages for the - make testsuite but restricts the drive letter support. */ -# ifdef NO_CHDIR2 -# warning NO_CHDIR2: usage of drive letters restricted -# undef chdir -# undef getcwd -# endif -#endif - -#ifndef initialize_main -# define initialize_main(pargc, pargv) -#endif - - -/* Some systems (like Solaris, PTX, etc.) do not support the SA_RESTART flag - properly according to POSIX. So, we try to wrap common system calls with - checks for EINTR. Note that there are still plenty of system calls that - can fail with EINTR but this, reportedly, gets the vast majority of - failure cases. If you still experience failures you'll need to either get - a system where SA_RESTART works, or you need to avoid -j. */ - -#define EINTRLOOP(_v,_c) while (((_v)=_c)==-1 && errno==EINTR) - -/* While system calls that return integers are pretty consistent about - returning -1 on failure and setting errno in that case, functions that - return pointers are not always so well behaved. Sometimes they return - NULL for expected behavior: one good example is readdir() which returns - NULL at the end of the directory--and _doesn't_ reset errno. So, we have - to do it ourselves here. */ - -#define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \ - while((_v)==0 && errno==EINTR) diff --git a/make_msvc_net2003.vcproj b/make_msvc_net2003.vcproj index cfb0deb..50492ad 100644 --- a/make_msvc_net2003.vcproj +++ b/make_msvc_net2003.vcproj @@ -278,7 +278,7 @@ RelativePath=".\job.h"> + RelativePath=".\makeint.h"> diff --git a/makeint.h b/makeint.h new file mode 100644 index 0000000..60ffb4c --- /dev/null +++ b/makeint.h @@ -0,0 +1,642 @@ +/* Miscellaneous global declarations and portability cruft for GNU Make. +Copyright (C) 1988-2012 Free Software Foundation, Inc. +This file is part of GNU Make. + +GNU Make 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 3 of the License, or (at your option) any later +version. + +GNU Make 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 +this program. If not, see . */ + +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because makeint.h was found in $srcdir). */ +#include +#undef HAVE_CONFIG_H +#define HAVE_CONFIG_H 1 + +/* Specify we want GNU source code. This must be defined before any + system headers are included. */ + +#define _GNU_SOURCE 1 + +/* AIX requires this to be the first thing in the file. */ +#if HAVE_ALLOCA_H +# include +#else +# ifdef _AIX + #pragma alloca +# else +# if !defined(__GNUC__) && !defined(WINDOWS32) +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + +/* Disable assert() unless we're a maintainer. + Some asserts are compute-intensive. */ +#ifndef MAKE_MAINTAINER_MODE +# define NDEBUG 1 +#endif + + +#ifdef CRAY +/* This must happen before #include so + that the declaration therein is changed. */ +# define signal bsdsignal +#endif + +/* If we're compiling for the dmalloc debugger, turn off string inlining. */ +#if defined(HAVE_DMALLOC_H) && defined(__GNUC__) +# define __NO_STRING_INLINES +#endif + +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_TIMEB_H +/* SCO 3.2 "devsys 4.2" has a prototype for 'ftime' in that bombs + unless has been included first. */ +# include +#endif +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include + +#ifndef errno +extern int errno; +#endif + +#ifndef isblank +# define isblank(c) ((c) == ' ' || (c) == '\t') +#endif + +#ifdef HAVE_UNISTD_H +# include +/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get + POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */ +# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS) +# define POSIX 1 +# endif +#endif + +/* Some systems define _POSIX_VERSION but are not really POSIX.1. */ +#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386))) +# undef POSIX +#endif + +#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE) +# define POSIX 1 +#endif + +#ifndef RETSIGTYPE +# define RETSIGTYPE void +#endif + +#ifndef sigmask +# define sigmask(sig) (1 << ((sig) - 1)) +#endif + +#ifndef HAVE_SA_RESTART +# define SA_RESTART 0 +#endif + +#ifdef HAVE_LIMITS_H +# include +#endif +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#ifndef PATH_MAX +# ifndef POSIX +# define PATH_MAX MAXPATHLEN +# endif +#endif +#ifndef MAXPATHLEN +# define MAXPATHLEN 1024 +#endif + +#ifdef PATH_MAX +# define GET_PATH_MAX PATH_MAX +# define PATH_VAR(var) char var[PATH_MAX] +#else +# define NEED_GET_PATH_MAX 1 +# define GET_PATH_MAX (get_path_max ()) +# define PATH_VAR(var) char *var = alloca (GET_PATH_MAX) +unsigned int get_path_max (void); +#endif + +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +#ifndef USHRT_MAX +# define USHRT_MAX 65535 +#endif + +/* Nonzero if the integer type T is signed. + Use <= to avoid GCC warnings about always-false expressions. */ +#define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0) + +/* The minimum and maximum values for the integer type T. + Use ~ (t) 0, not -1, for portability to 1's complement hosts. */ +#define INTEGER_TYPE_MINIMUM(t) \ + (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) +#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) + +#ifndef CHAR_MAX +# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char) +#endif + +#ifdef STAT_MACROS_BROKEN +# ifdef S_ISREG +# undef S_ISREG +# endif +# ifdef S_ISDIR +# undef S_ISDIR +# endif +#endif /* STAT_MACROS_BROKEN. */ + +#ifndef S_ISREG +# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) +#endif +#ifndef S_ISDIR +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#endif + +#ifdef VMS +# include +# include +# include +# include +/* Needed to use alloca on VMS. */ +# include +#endif + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +/* The __-protected variants of 'format' and 'printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif +#define UNUSED __attribute__ ((unused)) + +#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) +# include +# include +# define ANSI_STRING 1 +#else /* No standard headers. */ +# ifdef HAVE_STRING_H +# include +# define ANSI_STRING 1 +# else +# include +# endif +# ifdef HAVE_MEMORY_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# else +void *malloc (int); +void *realloc (void *, int); +void free (void *); + +void abort (void) __attribute__ ((noreturn)); +void exit (int) __attribute__ ((noreturn)); +# endif /* HAVE_STDLIB_H. */ + +#endif /* Standard headers. */ + +/* These should be in stdlib.h. Make sure we have them. */ +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#ifndef ANSI_STRING + +/* SCO Xenix has a buggy macro definition in . */ +#undef strerror +#if !defined(__DECC) +char *strerror (int errnum); +#endif + +#endif /* !ANSI_STRING. */ +#undef ANSI_STRING + +#if HAVE_INTTYPES_H +# include +#endif +#if HAVE_STDINT_H +# include +#endif +#define FILE_TIMESTAMP uintmax_t + +#if !defined(HAVE_STRSIGNAL) +char *strsignal (int signum); +#endif + +/* ISDIGIT offers the following features: + - Its arg may be any int or unsigned int; it need not be an unsigned char. + - It's guaranteed to evaluate its argument exactly once. + NOTE! Make relies on this behavior, don't change it! + - It's typically faster. + POSIX 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that + only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless + it's important to use the locale's definition of 'digit' even when the + host does not conform to POSIX. */ +#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) + +/* Test if two strings are equal. Is this worthwhile? Should be profiled. */ +#define streq(a, b) \ + ((a) == (b) || \ + (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) + +/* Test if two strings are equal, but match case-insensitively on systems + which have case-insensitive filesystems. Should only be used for + filenames! */ +#ifdef HAVE_CASE_INSENSITIVE_FS +# define patheq(a, b) \ + ((a) == (b) \ + || (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \ + && (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1)))) +#else +# define patheq(a, b) streq(a, b) +#endif + +#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) + +#if defined(__GNUC__) || defined(ENUM_BITFIELDS) +# define ENUM_BITFIELD(bits) :bits +#else +# define ENUM_BITFIELD(bits) +#endif + +/* Handle gettext and locales. */ + +#if HAVE_LOCALE_H +# include +#else +# define setlocale(category, locale) +#endif + +#include + +#define _(msgid) gettext (msgid) +#define N_(msgid) gettext_noop (msgid) +#define S_(msg1,msg2,num) ngettext (msg1,msg2,num) + +/* Handle other OSs. + To overcome an issue parsing paths in a DOS/Windows environment when + built in a unix based environment, override the PATH_SEPARATOR_CHAR + definition unless being built for Cygwin. */ +#if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__) +# undef PATH_SEPARATOR_CHAR +# define PATH_SEPARATOR_CHAR ';' +#elif !defined(PATH_SEPARATOR_CHAR) +# if defined (VMS) +# define PATH_SEPARATOR_CHAR ',' +# else +# define PATH_SEPARATOR_CHAR ':' +# endif +#endif + +/* This is needed for getcwd() and chdir(), on some W32 systems. */ +#if defined(HAVE_DIRECT_H) +# include +#endif + +#ifdef WINDOWS32 +# include +# include +# define pipe(_p) _pipe((_p), 512, O_BINARY) +# define kill(_pid,_sig) w32_kill((_pid),(_sig)) + +void sync_Path_environment (void); +int w32_kill (pid_t pid, int sig); +char *end_of_token_w32 (const char *s, char stopchar); +int find_and_set_default_shell (const char *token); + +/* indicates whether or not we have Bourne shell */ +extern int no_default_sh_exe; + +/* is default_shell unixy? */ +extern int unixy_shell; +#endif /* WINDOWS32 */ + +#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) +# define SET_STACK_SIZE +#endif +#ifdef SET_STACK_SIZE +# include +extern struct rlimit stack_limit; +#endif + +struct floc + { + const char *filenm; + unsigned long lineno; + }; +#define NILF ((struct floc *)0) + +#define CSTRLEN(_s) (sizeof (_s)-1) +#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s) + + +/* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use + variadic versions of these functions. */ + +#if HAVE_STDARG_H || HAVE_VARARGS_H +# if HAVE_VPRINTF || HAVE_DOPRNT +# define USE_VARIADIC 1 +# endif +#endif + +#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H +const char *concat (unsigned int, ...); +void message (int prefix, const char *fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +void error (const struct floc *flocp, const char *fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +void fatal (const struct floc *flocp, const char *fmt, ...) + __attribute__ ((noreturn, __format__ (__printf__, 2, 3))); +#else +const char *concat (); +void message (); +void error (); +void fatal (); +#endif + +void die (int) __attribute__ ((noreturn)); +void log_working_directory (int); +void pfatal_with_name (const char *) __attribute__ ((noreturn)); +void perror_with_name (const char *, const char *); +void *xmalloc (unsigned int); +void *xcalloc (unsigned int); +void *xrealloc (void *, unsigned int); +char *xstrdup (const char *); +char *xstrndup (const char *, unsigned int); +char *find_next_token (const char **, unsigned int *); +char *next_token (const char *); +char *end_of_token (const char *); +void collapse_continuations (char *); +char *lindex (const char *, const char *, int); +int alpha_compare (const void *, const void *); +void print_spaces (unsigned int); +char *find_percent (char *); +const char *find_percent_cached (const char **); +FILE *open_tmpfile (char **, const char *); + +#ifndef NO_ARCHIVES +int ar_name (const char *); +void ar_parse_name (const char *, char **, char **); +int ar_touch (const char *); +time_t ar_member_date (const char *); + +typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated, + long int hdrpos, long int datapos, + long int size, long int date, int uid, + int gid, int mode, const void *arg); + +long int ar_scan (const char *archive, ar_member_func_t function, const void *arg); +int ar_name_equal (const char *name, const char *mem, int truncated); +#ifndef VMS +int ar_member_touch (const char *arname, const char *memname); +#endif +#endif + +int dir_file_exists_p (const char *, const char *); +int file_exists_p (const char *); +int file_impossible_p (const char *); +void file_impossible (const char *); +const char *dir_name (const char *); +void hash_init_directories (void); + +void define_default_variables (void); +void set_default_suffixes (void); +void install_default_suffix_rules (void); +void install_default_implicit_rules (void); + +void build_vpath_lists (void); +void construct_vpath_list (char *pattern, char *dirpath); +const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr, + unsigned int* vpath_index, unsigned int* path_index); +int gpath_search (const char *file, unsigned int len); + +void construct_include_path (const char **arg_dirs); + +void user_access (void); +void make_access (void); +void child_access (void); + +void close_stdout (void); + +char *strip_whitespace (const char **begpp, const char **endpp); + +/* String caching */ +void strcache_init (void); +void strcache_print_stats (const char *prefix); +int strcache_iscached (const char *str); +const char *strcache_add (const char *str); +const char *strcache_add_len (const char *str, unsigned int len); +int strcache_setbufsize (unsigned int size); + +/* Guile support */ +#ifdef HAVE_GUILE +int guile_gmake_setup (const struct floc *flocp); +#endif + +/* Loadable object support. Sets to the strcached name of the loaded file. */ +typedef int (*load_func_t)(const struct floc *flocp); +int load_file (const struct floc *flocp, const char **filename, int noerror); + +#ifdef HAVE_VFORK_H +# include +#endif + +/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION, + because such systems often declare them in header files anyway. */ + +#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32) + +long int atol (); +# ifndef VMS +long int lseek (); +# endif + +#endif /* Not GNU C library or POSIX. */ + +#ifdef HAVE_GETCWD +# if !defined(VMS) && !defined(__DECC) +char *getcwd (); +# endif +#else +char *getwd (); +# define getcwd(buf, len) getwd (buf) +#endif + +#if !HAVE_STRCASECMP +# if HAVE_STRICMP +# define strcasecmp stricmp +# elif HAVE_STRCMPI +# define strcasecmp strcmpi +# else +/* Create our own, in misc.c */ +int strcasecmp (const char *s1, const char *s2); +# endif +#endif + +#if !HAVE_STRNCASECMP +# if HAVE_STRNICMP +# define strncasecmp strnicmp +# elif HAVE_STRNCMPI +# define strncasecmp strncmpi +# else +/* Create our own, in misc.c */ +int strncasecmp (const char *s1, const char *s2, int n); +# endif +#endif + +extern const struct floc *reading_file; +extern const struct floc **expanding_var; + +extern char **environ; + +extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag; +extern int print_data_base_flag, question_flag, touch_flag, always_make_flag; +extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag; +extern int print_version_flag, print_directory_flag, check_symlink_flag; +extern int warn_undefined_variables_flag, trace_flag, posix_pedantic; +extern int not_parallel, second_expansion, clock_skew_detected; +extern int rebuilding_makefiles, one_shell; + +/* can we run commands via 'sh -c xxx' or must we use batch files? */ +extern int batch_mode_shell; + +/* Resetting the command script introduction prefix character. */ +#define RECIPEPREFIX_NAME ".RECIPEPREFIX" +#define RECIPEPREFIX_DEFAULT '\t' +extern char cmd_prefix; + +extern unsigned int job_slots; +extern int job_fds[2]; +extern int job_rfd; +#ifndef NO_FLOAT +extern double max_load_average; +#else +extern int max_load_average; +#endif + +extern char *program; +extern char *starting_directory; +extern unsigned int makelevel; +extern char *version_string, *remote_description, *make_host; + +extern unsigned int commands_started; + +extern int handling_fatal_signal; + + +#ifndef MIN +#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) +#endif +#ifndef MAX +#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b)) +#endif + +#ifdef VMS +# define MAKE_SUCCESS 1 +# define MAKE_TROUBLE 2 +# define MAKE_FAILURE 3 +#else +# define MAKE_SUCCESS 0 +# define MAKE_TROUBLE 1 +# define MAKE_FAILURE 2 +#endif + +/* Set up heap debugging library dmalloc. */ + +#ifdef HAVE_DMALLOC_H +#include +#endif + +#ifndef initialize_main +# ifdef __EMX__ +# define initialize_main(pargc, pargv) \ + { _wildcard(pargc, pargv); _response(pargc, pargv); } +# else +# define initialize_main(pargc, pargv) +# endif +#endif + +#ifdef __EMX__ +# if !defined chdir +# define chdir _chdir2 +# endif +# if !defined getcwd +# define getcwd _getcwd2 +# endif + +/* NO_CHDIR2 causes make not to use _chdir2() and _getcwd2() instead of + chdir() and getcwd(). This avoids some error messages for the + make testsuite but restricts the drive letter support. */ +# ifdef NO_CHDIR2 +# warning NO_CHDIR2: usage of drive letters restricted +# undef chdir +# undef getcwd +# endif +#endif + +#ifndef initialize_main +# define initialize_main(pargc, pargv) +#endif + + +/* Some systems (like Solaris, PTX, etc.) do not support the SA_RESTART flag + properly according to POSIX. So, we try to wrap common system calls with + checks for EINTR. Note that there are still plenty of system calls that + can fail with EINTR but this, reportedly, gets the vast majority of + failure cases. If you still experience failures you'll need to either get + a system where SA_RESTART works, or you need to avoid -j. */ + +#define EINTRLOOP(_v,_c) while (((_v)=_c)==-1 && errno==EINTR) + +/* While system calls that return integers are pretty consistent about + returning -1 on failure and setting errno in that case, functions that + return pointers are not always so well behaved. Sometimes they return + NULL for expected behavior: one good example is readdir() which returns + NULL at the end of the directory--and _doesn't_ reset errno. So, we have + to do it ourselves here. */ + +#define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \ + while((_v)==0 && errno==EINTR) diff --git a/misc.c b/misc.c index cf371be..e615151 100644 --- a/misc.c +++ b/misc.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "dep.h" #include "debug.h" diff --git a/read.c b/read.c index 98361c8..0c682ad 100644 --- a/read.c +++ b/read.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include diff --git a/remake.c b/remake.c index b1ddd23..8510264 100644 --- a/remake.c +++ b/remake.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "filedef.h" #include "job.h" #include "commands.h" diff --git a/remote-cstms.c b/remote-cstms.c index 155c516..713b89a 100644 --- a/remote-cstms.c +++ b/remote-cstms.c @@ -18,7 +18,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "job.h" #include "filedef.h" #include "commands.h" diff --git a/remote-stub.c b/remote-stub.c index b02c9d9..13c6273 100644 --- a/remote-stub.c +++ b/remote-stub.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "filedef.h" #include "job.h" #include "commands.h" diff --git a/rule.c b/rule.c index 36eb308..7627225 100644 --- a/rule.c +++ b/rule.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include diff --git a/signame.c b/signame.c index 43f84e3..c54a8ea 100644 --- a/signame.c +++ b/signame.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" /* If the system provides strsignal, we don't need it. */ diff --git a/strcache.c b/strcache.c index 3e8d5d8..beb2b04 100644 --- a/strcache.c +++ b/strcache.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include #include diff --git a/variable.c b/variable.c index 8576d6a..0a544ad 100644 --- a/variable.c +++ b/variable.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include diff --git a/version.c b/version.c index 20eb417..32167ed 100644 --- a/version.c +++ b/version.c @@ -16,7 +16,7 @@ this program. If not, see . */ /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because make.h was found in $srcdir). */ + (which it would do because makeint.h was found in $srcdir). */ #include #ifndef MAKE_HOST diff --git a/vmsfunctions.c b/vmsfunctions.c index 8cae17f..6b3ecd4 100644 --- a/vmsfunctions.c +++ b/vmsfunctions.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "debug.h" #include "job.h" diff --git a/vpath.c b/vpath.c index 35664e6..33191f2 100644 --- a/vpath.c +++ b/vpath.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include "filedef.h" #include "variable.h" #ifdef WINDOWS32 @@ -146,7 +146,7 @@ build_vpath_lists () If DIRPATH is nil, remove all previous listings with the same pattern. If PATTERN is nil, remove all VPATH listings. Existing and readable directories that are not "." given in the DIRPATH - separated by the path element separator (defined in make.h) are + separated by the path element separator (defined in makeint.h) are loaded into the directory hash table if they are not there already and put in the VPATH searchpath for the given pattern with trailing slashes stripped off if present (and if the directory is not the diff --git a/w32/pathstuff.c b/w32/pathstuff.c index a2532d0..5e0f52c 100644 --- a/w32/pathstuff.c +++ b/w32/pathstuff.c @@ -14,7 +14,7 @@ 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 this program. If not, see . */ -#include "make.h" +#include "makeint.h" #include #include #include "pathstuff.h" diff --git a/w32/subproc/w32err.c b/w32/subproc/w32err.c index 1cb14d4..74b48ab 100644 --- a/w32/subproc/w32err.c +++ b/w32/subproc/w32err.c @@ -16,7 +16,7 @@ this program. If not, see . */ #include #include -#include "make.h" +#include "makeint.h" #include "w32err.h" /* -- cgit v1.2.3