get make to build

This commit is contained in:
ahgamut 2021-10-27 00:24:07 +05:30 committed by Justine Tunney
parent 7a50dba812
commit 3616f2a432
64 changed files with 9683 additions and 212 deletions

View file

@ -139,6 +139,7 @@ include libc/testlib/testlib.mk
include tool/viz/lib/vizlib.mk include tool/viz/lib/vizlib.mk
include third_party/linenoise/linenoise.mk include third_party/linenoise/linenoise.mk
include third_party/lua/lua.mk include third_party/lua/lua.mk
include third_party/make/make.mk
include third_party/argon2/argon2.mk include third_party/argon2/argon2.mk
include third_party/sqlite3/sqlite3.mk include third_party/sqlite3/sqlite3.mk
include third_party/mbedtls/test/test.mk include third_party/mbedtls/test/test.mk

72
third_party/make/lib/alloca.h vendored Normal file
View file

@ -0,0 +1,72 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Memory allocation on the stack.
Copyright (C) 1995, 1999, 2001-2004, 2006-2020 Free Software Foundation,
Inc.
This program 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, or (at your option)
any later version.
This program 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
<https://www.gnu.org/licenses/>.
*/
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
means there is a real alloca function. */
#ifndef _GL_ALLOCA_H
#define _GL_ALLOCA_H
/* alloca (N) returns a pointer to N bytes of memory
allocated on the stack, which will last until the function returns.
Use of alloca should be avoided:
- inside arguments of function calls - undefined behaviour,
- in inline functions - the allocation may actually last until the
calling function returns,
- for huge N (say, N >= 65536) - you never know how large (or small)
the stack is, and when the stack cannot fulfill the memory allocation
request, the program just crashes.
*/
#ifndef alloca
# ifdef __GNUC__
/* Some version of mingw have an <alloca.h> that causes trouble when
included after 'alloca' gets defined as a macro. As a workaround, include
this <alloca.h> first and define 'alloca' as a macro afterwards. */
# if (defined _WIN32 && ! defined __CYGWIN__) && 1
# include_next <alloca.h>
# endif
# define alloca __builtin_alloca
# elif defined _AIX
# define alloca __alloca
# elif defined _MSC_VER
# include <malloc.h>
# define alloca _alloca
# elif defined __DECC && defined __VMS
# define alloca __ALLOCA
# elif defined __TANDEM && defined _TNS_E_TARGET
# ifdef __cplusplus
extern "C"
# endif
void *_alloca (unsigned short);
# pragma intrinsic (_alloca)
# define alloca _alloca
# elif defined __MVS__
# include <stdlib.h>
# else
# include <stddef.h>
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
# endif
#endif
#endif /* _GL_ALLOCA_H */

View file

@ -16,9 +16,9 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
#include "dirname.h" #include "third_party/make/lib/dirname.h"
#include <string.h> #include <string.h>

View file

@ -16,16 +16,16 @@
/* Written by Bruno Haible <haible@clisp.cons.org>. */ /* Written by Bruno Haible <haible@clisp.cons.org>. */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include "concat-filename.h" #include "third_party/make/lib/concat-filename.h"
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "filename.h" #include "third_party/make/lib/filename.h"
/* Concatenate a directory filename, a relative filename and an optional /* Concatenate a directory filename, a relative filename and an optional
suffix. The directory may end with the directory separator. The second suffix. The directory may end with the directory separator. The second

View file

@ -16,9 +16,9 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
#include "dirname.h" #include "third_party/make/lib/dirname.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View file

@ -17,7 +17,7 @@
/* written by Paul Eggert */ /* written by Paul Eggert */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include <unistd.h> #include <unistd.h>

View file

@ -18,10 +18,11 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */ /* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#if !_LIBC #if !_LIBC
# include <config.h> #include "third_party/make/src/config.h"
#endif #endif
#include "error.h" #include "third_party/make/lib/error.h"
#include "third_party/make/lib/stdio.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>

View file

@ -15,10 +15,11 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
#include "exitfail.h" #include "third_party/make/lib/exitfail.h"
#include "libc/sysv/consts/exit.h"
#include <stdlib.h> #include <stdlib.h>
int volatile exit_failure = EXIT_FAILURE; int volatile exit_failure = 1; /*TODO: this should be EXIT_FAILURE; */

View file

@ -17,10 +17,10 @@
/* Written by Eric Blake <ebb9@byu.net>. */ /* Written by Eric Blake <ebb9@byu.net>. */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include <fcntl.h> #include "third_party/make/lib/fcntl.h"
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>

866
third_party/make/lib/fcntl.h vendored Normal file
View file

@ -0,0 +1,866 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Like <fcntl.h>, but with non-working flags defined to 0.
Copyright (C) 2006-2020 Free Software Foundation, Inc.
This program 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.
This program 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 <https://www.gnu.org/licenses/>. */
/* written by Paul Eggert */
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
#if defined __need_system_fcntl_h
/* Special invocation convention. */
/* Needed before <sys/stat.h>.
May also define off_t to a 64-bit type on native Windows. */
#include <sys/types.h>
/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
<fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
extern "C" { ... } block, which leads to errors in C++ mode with the
overridden <sys/stat.h> from gnulib. These errors are known to be gone
with g++ version >= 4.3. */
#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
# include <sys/stat.h>
#endif
#include_next <fcntl.h>
/* Native Windows platforms declare open(), creat() in <io.h>. */
#if (0 || 0 || defined GNULIB_POSIXCHECK) \
&& (defined _WIN32 && ! defined __CYGWIN__)
# include <io.h>
#endif
#else
/* Normal invocation convention. */
#ifndef _GL_FCNTL_H
/* Needed before <sys/stat.h>.
May also define off_t to a 64-bit type on native Windows. */
#include <sys/types.h>
/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
<fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
extern "C" { ... } block, which leads to errors in C++ mode with the
overridden <sys/stat.h> from gnulib. These errors are known to be gone
with g++ version >= 4.3. */
#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
# include <sys/stat.h>
#endif
/* The include_next requires a split double-inclusion guard. */
#include_next <fcntl.h>
/* Native Windows platforms declare open(), creat() in <io.h>. */
#if (0 || 0 || defined GNULIB_POSIXCHECK) \
&& (defined _WIN32 && ! defined __CYGWIN__)
# include <io.h>
#endif
#ifndef _GL_FCNTL_H
#define _GL_FCNTL_H
#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
# include <unistd.h>
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* C++ compatible function declaration macros.
Copyright (C) 2010-2020 Free Software Foundation, Inc.
This program 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.
This program 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 <https://www.gnu.org/licenses/>. */
#ifndef _GL_CXXDEFS_H
#define _GL_CXXDEFS_H
/* Begin/end the GNULIB_NAMESPACE namespace. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
# define _GL_END_NAMESPACE }
#else
# define _GL_BEGIN_NAMESPACE
# define _GL_END_NAMESPACE
#endif
/* The three most frequent use cases of these macros are:
* For providing a substitute for a function that is missing on some
platforms, but is declared and works fine on the platforms on which
it exists:
#if @GNULIB_FOO@
# if !@HAVE_FOO@
_GL_FUNCDECL_SYS (foo, ...);
# endif
_GL_CXXALIAS_SYS (foo, ...);
_GL_CXXALIASWARN (foo);
#elif defined GNULIB_POSIXCHECK
...
#endif
* For providing a replacement for a function that exists on all platforms,
but is broken/insufficient and needs to be replaced on some platforms:
#if @GNULIB_FOO@
# if @REPLACE_FOO@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef foo
# define foo rpl_foo
# endif
_GL_FUNCDECL_RPL (foo, ...);
_GL_CXXALIAS_RPL (foo, ...);
# else
_GL_CXXALIAS_SYS (foo, ...);
# endif
_GL_CXXALIASWARN (foo);
#elif defined GNULIB_POSIXCHECK
...
#endif
* For providing a replacement for a function that exists on some platforms
but is broken/insufficient and needs to be replaced on some of them and
is additionally either missing or undeclared on some other platforms:
#if @GNULIB_FOO@
# if @REPLACE_FOO@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef foo
# define foo rpl_foo
# endif
_GL_FUNCDECL_RPL (foo, ...);
_GL_CXXALIAS_RPL (foo, ...);
# else
# if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
_GL_FUNCDECL_SYS (foo, ...);
# endif
_GL_CXXALIAS_SYS (foo, ...);
# endif
_GL_CXXALIASWARN (foo);
#elif defined GNULIB_POSIXCHECK
...
#endif
*/
/* _GL_EXTERN_C declaration;
performs the declaration with C linkage. */
#if defined __cplusplus
# define _GL_EXTERN_C extern "C"
#else
# define _GL_EXTERN_C extern
#endif
/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
_GL_ARG_NONNULL ((1)));
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
_GL_EXTERN_C rettype rpl_func parameters_and_attributes
/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes.
Example:
_GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
_GL_ARG_NONNULL ((1)));
*/
#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
_GL_EXTERN_C rettype func parameters_and_attributes
/* _GL_CXXALIAS_RPL (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
Example:
_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
Wrapping rpl_func in an object with an inline conversion operator
avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
actually used in the program. */
#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
_GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return ::rpl_func; \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
except that the C function rpl_func may have a slightly different
declaration. A cast is used to silence the "invalid conversion" error
that would otherwise occur. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return reinterpret_cast<type>(::rpl_func); \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_SYS (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
that redirects to the system provided function func, if GNULIB_NAMESPACE
is defined.
Example:
_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
Wrapping func in an object with an inline conversion operator
avoids a reference to func unless GNULIB_NAMESPACE::func is
actually used in the program. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return ::func; \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
is like _GL_CXXALIAS_SYS (func, rettype, parameters);
except that the C function func may have a slightly different declaration.
A cast is used to silence the "invalid conversion" error that would
otherwise occur. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return reinterpret_cast<type>(::func); \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
is like _GL_CXXALIAS_SYS (func, rettype, parameters);
except that the C function is picked among a set of overloaded functions,
namely the one with rettype2 and parameters2. Two consecutive casts
are used to silence the "cannot find a match" and "invalid conversion"
errors that would otherwise occur. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
/* The outer cast must be a reinterpret_cast.
The inner cast: When the function is defined as a set of overloaded
functions, it works as a static_cast<>, choosing the designated variant.
When the function is defined as a single variant, it works as a
reinterpret_cast<>. The parenthesized cast syntax works both ways. */
# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
namespace GNULIB_NAMESPACE \
{ \
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
\
inline operator type () const \
{ \
return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
} \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIASWARN (func);
causes a warning to be emitted when ::func is used but not when
GNULIB_NAMESPACE::func is used. func must be defined without overloaded
variants. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIASWARN(func) \
_GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN_1(func,namespace) \
_GL_CXXALIASWARN_2 (func, namespace)
/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
we enable the warning only when not optimizing. */
# if !__OPTIMIZE__
# define _GL_CXXALIASWARN_2(func,namespace) \
_GL_WARN_ON_USE (func, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN_2(func,namespace) \
extern __typeof__ (func) func
# else
# define _GL_CXXALIASWARN_2(func,namespace) \
_GL_EXTERN_C int _gl_cxxalias_dummy
# endif
#else
# define _GL_CXXALIASWARN(func) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
causes a warning to be emitted when the given overloaded variant of ::func
is used but not when GNULIB_NAMESPACE::func is used. */
#if defined __cplusplus && defined GNULIB_NAMESPACE
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
_GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
_GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
we enable the warning only when not optimizing. */
# if !__OPTIMIZE__
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
_GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
extern __typeof__ (func) func
# else
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
_GL_EXTERN_C int _gl_cxxalias_dummy
# endif
#else
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
#endif /* _GL_CXXDEFS_H */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* A C macro for declaring that specific arguments must not be NULL.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
This program 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.
This program 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 <https://www.gnu.org/licenses/>. */
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
that the values passed as arguments n, ..., m must be non-NULL pointers.
n = 1 stands for the first argument, n = 2 for the second argument etc. */
#ifndef _GL_ARG_NONNULL
# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
# else
# define _GL_ARG_NONNULL(params)
# endif
#endif
/* The definition of _GL_WARN_ON_USE is copied here. */
/* A C macro for emitting warnings if a function is used.
Copyright (C) 2010-2020 Free Software Foundation, Inc.
This program 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.
This program 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 <https://www.gnu.org/licenses/>. */
/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
for FUNCTION which will then trigger a compiler warning containing
the text of "literal string" anywhere that function is called, if
supported by the compiler. If the compiler does not support this
feature, the macro expands to an unused extern declaration.
_GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
attribute used in _GL_WARN_ON_USE. If the compiler does not support
this feature, it expands to empty.
These macros are useful for marking a function as a potential
portability trap, with the intent that "literal string" include
instructions on the replacement function that should be used
instead.
_GL_WARN_ON_USE is for functions with 'extern' linkage.
_GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
linkage.
However, one of the reasons that a function is a portability trap is
if it has the wrong signature. Declaring FUNCTION with a different
signature in C is a compilation error, so this macro must use the
same type as any existing declaration so that programs that avoid
the problematic FUNCTION do not fail to compile merely because they
included a header that poisoned the function. But this implies that
_GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
have a declaration. Use of this macro implies that there must not
be any other macro hiding the declaration of FUNCTION; but
undefining FUNCTION first is part of the poisoning process anyway
(although for symbols that are provided only via a macro, the result
is a compilation error rather than a warning containing
"literal string"). Also note that in C++, it is only safe to use if
FUNCTION has no overloads.
For an example, it is possible to poison 'getline' by:
- adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
[getline]) in configure.ac, which potentially defines
HAVE_RAW_DECL_GETLINE
- adding this code to a header that wraps the system <stdio.h>:
#undef getline
#if HAVE_RAW_DECL_GETLINE
_GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
"not universally present; use the gnulib module getline");
#endif
It is not possible to directly poison global variables. But it is
possible to write a wrapper accessor function, and poison that
(less common usage, like &environ, will cause a compilation error
rather than issue the nice warning, but the end result of informing
the developer about their portability problem is still achieved):
#if HAVE_RAW_DECL_ENVIRON
static char ***
rpl_environ (void) { return &environ; }
_GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
# undef environ
# define environ (*rpl_environ ())
#endif
or better (avoiding contradictory use of 'static' and 'extern'):
#if HAVE_RAW_DECL_ENVIRON
static char ***
_GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
rpl_environ (void) { return &environ; }
# undef environ
# define environ (*rpl_environ ())
#endif
*/
#ifndef _GL_WARN_ON_USE
# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE(function, message) \
extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
__attribute__ ((__warning__ (message)))
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
# define _GL_WARN_ON_USE(function, message) \
extern __typeof__ (function) function
# define _GL_WARN_ON_USE_ATTRIBUTE(message)
# else /* Unsupported. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
# define _GL_WARN_ON_USE_ATTRIBUTE(message)
# endif
#endif
/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
is like _GL_WARN_ON_USE (function, "string"), except that the function is
declared with the given prototype, consisting of return type, parameters,
and attributes.
This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
not work in this case. */
#ifndef _GL_WARN_ON_USE_CXX
# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes \
__attribute__ ((__warning__ (msg)))
# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
/* Verify the existence of the function. */
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes
# else /* Unsupported. */
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
# endif
#endif
/* _GL_WARN_EXTERN_C declaration;
performs the declaration with C linkage. */
#ifndef _GL_WARN_EXTERN_C
# if defined __cplusplus
# define _GL_WARN_EXTERN_C extern "C"
# else
# define _GL_WARN_EXTERN_C extern
# endif
#endif
/* Declare overridden functions. */
#if 0
# if 0
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef creat
# define creat rpl_creat
# endif
_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
# else
_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
# endif
_GL_CXXALIASWARN (creat);
#elif defined GNULIB_POSIXCHECK
# undef creat
/* Assume creat is always declared. */
_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
"use gnulib module creat for portability");
#endif
#if 1
# if 1
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fcntl
# define fcntl rpl_fcntl
# endif
_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
# else
# if !1
_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
# endif
_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
# endif
_GL_CXXALIASWARN (fcntl);
#elif defined GNULIB_POSIXCHECK
# undef fcntl
# if HAVE_RAW_DECL_FCNTL
_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
"use gnulib module fcntl for portability");
# endif
#endif
#if 0
# if 0
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef open
# define open rpl_open
# endif
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
# else
_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
# endif
/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
default argument. _GL_CXXALIASWARN does not work in this case. */
# if !defined __hpux
_GL_CXXALIASWARN (open);
# endif
#elif defined GNULIB_POSIXCHECK
# undef open
/* Assume open is always declared. */
_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
"use gnulib module open for portability");
#endif
#if 0
# if 0
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef openat
# define openat rpl_openat
# endif
_GL_FUNCDECL_RPL (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */ ...)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */ ...));
# else
# if !1
_GL_FUNCDECL_SYS (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */ ...)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (openat, int,
(int fd, char const *file, int flags, /* mode_t mode */ ...));
# endif
_GL_CXXALIASWARN (openat);
#elif defined GNULIB_POSIXCHECK
# undef openat
# if HAVE_RAW_DECL_OPENAT
_GL_WARN_ON_USE (openat, "openat is not portable - "
"use gnulib module openat for portability");
# endif
#endif
/* Fix up the FD_* macros, only known to be missing on mingw. */
#ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
#endif
/* Fix up the supported F_* macros. Intentionally leave other F_*
macros undefined. Only known to be missing on mingw. */
#ifndef F_DUPFD_CLOEXEC
# define F_DUPFD_CLOEXEC 0x40000000
/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */
# define GNULIB_defined_F_DUPFD_CLOEXEC 1
#else
# define GNULIB_defined_F_DUPFD_CLOEXEC 0
#endif
#ifndef F_DUPFD
# define F_DUPFD 1
#endif
#ifndef F_GETFD
# define F_GETFD 2
#endif
/* Fix up the O_* macros. */
/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
to values outside 'int' range, so omit these misdefinitions.
But avoid namespace pollution on non-AIX systems. */
#ifdef _AIX
# include <limits.h>
# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
# undef O_CLOEXEC
# endif
# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
# undef O_NOFOLLOW
# endif
# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
# undef O_TTY_INIT
# endif
#endif
#if !defined O_DIRECT && defined O_DIRECTIO
/* Tru64 spells it 'O_DIRECTIO'. */
# define O_DIRECT O_DIRECTIO
#endif
#if !defined O_CLOEXEC && defined O_NOINHERIT
/* Mingw spells it 'O_NOINHERIT'. */
# define O_CLOEXEC O_NOINHERIT
#endif
#ifndef O_CLOEXEC
# define O_CLOEXEC 0x40000000 /* Try to not collide with system O_* flags. */
# define GNULIB_defined_O_CLOEXEC 1
#else
# define GNULIB_defined_O_CLOEXEC 0
#endif
#ifndef O_DIRECT
# define O_DIRECT 0
#endif
#ifndef O_DIRECTORY
# define O_DIRECTORY 0
#endif
#ifndef O_DSYNC
# define O_DSYNC 0
#endif
#ifndef O_EXEC
# define O_EXEC O_RDONLY /* This is often close enough in older systems. */
#endif
#ifndef O_IGNORE_CTTY
# define O_IGNORE_CTTY 0
#endif
#ifndef O_NDELAY
# define O_NDELAY 0
#endif
#ifndef O_NOATIME
# define O_NOATIME 0
#endif
#ifndef O_NONBLOCK
# define O_NONBLOCK O_NDELAY
#endif
/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
or to 0 as fallback. */
#if 0
# if O_NONBLOCK
# define GNULIB_defined_O_NONBLOCK 0
# else
# define GNULIB_defined_O_NONBLOCK 1
# undef O_NONBLOCK
# define O_NONBLOCK 0x40000000
# endif
#endif
#ifndef O_NOCTTY
# define O_NOCTTY 0
#endif
#ifndef O_NOFOLLOW
# define O_NOFOLLOW 0
#endif
#ifndef O_NOLINK
# define O_NOLINK 0
#endif
#ifndef O_NOLINKS
# define O_NOLINKS 0
#endif
#ifndef O_NOTRANS
# define O_NOTRANS 0
#endif
#ifndef O_RSYNC
# define O_RSYNC 0
#endif
#ifndef O_SEARCH
# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
#endif
#ifndef O_SYNC
# define O_SYNC 0
#endif
#ifndef O_TTY_INIT
# define O_TTY_INIT 0
#endif
#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
# undef O_ACCMODE
# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
#endif
/* For systems that distinguish between text and binary I/O.
O_BINARY is usually declared in fcntl.h */
#if !defined O_BINARY && defined _O_BINARY
/* For MSC-compatible compilers. */
# define O_BINARY _O_BINARY
# define O_TEXT _O_TEXT
#endif
#if defined __BEOS__ || defined __HAIKU__
/* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
# undef O_BINARY
# undef O_TEXT
#endif
#ifndef O_BINARY
# define O_BINARY 0
# define O_TEXT 0
#endif
/* Fix up the AT_* macros. */
/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
value exceeds INT_MAX, so its use as an int doesn't conform to the
C standard, and GCC and Sun C complain in some cases. If the bug
is present, undef AT_FDCWD here, so it can be redefined below. */
#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
# undef AT_FDCWD
#endif
/* Use the same bit pattern as Solaris 9, but with the proper
signedness. The bit pattern is important, in case this actually is
Solaris with the above workaround. */
#ifndef AT_FDCWD
# define AT_FDCWD (-3041965)
#endif
/* Use the same values as Solaris 9. This shouldn't matter, but
there's no real reason to differ. */
#ifndef AT_SYMLINK_NOFOLLOW
# define AT_SYMLINK_NOFOLLOW 4096
#endif
#ifndef AT_REMOVEDIR
# define AT_REMOVEDIR 1
#endif
/* Solaris 9 lacks these two, so just pick unique values. */
#ifndef AT_SYMLINK_FOLLOW
# define AT_SYMLINK_FOLLOW 2
#endif
#ifndef AT_EACCESS
# define AT_EACCESS 4
#endif
#endif /* _GL_FCNTL_H */
#endif /* _GL_FCNTL_H */
#endif

View file

@ -15,10 +15,10 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include "fd-hook.h" #include "third_party/make/lib/fd-hook.h"
#include <stdlib.h> #include <stdlib.h>

View file

@ -16,10 +16,11 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include "findprog.h" #include "third_party/make/lib/findprog.h"
#include "libc/sysv/consts/ok.h"
#include <errno.h> #include <errno.h>
#include <stdbool.h> #include <stdbool.h>
@ -27,9 +28,9 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "filename.h" #include "third_party/make/lib/filename.h"
#include "concat-filename.h" #include "third_party/make/lib/concat-filename.h"
#include "xalloc.h" #include "third_party/make/lib/xalloc.h"
#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__ #if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
/* Native Windows, OS/2, DOS */ /* Native Windows, OS/2, DOS */

View file

@ -76,7 +76,7 @@
We also #define LDAV_PRIVILEGED if a program will require We also #define LDAV_PRIVILEGED if a program will require
special installation to be able to call getloadavg. */ special installation to be able to call getloadavg. */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include <stdlib.h> #include <stdlib.h>
@ -88,7 +88,7 @@
# include <sys/types.h> # include <sys/types.h>
# if HAVE_SYS_PARAM_H # if HAVE_SYS_PARAM_H
# include <sys/param.h> // # include <sys/param.h>
# endif # endif
# include "intprops.h" # include "intprops.h"

View file

@ -14,10 +14,10 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include "getprogname.h" #include "third_party/make/lib/getprogname.h"
#include <errno.h> /* get program_invocation_name declaration */ #include <errno.h> /* get program_invocation_name declaration */
#include <stdlib.h> /* get __argv declaration */ #include <stdlib.h> /* get __argv declaration */
@ -51,7 +51,7 @@
# include <sys/procfs.h> # include <sys/procfs.h>
#endif #endif
#include "dirname.h" #include "third_party/make/lib/dirname.h"
#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */ #ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
char const * char const *

105
third_party/make/lib/limits.h vendored Normal file
View file

@ -0,0 +1,105 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* A GNU-like <limits.h>.
Copyright 2016-2020 Free Software Foundation, Inc.
This program 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, or
(at your option) any later version.
This program 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 <https://www.gnu.org/licenses/>. */
#ifndef _GL_LIMITS_H
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
/* The include_next requires a split double-inclusion guard. */
#include_next <limits.h>
#ifndef _GL_LIMITS_H
#define _GL_LIMITS_H
#ifndef LLONG_MIN
# if defined LONG_LONG_MIN /* HP-UX 11.31 */
# define LLONG_MIN LONG_LONG_MIN
# elif defined LONGLONG_MIN /* IRIX 6.5 */
# define LLONG_MIN LONGLONG_MIN
# elif defined __GNUC__
# define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
# endif
#endif
#ifndef LLONG_MAX
# if defined LONG_LONG_MAX /* HP-UX 11.31 */
# define LLONG_MAX LONG_LONG_MAX
# elif defined LONGLONG_MAX /* IRIX 6.5 */
# define LLONG_MAX LONGLONG_MAX
# elif defined __GNUC__
# define LLONG_MAX __LONG_LONG_MAX__
# endif
#endif
#ifndef ULLONG_MAX
# if defined ULONG_LONG_MAX /* HP-UX 11.31 */
# define ULLONG_MAX ULONG_LONG_MAX
# elif defined ULONGLONG_MAX /* IRIX 6.5 */
# define ULLONG_MAX ULONGLONG_MAX
# elif defined __GNUC__
# define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
# endif
#endif
/* The number of usable bits in an unsigned or signed integer type
with minimum value MIN and maximum value MAX, as an int expression
suitable in #if. Cover all known practical hosts. This
implementation exploits the fact that MAX is 1 less than a power of
2, and merely counts the number of 1 bits in MAX; "COBn" means
"count the number of 1 bits in the low-order n bits"). */
#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
#ifndef WORD_BIT
/* Assume 'int' is 32 bits wide. */
# define WORD_BIT 32
#endif
#ifndef LONG_BIT
/* Assume 'long' is 32 or 64 bits wide. */
# if LONG_MAX == INT_MAX
# define LONG_BIT 32
# else
# define LONG_BIT 64
# endif
#endif
/* Macros specified by ISO/IEC TS 18661-1:2014. */
#if (! defined ULLONG_WIDTH \
&& (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
#endif /* _GL_LIMITS_H */
#endif /* _GL_LIMITS_H */

133
third_party/make/lib/stdbool.h vendored Normal file
View file

@ -0,0 +1,133 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Copyright (C) 2001-2003, 2006-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program 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, or (at your option)
any later version.
This program 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 <https://www.gnu.org/licenses/>. */
#ifndef _GL_STDBOOL_H
#define _GL_STDBOOL_H
/* ISO C 99 <stdbool.h> for platforms that lack it. */
/* Usage suggestions:
Programs that use <stdbool.h> should be aware of some limitations
and standards compliance issues.
Standards compliance:
- <stdbool.h> must be #included before 'bool', 'false', 'true'
can be used.
- You cannot assume that sizeof (bool) == 1.
- Programs should not undefine the macros bool, true, and false,
as C99 lists that as an "obsolescent feature".
Limitations of this substitute, when used in a C89 environment:
- <stdbool.h> must be #included before the '_Bool' type can be used.
- You cannot assume that _Bool is a typedef; it might be a macro.
- Bit-fields of type 'bool' are not supported. Portable code
should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
- In C99, casts and automatic conversions to '_Bool' or 'bool' are
performed in such a way that every nonzero value gets converted
to 'true', and zero gets converted to 'false'. This doesn't work
with this substitute. With this substitute, only the values 0 and 1
give the expected result when converted to _Bool' or 'bool'.
- C99 allows the use of (_Bool)0.0 in constant expressions, but
this substitute cannot always provide this property.
Also, it is suggested that programs use 'bool' rather than '_Bool';
this isn't required, but 'bool' is more common. */
/* 7.16. Boolean type and values */
/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
definitions below, but temporarily we have to #undef them. */
#if defined __BEOS__ && !defined __HAIKU__
# include <OS.h> /* defines bool but not _Bool */
# undef false
# undef true
#endif
#ifdef __cplusplus
# define _Bool bool
# define bool bool
#else
# if defined __BEOS__ && !defined __HAIKU__
/* A compiler known to have 'bool'. */
/* If the compiler already has both 'bool' and '_Bool', we can assume they
are the same types. */
# if 0
typedef bool _Bool;
# endif
# else
# if !defined __GNUC__
/* If 1:
Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
the built-in _Bool type is used. See
https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
Similar bugs are likely with other compilers as well; this file
wouldn't be used if <stdbool.h> was working.
So we override the _Bool type.
If !1:
Need to define _Bool ourselves. As 'signed char' or as an enum type?
Use of a typedef, with SunPRO C, leads to a stupid
"warning: _Bool is a keyword in ISO C99".
Use of an enum type, with IRIX cc, leads to a stupid
"warning(1185): enumerated type mixed with another type".
Even the existence of an enum type, without a typedef,
"Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
The only benefit of the enum, debuggability, is not important
with these compilers. So use 'signed char' and no enum. */
# define _Bool signed char
# else
/* With this compiler, trust the _Bool type if the compiler has it. */
# if !1
/* For the sake of symbolic names in gdb, define true and false as
enum constants, not only as macros.
It is tempting to write
typedef enum { false = 0, true = 1 } _Bool;
so that gdb prints values of type 'bool' symbolically. But then
values of type '_Bool' might promote to 'int' or 'unsigned int'
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
(see ISO C 99 6.3.1.1.(2)). So add a negative value to the
enum; this ensures that '_Bool' promotes to 'int'. */
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
# endif
# endif
# endif
// # define bool _Bool
#endif
/* The other macros must be usable in preprocessor directives. */
#ifdef __cplusplus
# define false false
# define true true
#else
# define false 0
# define true 1
#endif
#define __bool_true_false_are_defined 1
#endif /* _GL_STDBOOL_H */

122
third_party/make/lib/stddef.h vendored Normal file
View file

@ -0,0 +1,122 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
This program 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, or (at your option)
any later version.
This program 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 <https://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
/*
* POSIX 2008 <stddef.h> for platforms that have issues.
* <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html>
*/
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
#if defined __need_wchar_t || defined __need_size_t \
|| defined __need_ptrdiff_t || defined __need_NULL \
|| defined __need_wint_t
/* Special invocation convention inside gcc header files. In
particular, gcc provides a version of <stddef.h> that blindly
redefines NULL even when __need_wint_t was defined, even though
wint_t is not normally provided by <stddef.h>. Hence, we must
remember if special invocation has ever been used to obtain wint_t,
in which case we need to clean up NULL yet again. */
# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
# ifdef __need_wint_t
# define _GL_STDDEF_WINT_T
# endif
# include_next <stddef.h>
# endif
#else
/* Normal invocation convention. */
# ifndef _GL_STDDEF_H
/* The include_next requires a split double-inclusion guard. */
# include_next <stddef.h>
/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
# if (0 \
&& (!defined _GL_STDDEF_H || defined _GL_STDDEF_WINT_T))
# undef NULL
# ifdef __cplusplus
/* ISO C++ says that the macro NULL must expand to an integer constant
expression, hence '((void *) 0)' is not allowed in C++. */
# if __GNUG__ >= 3
/* GNU C++ has a __null macro that behaves like an integer ('int' or
'long') but has the same size as a pointer. Use that, to avoid
warnings. */
# define NULL __null
# else
# define NULL 0L
# endif
# else
# define NULL ((void *) 0)
# endif
# endif
# ifndef _GL_STDDEF_H
# define _GL_STDDEF_H
/* Some platforms lack wchar_t. */
#if !1
# define wchar_t int
#endif
/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is
a hack in case the configure-time test was done with g++ even though
we are currently compiling with gcc.
On MSVC, max_align_t is defined only in C++ mode, after <cstddef> was
included. Its definition is good since it has an alignment of 8 (on x86
and x86_64). */
#if defined _MSC_VER && defined __cplusplus
# include <cstddef>
#else
# if ! (0 || defined _GCC_MAX_ALIGN_T)
# if !GNULIB_defined_max_align_t
/* On the x86, the maximum storage alignment of double, long, etc. is 4,
but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
and the C11 standard allows this. Work around this problem by
using __alignof__ (which returns 8 for double) rather than _Alignof
(which returns 4), and align each union member accordingly. */
# ifdef __GNUC__
# define _GL_STDDEF_ALIGNAS(type) \
__attribute__ ((__aligned__ (__alignof__ (type))))
# else
# define _GL_STDDEF_ALIGNAS(type) /* */
# endif
typedef union
{
char *__p _GL_STDDEF_ALIGNAS (char *);
double __d _GL_STDDEF_ALIGNAS (double);
long double __ld _GL_STDDEF_ALIGNAS (long double);
long int __i _GL_STDDEF_ALIGNAS (long int);
} rpl_max_align_t;
# define max_align_t rpl_max_align_t
# define GNULIB_defined_max_align_t 1
# endif
# endif
#endif
# endif /* _GL_STDDEF_H */
# endif /* _GL_STDDEF_H */
#endif /* __need_XXX */

747
third_party/make/lib/stdint.h vendored Normal file
View file

@ -0,0 +1,747 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
This program 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, or (at your option)
any later version.
This program 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 <https://www.gnu.org/licenses/>. */
/*
* ISO C 99 <stdint.h> for platforms that lack it.
* <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html>
*/
#ifndef _GL_STDINT_H
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
/* When including a system file that in turn includes <inttypes.h>,
use the system <inttypes.h>, not our substitute. This avoids
problems with (for example) VMS, whose <sys/bitypes.h> includes
<inttypes.h>. */
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
/* On Android (Bionic libc), <sys/types.h> includes this file before
having defined 'time_t'. Therefore in this case avoid including
other system header files; just include the system's <stdint.h>.
Ideally we should test __BIONIC__ here, but it is only defined after
<sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
#if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H
# include_next <stdint.h>
#else
/* Get those types that are already defined in other system include
files, so that we can "#define int8_t signed char" below without
worrying about a later system include file containing a "typedef
signed char int8_t;" that will get messed up by our macro. Our
macros should all be consistent with the system versions, except
for the "fast" types and macros, which we recommend against using
in public interfaces due to compiler differences. */
#if 1
# if defined __sgi && ! defined __c99
/* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
with "This header file is to be used only for c99 mode compilations"
diagnostics. */
# define __STDINT_H__
# endif
/* Some pre-C++11 <stdint.h> implementations need this. */
# ifdef __cplusplus
# ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS 1
# endif
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS 1
# endif
# endif
/* Other systems may have an incomplete or buggy <stdint.h>.
Include it before <inttypes.h>, since any "#include <stdint.h>"
in <inttypes.h> would reinclude us, skipping our contents because
_GL_STDINT_H is defined.
The include_next requires a split double-inclusion guard. */
# include_next <stdint.h>
#endif
#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
#define _GL_STDINT_H
/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */
#include <limits.h>
/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
wint_t. */
#if 0
# undef WINT_MIN
# undef WINT_MAX
# define WINT_MIN 0x0U
# define WINT_MAX 0xffffffffU
#endif
#if ! 0
/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
AIX 5.2 <sys/types.h> isn't needed and causes troubles.
Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
relies on the system <stdint.h> definitions, so include
<sys/types.h> after <stdint.h>. */
# if 1 && ! defined _AIX
# include <sys/types.h>
# endif
# if 1
/* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
<inttypes.h> also defines intptr_t and uintptr_t. */
# include <inttypes.h>
# elif 0
/* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
# include <sys/inttypes.h>
# endif
# if 0 && ! defined __BIT_TYPES_DEFINED__
/* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
included by <sys/types.h>. */
# include <sys/bitypes.h>
# endif
# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
/* Minimum and maximum values for an integer type under the usual assumption.
Return an unspecified value if BITS == 0, adding a check to pacify
picky compilers. */
/* These are separate macros, because if you try to merge these macros into
a single one, HP-UX cc rejects the resulting expression in constant
expressions. */
# define _STDINT_UNSIGNED_MIN(bits, zero) \
(zero)
# define _STDINT_SIGNED_MIN(bits, zero) \
(~ _STDINT_MAX (1, bits, zero))
# define _STDINT_MAX(signed, bits, zero) \
(((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
#if !GNULIB_defined_stdint_types
/* 7.18.1.1. Exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. */
# undef int8_t
# undef uint8_t
typedef signed char gl_int8_t;
typedef unsigned char gl_uint8_t;
# define int8_t gl_int8_t
# define uint8_t gl_uint8_t
# undef int16_t
# undef uint16_t
typedef short int gl_int16_t;
typedef unsigned short int gl_uint16_t;
# define int16_t gl_int16_t
# define uint16_t gl_uint16_t
# undef int32_t
# undef uint32_t
typedef int gl_int32_t;
typedef unsigned int gl_uint32_t;
# define int32_t gl_int32_t
# define uint32_t gl_uint32_t
/* If the system defines INT64_MAX, assume int64_t works. That way,
if the underlying platform defines int64_t to be a 64-bit long long
int, the code below won't mistakenly define it to be a 64-bit long
int, which would mess up C++ name mangling. We must use #ifdef
rather than #if, to avoid an error with HP-UX 10.20 cc. */
# ifdef INT64_MAX
# define GL_INT64_T
# else
/* Do not undefine int64_t if gnulib is not being used with 64-bit
types, since otherwise it breaks platforms like Tandem/NSK. */
# if LONG_MAX >> 31 >> 31 == 1
# undef int64_t
typedef long int gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# elif defined _MSC_VER
# undef int64_t
typedef __int64 gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# else
# undef int64_t
typedef long long int gl_int64_t;
# define int64_t gl_int64_t
# define GL_INT64_T
# endif
# endif
# ifdef UINT64_MAX
# define GL_UINT64_T
# else
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
# undef uint64_t
typedef unsigned long int gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# elif defined _MSC_VER
# undef uint64_t
typedef unsigned __int64 gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# else
# undef uint64_t
typedef unsigned long long int gl_uint64_t;
# define uint64_t gl_uint64_t
# define GL_UINT64_T
# endif
# endif
/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
# define _UINT8_T
# define _UINT32_T
# define _UINT64_T
/* 7.18.1.2. Minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
are the same as the corresponding N_t types. */
# undef int_least8_t
# undef uint_least8_t
# undef int_least16_t
# undef uint_least16_t
# undef int_least32_t
# undef uint_least32_t
# undef int_least64_t
# undef uint_least64_t
# define int_least8_t int8_t
# define uint_least8_t uint8_t
# define int_least16_t int16_t
# define uint_least16_t uint16_t
# define int_least32_t int32_t
# define uint_least32_t uint32_t
# ifdef GL_INT64_T
# define int_least64_t int64_t
# endif
# ifdef GL_UINT64_T
# define uint_least64_t uint64_t
# endif
/* 7.18.1.3. Fastest minimum-width integer types */
/* Note: Other <stdint.h> substitutes may define these types differently.
It is not recommended to use these types in public header files. */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
are taken from the same list of types. The following code normally
uses types consistent with glibc, as that lessens the chance of
incompatibility with older GNU hosts. */
# undef int_fast8_t
# undef uint_fast8_t
# undef int_fast16_t
# undef uint_fast16_t
# undef int_fast32_t
# undef uint_fast32_t
# undef int_fast64_t
# undef uint_fast64_t
typedef signed char gl_int_fast8_t;
typedef unsigned char gl_uint_fast8_t;
# ifdef __sun
/* Define types compatible with SunOS 5.10, so that code compiled under
earlier SunOS versions works with code compiled under SunOS 5.10. */
typedef int gl_int_fast32_t;
typedef unsigned int gl_uint_fast32_t;
# else
typedef long int gl_int_fast32_t;
typedef unsigned long int gl_uint_fast32_t;
# endif
typedef gl_int_fast32_t gl_int_fast16_t;
typedef gl_uint_fast32_t gl_uint_fast16_t;
# define int_fast8_t gl_int_fast8_t
# define uint_fast8_t gl_uint_fast8_t
# define int_fast16_t gl_int_fast16_t
# define uint_fast16_t gl_uint_fast16_t
# define int_fast32_t gl_int_fast32_t
# define uint_fast32_t gl_uint_fast32_t
# ifdef GL_INT64_T
# define int_fast64_t int64_t
# endif
# ifdef GL_UINT64_T
# define uint_fast64_t uint64_t
# endif
/* 7.18.1.4. Integer types capable of holding object pointers */
/* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own
definitions of intptr_t and uintptr_t (which use int and unsigned)
to avoid clashes with declarations of system functions like sbrk.
Similarly, mingw 5.22 <crtdefs.h> defines _INTPTR_T_DEFINED and
_UINTPTR_T_DEFINED and needs its own definitions of intptr_t and
uintptr_t to avoid conflicting declarations of system functions like
_findclose in <io.h>. */
# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \
|| (defined __MINGW32__ && defined _INTPTR_T_DEFINED && defined _UINTPTR_T_DEFINED))
# undef intptr_t
# undef uintptr_t
# ifdef _WIN64
typedef long long int gl_intptr_t;
typedef unsigned long long int gl_uintptr_t;
# else
typedef long int gl_intptr_t;
typedef unsigned long int gl_uintptr_t;
# endif
# define intptr_t gl_intptr_t
# define uintptr_t gl_uintptr_t
# endif
/* 7.18.1.5. Greatest-width integer types */
/* Note: These types are compiler dependent. It may be unwise to use them in
public header files. */
/* If the system defines INTMAX_MAX, assume that intmax_t works, and
similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
assuming one type where another is used by the system. */
# ifndef INTMAX_MAX
# undef INTMAX_C
# undef intmax_t
# if LONG_MAX >> 30 == 1
typedef long long int gl_intmax_t;
# define intmax_t gl_intmax_t
# elif defined GL_INT64_T
# define intmax_t int64_t
# else
typedef long int gl_intmax_t;
# define intmax_t gl_intmax_t
# endif
# endif
# ifndef UINTMAX_MAX
# undef UINTMAX_C
# undef uintmax_t
# if ULONG_MAX >> 31 == 1
typedef unsigned long long int gl_uintmax_t;
# define uintmax_t gl_uintmax_t
# elif defined GL_UINT64_T
# define uintmax_t uint64_t
# else
typedef unsigned long int gl_uintmax_t;
# define uintmax_t gl_uintmax_t
# endif
# endif
/* Verify that intmax_t and uintmax_t have the same size. Too much code
breaks if this is not the case. If this check fails, the reason is likely
to be found in the autoconf macros. */
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
? 1 : -1];
# define GNULIB_defined_stdint_types 1
# endif /* !GNULIB_defined_stdint_types */
/* 7.18.2. Limits of specified-width integer types */
/* 7.18.2.1. Limits of exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. */
# undef INT8_MIN
# undef INT8_MAX
# undef UINT8_MAX
# define INT8_MIN (~ INT8_MAX)
# define INT8_MAX 127
# define UINT8_MAX 255
# undef INT16_MIN
# undef INT16_MAX
# undef UINT16_MAX
# define INT16_MIN (~ INT16_MAX)
# define INT16_MAX 32767
# define UINT16_MAX 65535
# undef INT32_MIN
# undef INT32_MAX
# undef UINT32_MAX
# define INT32_MIN (~ INT32_MAX)
# define INT32_MAX 2147483647
# define UINT32_MAX 4294967295U
# if defined GL_INT64_T && ! defined INT64_MAX
/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
evaluates the latter incorrectly in preprocessor expressions. */
# define INT64_MIN (- INTMAX_C (1) << 63)
# define INT64_MAX INTMAX_C (9223372036854775807)
# endif
# if defined GL_UINT64_T && ! defined UINT64_MAX
# define UINT64_MAX UINTMAX_C (18446744073709551615)
# endif
/* 7.18.2.2. Limits of minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
are the same as the corresponding N_t types. */
# undef INT_LEAST8_MIN
# undef INT_LEAST8_MAX
# undef UINT_LEAST8_MAX
# define INT_LEAST8_MIN INT8_MIN
# define INT_LEAST8_MAX INT8_MAX
# define UINT_LEAST8_MAX UINT8_MAX
# undef INT_LEAST16_MIN
# undef INT_LEAST16_MAX
# undef UINT_LEAST16_MAX
# define INT_LEAST16_MIN INT16_MIN
# define INT_LEAST16_MAX INT16_MAX
# define UINT_LEAST16_MAX UINT16_MAX
# undef INT_LEAST32_MIN
# undef INT_LEAST32_MAX
# undef UINT_LEAST32_MAX
# define INT_LEAST32_MIN INT32_MIN
# define INT_LEAST32_MAX INT32_MAX
# define UINT_LEAST32_MAX UINT32_MAX
# undef INT_LEAST64_MIN
# undef INT_LEAST64_MAX
# ifdef GL_INT64_T
# define INT_LEAST64_MIN INT64_MIN
# define INT_LEAST64_MAX INT64_MAX
# endif
# undef UINT_LEAST64_MAX
# ifdef GL_UINT64_T
# define UINT_LEAST64_MAX UINT64_MAX
# endif
/* 7.18.2.3. Limits of fastest minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
are taken from the same list of types. */
# undef INT_FAST8_MIN
# undef INT_FAST8_MAX
# undef UINT_FAST8_MAX
# define INT_FAST8_MIN SCHAR_MIN
# define INT_FAST8_MAX SCHAR_MAX
# define UINT_FAST8_MAX UCHAR_MAX
# undef INT_FAST16_MIN
# undef INT_FAST16_MAX
# undef UINT_FAST16_MAX
# define INT_FAST16_MIN INT_FAST32_MIN
# define INT_FAST16_MAX INT_FAST32_MAX
# define UINT_FAST16_MAX UINT_FAST32_MAX
# undef INT_FAST32_MIN
# undef INT_FAST32_MAX
# undef UINT_FAST32_MAX
# ifdef __sun
# define INT_FAST32_MIN INT_MIN
# define INT_FAST32_MAX INT_MAX
# define UINT_FAST32_MAX UINT_MAX
# else
# define INT_FAST32_MIN LONG_MIN
# define INT_FAST32_MAX LONG_MAX
# define UINT_FAST32_MAX ULONG_MAX
# endif
# undef INT_FAST64_MIN
# undef INT_FAST64_MAX
# ifdef GL_INT64_T
# define INT_FAST64_MIN INT64_MIN
# define INT_FAST64_MAX INT64_MAX
# endif
# undef UINT_FAST64_MAX
# ifdef GL_UINT64_T
# define UINT_FAST64_MAX UINT64_MAX
# endif
/* 7.18.2.4. Limits of integer types capable of holding object pointers */
# undef INTPTR_MIN
# undef INTPTR_MAX
# undef UINTPTR_MAX
# ifdef _WIN64
# define INTPTR_MIN LLONG_MIN
# define INTPTR_MAX LLONG_MAX
# define UINTPTR_MAX ULLONG_MAX
# else
# define INTPTR_MIN LONG_MIN
# define INTPTR_MAX LONG_MAX
# define UINTPTR_MAX ULONG_MAX
# endif
/* 7.18.2.5. Limits of greatest-width integer types */
# ifndef INTMAX_MAX
# undef INTMAX_MIN
# ifdef INT64_MAX
# define INTMAX_MIN INT64_MIN
# define INTMAX_MAX INT64_MAX
# else
# define INTMAX_MIN INT32_MIN
# define INTMAX_MAX INT32_MAX
# endif
# endif
# ifndef UINTMAX_MAX
# ifdef UINT64_MAX
# define UINTMAX_MAX UINT64_MAX
# else
# define UINTMAX_MAX UINT32_MAX
# endif
# endif
/* 7.18.3. Limits of other integer types */
/* ptrdiff_t limits */
# undef PTRDIFF_MIN
# undef PTRDIFF_MAX
# if 0
# ifdef _LP64
# define PTRDIFF_MIN _STDINT_SIGNED_MIN (64, 0l)
# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
# else
# define PTRDIFF_MIN _STDINT_SIGNED_MIN (32, 0)
# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
# endif
# else
# define PTRDIFF_MIN \
_STDINT_SIGNED_MIN (64, 0l)
# define PTRDIFF_MAX \
_STDINT_MAX (1, 64, 0l)
# endif
/* sig_atomic_t limits */
# undef SIG_ATOMIC_MIN
# undef SIG_ATOMIC_MAX
# if 1
# define SIG_ATOMIC_MIN \
_STDINT_SIGNED_MIN (32, 0)
# else
# define SIG_ATOMIC_MIN \
_STDINT_UNSIGNED_MIN (32, 0)
# endif
# define SIG_ATOMIC_MAX \
_STDINT_MAX (1, 32, \
0)
/* size_t limit */
# undef SIZE_MAX
# if 0
# ifdef _LP64
# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
# else
# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
# endif
# else
# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
# endif
/* wchar_t limits */
/* Get WCHAR_MIN, WCHAR_MAX.
This include is not on the top, above, because on OSF/1 4.0 we have a
sequence of nested includes
<wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
<stdint.h> and assumes its types are already defined. */
# if 1 && ! (defined WCHAR_MIN && defined WCHAR_MAX)
/* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
# include <stddef.h>
# include <stdio.h>
# include <time.h>
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
# include <wchar.h>
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
# endif
# undef WCHAR_MIN
# undef WCHAR_MAX
# if 1
# define WCHAR_MIN \
_STDINT_SIGNED_MIN (32, 0)
# else
# define WCHAR_MIN \
_STDINT_UNSIGNED_MIN (32, 0)
# endif
# define WCHAR_MAX \
_STDINT_MAX (1, 32, 0)
/* wint_t limits */
/* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, u is not
accurate, therefore use the definitions from above. */
# if !0
# undef WINT_MIN
# undef WINT_MAX
# if 0
# define WINT_MIN \
_STDINT_SIGNED_MIN (32, 0u)
# else
# define WINT_MIN \
_STDINT_UNSIGNED_MIN (32, 0u)
# endif
# define WINT_MAX \
_STDINT_MAX (0, 32, 0u)
# endif
/* 7.18.4. Macros for integer constants */
/* 7.18.4.1. Macros for minimum-width integer constants */
/* According to ISO C 99 Technical Corrigendum 1 */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
# undef INT8_C
# undef UINT8_C
# define INT8_C(x) x
# define UINT8_C(x) x
# undef INT16_C
# undef UINT16_C
# define INT16_C(x) x
# define UINT16_C(x) x
# undef INT32_C
# undef UINT32_C
# define INT32_C(x) x
# define UINT32_C(x) x ## U
# undef INT64_C
# undef UINT64_C
# if LONG_MAX >> 31 >> 31 == 1
# define INT64_C(x) x##L
# elif defined _MSC_VER
# define INT64_C(x) x##i64
# else
# define INT64_C(x) x##LL
# endif
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
# define UINT64_C(x) x##UL
# elif defined _MSC_VER
# define UINT64_C(x) x##ui64
# else
# define UINT64_C(x) x##ULL
# endif
/* 7.18.4.2. Macros for greatest-width integer constants */
# ifndef INTMAX_C
# if LONG_MAX >> 30 == 1
# define INTMAX_C(x) x##LL
# elif defined GL_INT64_T
# define INTMAX_C(x) INT64_C(x)
# else
# define INTMAX_C(x) x##L
# endif
# endif
# ifndef UINTMAX_C
# if ULONG_MAX >> 31 == 1
# define UINTMAX_C(x) x##ULL
# elif defined GL_UINT64_T
# define UINTMAX_C(x) UINT64_C(x)
# else
# define UINTMAX_C(x) x##UL
# endif
# endif
#endif /* !0 */
/* Macros specified by ISO/IEC TS 18661-1:2014. */
#if (!defined UINTMAX_WIDTH \
&& (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
# ifdef INT8_MAX
# define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX)
# endif
# ifdef UINT8_MAX
# define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX)
# endif
# ifdef INT16_MAX
# define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX)
# endif
# ifdef UINT16_MAX
# define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX)
# endif
# ifdef INT32_MAX
# define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX)
# endif
# ifdef UINT32_MAX
# define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX)
# endif
# ifdef INT64_MAX
# define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX)
# endif
# ifdef UINT64_MAX
# define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX)
# endif
# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX)
# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX)
# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX)
# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX)
# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX)
# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX)
# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX)
# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX)
# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX)
# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX)
# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX)
# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX)
# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX)
# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX)
# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX)
# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX)
# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX)
# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX)
# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX)
# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX)
# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX)
# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX)
# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
# ifdef WINT_MAX
# define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX)
# endif
# ifdef SIG_ATOMIC_MAX
# define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX)
# endif
#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
#endif /* _GL_STDINT_H */
#endif /* !(defined __ANDROID__ && ...) */
#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */

1918
third_party/make/lib/stdio.h vendored Normal file

File diff suppressed because it is too large Load diff

1626
third_party/make/lib/stdlib.h vendored Normal file

File diff suppressed because it is too large Load diff

1541
third_party/make/lib/string.h vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -16,9 +16,9 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
#include "dirname.h" #include "third_party/make/lib/dirname.h"
/* Remove trailing slashes from FILE. Return true if a trailing slash /* Remove trailing slashes from FILE. Return true if a trailing slash
was removed. This is useful when using file name completion from a was removed. This is useful when using file name completion from a

View file

@ -1,4 +1,4 @@
#include <config.h> #include "third_party/make/src/config.h"
#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE #define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
#include "unistd.h" #include "third_party/make/lib/unistd.h"
typedef int dummy; typedef int dummy;

2193
third_party/make/lib/unistd.h vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -16,16 +16,16 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
#include "xalloc.h" #include "third_party/make/lib/xalloc.h"
#include <stdlib.h> #include <stdlib.h>
#include "error.h" #include "third_party/make/lib/error.h"
#include "exitfail.h" #include "third_party/make/lib/exitfail.h"
#include "gettext.h" #include "third_party/make/src/gettext.h"
#define _(msgid) gettext (msgid) #define _(msgid) gettext (msgid)
void void

View file

@ -20,8 +20,9 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "libc/limits.h"
#include "xalloc-oversized.h" #include "third_party/make/lib/xalloc-oversized.h"
#ifndef _GL_INLINE_HEADER_BEGIN #ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first." #error "Please include config.h first."

View file

@ -16,12 +16,12 @@
/* Written by Bruno Haible <haible@clisp.cons.org>. */ /* Written by Bruno Haible <haible@clisp.cons.org>. */
#include <config.h> #include "third_party/make/src/config.h"
/* Specification. */ /* Specification. */
#include "concat-filename.h" #include "third_party/make/lib/concat-filename.h"
#include "xalloc.h" #include "third_party/make/lib/xalloc.h"
/* Concatenate a directory filename, a relative filename and an optional /* Concatenate a directory filename, a relative filename and an optional
suffix. The directory may end with the directory separator. The second suffix. The directory may end with the directory separator. The second

View file

@ -15,11 +15,11 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h> #include "third_party/make/src/config.h"
#define XALLOC_INLINE _GL_EXTERN_INLINE #define XALLOC_INLINE _GL_EXTERN_INLINE
#include "xalloc.h" #include "third_party/make/lib/xalloc.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

129
third_party/make/make.mk vendored Normal file
View file

@ -0,0 +1,129 @@
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
PKGS += THIRD_PARTY_MAKE
THIRD_PARTY_MAKE_COMS = \
o/$(MODE)/third_party/make/make.com
THIRD_PARTY_MAKE_BINS = \
$(THIRD_PARTY_MAKE_COMS) \
$(THIRD_PARTY_MAKE_COMS:%=%.dbg)
THIRD_PARTY_MAKE_A = \
o/$(MODE)/third_party/make/make.a
THIRD_PARTY_MAKE_CHECKS = \
$(THIRD_PARTY_MAKE_A).pkg
# libgnu.a recipe
THIRD_PARTY_MAKE_SRCS_LIB = \
third_party/make/lib/basename-lgpl.c \
third_party/make/lib/concat-filename.c \
third_party/make/lib/dirname-lgpl.c \
third_party/make/lib/dup2.c \
third_party/make/lib/error.c \
third_party/make/lib/exitfail.c \
third_party/make/lib/fcntl.c \
third_party/make/lib/fd-hook.c \
third_party/make/lib/findprog-in.c \
third_party/make/lib/getloadavg.c \
third_party/make/lib/getprogname.c \
third_party/make/lib/stripslash.c \
third_party/make/lib/unistd.c \
third_party/make/lib/xalloc-die.c \
third_party/make/lib/xconcat-filename.c \
third_party/make/lib/xmalloc.c
THIRD_PARTY_MAKE_SRCS_BASE = \
third_party/make/src/ar.c \
third_party/make/src/arscan.c \
third_party/make/src/commands.c \
third_party/make/src/default.c \
third_party/make/src/dir.c \
third_party/make/src/expand.c \
third_party/make/src/file.c \
third_party/make/src/function.c \
third_party/make/src/getopt.c \
third_party/make/src/getopt1.c \
third_party/make/src/guile.c \
third_party/make/src/hash.c \
third_party/make/src/implicit.c \
third_party/make/src/job.c \
third_party/make/src/load.c \
third_party/make/src/loadapi.c \
third_party/make/src/main.c \
third_party/make/src/misc.c \
third_party/make/src/output.c \
third_party/make/src/posixos.c \
third_party/make/src/read.c \
third_party/make/src/remake.c \
third_party/make/src/remote-stub.c \
third_party/make/src/rule.c \
third_party/make/src/signame.c \
third_party/make/src/strcache.c \
third_party/make/src/variable.c \
third_party/make/src/version.c \
third_party/make/src/vpath.c
THIRD_PARTY_MAKE_SRCS = \
$(THIRD_PARTY_MAKE_SRCS_BASE) \
$(THIRD_PARTY_MAKE_SRCS_LIB)
THIRD_PARTY_MAKE_OBJS = \
$(THIRD_PARTY_MAKE_SRCS:%.c=o/$(MODE)/%.o)
THIRD_PARTY_MAKE_DIRECTDEPS = \
LIBC_CALLS \
LIBC_FMT \
LIBC_INTRIN \
LIBC_LOG \
LIBC_MEM \
LIBC_NEXGEN32E \
LIBC_RUNTIME \
LIBC_STDIO \
LIBC_STR \
LIBC_SYSV \
LIBC_SYSV_CALLS \
LIBC_TIME \
LIBC_X \
LIBC_TINYMATH \
LIBC_UNICODE \
THIRD_PARTY_COMPILER_RT \
THIRD_PARTY_MUSL \
THIRD_PARTY_GDTOA
THIRD_PARTY_MAKE_DEPS := \
$(call uniq,$(foreach x,$(THIRD_PARTY_MAKE_DIRECTDEPS),$($(x))))
$(THIRD_PARTY_MAKE_A).pkg: \
$(THIRD_PARTY_MAKE_OBJS) \
$(foreach x,$(THIRD_PARTY_MAKE_DIRECTDEPS),$($(x)_A).pkg)
$(THIRD_PARTY_MAKE_A): \
third_party/make/ \
$(THIRD_PARTY_MAKE_A).pkg \
$(filter-out %main.o,$(THIRD_PARTY_MAKE_OBJS))
o/$(MODE)/third_party/make/make.com.dbg: \
$(THIRD_PARTY_MAKE_DEPS) \
$(THIRD_PARTY_MAKE_A) \
$(THIRD_PARTY_MAKE_A).pkg \
o/$(MODE)/third_party/make/src/main.o \
$(CRT) \
$(APE)
@$(APELINK)
$(THIRD_PARTY_MAKE_OBJS): \
OVERRIDE_CFLAGS += \
-isystem libc/isystem \
-DHAVE_CONFIG_H \
-DINCLUDEDIR=\".\" \
-DLIBDIR=\".\" \
-DLOCALEDIR=\".\"
.PHONY: o/$(MODE)/third_party/make
o/$(MODE)/third_party/make: \
$(THIRD_PARTY_MAKE_BINS) \
$(THIRD_PARTY_MAKE_CHECKS)

View file

@ -15,13 +15,13 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#ifndef NO_ARCHIVES #ifndef NO_ARCHIVES
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include <fnmatch.h> #include "third_party/musl/fnmatch.h"
/* Return nonzero if NAME is an archive-member reference, zero if not. An /* Return nonzero if NAME is an archive-member reference, zero if not. An
archive-member reference is a name like 'lib(member)' where member is a archive-member reference is a name like 'lib(member)' where member is a

View file

@ -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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#ifdef TEST #ifdef TEST
/* Hack, the real error() routine eventually pulls in die from main.c */ /* Hack, the real error() routine eventually pulls in die from main.c */
@ -376,7 +376,7 @@ struct ar_hdr
# define AR_HDR_SIZE (sizeof (struct ar_hdr)) # define AR_HDR_SIZE (sizeof (struct ar_hdr))
#endif #endif
#include "output.h" #include "third_party/make/src/output.h"
/* Takes three arguments ARCHIVE, FUNCTION and ARG. /* Takes three arguments ARCHIVE, FUNCTION and ARG.

View file

@ -14,15 +14,15 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#ifdef WINDOWS32 #ifdef WINDOWS32
#include <windows.h> #include <windows.h>
#include "w32err.h" // #include "w32err.h"
#endif #endif
#if VMS #if VMS

View file

@ -14,16 +14,16 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <assert.h> #include <assert.h>
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "rule.h" #include "third_party/make/src/rule.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
/* Define GCC_IS_NATIVE if gcc is the native development environment on /* Define GCC_IS_NATIVE if gcc is the native development environment on
your system (gcc/bison/flex vs cc/yacc/lex). */ your system (gcc/bison/flex vs cc/yacc/lex). */

View file

@ -14,10 +14,11 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "hash.h" #include "third_party/make/src/hash.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "third_party/musl/glob.h"
#ifndef __ptr_t #ifndef __ptr_t
#define __ptr_t void* #define __ptr_t void*
@ -119,7 +120,7 @@ dosify (const char *filename)
#endif /* __MSDOS__ */ #endif /* __MSDOS__ */
#ifdef WINDOWS32 #ifdef WINDOWS32
#include "pathstuff.h" //#include "pathstuff.h"
#endif #endif
#ifdef _AMIGA #ifdef _AMIGA

View file

@ -14,15 +14,15 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <assert.h> #include <assert.h>
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "rule.h" #include "third_party/make/src/rule.h"
/* Initially, any errors reported when expanding strings will be reported /* Initially, any errors reported when expanding strings will be reported
against the file where the error appears. */ against the file where the error appears. */

View file

@ -14,17 +14,17 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <assert.h> #include <assert.h>
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "hash.h" #include "third_party/make/src/hash.h"
/* Remember whether snap_deps has been invoked: we need this to be sure we /* Remember whether snap_deps has been invoked: we need this to be sure we

View file

@ -19,7 +19,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
that the makefile says how to make. that the makefile says how to make.
All of these are chained together through 'next'. */ All of these are chained together through 'next'. */
#include "hash.h" #include "third_party/make/src/hash.h"
struct commands; struct commands;
struct dep; struct dep;

View file

@ -14,17 +14,17 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "os.h" #include "third_party/make/src/os.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#ifdef _AMIGA #ifdef _AMIGA
#include "amiga.h" #include "third_party/make/src/amiga.h"
#endif #endif
@ -1484,7 +1484,7 @@ shell_completed (int exit_code, int exit_sig)
#include <windows.h> #include <windows.h>
#include <io.h> #include <io.h>
#include "sub_proc.h" // #include "sub_proc.h"
int int

View file

@ -27,8 +27,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#endif #endif
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include "third_party/make/src/config.h"
#endif #endif
#pragma GCC diagnostic ignored "-Wredundant-decls"
#if !defined __STDC__ || !__STDC__ #if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems /* This is a separate conditional since some stdc systems
@ -77,7 +78,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* This is for other GNU distributions with internationalized messages. /* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */ When compiling libc, the _ macro is predefined. */
#include "gettext.h" #include "third_party/make/src/gettext.h"
#define _(msgid) gettext (msgid) #define _(msgid) gettext (msgid)
@ -95,7 +96,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
GNU application programs can use a third alternative mode in which GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */ they can distinguish the relative order of options and other arguments. */
#include "getopt.h" #include "third_party/make/src/getopt.h"
/* For communication from `getopt' to the caller. /* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument, When `getopt' finds an option that takes an argument,

View file

@ -16,6 +16,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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "third_party/getopt/getopt.h"
#ifndef _GETOPT_H #ifndef _GETOPT_H
#if 0 && !defined(_GETOPT_H) #if 0 && !defined(_GETOPT_H)
#define _GETOPT_H 1 #define _GETOPT_H 1

View file

@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include "third_party/make/src/config.h"
#endif #endif
#include "getopt.h" #include "third_party/make/src/getopt.h"
#if !defined __STDC__ || !__STDC__ #if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems /* This is a separate conditional since some stdc systems

View file

@ -14,16 +14,16 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#ifdef HAVE_GUILE #ifdef HAVE_GUILE
#include "gnumake.h" #include "third_party/make/src/gnumake.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include <libguile.h> #include <libguile.h>
@ -82,7 +82,7 @@ static void
guile_define_module (void *data UNUSED) guile_define_module (void *data UNUSED)
{ {
/* Ingest the predefined Guile module for GNU make. */ /* Ingest the predefined Guile module for GNU make. */
#include "gmk-default.h" #include "third_party/make/src/gmk-default.h"
/* Register a subr for GNU make's eval capability. */ /* Register a subr for GNU make's eval capability. */
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (GSUBR_TYPE) guile_expand_wrapper); scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (GSUBR_TYPE) guile_expand_wrapper);

View file

@ -14,8 +14,8 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "hash.h" #include "third_party/make/src/hash.h"
#include <assert.h> #include <assert.h>
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n))) #define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))

View file

@ -14,14 +14,14 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "rule.h" #include "third_party/make/src/rule.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "job.h" /* struct child, used inside commands.h */ #include "third_party/make/src/job.h" /* struct child, used inside commands.h */
#include "commands.h" /* set_file_variables */ #include "third_party/make/src/commands.h" /* set_file_variables */
static int pattern_search (struct file *file, int archive, static int pattern_search (struct file *file, int archive,
unsigned int depth, unsigned int recursions); unsigned int depth, unsigned int recursions);

View file

@ -14,17 +14,17 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include "job.h" #include "third_party/make/src/job.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "os.h" #include "third_party/make/src/os.h"
/* Default shell to use. */ /* Default shell to use. */
#ifdef WINDOWS32 #ifdef WINDOWS32
@ -111,9 +111,9 @@ static void vmsWaitForChildren (int *);
# include <windows.h> # include <windows.h>
# include <io.h> # include <io.h>
# include <process.h> # include <process.h>
# include "sub_proc.h" // # include "sub_proc.h"
# include "w32err.h" // # include "w32err.h"
# include "pathstuff.h" // # include "pathstuff.h"
# define WAIT_NOHANG 1 # define WAIT_NOHANG 1
#endif /* WINDOWS32 */ #endif /* WINDOWS32 */

View file

@ -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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "output.h" #include "third_party/make/src/output.h"
/* Structure describing a running or dead child process. */ /* Structure describing a running or dead child process. */

View file

@ -14,21 +14,21 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#if MAKE_LOAD #if MAKE_LOAD
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <dlfcn.h> #include "libc/runtime/dlfcn.h"
#include <errno.h> #include <errno.h>
#define SYMBOL_EXTENSION "_gmk_setup" #define SYMBOL_EXTENSION "_gmk_setup"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "variable.h" #include "third_party/make/src/variable.h"
/* Tru64 V4.0 does not have this flag */ /* Tru64 V4.0 does not have this flag */
#ifndef RTLD_GLOBAL #ifndef RTLD_GLOBAL

View file

@ -14,11 +14,11 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "dep.h" #include "third_party/make/src/dep.h"
/* Allocate a buffer in our context, so we can free it. */ /* Allocate a buffer in our context, so we can free it. */
char * char *

View file

@ -14,16 +14,19 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "os.h" #include "third_party/make/src/os.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "rule.h" #include "third_party/make/src/rule.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "getopt.h" #include "third_party/make/src/getopt.h"
#include "libc/sysv/consts/sa.h"
#include "third_party/gdtoa/gdtoa.h"
#include <assert.h> #include <assert.h>
#ifdef _AMIGA #ifdef _AMIGA
@ -36,9 +39,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRINGS_H
# include <strings.h> /* for strcasecmp */ # include <strings.h> /* for strcasecmp */
#endif #endif
# include "pathstuff.h" // # include "pathstuff.h"
# include "sub_proc.h" // # include "sub_proc.h"
# include "w32err.h" // # include "w32err.h"
#endif #endif
#ifdef __EMX__ #ifdef __EMX__
# include <sys/types.h> # include <sys/types.h>

View file

@ -17,7 +17,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* We use <config.h> instead of "config.h" so that a compilation /* We use <config.h> instead of "config.h" so that a compilation
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
(which it would do because makeint.h was found in $srcdir). */ (which it would do because makeint.h was found in $srcdir). */
#include <config.h> #include "third_party/make/src/config.h"
#pragma GCC diagnostic ignored "-Wredundant-decls"
#undef HAVE_CONFIG_H #undef HAVE_CONFIG_H
#define HAVE_CONFIG_H 1 #define HAVE_CONFIG_H 1
@ -54,7 +55,7 @@ char *alloca ();
#ifdef WINDOWS32 #ifdef WINDOWS32
# define GMK_BUILDING_MAKE # define GMK_BUILDING_MAKE
#endif #endif
#include "gnumake.h" #include "third_party/make/src/gnumake.h"
#ifdef CRAY #ifdef CRAY
/* This must happen before #include <signal.h> so /* This must happen before #include <signal.h> so
@ -92,7 +93,7 @@ char *alloca ();
#include <errno.h> #include <errno.h>
#ifndef errno #if 0 && !defined(errno)
extern int errno; extern int errno;
#endif #endif
@ -143,7 +144,7 @@ extern int errno;
# include <limits.h> # include <limits.h>
#endif #endif
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> // # include <sys/param.h>
#endif #endif
#ifndef PATH_MAX #ifndef PATH_MAX
@ -344,7 +345,7 @@ extern mode_t umask (mode_t);
# define setlocale(category, locale) # define setlocale(category, locale)
#endif #endif
#include <gettext.h> #include "third_party/make/src/gettext.h"
#define _(msgid) gettext (msgid) #define _(msgid) gettext (msgid)
#define N_(msgid) gettext_noop (msgid) #define N_(msgid) gettext_noop (msgid)
@ -460,7 +461,7 @@ extern int unixy_shell;
extern struct rlimit stack_limit; extern struct rlimit stack_limit;
#endif #endif
#include <glob.h> #include "third_party/musl/glob.h"
#define NILF ((floc *)0) #define NILF ((floc *)0)
@ -512,6 +513,9 @@ void out_of_memory () NORETURN;
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \ #define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
(_f), (_n), (_s)) (_f), (_n), (_s))
#include "libc/x/x.h"
#include "libc/time/struct/tm.h"
void die (int) NORETURN; void die (int) NORETURN;
void pfatal_with_name (const char *) NORETURN; void pfatal_with_name (const char *) NORETURN;
void perror_with_name (const char *, const char *); void perror_with_name (const char *, const char *);

View file

@ -14,10 +14,11 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "libc/calls/calls.h"
/* GNU make no longer supports pre-ANSI89 environments. */ /* GNU make no longer supports pre-ANSI89 environments. */

View file

@ -14,9 +14,10 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "os.h" #include "third_party/make/src/os.h"
#include "output.h" #include "third_party/make/src/output.h"
#include "libc/calls/struct/flock.h"
/* GNU make no longer supports pre-ANSI89 environments. */ /* GNU make no longer supports pre-ANSI89 environments. */
@ -37,7 +38,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef WINDOWS32 #ifdef WINDOWS32
# include <windows.h> # include <windows.h>
# include <io.h> # include <io.h>
# include "sub_proc.h" // # include "sub_proc.h"
#endif /* WINDOWS32 */ #endif /* WINDOWS32 */
struct output *output_context = NULL; struct output *output_context = NULL;

View file

@ -14,7 +14,8 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "libc/sysv/consts/sa.h"
#include <stdio.h> #include <stdio.h>
@ -28,9 +29,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
# include <sys/select.h> # include <sys/select.h>
#endif #endif
#include "debug.h" #include "third_party/make/src/debug.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "os.h" #include "third_party/make/src/os.h"
#ifdef MAKE_JOBSERVER #ifdef MAKE_JOBSERVER

View file

@ -14,25 +14,25 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <assert.h> #include <assert.h>
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "os.h" #include "third_party/make/src/os.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "rule.h" #include "third_party/make/src/rule.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include "hash.h" #include "third_party/make/src/hash.h"
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */ # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
#ifdef WINDOWS32 #ifdef WINDOWS32
#include <windows.h> #include <windows.h>
#include "sub_proc.h" // #include "sub_proc.h"
#else /* !WINDOWS32 */ #else /* !WINDOWS32 */
#ifndef _AMIGA #ifndef _AMIGA
#ifndef VMS #ifndef VMS

View file

@ -14,13 +14,13 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "debug.h" #include "third_party/make/src/debug.h"
#include <assert.h> #include <assert.h>

View file

@ -14,10 +14,10 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
char *remote_description = 0; char *remote_description = 0;

View file

@ -14,16 +14,16 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <assert.h> #include <assert.h>
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "rule.h" #include "third_party/make/src/rule.h"
static void freerule (struct rule *rule, struct rule *lastrule); static void freerule (struct rule *rule, struct rule *lastrule);

View file

@ -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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
/* If the system provides strsignal, we don't need it. */ /* If the system provides strsignal, we don't need it. */

View file

@ -14,12 +14,12 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <stddef.h> #include <stddef.h>
#include <assert.h> #include <assert.h>
#include "hash.h" #include "third_party/make/src/hash.h"
/* A string cached here will never be freed, so we don't need to worry about /* A string cached here will never be freed, so we don't need to worry about
reference counting. We just store the string, and then remember it in a reference counting. We just store the string, and then remember it in a

View file

@ -14,20 +14,20 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include <assert.h> #include <assert.h>
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "dep.h" #include "third_party/make/src/dep.h"
#include "job.h" #include "third_party/make/src/job.h"
#include "commands.h" #include "third_party/make/src/commands.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#include "rule.h" #include "third_party/make/src/rule.h"
#ifdef WINDOWS32 #ifdef WINDOWS32
#include "pathstuff.h" // #include "pathstuff.h"
#endif #endif
#include "hash.h" #include "third_party/make/src/hash.h"
/* Incremented every time we add or remove a global variable. */ /* Incremented every time we add or remove a global variable. */
static unsigned long variable_changenum; static unsigned long variable_changenum;

View file

@ -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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "hash.h" #include "third_party/make/src/hash.h"
/* Codes in a variable definition saying where the definition came from. /* Codes in a variable definition saying where the definition came from.
Increasing numeric values signify less-overridable definitions. */ Increasing numeric values signify less-overridable definitions. */

View file

@ -17,7 +17,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* We use <config.h> instead of "config.h" so that a compilation /* We use <config.h> instead of "config.h" so that a compilation
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
(which it would do because makeint.h was found in $srcdir). */ (which it would do because makeint.h was found in $srcdir). */
#include <config.h> #include "third_party/make/src/config.h"
#ifndef MAKE_HOST #ifndef MAKE_HOST
# define MAKE_HOST "unknown" # define MAKE_HOST "unknown"

View file

@ -14,11 +14,11 @@ 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 You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h" #include "third_party/make/src/makeint.h"
#include "filedef.h" #include "third_party/make/src/filedef.h"
#include "variable.h" #include "third_party/make/src/variable.h"
#ifdef WINDOWS32 #ifdef WINDOWS32
#include "pathstuff.h" // #include "pathstuff.h"
#endif #endif

View file

@ -15,6 +15,7 @@ o/$(MODE)/third_party: \
o/$(MODE)/third_party/lua \ o/$(MODE)/third_party/lua \
o/$(MODE)/third_party/lz4cli \ o/$(MODE)/third_party/lz4cli \
o/$(MODE)/third_party/mbedtls \ o/$(MODE)/third_party/mbedtls \
o/$(MODE)/third_party/make \
o/$(MODE)/third_party/musl \ o/$(MODE)/third_party/musl \
o/$(MODE)/third_party/python \ o/$(MODE)/third_party/python \
o/$(MODE)/third_party/quickjs \ o/$(MODE)/third_party/quickjs \