Skip to content

Commit

Permalink
mamake: bind: also bind to local .a files (re: a9a8586, 8c3ab86)
Browse files Browse the repository at this point in the history
The first referenced commit exposed a mamake bug introduced in the
second: when executing 'bind', a dependency was only declared on a
file that has an absolute path -- effectively, one that is already
preinstalled. But *.a files that exist in the current working
directory also need to count; when we link a binary against a
library we just built, such as linking ksh against libshell, that's
what ${mam_libshell} contains.

To fix it, instead of only declaring dependencies on /* paths,
declare dependencies on everything except strings that start with
'-l' (which are compiler flags, not real files).
  • Loading branch information
McDutchie committed Feb 27, 2024
1 parent a9a8586 commit a867e15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/INIT/mamake.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* coded for portability
*/

#define RELEASE_DATE "2024-02-17"
#define RELEASE_DATE "2024-02-27"
static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";

#if _PACKAGE_ast
Expand Down Expand Up @@ -1905,7 +1905,7 @@ make(Rule_t *r, int inloop, unsigned long modtime, Buf_t **parentcmd)
else
s = 0;
/* only bother if t is a path to a *.a we built (i.e. not -l...) */
if (*t == '/')
if (t[0] != '-' || t[1] != 'l')
{
q = rule(expand(buf, t));
attributes(q, v);
Expand Down

0 comments on commit a867e15

Please sign in to comment.