VirtualBox

Changeset 3138 in kBuild for vendor/gnumake/current/makeint.h


Ignore:
Timestamp:
Mar 12, 2018 7:32:29 PM (7 years ago)
Author:
bird
Message:

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/makeint.h

    r3137 r3138  
    11/* Miscellaneous global declarations and portability cruft for GNU Make.
    2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
    4 2010 Free Software Foundation, Inc.
     2Copyright (C) 1988-2016 Free Software Foundation, Inc.
    53This file is part of GNU Make.
    64
     
    1917/* We use <config.h> instead of "config.h" so that a compilation
    2018   using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
    21    (which it would do because make.h was found in $srcdir).  */
     19   (which it would do because makeint.h was found in $srcdir).  */
    2220#include <config.h>
    2321#undef  HAVE_CONFIG_H
     
    4442#endif
    4543
     44/* Disable assert() unless we're a maintainer.
     45   Some asserts are compute-intensive.  */
     46#ifndef MAKE_MAINTAINER_MODE
     47# define NDEBUG 1
     48#endif
     49
     50/* Include the externally-visible content.
     51   Be sure to use the local one, and not one installed on the system.
     52   Define GMK_BUILDING_MAKE for proper selection of dllexport/dllimport
     53   declarations for MS-Windows.  */
     54#ifdef WINDOWS32
     55# define GMK_BUILDING_MAKE
     56#endif
     57#include "gnumake.h"
    4658
    4759#ifdef  CRAY
     
    6173#include <stdio.h>
    6274#include <ctype.h>
     75
    6376#ifdef HAVE_SYS_TIMEB_H
    64 /* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs
    65    unless <sys/timeb.h> has been included first.  Does every system have a
    66    <sys/timeb.h>?  If any does not, configure should check for it.  */
     77/* SCO 3.2 "devsys 4.2" has a prototype for 'ftime' in <time.h> that bombs
     78   unless <sys/timeb.h> has been included first.  */
    6779# include <sys/timeb.h>
    6880#endif
    69 
    7081#if TIME_WITH_SYS_TIME
    7182# include <sys/time.h>
     
    8596#endif
    8697
    87 #ifndef isblank
    88 # define isblank(c)     ((c) == ' ' || (c) == '\t')
     98#ifdef __VMS
     99/* In strict ANSI mode, VMS compilers should not be defining the
     100   VMS macro.  Define it here instead of a bulk edit for the correct code.
     101 */
     102# ifndef VMS
     103#  define VMS
     104# endif
    89105#endif
    90106
     
    92108# include <unistd.h>
    93109/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
    94    POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself!  */
     110   POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself!  */
    95111# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
    96112#  define POSIX 1
     
    117133#ifndef HAVE_SA_RESTART
    118134# define SA_RESTART 0
     135#endif
     136
     137#ifdef HAVE_VFORK_H
     138# include <vfork.h>
    119139#endif
    120140
     
    149169#endif
    150170
    151 /* Nonzero if the integer type T is signed.  */
    152 #define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0)
     171#ifndef USHRT_MAX
     172# define USHRT_MAX 65535
     173#endif
     174
     175/* Nonzero if the integer type T is signed.
     176   Use <= to avoid GCC warnings about always-false expressions.  */
     177#define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0)
    153178
    154179/* The minimum and maximum values for the integer type T.
     
    179204
    180205#ifdef VMS
     206# include <fcntl.h>
    181207# include <types.h>
    182208# include <unixlib.h>
     
    185211/* Needed to use alloca on VMS.  */
    186212# include <builtins.h>
     213
     214extern int vms_use_mcr_command;
     215extern int vms_always_use_cmd_file;
     216extern int vms_gnv_shell;
     217extern int vms_comma_separator;
     218extern int vms_legacy_behavior;
     219extern int vms_unix_simulation;
    187220#endif
    188221
     
    192225#  define __attribute__(x)
    193226# endif
    194 /* The __-protected variants of `format' and `printf' attributes
     227/* The __-protected variants of 'format' and 'printf' attributes
    195228   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
    196229# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
     
    250283# include <inttypes.h>
    251284#endif
     285#if HAVE_STDINT_H
     286# include <stdint.h>
     287#endif
    252288#define FILE_TIMESTAMP uintmax_t
    253289
     
    263299   POSIX 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
    264300   only '0' through '9' are digits.  Prefer ISDIGIT to isdigit() unless
    265    it's important to use the locale's definition of `digit' even when the
     301   it's important to use the locale's definition of 'digit' even when the
    266302   host does not conform to POSIX.  */
    267303#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
     
    306342#define S_(msg1,msg2,num)   ngettext (msg1,msg2,num)
    307343
    308 /* Handle other OSs.  */
    309 #ifndef PATH_SEPARATOR_CHAR
    310 # if defined(HAVE_DOS_PATHS)
    311 #  define PATH_SEPARATOR_CHAR ';'
    312 # elif defined(VMS)
    313 #  define PATH_SEPARATOR_CHAR ','
    314 # else
    315 #  define PATH_SEPARATOR_CHAR ':'
    316 # endif
    317 #endif
    318 
    319344/* This is needed for getcwd() and chdir(), on some W32 systems.  */
    320345#if defined(HAVE_DIRECT_H)
     
    327352# define pipe(_p)        _pipe((_p), 512, O_BINARY)
    328353# define kill(_pid,_sig) w32_kill((_pid),(_sig))
     354/* MSVC and Watcom C don't have ftruncate.  */
     355# if defined(_MSC_VER) || defined(__WATCOMC__)
     356#  define ftruncate(_fd,_len) _chsize(_fd,_len)
     357# endif
     358/* MinGW64 doesn't have _S_ISDIR.  */
     359# ifndef _S_ISDIR
     360#  define _S_ISDIR(m)  S_ISDIR(m)
     361# endif
    329362
    330363void sync_Path_environment (void);
    331364int w32_kill (pid_t pid, int sig);
    332 char *end_of_token_w32 (const char *s, char stopchar);
    333365int find_and_set_default_shell (const char *token);
    334366
     
    338370/* is default_shell unixy? */
    339371extern int unixy_shell;
     372
     373/* We don't have a preferred fixed value for LOCALEDIR.  */
     374# ifndef LOCALEDIR
     375#  define LOCALEDIR NULL
     376# endif
     377
     378/* Include only the minimal stuff from windows.h.   */
     379# define WIN32_LEAN_AND_MEAN
    340380#endif  /* WINDOWS32 */
     381
     382#define ANY_SET(_v,_m)  (((_v)&(_m)) != 0)
     383#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
     384
     385#define MAP_NUL         0x0001
     386#define MAP_BLANK       0x0002
     387#define MAP_NEWLINE     0x0004
     388#define MAP_COMMENT     0x0008
     389#define MAP_SEMI        0x0010
     390#define MAP_EQUALS      0x0020
     391#define MAP_COLON       0x0040
     392#define MAP_PERCENT     0x0080
     393#define MAP_PIPE        0x0100
     394#define MAP_DOT         0x0200
     395#define MAP_COMMA       0x0400
     396
     397/* These are the valid characters for a user-defined function.  */
     398#define MAP_USERFUNC    0x2000
     399/* This means not only a '$', but skip the variable reference.  */
     400#define MAP_VARIABLE    0x4000
     401/* The set of characters which are directory separators is OS-specific.  */
     402#define MAP_DIRSEP      0x8000
     403
     404#ifdef VMS
     405# define MAP_VMSCOMMA   MAP_COMMA
     406#else
     407# define MAP_VMSCOMMA   0x0000
     408#endif
     409
     410#define MAP_SPACE       (MAP_BLANK|MAP_NEWLINE)
     411
     412/* Handle other OSs.
     413   To overcome an issue parsing paths in a DOS/Windows environment when
     414   built in a unix based environment, override the PATH_SEPARATOR_CHAR
     415   definition unless being built for Cygwin. */
     416#if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__)
     417# undef PATH_SEPARATOR_CHAR
     418# define PATH_SEPARATOR_CHAR ';'
     419# define MAP_PATHSEP    MAP_SEMI
     420#elif !defined(PATH_SEPARATOR_CHAR)
     421# if defined (VMS)
     422#  define PATH_SEPARATOR_CHAR (vms_comma_separator ? ',' : ':')
     423#  define MAP_PATHSEP    (vms_comma_separator ? MAP_COMMA : MAP_SEMI)
     424# else
     425#  define PATH_SEPARATOR_CHAR ':'
     426#  define MAP_PATHSEP    MAP_COLON
     427# endif
     428#elif PATH_SEPARATOR_CHAR == ':'
     429# define MAP_PATHSEP     MAP_COLON
     430#elif PATH_SEPARATOR_CHAR == ';'
     431# define MAP_PATHSEP     MAP_SEMI
     432#elif PATH_SEPARATOR_CHAR == ','
     433# define MAP_PATHSEP     MAP_COMMA
     434#else
     435# error "Unknown PATH_SEPARATOR_CHAR"
     436#endif
     437
     438#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
     439
     440#define ISBLANK(c)      STOP_SET((c),MAP_BLANK)
     441#define ISSPACE(c)      STOP_SET((c),MAP_SPACE)
     442#define NEXT_TOKEN(s)   while (ISSPACE (*(s))) ++(s)
     443#define END_OF_TOKEN(s) while (! STOP_SET (*(s), MAP_SPACE|MAP_NUL)) ++(s)
    341444
    342445#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
     
    345448#ifdef SET_STACK_SIZE
    346449# include <sys/resource.h>
    347 struct rlimit stack_limit;
    348 #endif
    349 
    350 struct floc
     450extern struct rlimit stack_limit;
     451#endif
     452
     453#include <glob.h>
     454
     455#define NILF ((floc *)0)
     456
     457#define CSTRLEN(_s)           (sizeof (_s)-1)
     458#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
     459
     460/* The number of bytes needed to represent the largest integer as a string.  */
     461#define INTSTR_LENGTH         CSTRLEN ("18446744073709551616")
     462
     463#define DEFAULT_TTYNAME "true"
     464#ifdef HAVE_TTYNAME
     465# define TTYNAME(_f) ttyname (_f)
     466#else
     467# define TTYNAME(_f) DEFAULT_TTYNAME
     468#endif
     469
     470
     471
     472
     473/* Specify the location of elements read from makefiles.  */
     474typedef struct
    351475  {
    352476    const char *filenm;
    353477    unsigned long lineno;
    354   };
    355 #define NILF ((struct floc *)0)
    356 
    357 #define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1)
    358 
    359 
    360 
    361 /* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use
    362    variadic versions of these functions.  */
    363 
    364 #if HAVE_STDARG_H || HAVE_VARARGS_H
    365 # if HAVE_VPRINTF || HAVE_DOPRNT
    366 #  define USE_VARIADIC 1
    367 # endif
    368 #endif
    369 
    370 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
     478    unsigned long offset;
     479  } floc;
     480
    371481const char *concat (unsigned int, ...);
    372 void message (int prefix, const char *fmt, ...)
    373               __attribute__ ((__format__ (__printf__, 2, 3)));
    374 void error (const struct floc *flocp, const char *fmt, ...)
    375             __attribute__ ((__format__ (__printf__, 2, 3)));
    376 void fatal (const struct floc *flocp, const char *fmt, ...)
    377                    __attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
    378 #else
    379 const char *concat ();
    380 void message ();
    381 void error ();
    382 void fatal ();
    383 #endif
     482void message (int prefix, size_t length, const char *fmt, ...)
     483              __attribute__ ((__format__ (__printf__, 3, 4)));
     484void error (const floc *flocp, size_t length, const char *fmt, ...)
     485            __attribute__ ((__format__ (__printf__, 3, 4)));
     486void fatal (const floc *flocp, size_t length, const char *fmt, ...)
     487            __attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
     488
     489#define O(_t,_a,_f)           _t((_a), 0, (_f))
     490#define OS(_t,_a,_f,_s)       _t((_a), strlen (_s), (_f), (_s))
     491#define OSS(_t,_a,_f,_s1,_s2) _t((_a), strlen (_s1) + strlen (_s2), \
     492                                 (_f), (_s1), (_s2))
     493#define OSSS(_t,_a,_f,_s1,_s2,_s3) _t((_a), strlen (_s1) + strlen (_s2) + strlen (_s3), \
     494                                      (_f), (_s1), (_s2), (_s3))
     495#define ON(_t,_a,_f,_n)       _t((_a), INTSTR_LENGTH, (_f), (_n))
     496#define ONN(_t,_a,_f,_n1,_n2) _t((_a), INTSTR_LENGTH*2, (_f), (_n1), (_n2))
     497
     498#define OSN(_t,_a,_f,_s,_n)   _t((_a), strlen (_s) + INTSTR_LENGTH, \
     499                                 (_f), (_s), (_n))
     500#define ONS(_t,_a,_f,_n,_s)   _t((_a), INTSTR_LENGTH + strlen (_s), \
     501                                 (_f), (_n), (_s))
     502
     503#define OUT_OF_MEM() O (fatal, NILF, _("virtual memory exhausted"))
    384504
    385505void die (int) __attribute__ ((noreturn));
    386 void log_working_directory (int);
    387506void pfatal_with_name (const char *) __attribute__ ((noreturn));
    388507void perror_with_name (const char *, const char *);
     508#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
    389509void *xmalloc (unsigned int);
    390510void *xcalloc (unsigned int);
     
    401521char *find_percent (char *);
    402522const char *find_percent_cached (const char **);
    403 FILE *open_tmpfile (char **, const char *);
    404523
    405524#ifndef NO_ARCHIVES
     
    410529
    411530typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
    412                                       long int hdrpos, long int datapos,
    413                                       long int size, long int date, int uid,
    414                                       int gid, int mode, const void *arg);
     531                                      long int hdrpos, long int datapos,
     532                                      long int size, long int date, int uid,
     533                                      int gid, unsigned int mode,
     534                                      const void *arg);
    415535
    416536long int ar_scan (const char *archive, ar_member_func_t function, const void *arg);
     
    426546void file_impossible (const char *);
    427547const char *dir_name (const char *);
     548void print_dir_data_base (void);
     549void dir_setup_glob (glob_t *);
    428550void hash_init_directories (void);
    429551
    430552void define_default_variables (void);
     553void undefine_default_variables (void);
    431554void set_default_suffixes (void);
    432555void install_default_suffix_rules (void);
     
    445568void child_access (void);
    446569
    447 void close_stdout (void);
    448 
    449570char *strip_whitespace (const char **begpp, const char **endpp);
     571
     572void show_goal_error (void);
    450573
    451574/* String caching  */
     
    454577int strcache_iscached (const char *str);
    455578const char *strcache_add (const char *str);
    456 const char *strcache_add_len (const char *str, int len);
    457 int strcache_setbufsize (int size);
    458 
    459 #ifdef  HAVE_VFORK_H
    460 # include <vfork.h>
    461 #endif
     579const char *strcache_add_len (const char *str, unsigned int len);
     580
     581/* Guile support  */
     582int guile_gmake_setup (const floc *flocp);
     583
     584/* Loadable object support.  Sets to the strcached name of the loaded file.  */
     585typedef int (*load_func_t)(const floc *flocp);
     586int load_file (const floc *flocp, const char **filename, int noerror);
     587void unload_file (const char *name);
    462588
    463589/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
     
    471597# endif
    472598
     599# ifdef  HAVE_GETCWD
     600#  if !defined(VMS) && !defined(__DECC)
     601char *getcwd ();
     602#  endif
     603# else
     604char *getwd ();
     605#  define getcwd(buf, len)       getwd (buf)
     606# endif
     607
    473608#endif  /* Not GNU C library or POSIX.  */
    474 
    475 #ifdef  HAVE_GETCWD
    476 # if !defined(VMS) && !defined(__DECC)
    477 char *getcwd ();
    478 # endif
    479 #else
    480 char *getwd ();
    481 # define getcwd(buf, len)       getwd (buf)
    482 #endif
    483609
    484610#if !HAVE_STRCASECMP
     
    504630#endif
    505631
    506 extern const struct floc *reading_file;
    507 extern const struct floc **expanding_var;
    508 
     632#define OUTPUT_SYNC_NONE    0
     633#define OUTPUT_SYNC_LINE    1
     634#define OUTPUT_SYNC_TARGET  2
     635#define OUTPUT_SYNC_RECURSE 3
     636
     637/* Non-GNU systems may not declare this in unistd.h.  */
    509638extern char **environ;
     639
     640extern const floc *reading_file;
     641extern const floc **expanding_var;
     642
     643extern unsigned short stopchar_map[];
    510644
    511645extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
     
    513647extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
    514648extern int print_version_flag, print_directory_flag, check_symlink_flag;
    515 extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
    516 extern int second_expansion, clock_skew_detected, rebuilding_makefiles;
    517 extern int one_shell;
     649extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
     650extern int not_parallel, second_expansion, clock_skew_detected;
     651extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
     652
     653extern const char *default_shell;
    518654
    519655/* can we run commands via 'sh -c xxx' or must we use batch files? */
     
    526662
    527663extern unsigned int job_slots;
    528 extern int job_fds[2];
    529 extern int job_rfd;
    530664#ifndef NO_FLOAT
    531665extern double max_load_average;
     
    534668#endif
    535669
     670#ifdef WINDOWS32
    536671extern char *program;
     672#else
     673extern const char *program;
     674#endif
     675
     676#ifdef VMS
     677const char *vms_command (const char *argv0);
     678const char *vms_progname (const char *argv0);
     679
     680void vms_exit (int);
     681# define _exit(foo) vms_exit(foo)
     682# define exit(foo) vms_exit(foo)
     683
     684extern char *program_name;
     685
     686void
     687set_program_name (const char *arv0);
     688
     689int
     690need_vms_symbol (void);
     691
     692int
     693create_foreign_command (const char *command, const char *image);
     694
     695int
     696vms_export_dcl_symbol (const char *name, const char *value);
     697
     698int
     699vms_putenv_symbol (const char *string);
     700
     701void
     702vms_restore_symbol (const char *string);
     703
     704#endif
     705
     706void remote_setup (void);
     707void remote_cleanup (void);
     708int start_remote_job_p (int);
     709int start_remote_job (char **, char **, int, int *, int *, int *);
     710int remote_status (int *, int *, int *, int);
     711void block_remote_children (void);
     712void unblock_remote_children (void);
     713int remote_kill (int id, int sig);
     714void print_variable_data_base (void);
     715void print_vpath_data_base (void);
     716
    537717extern char *starting_directory;
    538718extern unsigned int makelevel;
     
    551731#endif
    552732
    553 #ifdef VMS
    554 #  define MAKE_SUCCESS 1
    555 #  define MAKE_TROUBLE 2
    556 #  define MAKE_FAILURE 3
    557 #else
    558 #  define MAKE_SUCCESS 0
    559 #  define MAKE_TROUBLE 1
    560 #  define MAKE_FAILURE 2
    561 #endif
     733
     734#define MAKE_SUCCESS 0
     735#define MAKE_TROUBLE 1
     736#define MAKE_FAILURE 2
    562737
    563738/* Set up heap debugging library dmalloc.  */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette