* Copyright (c) 1988, 1989, 1990, 1993
* The Regents of the University of California. All rights reserved.
* Copyright (c) 1989 by Berkeley Softworks
* This code is derived from software contributed to Berkeley by
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
static char sccsid
[] = "@(#)arch.c 8.3 (Berkeley) 4/28/95";
* Functions to manipulate libraries, archives and their members.
* Once again, cacheing/hashing comes into play in the manipulation
* of archives. The first time an archive is referenced, all of its members'
* headers are read and hashed and the archive closed again. All hashed
* archives are kept on a list which is searched each time an archive member
* The interface to this module is:
* Arch_ParseArchive Given an archive specification, return a list
* of GNode's, one for each member in the spec.
* FAILURE is returned if the specification is
* invalid for some reason.
* Arch_Touch Alter the modification time of the archive
* member described by the given node to be
* Arch_TouchLib Update the modification time of the library
* described by the given node. This is special
* because it also updates the modification time
* of the library's table of contents.
* Arch_MTime Find the modification time of a member of
* an archive *in the archive*. The time is also
* placed in the member's GNode. Returns the
* Arch_MemTime Find the modification time of a member of
* an archive. Called when the member doesn't
* already exist. Looks in the archive for the
* modification time. Returns the modification
* Arch_FindLib Search for a library along a path. The
* library name in the GNode should be in
* Arch_LibOODate Special function to decide if a library node
* Arch_Init Initialize this module.
* Arch_End Cleanup this module.
static Lst archives
; /* Lst of archives we've already examined */
char *name
; /* Name of archive */
Hash_Table members
; /* All the members of the archive described
* by <name, struct ar_hdr *> key/value pairs */
static int ArchFindArchive
__P((ClientData
, ClientData
));
static void ArchFree
__P((ClientData
));
static struct ar_hdr
*ArchStatMember
__P((char *, char *, Boolean
));
static FILE *ArchFindMember
__P((char *, char *, struct ar_hdr
*, char *));
*-----------------------------------------------------------------------
* Free memory used by an archive
*-----------------------------------------------------------------------
/* Free memory from hash entries */
for (entry
= Hash_EnumFirst(&a
->members
, &search
);
entry
!= (Hash_Entry
*)NULL
;
entry
= Hash_EnumNext(&search
))
free((Address
) Hash_GetValue (entry
));
Hash_DeleteTable(&a
->members
);
*-----------------------------------------------------------------------
* Parse the archive specification in the given line and find/create
* the nodes for the specified archive members, placing their nodes
* SUCCESS if it was a valid specification. The linePtr is updated
* to point to the first non-space after the archive spec. The
* nodes for the members are placed on the given list.
* Some nodes may be created. The given list is extended.
*-----------------------------------------------------------------------
Arch_ParseArchive (linePtr
, nodeLst
, ctxt
)
char **linePtr
; /* Pointer to start of specification */
Lst nodeLst
; /* Lst on which to place the nodes */
GNode
*ctxt
; /* Context in which to expand variables */
register char *cp
; /* Pointer into line */
GNode
*gn
; /* New node */
char *libName
; /* Library-part of specification */
char *memName
; /* Member-part of specification */
char nameBuf
[MAKE_BSIZE
]; /* temporary place for node name */
char saveChar
; /* Ending delimiter of member-name */
Boolean subLibName
; /* TRUE if libName should have/had
* variable substitution performed on it */
for (cp
= libName
; *cp
!= '(' && *cp
!= '\0'; cp
++) {
* Variable spec, so call the Var module to parse the puppy
* so we can safely advance beyond it...
result
=Var_Parse(cp
, ctxt
, TRUE
, &length
, &freeIt
);
if (result
== var_Error
) {
libName
= Var_Subst(NULL
, libName
, ctxt
, TRUE
);
* First skip to the start of the member's name, mark that
* place and skip to the end of it (either white-space or
Boolean doSubst
= FALSE
; /* TRUE if need to substitute in memName */
while (*cp
!= '\0' && *cp
!= ')' && isspace (*cp
)) {
while (*cp
!= '\0' && *cp
!= ')' && !isspace (*cp
)) {
* Variable spec, so call the Var module to parse the puppy
* so we can safely advance beyond it...
result
=Var_Parse(cp
, ctxt
, TRUE
, &length
, &freeIt
);
if (result
== var_Error
) {
* If the specification ends without a closing parenthesis,
* chances are there's something wrong (like a missing backslash),
* so it's better to return failure than allow such things to happen
printf("No closing parenthesis in archive specification\n");
* If we didn't move anywhere, we must be done
* XXX: This should be taken care of intelligently by
* SuffExpandChildren, both for the archive and the member portions.
* If member contains variables, try and substitute for them.
* This will slow down archive specs with dynamic sources, of course,
* since we'll be (non-)substituting them three times, but them's
* the breaks -- we need to do this since SuffExpandChildren calls
* us, otherwise we could assume the thing would be taken care of
char *oldMemName
= memName
;
memName
= Var_Subst(NULL
, memName
, ctxt
, TRUE
);
* Now form an archive spec and recurse to deal with nested
* variables and multi-word variable values.... The results
* are just placed at the end of the nodeLst we're returning.
buf
= sacrifice
= emalloc(strlen(memName
)+strlen(libName
)+3);
sprintf(buf
, "%s(%s)", libName
, memName
);
if (strchr(memName
, '$') && strcmp(memName
, oldMemName
) == 0) {
* Must contain dynamic sources, so we can't deal with it now.
* Just create an ARCHV node for the thing and let
* SuffExpandChildren handle it...
gn
= Targ_FindNode(buf
, TARG_CREATE
);
(void)Lst_AtEnd(nodeLst
, (ClientData
)gn
);
} else if (Arch_ParseArchive(&sacrifice
, nodeLst
, ctxt
)!=SUCCESS
) {
* Error in nested call -- free buffer and return FAILURE
* Free buffer and continue with our work.
} else if (Dir_HasWildcards(memName
)) {
Lst members
= Lst_Init(FALSE
);
Dir_Expand(memName
, dirSearchPath
, members
);
while (!Lst_IsEmpty(members
)) {
member
= (char *)Lst_DeQueue(members
);
sprintf(nameBuf
, "%s(%s)", libName
, member
);
gn
= Targ_FindNode (nameBuf
, TARG_CREATE
);
* We've found the node, but have to make sure the rest of
* the world knows it's an archive member, without having
* to constantly check for parentheses, so we type the
* thing with the OP_ARCHV bit before we place it on the
* end of the provided list.
(void) Lst_AtEnd (nodeLst
, (ClientData
)gn
);
Lst_Destroy(members
, NOFREE
);
sprintf(nameBuf
, "%s(%s)", libName
, memName
);
gn
= Targ_FindNode (nameBuf
, TARG_CREATE
);
* We've found the node, but have to make sure the rest of the
* world knows it's an archive member, without having to
* constantly check for parentheses, so we type the thing with
* the OP_ARCHV bit before we place it on the end of the
(void) Lst_AtEnd (nodeLst
, (ClientData
)gn
);
* If substituted libName, free it now, since we need it no longer.
* We promised the pointer would be set up at the next non-space, so
* we must advance cp there before setting *linePtr... (note that on
* entrance to the loop, cp is guaranteed to point at a ')')
} while (*cp
!= '\0' && isspace (*cp
));
*-----------------------------------------------------------------------
* See if the given archive is the one we are looking for. Called
* From ArchStatMember and ArchFindMember via Lst_Find.
* 0 if it is, non-zero if it isn't.
*-----------------------------------------------------------------------
ArchFindArchive (ar
, archName
)
ClientData ar
; /* Current list element */
ClientData archName
; /* Name we want */
return (strcmp ((char *) archName
, ((Arch
*) ar
)->name
));
*-----------------------------------------------------------------------
* Locate a member of an archive, given the path of the archive and
* the path of the desired member.
* A pointer to the current struct ar_hdr structure for the member. Note
* That no position is returned, so this is not useful for touching
* archive members. This is mostly because we have no assurances that
* The archive will remain constant after we read all the headers, so
* there's not much point in remembering the position...
*-----------------------------------------------------------------------
ArchStatMember (archive
, member
, hash
)
char *archive
; /* Path to the archive */
char *member
; /* Name of member. If it is a path, only the
* last component is used. */
Boolean hash
; /* TRUE if archive should be hashed if not
#define AR_MAX_NAME_LEN (sizeof(arh.ar_name)-1)
FILE * arch
; /* Stream to archive */
int size
; /* Size of archive member */
char *cp
; /* Useful character pointer */
LstNode ln
; /* Lst member containing archive descriptor */
Arch
*ar
; /* Archive descriptor */
Hash_Entry
*he
; /* Entry containing member's description */
struct ar_hdr arh
; /* archive-member header for reading archive */
char memName
[MAXPATHLEN
+1];
/* Current member name while hashing. */
* Because of space constraints and similar things, files are archived
* using their final path components, not the entire thing, so we need
* to point 'member' to the final component, if there is one, to make
* the comparisons easier...
cp
= strrchr (member
, '/');
if (cp
!= (char *) NULL
) {
ln
= Lst_Find (archives
, (ClientData
) archive
, ArchFindArchive
);
ar
= (Arch
*) Lst_Datum (ln
);
he
= Hash_FindEntry (&ar
->members
, member
);
if (he
!= (Hash_Entry
*) NULL
) {
return ((struct ar_hdr
*) Hash_GetValue (he
));
char copy
[AR_MAX_NAME_LEN
+1];
int len
= strlen (member
);
if (len
> AR_MAX_NAME_LEN
) {
strncpy(copy
, member
, AR_MAX_NAME_LEN
);
copy
[AR_MAX_NAME_LEN
] = '\0';
if (he
= Hash_FindEntry (&ar
->members
, copy
))
return ((struct ar_hdr
*) Hash_GetValue (he
));
return ((struct ar_hdr
*) NULL
);
* Caller doesn't want the thing hashed, just use ArchFindMember
* to read the header for the member out and close down the stream
* again. Since the archive is not to be hashed, we assume there's
* no need to allocate extra room for the header we're returning,
* so just declare it static.
static struct ar_hdr sarh
;
arch
= ArchFindMember(archive
, member
, &sarh
, "r");
if (arch
== (FILE *)NULL
) {
return ((struct ar_hdr
*)NULL
);
* We don't have this archive on the list yet, so we want to find out
* everything that's in it and cache it so we can get at it quickly.
arch
= fopen (archive
, "r");
if (arch
== (FILE *) NULL
) {
return ((struct ar_hdr
*) NULL
);
* We use the ARMAG string to make sure this is an archive we
if ((fread (magic
, SARMAG
, 1, arch
) != 1) ||
(strncmp (magic
, ARMAG
, SARMAG
) != 0)) {
return ((struct ar_hdr
*) NULL
);
ar
= (Arch
*)emalloc (sizeof (Arch
));
ar
->name
= strdup (archive
);
Hash_InitTable (&ar
->members
, -1);
memName
[AR_MAX_NAME_LEN
] = '\0';
while (fread ((char *)&arh
, sizeof (struct ar_hdr
), 1, arch
) == 1) {
if (strncmp ( arh
.ar_fmag
, ARFMAG
, sizeof (arh
.ar_fmag
)) != 0) {
* The header is bogus, so the archive is bad
* and there's no way we can recover...
Hash_DeleteTable (&ar
->members
);
return ((struct ar_hdr
*) NULL
);
(void) strncpy (memName
, arh
.ar_name
, sizeof(arh
.ar_name
));
for (cp
= &memName
[AR_MAX_NAME_LEN
]; *cp
== ' '; cp
--) {
* BSD 4.4 extended AR format: #1/<namelen>, with name as the
* first <namelen> bytes of the file
if (strncmp(memName
, AR_EFMT1
, sizeof(AR_EFMT1
) - 1) == 0 &&
isdigit(memName
[sizeof(AR_EFMT1
) - 1])) {
unsigned int elen
= atoi(&memName
[sizeof(AR_EFMT1
)-1]);
Hash_DeleteTable (&ar
->members
);
return ((struct ar_hdr
*) NULL
);
if (fread (memName
, elen
, 1, arch
) != 1) {
Hash_DeleteTable (&ar
->members
);
return ((struct ar_hdr
*) NULL
);
if (DEBUG(ARCH
) || DEBUG(MAKE
)) {
printf("ArchStat: Extended format entry for %s\n", memName
);
he
= Hash_CreateEntry (&ar
->members
, memName
, (Boolean
*)NULL
);
Hash_SetValue (he
, (ClientData
)emalloc (sizeof (struct ar_hdr
)));
memcpy ((Address
)Hash_GetValue (he
), (Address
)&arh
,
* We need to advance the stream's pointer to the start of the
* next header. Files are padded with newlines to an even-byte
* boundary, so we need to extract the size of the file from the
* 'size' field of the header and round it up during the seek.
arh
.ar_size
[sizeof(arh
.ar_size
)-1] = '\0';
size
= (int) strtol(arh
.ar_size
, NULL
, 10);
fseek (arch
, (size
+ 1) & ~1, 1);
(void) Lst_AtEnd (archives
, (ClientData
) ar
);
* Now that the archive has been read and cached, we can look into
* the hash table to find the desired member's header.
he
= Hash_FindEntry (&ar
->members
, member
);
if (he
!= (Hash_Entry
*) NULL
) {
return ((struct ar_hdr
*) Hash_GetValue (he
));
return ((struct ar_hdr
*) NULL
);
*-----------------------------------------------------------------------
* Locate a member of an archive, given the path of the archive and
* the path of the desired member. If the archive is to be modified,
* the mode should be "r+", if not, it should be "r".
* An FILE *, opened for reading and writing, positioned at the
* start of the member's struct ar_hdr, or NULL if the member was
* nonexistent. The current struct ar_hdr for member.
* The passed struct ar_hdr structure is filled in.
*-----------------------------------------------------------------------
ArchFindMember (archive
, member
, arhPtr
, mode
)
char *archive
; /* Path to the archive */
char *member
; /* Name of member. If it is a path, only the
* last component is used. */
struct ar_hdr
*arhPtr
; /* Pointer to header structure to be filled in */
char *mode
; /* The mode for opening the stream */
FILE * arch
; /* Stream to archive */
int size
; /* Size of archive member */
char *cp
; /* Useful character pointer */
arch
= fopen (archive
, mode
);
if (arch
== (FILE *) NULL
) {
* We use the ARMAG string to make sure this is an archive we
if ((fread (magic
, SARMAG
, 1, arch
) != 1) ||
(strncmp (magic
, ARMAG
, SARMAG
) != 0)) {
* Because of space constraints and similar things, files are archived
* using their final path components, not the entire thing, so we need
* to point 'member' to the final component, if there is one, to make
* the comparisons easier...
cp
= strrchr (member
, '/');
if (cp
!= (char *) NULL
) {
len
= tlen
= strlen (member
);
if (len
> sizeof (arhPtr
->ar_name
)) {
tlen
= sizeof (arhPtr
->ar_name
);
while (fread ((char *)arhPtr
, sizeof (struct ar_hdr
), 1, arch
) == 1) {
if (strncmp(arhPtr
->ar_fmag
, ARFMAG
, sizeof (arhPtr
->ar_fmag
) ) != 0) {
* The header is bogus, so the archive is bad
* and there's no way we can recover...
} else if (strncmp (member
, arhPtr
->ar_name
, tlen
) == 0) {
* If the member's name doesn't take up the entire 'name' field,
* we have to be careful of matching prefixes. Names are space-
* padded to the right, so if the character in 'name' at the end
* of the matched string is anything but a space, this isn't the
if (tlen
!= sizeof(arhPtr
->ar_name
) && arhPtr
->ar_name
[tlen
] != ' '){
* To make life easier, we reposition the file at the start
* of the header we just read before we return the stream.
* In a more general situation, it might be better to leave
* the file at the actual member, rather than its header, but
fseek (arch
, -sizeof(struct ar_hdr
), 1);
* BSD 4.4 extended AR format: #1/<namelen>, with name as the
* first <namelen> bytes of the file
if (strncmp(arhPtr
->ar_name
, AR_EFMT1
,
sizeof(AR_EFMT1
) - 1) == 0 &&
isdigit(arhPtr
->ar_name
[sizeof(AR_EFMT1
) - 1])) {
unsigned int elen
= atoi(&arhPtr
->ar_name
[sizeof(AR_EFMT1
)-1]);
if (fread (ename
, elen
, 1, arch
) != 1) {
if (DEBUG(ARCH
) || DEBUG(MAKE
)) {
printf("ArchFind: Extended format entry for %s\n", ename
);
if (strncmp(ename
, member
, len
) == 0) {
/* Found as extended name */
fseek (arch
, -sizeof(struct ar_hdr
) - elen
, 1);
* This isn't the member we're after, so we need to advance the
* stream's pointer to the start of the next header. Files are
* padded with newlines to an even-byte boundary, so we need to
* extract the size of the file from the 'size' field of the
* header and round it up during the seek.
arhPtr
->ar_size
[sizeof(arhPtr
->ar_size
)-1] = '\0';
size
= (int) strtol(arhPtr
->ar_size
, NULL
, 10);
fseek (arch
, (size
+ 1) & ~1, 1);
* We've looked everywhere, but the member is not to be found. Close the
* archive and return NULL -- an error.
*-----------------------------------------------------------------------
* Touch a member of an archive.
* The 'time' field of the member's header is updated.
* The modification time of the entire archive is also changed.
* For a library, this could necessitate the re-ranlib'ing of the
*-----------------------------------------------------------------------
GNode
*gn
; /* Node of member to touch */
FILE * arch
; /* Stream open to archive, positioned properly */
struct ar_hdr arh
; /* Current header describing member */
arch
= ArchFindMember(Var_Value (ARCHIVE
, gn
, &p1
),
Var_Value (TARGET
, gn
, &p2
),
sprintf(arh
.ar_date
, "%-12ld", (long) now
);
if (arch
!= (FILE *) NULL
) {
(void)fwrite ((char *)&arh
, sizeof (struct ar_hdr
), 1, arch
);
*-----------------------------------------------------------------------
* Given a node which represents a library, touch the thing, making
* sure that the table of contents also is touched.
* Both the modification time of the library and of the RANLIBMAG
* member are set to 'now'.
*-----------------------------------------------------------------------
GNode
*gn
; /* The node of the library to touch */
FILE * arch
; /* Stream open to archive */
struct ar_hdr arh
; /* Header describing table of contents */
struct timeval times
[2]; /* Times for utimes() call */
arch
= ArchFindMember (gn
->path
, RANLIBMAG
, &arh
, "r+");
sprintf(arh
.ar_date
, "%-12ld", (long) now
);
if (arch
!= (FILE *) NULL
) {
(void)fwrite ((char *)&arh
, sizeof (struct ar_hdr
), 1, arch
);
times
[0].tv_sec
= times
[1].tv_sec
= now
;
times
[0].tv_usec
= times
[1].tv_usec
= 0;
*-----------------------------------------------------------------------
* Return the modification time of a member of an archive.
* The modification time (seconds).
* The mtime field of the given node is filled in with the value
* returned by the function.
*-----------------------------------------------------------------------
GNode
*gn
; /* Node describing archive member */
struct ar_hdr
*arhPtr
; /* Header of desired member */
int modTime
; /* Modification time as an integer */
arhPtr
= ArchStatMember (Var_Value (ARCHIVE
, gn
, &p1
),
Var_Value (TARGET
, gn
, &p2
),
if (arhPtr
!= (struct ar_hdr
*) NULL
) {
modTime
= (int) strtol(arhPtr
->ar_date
, NULL
, 10);
*-----------------------------------------------------------------------
* Given a non-existent archive member's node, get its modification
* time from its archived form, if it exists.
* The mtime field is filled in.
*-----------------------------------------------------------------------
if (Lst_Open (gn
->parents
) != SUCCESS
) {
while ((ln
= Lst_Next (gn
->parents
)) != NILLNODE
) {
pgn
= (GNode
*) Lst_Datum (ln
);
if (pgn
->type
& OP_ARCHV
) {
* If the parent is an archive specification and is being made
* and its member's name matches the name of the node we were
* given, record the modification time of the parent in the
* child. We keep searching its parents in case some other
* parent requires this child to exist...
nameStart
= strchr (pgn
->name
, '(') + 1;
nameEnd
= strchr (nameStart
, ')');
strncmp(nameStart
, gn
->name
, nameEnd
- nameStart
) == 0) {
gn
->mtime
= Arch_MTime(pgn
);
* Something which isn't a library depends on the existence of
* this target, so it needs to exist.
*-----------------------------------------------------------------------
* Search for a library along the given search path.
* The node's 'path' field is set to the found path (including the
* actual file name, not -l...). If the system can handle the -L
* flag when linking (or we cannot find the library), we assume that
* the user has placed the .LIBRARIES variable in the final linking
* command (or the linker will know where to find it) and set the
* TARGET variable for this node to be the node's name. Otherwise,
* we set the TARGET variable to be the full path of the library,
* as returned by Dir_FindFile.
*-----------------------------------------------------------------------
GNode
*gn
; /* Node of library to find */
Lst path
; /* Search path */
char *libName
; /* file name for archive */
libName
= (char *)emalloc (strlen (gn
->name
) + 6 - 2);
sprintf(libName
, "lib%s.a", &gn
->name
[2]);
gn
->path
= Dir_FindFile (libName
, path
);
Var_Set (TARGET
, gn
->name
, gn
);
Var_Set (TARGET
, gn
->path
== (char *) NULL
? gn
->name
: gn
->path
, gn
);
*-----------------------------------------------------------------------
* Decide if a node with the OP_LIB attribute is out-of-date. Called
* from Make_OODate to make its life easier.
* There are several ways for a library to be out-of-date that are
* not available to ordinary files. In addition, there are ways
* that are open to regular files that are not available to
* libraries. A library that is only used as a source is never
* considered out-of-date by itself. This does not preclude the
* library's modification time from making its parent be out-of-date.
* A library will be considered out-of-date for any of these reasons,
* given that it is a target on a dependency line somewhere:
* Its modification time is less than that of one of its
* sources (gn->mtime < gn->cmtime).
* Its modification time is greater than the time at which the
* make began (i.e. it's been modified in the course
* of the make, probably by archiving).
* The modification time of one of its sources is greater than
* the one of its RANLIBMAG member (i.e. its table of contents
* is out-of-date). We don't compare of the archive time
* vs. TOC time because they can be too close. In my
* opinion we should not bother with the TOC at all since
* this is used by 'ar' rules that affect the data contents
* of the archive, not by ranlib rules, which affect the
* TRUE if the library is out-of-date. FALSE otherwise.
* The library will be hashed if it hasn't been already.
*-----------------------------------------------------------------------
GNode
*gn
; /* The library's graph node */
if (OP_NOP(gn
->type
) && Lst_IsEmpty(gn
->children
)) {
} else if ((gn
->mtime
> now
) || (gn
->mtime
< gn
->cmtime
)) {
struct ar_hdr
*arhPtr
; /* Header for __.SYMDEF */
int modTimeTOC
; /* The table-of-contents's mod time */
arhPtr
= ArchStatMember (gn
->path
, RANLIBMAG
, FALSE
);
if (arhPtr
!= (struct ar_hdr
*)NULL
) {
modTimeTOC
= (int) strtol(arhPtr
->ar_date
, NULL
, 10);
if (DEBUG(ARCH
) || DEBUG(MAKE
)) {
printf("%s modified %s...", RANLIBMAG
, Targ_FmtTime(modTimeTOC
));
oodate
= (gn
->cmtime
> modTimeTOC
);
* A library w/o a table of contents is out-of-date
if (DEBUG(ARCH
) || DEBUG(MAKE
)) {
*-----------------------------------------------------------------------
* Initialize things for this module.
* The 'archives' list is initialized.
*-----------------------------------------------------------------------
archives
= Lst_Init (FALSE
);
*-----------------------------------------------------------------------
* Cleanup things for this module.
* The 'archives' list is freed
*-----------------------------------------------------------------------
Lst_Destroy(archives
, ArchFree
);