#ifndef MAKE_MAKE_H
#define MAKE_MAKE_H
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <assert.h>
#include <ctype.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef BSD4_4
# include <sys/cdefs.h>
#endif
#ifndef FD_CLOEXEC
#define FD_CLOEXEC 1
#endif
#if defined(__GNUC__)
#define MAKE_GNUC_PREREQ(x, y) \
((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
(__GNUC__ > (x)))
#else
#define MAKE_GNUC_PREREQ(x, y) 0
#endif
#if MAKE_GNUC_PREREQ(2, 7) || lint
#define MAKE_ATTR_UNUSED __attribute__((__unused__))
#else
#define MAKE_ATTR_UNUSED
#endif
#if MAKE_GNUC_PREREQ(2, 5)
#define MAKE_ATTR_DEAD __attribute__((__noreturn__))
#elif defined(__GNUC__)
#define MAKE_ATTR_DEAD __volatile
#else
#define MAKE_ATTR_DEAD
#endif
#if MAKE_GNUC_PREREQ(2, 7)
#define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#else
#define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg)
#endif
#if MAKE_GNUC_PREREQ(4, 0)
#define MAKE_ATTR_USE __attribute__((__warn_unused_result__))
#else
#define MAKE_ATTR_USE
#endif
#if MAKE_GNUC_PREREQ(8, 0)
#define MAKE_ATTR_NOINLINE __attribute__((__noinline__))
#else
#define MAKE_ATTR_NOINLINE
#endif
#if __STDC_VERSION__ >= 199901L || defined(lint)
#define MAKE_INLINE static inline MAKE_ATTR_UNUSED
#else
#define MAKE_INLINE static MAKE_ATTR_UNUSED
#endif
#if defined(lint)
#define MAKE_STATIC MAKE_INLINE
#else
#define MAKE_STATIC static MAKE_ATTR_UNUSED
#endif
#if __STDC_VERSION__ >= 199901L || defined(lint) || defined(USE_C99_BOOLEAN)
#include <stdbool.h>
#elif defined(__bool_true_false_are_defined)
#error "<stdbool.h> is included in pre-C99 mode"
#elif defined(bool) || defined(true) || defined(false)
#error "bool/true/false is defined in pre-C99 mode"
#else
typedef unsigned char bool;
#define true 1
#define false 0
#endif
#ifndef FORK_FUNCTION
#define FORK_FUNCTION vfork
#endif
#include "lst.h"
#include "make_malloc.h"
#include "str.h"
#include "hash.h"
#include "config.h"
#include "buf.h"
typedef enum GNodeMade {
UNMADE,
DEFERRED,
REQUESTED,
BEINGMADE,
MADE,
UPTODATE,
ERROR,
ABORTED
} GNodeMade;
typedef enum GNodeType {
OP_NONE = 0,
OP_DEPENDS = 1 << 0,
OP_FORCE = 1 << 1,
OP_DOUBLEDEP = 1 << 2,
OP_OPMASK = OP_DEPENDS | OP_FORCE | OP_DOUBLEDEP,
OP_OPTIONAL = 1 << 3,
OP_USE = 1 << 4,
OP_EXEC = 1 << 5,
OP_IGNORE = 1 << 6,
OP_PRECIOUS = 1 << 7,
OP_SILENT = 1 << 8,
OP_MAKE = 1 << 9,
OP_JOIN = 1 << 10,
OP_MADE = 1 << 11,
OP_SPECIAL = 1 << 12,
OP_USEBEFORE = 1 << 13,
OP_INVISIBLE = 1 << 14,
OP_NOTMAIN = 1 << 15,
OP_PHONY = 1 << 16,
OP_NOPATH = 1 << 17,
OP_WAIT = 1 << 18,
OP_NOMETA = 1 << 19,
OP_META = 1 << 20,
OP_NOMETA_CMP = 1 << 21,
OP_SUBMAKE = 1 << 22,
OP_TRANSFORM = 1 << 30,
OP_MEMBER = 1 << 29,
OP_LIB = 1 << 28,
OP_ARCHV = 1 << 27,
OP_HAS_COMMANDS = 1 << 26,
OP_SAVE_CMDS = 1 << 25,
OP_DEPS_FOUND = 1 << 24,
OP_MARK = 1 << 23
} GNodeType;
typedef struct GNodeFlags {
bool remake:1;
bool childMade:1;
bool force:1;
bool doneWait:1;
bool doneOrder:1;
bool fromDepend:1;
bool doneAllsrc:1;
bool doneSubmake:1;
bool cycle:1;
bool doneCycle:1;
} GNodeFlags;
typedef List StringList;
typedef ListNode StringListNode;
typedef List GNodeList;
typedef ListNode GNodeListNode;
typedef struct SearchPath {
List dirs;
} SearchPath;
typedef struct GNode {
char *name;
char *uname;
char *path;
GNodeType type;
GNodeFlags flags;
GNodeMade made;
int unmade;
time_t mtime;
struct GNode *youngestChild;
GNodeList implicitParents;
GNodeList parents;
GNodeList children;
GNodeList order_pred;
GNodeList order_succ;
GNodeList cohorts;
char cohort_num[8];
int unmade_cohorts;
struct GNode *centurion;
unsigned checked_seqno;
HashTable vars;
StringList commands;
struct Suffix *suffix;
const char *fname;
unsigned lineno;
int exit_status;
} GNode;
extern enum PosixState {
PS_NOT_YET,
PS_MAYBE_NEXT_LINE,
PS_NOW_OR_NEVER,
PS_SET,
PS_TOO_LATE
} posix_state;
typedef enum ParseErrorLevel {
PARSE_FATAL = 1,
PARSE_WARNING,
PARSE_INFO
} ParseErrorLevel;
typedef enum CondResult {
CR_TRUE,
CR_FALSE,
CR_ERROR
} CondResult;
typedef struct {
enum GuardKind {
GK_VARIABLE,
GK_TARGET
} kind;
char *name;
} Guard;
#define TARGET "@"
#define OODATE "?"
#define ALLSRC ">"
#define IMPSRC "<"
#define PREFIX "*"
#define ARCHIVE "!"
#define MEMBER "%"
extern bool allPrecious;
extern bool deleteOnError;
extern bool doing_depend;
extern GNode *defaultNode;
extern GNode *SCOPE_INTERNAL;
extern GNode *SCOPE_GLOBAL;
extern GNode *SCOPE_CMDLINE;
extern char var_Error[];
extern time_t now;
extern SearchPath dirSearchPath;
extern SearchPath *parseIncPath;
extern SearchPath *sysIncPath;
extern SearchPath *defSysIncPath;
extern char curdir[];
extern const char *progname;
extern int makelevel;
extern char *makeDependfile;
extern char **savedEnv;
extern GNode *mainNode;
extern pid_t myPid;
#define MAKEFLAGS ".MAKEFLAGS"
#ifndef MAKE_LEVEL_ENV
# define MAKE_LEVEL_ENV "MAKELEVEL"
#endif
typedef struct DebugFlags {
bool DEBUG_ARCH:1;
bool DEBUG_COND:1;
bool DEBUG_CWD:1;
bool DEBUG_DIR:1;
bool DEBUG_ERROR:1;
bool DEBUG_FOR:1;
bool DEBUG_GRAPH1:1;
bool DEBUG_GRAPH2:1;
bool DEBUG_GRAPH3:1;
bool DEBUG_HASH:1;
bool DEBUG_JOB:1;
bool DEBUG_LOUD:1;
bool DEBUG_MAKE:1;
bool DEBUG_META:1;
bool DEBUG_PARSE:1;
bool DEBUG_SCRIPT:1;
bool DEBUG_SHELL:1;
bool DEBUG_SUFF:1;
bool DEBUG_TARG:1;
bool DEBUG_VAR:1;
} DebugFlags;
#define CONCAT(a, b) a##b
#define DEBUG(module) (opts.debug.CONCAT(DEBUG_, module))
void debug_printf(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
#define DEBUG_IMPL(module, args) \
do { \
if (DEBUG(module)) \
debug_printf args; \
} while (false)
#define DEBUG0(module, fmt) \
DEBUG_IMPL(module, (fmt))
#define DEBUG1(module, fmt, arg1) \
DEBUG_IMPL(module, (fmt, arg1))
#define DEBUG2(module, fmt, arg1, arg2) \
DEBUG_IMPL(module, (fmt, arg1, arg2))
#define DEBUG3(module, fmt, arg1, arg2, arg3) \
DEBUG_IMPL(module, (fmt, arg1, arg2, arg3))
#define DEBUG4(module, fmt, arg1, arg2, arg3, arg4) \
DEBUG_IMPL(module, (fmt, arg1, arg2, arg3, arg4))
#define DEBUG5(module, fmt, arg1, arg2, arg3, arg4, arg5) \
DEBUG_IMPL(module, (fmt, arg1, arg2, arg3, arg4, arg5))
typedef enum PrintVarsMode {
PVM_NONE,
PVM_UNEXPANDED,
PVM_EXPANDED
} PrintVarsMode;
typedef struct CmdOpts {
bool compatMake;
DebugFlags debug;
FILE *debug_file;
bool strict;
bool debugVflag;
bool checkEnvFirst;
StringList makefiles;
bool ignoreErrors;
int maxJobs;
bool keepgoing;
bool noRecursiveExecute;
bool noExecute;
bool query;
bool noBuiltins;
bool silent;
bool touch;
PrintVarsMode printVars;
StringList variables;
bool parseWarnFatal;
bool enterFlag;
bool varNoExportEnv;
StringList create;
bool randomizeTargets;
} CmdOpts;
extern CmdOpts opts;
extern bool forceJobs;
extern char **environ;
void Arch_Init(void);
#ifdef CLEANUP
void Arch_End(void);
#endif
bool Arch_ParseArchive(char **, GNodeList *, GNode *);
void Arch_Touch(GNode *);
void Arch_TouchLib(GNode *);
void Arch_UpdateMTime(GNode *);
void Arch_UpdateMemberMTime(GNode *);
void Arch_FindLib(GNode *, SearchPath *);
bool Arch_LibOODate(GNode *) MAKE_ATTR_USE;
bool Arch_IsLib(GNode *) MAKE_ATTR_USE;
bool Compat_RunCommand(const char *, GNode *, StringListNode *);
void Compat_MakeAll(GNodeList *);
void Compat_Make(GNode *, GNode *);
extern unsigned cond_depth;
CondResult Cond_EvalCondition(const char *) MAKE_ATTR_USE;
CondResult Cond_EvalLine(const char *) MAKE_ATTR_USE;
Guard *Cond_ExtractGuard(const char *) MAKE_ATTR_USE;
void Cond_EndFile(void);
MAKE_INLINE const char * MAKE_ATTR_USE
str_basename(const char *pathname)
{
const char *lastSlash = strrchr(pathname, '/');
return lastSlash != NULL ? lastSlash + 1 : pathname;
}
MAKE_INLINE SearchPath * MAKE_ATTR_USE
SearchPath_New(void)
{
SearchPath *path = bmake_malloc(sizeof *path);
Lst_Init(&path->dirs);
return path;
}
void SearchPath_Free(SearchPath *);
struct ForLoop;
int For_Eval(const char *) MAKE_ATTR_USE;
bool For_Accum(const char *, int *) MAKE_ATTR_USE;
void For_Run(unsigned, unsigned);
bool For_NextIteration(struct ForLoop *, Buffer *);
char *ForLoop_Details(const struct ForLoop *);
void ForLoop_Free(struct ForLoop *);
void For_Break(struct ForLoop *);
void JobReapChild(pid_t, int, bool);
#ifndef MAKE_CMDLEN_LIMIT
# define MAKE_CMDLEN_LIMIT 1000
#endif
void Main_ParseArgLine(const char *);
void Cmd_Argv(const char *, size_t, const char *[5], char *, size_t,
bool, bool);
char *Cmd_Exec(const char *, char **) MAKE_ATTR_USE;
void Var_ExportStackTrace(const char *, const char *);
void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
void DieHorribly(void) MAKE_ATTR_DEAD;
int unlink_file(const char *) MAKE_ATTR_USE;
void execDie(const char *, const char *);
char *getTmpdir(void) MAKE_ATTR_USE;
bool ParseBoolean(const char *, bool) MAKE_ATTR_USE;
const char *cached_realpath(const char *, char *);
bool GetBooleanExpr(const char *, bool);
extern int parseErrors;
void Parse_Init(void);
#ifdef CLEANUP
void Parse_End(void);
#endif
void PrintLocation(FILE *, bool, const GNode *);
const char *GetParentStackTrace(void);
char *GetStackTrace(bool);
void PrintStackTrace(FILE *, bool);
void Parse_Error(ParseErrorLevel, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
bool Parse_VarAssign(const char *, bool, GNode *) MAKE_ATTR_USE;
void Parse_File(const char *, int);
void Parse_PushInput(const char *, unsigned, unsigned, Buffer,
struct ForLoop *);
void Parse_MainName(GNodeList *);
unsigned CurFile_CondMinDepth(void) MAKE_ATTR_USE;
void Parse_GuardElse(void);
void Parse_GuardEndif(void);
void Suff_Init(void);
#ifdef CLEANUP
void Suff_End(void);
#endif
void Suff_ClearSuffixes(void);
bool Suff_IsTransform(const char *) MAKE_ATTR_USE;
GNode *Suff_AddTransform(const char *);
void Suff_EndTransform(GNode *);
void Suff_AddSuffix(const char *);
SearchPath *Suff_GetPath(const char *) MAKE_ATTR_USE;
void Suff_ExtendPaths(void);
void Suff_AddInclude(const char *);
void Suff_AddLib(const char *);
void Suff_FindDeps(GNode *);
SearchPath *Suff_FindPath(GNode *) MAKE_ATTR_USE;
void Suff_SetNull(const char *);
void Suff_PrintAll(void);
char *Suff_NamesStr(void) MAKE_ATTR_USE;
void Targ_Init(void);
void Targ_End(void);
void Targ_Stats(void);
GNodeList *Targ_List(void) MAKE_ATTR_USE;
GNode *GNode_New(const char *) MAKE_ATTR_USE;
GNode *Targ_FindNode(const char *) MAKE_ATTR_USE;
GNode *Targ_GetNode(const char *) MAKE_ATTR_USE;
GNode *Targ_NewInternalNode(const char *) MAKE_ATTR_USE;
GNode *Targ_GetEndNode(void);
void Targ_FindList(GNodeList *, StringList *);
void Targ_PrintCmds(GNode *);
void Targ_PrintNode(GNode *, int);
void Targ_PrintNodes(GNodeList *, int);
const char *Targ_FmtTime(time_t) MAKE_ATTR_USE;
void Targ_PrintType(GNodeType);
void Targ_PrintGraph(int);
void Targ_Propagate(void);
const char *GNodeMade_Name(GNodeMade) MAKE_ATTR_USE;
#ifdef CLEANUP
void Parse_RegisterCommand(char *);
#else
MAKE_INLINE
void Parse_RegisterCommand(char *cmd MAKE_ATTR_UNUSED)
{
}
#endif
typedef enum VarEvalMode {
VARE_PARSE,
VARE_PARSE_BALANCED,
VARE_EVAL,
VARE_EVAL_DEFINED_LOUD,
VARE_EVAL_DEFINED,
VARE_EVAL_KEEP_UNDEFINED,
VARE_EVAL_KEEP_DOLLAR_AND_UNDEFINED
} VarEvalMode;
typedef enum VarSetFlags {
VAR_SET_NONE = 0,
VAR_SET_NO_EXPORT = 1 << 0,
VAR_SET_READONLY = 1 << 1,
VAR_SET_INTERNAL = 1 << 2
} VarSetFlags;
typedef enum VarExportMode {
VEM_ALL,
VEM_ENV,
VEM_PLAIN,
VEM_LITERAL
} VarExportMode;
#define MAKE_SAVE_DOLLARS ".MAKE.SAVE_DOLLARS"
void Var_Delete(GNode *, const char *);
#ifdef CLEANUP
void Var_DeleteAll(GNode *scope);
#endif
void Var_Undef(const char *);
void Var_Set(GNode *, const char *, const char *);
void Var_SetExpand(GNode *, const char *, const char *);
void Var_SetWithFlags(GNode *, const char *, const char *, VarSetFlags);
void Var_Append(GNode *, const char *, const char *);
void Var_AppendExpand(GNode *, const char *, const char *);
bool Var_Exists(GNode *, const char *) MAKE_ATTR_USE;
bool Var_ExistsExpand(GNode *, const char *) MAKE_ATTR_USE;
FStr Var_Value(GNode *, const char *) MAKE_ATTR_USE;
const char *GNode_ValueDirect(GNode *, const char *) MAKE_ATTR_USE;
FStr Var_Parse(const char **, GNode *, VarEvalMode);
char *Var_Subst(const char *, GNode *, VarEvalMode);
char *Var_SubstInTarget(const char *, GNode *);
void Var_Expand(FStr *, GNode *, VarEvalMode);
void Var_Stats(void);
void Var_Dump(GNode *);
void Var_ReexportVars(GNode *);
void Var_Export(VarExportMode, const char *);
void Var_ExportVars(const char *);
void Var_UnExport(bool, const char *);
void Var_ReadOnly(const char *, bool);
void Global_Set(const char *, const char *);
void Global_Append(const char *, const char *);
void Global_Delete(const char *);
void Global_Set_ReadOnly(const char *, const char *);
void EvalStack_PushMakeflags(const char *);
void EvalStack_Pop(void);
bool EvalStack_Details(Buffer *buf) MAKE_ATTR_USE;
typedef void (*SignalProc)(int);
SignalProc bmake_signal(int, SignalProc);
void GNode_UpdateYoungestChild(GNode *, GNode *);
bool GNode_IsOODate(GNode *) MAKE_ATTR_USE;
void Make_ExpandUse(GNodeList *);
time_t Make_Recheck(GNode *) MAKE_ATTR_USE;
void Make_HandleUse(GNode *, GNode *);
void Make_Update(GNode *);
void GNode_SetLocalVars(GNode *);
bool Make_MakeParallel(GNodeList *);
bool shouldDieQuietly(GNode *, int) MAKE_ATTR_USE;
void PrintOnError(GNode *, const char *);
void Main_ExportMAKEFLAGS(bool);
bool Main_SetObjdir(bool, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
int mkTempFile(const char *, char *, size_t) MAKE_ATTR_USE;
void AppendWords(StringList *, char *);
void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *);
bool GNode_ShouldExecute(GNode *gn) MAKE_ATTR_USE;
char *GNodeType_ToString(GNodeType);
MAKE_INLINE bool MAKE_ATTR_USE
GNode_IsTarget(const GNode *gn)
{
return (gn->type & OP_OPMASK) != OP_NONE;
}
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_Path(const GNode *gn)
{
return gn->path != NULL ? gn->path : gn->name;
}
MAKE_INLINE bool MAKE_ATTR_USE
GNode_IsWaitingFor(const GNode *gn)
{
return gn->flags.remake && gn->made <= REQUESTED;
}
MAKE_INLINE bool MAKE_ATTR_USE
GNode_IsReady(const GNode *gn)
{
return gn->made > DEFERRED;
}
MAKE_INLINE bool MAKE_ATTR_USE
GNode_IsDone(const GNode *gn)
{
return gn->made >= MADE;
}
MAKE_INLINE bool MAKE_ATTR_USE
GNode_IsError(const GNode *gn)
{
return gn->made == ERROR || gn->made == ABORTED;
}
MAKE_INLINE bool MAKE_ATTR_USE
GNode_IsMainCandidate(const GNode *gn)
{
return (gn->type & (OP_NOTMAIN | OP_USE | OP_USEBEFORE |
OP_EXEC | OP_TRANSFORM)) == 0;
}
MAKE_INLINE bool MAKE_ATTR_USE
GNode_IsPrecious(const GNode *gn)
{
return allPrecious || gn->type & (OP_PRECIOUS | OP_DOUBLEDEP);
}
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_VarTarget(GNode *gn) { return GNode_ValueDirect(gn, TARGET); }
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_VarOodate(GNode *gn) { return GNode_ValueDirect(gn, OODATE); }
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_VarAllsrc(GNode *gn) { return GNode_ValueDirect(gn, ALLSRC); }
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_VarImpsrc(GNode *gn) { return GNode_ValueDirect(gn, IMPSRC); }
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_VarPrefix(GNode *gn) { return GNode_ValueDirect(gn, PREFIX); }
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_VarArchive(GNode *gn) { return GNode_ValueDirect(gn, ARCHIVE); }
MAKE_INLINE const char * MAKE_ATTR_USE
GNode_VarMember(GNode *gn) { return GNode_ValueDirect(gn, MEMBER); }
MAKE_INLINE void * MAKE_ATTR_USE
UNCONST(const void *ptr)
{
void *ret;
memcpy(&ret, &ptr, sizeof(ret));
return ret;
}
#include <limits.h>
#ifndef MAXPATHLEN
#define MAXPATHLEN 4096
#endif
#ifndef PATH_MAX
#define PATH_MAX MAXPATHLEN
#endif
#if defined(SYSV)
#define KILLPG(pid, sig) kill(-(pid), (sig))
#else
#define KILLPG(pid, sig) killpg((pid), (sig))
#endif
MAKE_INLINE bool MAKE_ATTR_USE
ch_isalnum(char ch) { return isalnum((unsigned char)ch) != 0; }
MAKE_INLINE bool MAKE_ATTR_USE
ch_isalpha(char ch) { return isalpha((unsigned char)ch) != 0; }
MAKE_INLINE bool MAKE_ATTR_USE
ch_isdigit(char ch) { return isdigit((unsigned char)ch) != 0; }
MAKE_INLINE bool MAKE_ATTR_USE
ch_islower(char ch) { return islower((unsigned char)ch) != 0; }
MAKE_INLINE bool MAKE_ATTR_USE
ch_isprint(char ch) { return isprint((unsigned char)ch) != 0; }
MAKE_INLINE bool MAKE_ATTR_USE
ch_isspace(char ch) { return isspace((unsigned char)ch) != 0; }
MAKE_INLINE bool MAKE_ATTR_USE
ch_isupper(char ch) { return isupper((unsigned char)ch) != 0; }
MAKE_INLINE char MAKE_ATTR_USE
ch_tolower(char ch) { return (char)tolower((unsigned char)ch); }
MAKE_INLINE char MAKE_ATTR_USE
ch_toupper(char ch) { return (char)toupper((unsigned char)ch); }
MAKE_INLINE void
cpp_skip_whitespace(const char **pp)
{
while (ch_isspace(**pp))
(*pp)++;
}
MAKE_INLINE void
cpp_skip_hspace(const char **pp)
{
while (**pp == ' ' || **pp == '\t')
(*pp)++;
}
MAKE_INLINE bool
cpp_skip_string(const char **pp, const char *s)
{
const char *p = *pp;
while (*p == *s && *s != '\0')
p++, s++;
if (*s == '\0')
*pp = p;
return *s == '\0';
}
MAKE_INLINE void
pp_skip_whitespace(char **pp)
{
while (ch_isspace(**pp))
(*pp)++;
}
MAKE_INLINE void
pp_skip_hspace(char **pp)
{
while (**pp == ' ' || **pp == '\t')
(*pp)++;
}
#if defined(lint)
void do_not_define_rcsid(void);
# define MAKE_RCSID(id) void do_not_define_rcsid(void)
#elif defined(MAKE_NATIVE)
# include <sys/cdefs.h>
# define MAKE_RCSID(id) __RCSID(id)
#elif defined(MAKE_ALL_IN_ONE) && defined(__COUNTER__)
# define MAKE_RCSID_CONCAT(x, y) CONCAT(x, y)
# define MAKE_RCSID(id) static volatile char \
MAKE_RCSID_CONCAT(rcsid_, __COUNTER__)[] = id
#elif defined(MAKE_ALL_IN_ONE)
# define MAKE_RCSID(id) void do_not_define_rcsid(void)
#else
# define MAKE_RCSID(id) static volatile char rcsid[] = id
#endif
#endif