mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
lib9: pass $PLAN9_TARGET via CPP for get9root fallback value
Allows this function to always return the proper path in situations where the $PLAN9 environment variable is not set, i.e. a rc login shell.
This commit is contained in:
parent
f7b572818c
commit
521fc08180
3 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,6 @@ get9root(void)
|
|||
|
||||
if((s = getenv("PLAN9")) != 0)
|
||||
return s;
|
||||
/* could do better - search $PATH */
|
||||
s = "/usr/local/plan9";
|
||||
s = PLAN9_TARGET;
|
||||
return s;
|
||||
}
|
||||
|
|
|
@ -175,6 +175,9 @@ HFILES=\
|
|||
%.$O: utf/%.c
|
||||
$CC $CFLAGS utf/$stem.c
|
||||
|
||||
get9root.$O: get9root.c
|
||||
$CC $CFLAGS -DPLAN9_TARGET=\"$PLAN9_TARGET\" get9root.c
|
||||
|
||||
XLIB=$PLAN9/lib/$LIB
|
||||
|
||||
testfmt: testfmt.$O $XLIB
|
||||
|
|
|
@ -36,7 +36,7 @@ echo cd `pwd`
|
|||
9c exitcode.c
|
||||
9c fcallfmt.c
|
||||
9c frand.c
|
||||
9c get9root.c
|
||||
9c -DPLAN9_TARGET=\"$PLAN9_TARGET\" get9root.c
|
||||
9c getcallerpc.c
|
||||
9c getenv.c
|
||||
9c getfields.c
|
||||
|
|
Loading…
Reference in a new issue