Makefile macros - dependency to shell

jerzy szczudłowski jerzy at jedwab.net.pl
Tue Sep 21 16:28:01 CEST 2004


Paweł Sakowski wrote:
> >  Transition bash ->
> > ksh works for me too. But again, su from user at bash to root at ksh don't.
> 
> You mean, as in:
> 
> $ cat Makefile
> dupa:
>         echo "$(PWD)"
> $ head -n1 /etc/passwd
> root:x:0:0:root:/root:/bin/ksh
> $ su root
> Password:
> # make
> echo "/tmp"
> /tmp

Same effect here, but like Łukasz said: change "su" to "su -".


> # rpm -q pdksh make bash
> pdksh-5.2.14-41
> make-3.80-5

Same here.


> bash-2.05b-15

Almost the same: -16


> > But when it does, where should I look to change it?
> 
> strace -f make

I did that, but nothing interesting appears on this "level of
abstraction":

(I left only parts which really differs; "-" denotes ksh, "+" bash run)

#v+
-write(1, "echo \"\"\n", 8)        = 8
+write(1, "echo \"/tmp\"\n", 12)   = 12
[...]
-execve("/bin/sh", ["/bin/sh", "-c", "echo \"\""], [/* 20 vars */]) = 0
+execve("/bin/sh", ["/bin/sh", "-c", "echo \"/tmp\""], [/* 22 vars */]) = 0
[...]
-getpid()                          = 2622
-getcwd("/tmp", 4096)              = 5
+getpid()                          = 2628
+stat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
+stat64(".", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
[...]
-write(1, "\n", 1)                 = 1
+write(1, "/tmp\n", 5)             = 5
[...]
#v-





More information about the pld-devel-en mailing list