version 1.27, 2000/06/10 01:41:05 |
version 1.28, 2000/06/17 14:38:13 |
|
|
#define MACHINE_ARCH TARGET_MACHINE_ARCH |
#define MACHINE_ARCH TARGET_MACHINE_ARCH |
#endif |
#endif |
|
|
static Lst archives; /* Lst of archives we've already examined */ |
static LIST archives; /* Lst of archives we've already examined */ |
|
|
typedef struct Arch { |
typedef struct Arch { |
char *name; /* Name of archive */ |
char *name; /* Name of archive */ |
|
|
*/ |
*/ |
free(buf); |
free(buf); |
} else if (Dir_HasWildcards(memName)) { |
} else if (Dir_HasWildcards(memName)) { |
Lst members = Lst_Init(); |
LIST members; |
char *member; |
char *member; |
|
|
Dir_Expand(memName, dirSearchPath, members); |
Lst_Init(&members); |
while ((member = (char *)Lst_DeQueue(members)) != NULL) { |
Dir_Expand(memName, &dirSearchPath, &members); |
|
while ((member = (char *)Lst_DeQueue(&members)) != NULL) { |
|
|
sprintf(nameBuf, "%s(%s)", libName, member); |
sprintf(nameBuf, "%s(%s)", libName, member); |
free(member); |
free(member); |
gn = Targ_FindNode (nameBuf, TARG_CREATE); |
gn = Targ_FindNode(nameBuf, TARG_CREATE); |
if (gn == NULL) { |
if (gn == NULL) |
return (FAILURE); |
return (FAILURE); |
} else { |
else { |
/* |
/* |
* We've found the node, but have to make sure the rest of |
* We've found the node, but have to make sure the rest of |
* the world knows it's an archive member, without having |
* the world knows it's an archive member, without having |
|
|
Lst_AtEnd(nodeLst, gn); |
Lst_AtEnd(nodeLst, gn); |
} |
} |
} |
} |
Lst_Destroy(members, NOFREE); |
Lst_Destroy(&members, NOFREE); |
} else { |
} else { |
sprintf(nameBuf, "%s(%s)", libName, memName); |
sprintf(nameBuf, "%s(%s)", libName, memName); |
gn = Targ_FindNode (nameBuf, TARG_CREATE); |
gn = Targ_FindNode (nameBuf, TARG_CREATE); |
|
|
if (cp != NULL) |
if (cp != NULL) |
member = cp + 1; |
member = cp + 1; |
|
|
ln = Lst_Find(archives, ArchFindArchive, archive); |
ln = Lst_Find(&archives, ArchFindArchive, archive); |
if (ln != NULL) { |
if (ln != NULL) { |
ar = (Arch *) Lst_Datum (ln); |
ar = (Arch *) Lst_Datum (ln); |
|
|
|
|
|
|
fclose (arch); |
fclose (arch); |
|
|
Lst_AtEnd(archives, ar); |
Lst_AtEnd(&archives, ar); |
|
|
/* |
/* |
* Now that the archive has been read and cached, we can look into |
* Now that the archive has been read and cached, we can look into |
|
|
char *nameStart, |
char *nameStart, |
*nameEnd; |
*nameEnd; |
|
|
if (Lst_Open (gn->parents) != SUCCESS) { |
if (Lst_Open(&gn->parents) != SUCCESS) { |
gn->mtime = OUT_OF_DATE; |
gn->mtime = OUT_OF_DATE; |
return FALSE; |
return FALSE; |
} |
} |
while ((ln = Lst_Next (gn->parents)) != NULL) { |
while ((ln = Lst_Next(&gn->parents)) != NULL) { |
pgn = (GNode *) Lst_Datum (ln); |
pgn = (GNode *) Lst_Datum (ln); |
|
|
if (pgn->type & OP_ARCHV) { |
if (pgn->type & OP_ARCHV) { |
|
|
} |
} |
} |
} |
|
|
Lst_Close (gn->parents); |
Lst_Close(&gn->parents); |
|
|
return gn->mtime == OUT_OF_DATE; |
return gn->mtime == OUT_OF_DATE; |
} |
} |
|
|
{ |
{ |
Boolean oodate; |
Boolean oodate; |
|
|
if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) { |
if (OP_NOP(gn->type) && Lst_IsEmpty(&gn->children)) { |
oodate = FALSE; |
oodate = FALSE; |
} else if (gn->mtime > now || gn->mtime < gn->cmtime || |
} else if (gn->mtime > now || gn->mtime < gn->cmtime || |
gn->mtime == OUT_OF_DATE) { |
gn->mtime == OUT_OF_DATE) { |
|
|
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
*/ |
*/ |
void |
void |
Arch_Init () |
Arch_Init() |
{ |
{ |
archives = Lst_Init(); |
Lst_Init(&archives); |
} |
} |
|
|
|
|
|
|
Arch_End () |
Arch_End () |
{ |
{ |
#ifdef CLEANUP |
#ifdef CLEANUP |
Lst_Destroy(archives, ArchFree); |
Lst_Destroy(&archives, ArchFree); |
#endif |
#endif |
} |
} |
|
|