Sebastien Lorquet sebastien-i/0epbAZHkZGWvitb5QawA@public.gmane.org [nuttx]
2014-05-28 10:36:27 UTC
Hello
I spoke too fast: I still have problems with msys and clean_context.
I'm using the following config, as stated before:
CONFIG_HOST_WINDOWS=y
CONFIG_WINDOWS_MSYS=y
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
The reason why I'm using this config, is that MSYS tries to imitate a POSIX
platform, and has nothing to do with cygwin, cygpath, and windows tools.
With msys, there is no /cygdrive folder, instead path translation between
c:\windowspath and /c/windowspath is automatic. That's why the bleeding edge
toolchain, and probably other toolchains, work easily under msys.
So using a toolchain that does not define WINTOOL via Toolchain.defs allows me
to avoid the use of cygpath with msys.
But there is still one more problem: with MSYS, ln -s does not create a symlink,
but a simple copy. There is no way to circumvent this, because windows does not
support symlinks.
So here I am, LN does a copy behind my back.
"make" works, and I can successfully build nuttx.hex with msys.
The problem arises when I run "make clean_context" or "make distclean", because
unlink.sh (or whatever was used before my change) does not find the .fakelnk
file that signals a faked directory symlink, or does not add the -r option to rm -f.
I sort of fixed this with two changes:
1. in configs/stm3f4discovery/nsh/Make.defs, I added a special case to use
link.sh and unlink.sh when msys is defined, but not wintool:
ifeq ($(WINTOOL),y)
# Windows-native toolchains
DIRLINK = $(TOPDIR)/tools/copydir.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem
"${shell cygpath -w $(TOPDIR)/include/cxx}"
ARCHSCRIPT = -T "${shell cygpath -w
$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
else
# Linux/MSYS/Cygwin-native toolchain
# sebastien lorquet: msys ln will copy (hardlink), not symbolic link, so we
need the fakelink method as in windows native
ifeq ($(CONFIG_WINDOWS_MSYS),y)
DIRLINK = $(TOPDIR)/tools/copydir.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
endif
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
I suspect there is a lot of Make.defs that look like this one in a lot of
configurations, so a side question is, why is this file configuration-specific?
2. in tools/link.sh, I try to detect msys via uname -o, and I add the .fakelnk file:
# Create the soft link
ln -s "${src}" "${dest}" || \
{ echo "Failed to create link: $dest" ; exit 1 ; }
# sebastien lorquet 20140528 for msys, ln will not create a symlink, but a copy
# so fake the link instead
os = `shell uname -o`
if [ "x${os}" == "xMsys" ]; then
touch ${dest}/.fakelnk
fi
This seems to work, I can run make clean_context or distclean without problems;
I'd like to get your inputs on these changes.
Should we create a new configuration stm32f4discovery/msysbuild with the correct
default settings for this build platform? I don't know.
best regards,
--
Sébastien Lorquet
------------------------------------
Posted by: Sebastien Lorquet <sebastien-i/***@public.gmane.org>
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/nuttx/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/nuttx/join
(Yahoo! ID required)
<*> To change settings via email:
nuttx-digest-***@public.gmane.org
nuttx-fullfeatured-***@public.gmane.org
<*> To unsubscribe from this group, send an email to:
nuttx-unsubscribe-***@public.gmane.org
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
I spoke too fast: I still have problems with msys and clean_context.
I'm using the following config, as stated before:
CONFIG_HOST_WINDOWS=y
CONFIG_WINDOWS_MSYS=y
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
The reason why I'm using this config, is that MSYS tries to imitate a POSIX
platform, and has nothing to do with cygwin, cygpath, and windows tools.
With msys, there is no /cygdrive folder, instead path translation between
c:\windowspath and /c/windowspath is automatic. That's why the bleeding edge
toolchain, and probably other toolchains, work easily under msys.
So using a toolchain that does not define WINTOOL via Toolchain.defs allows me
to avoid the use of cygpath with msys.
But there is still one more problem: with MSYS, ln -s does not create a symlink,
but a simple copy. There is no way to circumvent this, because windows does not
support symlinks.
So here I am, LN does a copy behind my back.
"make" works, and I can successfully build nuttx.hex with msys.
The problem arises when I run "make clean_context" or "make distclean", because
unlink.sh (or whatever was used before my change) does not find the .fakelnk
file that signals a faked directory symlink, or does not add the -r option to rm -f.
I sort of fixed this with two changes:
1. in configs/stm3f4discovery/nsh/Make.defs, I added a special case to use
link.sh and unlink.sh when msys is defined, but not wintool:
ifeq ($(WINTOOL),y)
# Windows-native toolchains
DIRLINK = $(TOPDIR)/tools/copydir.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem
"${shell cygpath -w $(TOPDIR)/include/cxx}"
ARCHSCRIPT = -T "${shell cygpath -w
$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
else
# Linux/MSYS/Cygwin-native toolchain
# sebastien lorquet: msys ln will copy (hardlink), not symbolic link, so we
need the fakelink method as in windows native
ifeq ($(CONFIG_WINDOWS_MSYS),y)
DIRLINK = $(TOPDIR)/tools/copydir.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
endif
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
I suspect there is a lot of Make.defs that look like this one in a lot of
configurations, so a side question is, why is this file configuration-specific?
2. in tools/link.sh, I try to detect msys via uname -o, and I add the .fakelnk file:
# Create the soft link
ln -s "${src}" "${dest}" || \
{ echo "Failed to create link: $dest" ; exit 1 ; }
# sebastien lorquet 20140528 for msys, ln will not create a symlink, but a copy
# so fake the link instead
os = `shell uname -o`
if [ "x${os}" == "xMsys" ]; then
touch ${dest}/.fakelnk
fi
This seems to work, I can run make clean_context or distclean without problems;
I'd like to get your inputs on these changes.
Should we create a new configuration stm32f4discovery/msysbuild with the correct
default settings for this build platform? I don't know.
best regards,
--
Sébastien Lorquet
------------------------------------
Posted by: Sebastien Lorquet <sebastien-i/***@public.gmane.org>
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/nuttx/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/nuttx/join
(Yahoo! ID required)
<*> To change settings via email:
nuttx-digest-***@public.gmane.org
nuttx-fullfeatured-***@public.gmane.org
<*> To unsubscribe from this group, send an email to:
nuttx-unsubscribe-***@public.gmane.org
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/