win下cygwin openwrt编译测试 (应该行得通,但是我找不出来working g++ failed原因。)

来源:互联网 发布:复杂的网络拓扑 编辑:程序博客网 时间:2024/05/01 04:45

主要是懒。
我之前已经用Ubuntu折腾一遍了。然后听说微软发布会上新产品,bash for windows 10.和我win7用户没什么关系。我就在网上随便闲逛发现了babun

Babun,一个开箱即用的 Windows Shell

个人测试了下还算好用。于是就好奇能不能编译openwrt(当然这里就开始错了,这里旨在找错的过程)

pact install gitgit clone git://git.openwrt.org/openwrt.gitcd openwrt./scripts/feeds update -a./scripts/feeds install -amake defconfigChecking 'working-make'... ok.Checking 'case-sensitive-fs'... failed.Checking 'gcc'... ok.Checking 'working-gcc'... ok.Checking 'g++'... ok.Checking 'working-g++'... failed.Checking 'ncurses'... ok.Checking 'zlib'... ok.Checking 'libssl'... ok.Checking 'perl-thread-queue'... ok.Checking 'tar'... ok.Checking 'find'... ok.Checking 'bash'... ok.Checking 'patch'... failed.Checking 'diff'... ok.Checking 'cp'... ok.Checking 'seq'... ok.Checking 'awk'... ok.Checking 'grep'... ok.Checking 'getopt'... ok.Checking 'stat'... ok.Checking 'md5sum'... ok.Checking 'unzip'... ok.Checking 'bzip2'... ok.Checking 'wget'... ok.Checking 'perl'... ok.Checking 'python'... ok.Checking 'svn'... ok.Checking 'git'... ok.Checking 'file'... ok.Checking 'openssl'... ok.Checking 'ldconfig-stub'... ok.Build dependency: OpenWrt can only be built on a case-sensitive filesystemBuild dependency: Please reinstall the GNU C++ Compiler - it appears to be broken

Build dependency: Please reinstall the GNU C++ Compiler - it appears to be broken

先说这个working-g++ failed.我没解决这个问题。
我以为是g++不工作,于是随便编译了个helloworld.cpp

提示compilation error:”stddef.h : no such file or directory”
原因链接里面也有,是gcc-core与gcc-g++版本不同造成的。

pact update gcc-core gcc-g++
就解决了。
回头重新make defconfig还是failed。这个问题只能以后来解决了。一个坑

Build dependency: OpenWrt can only be built on a case-sensitive filesystem

这个问题我一开始是没能理解什么是case-sensitive filesystem
于是我搜到了陈年老帖。(应该很早就有人折腾过,但是相关的帖子好难找)

老外折腾的一个提问帖

关于case-sensitive
大小写敏感性

In Unix filesystems, filenames are usually case-sensitive. Old Windows filesystems (VFAT, FAT32) are not case-sensitive (there cannot be a readme.txt and a Readme.txt in the same directory) but are case-preserving, i.e. remembering the case of the letters. The original FAT12 filesystem was case-insensitive.[7] Current Windows file systems, like NTFS, are case-sensitive; that is a readme.txt and a Readme.txt can exist in the same directory.

http://stackoverflow.com/questions/30848881/unknow-build-error-with-openwrt

我试着将win7改成case-sensitive ,查到解决方法

http://superuser.com/questions/266110/how-do-you-make-windows-7-fully-case-sensitive-with-respect-to-the-filesystem

重启。解决了这个问题。
根据上面帖子说的,先更改注册表
-写一个add.reg

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel]"obcaseinsensitive"=dword:00000000

导入,或者手动到

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\ dword:ObCaseInsensitive

改成0
然后到fstab里面改posix=1,
fstab在cygwin的etc目录下。
我的在
C:\Users\Administrator.babun\cygwin\etc

none /cygdrive cygdrive binary,noacl,posix=1,user 0 0
c: /cygdrive/c ntfs binary,posix=1,user,auto 0 0

关于posix=1的解释在note里面。

https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive

/cygdrive paths are case-insensitive by default. The reason is that the native Windows %PATH% environment variable is not always using the correct case for all paths in it. As a result, if you use case-sensitivity on the /cygdrive prefix, your shell might claim that it can’t find Windows commands like attrib or net. To ease the pain, the /cygdrive path is case-insensitive by default and you have to use the “posix=1” setting explicitly in /etc/fstab or /etc/fstab.d/$USER to switch it to case-sensitivity, or you have to make sure that the native Win32 %PATH% environment variable is using the correct case for all paths throughout.

现在主要解决之前的问题。working g++ failed

编译结果更新

0 0
原创粉丝点击