2019/5/29

"echo -e" in make

在 build yocto 時遇到..
NOTE: make -j 6 DESTDIR=/home/charles-chang/psdk-auto/yocto-layers/
build/arago-tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/input-utils/1.0-r0/image STRIP=
| 
| Make.config written, edit if needed
| 
| Make.config:1: *** empty variable name.  Stop.
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
找一下 產生的 Make.config,內容是..
-e LIB := gcc
但是在 ubuntu 14.04 中又沒有問題,他的 Make.config 是
LIB := gcc
然後 這一篇 說...
I fixed this problem while building on Ubuntu 16.04 by modifying the input-utils Autoconf.mk. 
If you look at the failing Make.config, it had something like this:

-e LIB := gcc

Make.config is generated by mk/Autoconf.mk, which has the following:

Make.config: $(srcdir)/GNUmakefile
    @echo -e "$(make-config-q)" > $@
    @echo
    @echo "Make.config written, edit if needed"
    @echo
I removed the "-e". I didn't investigate why the echo invoked from the makefile would interpret 
the -e as something to output.
然後這一篇 說,印不印出 '-e' 是 shell 的關係。...
因為makefile中也有一個"$SHELL"的變數,跟系統的"$SHELL"變數互不干擾。

所以如果只有單一個makefile要使用bash的話,只要在makefile前面寫上"SHELL=/bin/bash"就可以完美執行囉~


因為 yocto 部份要改 source 並且 做version control 比較麻煩,所以改 system..
$sudo dpkg-reconfigure dash
然後選 No, 他就會改用bash..
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
Adding 'diversion of /bin/sh to /bin/sh.distrib by bash'
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash'

沒有留言:

張貼留言