最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】Cygwin下配置编译和安装crosstool-ng

crosstool-ng crifan 5004浏览 0评论

【背景】

折腾:

【记录】Cygwin下用crosstool-ng为arm制作交叉编译器

期间,需要把crosstool-ng,配置编译和安装到当前的Cygwin中。

【折腾过程】

1.先去配置,此处,配置很顺利,没出错,就配置好了:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ls
COPYING   Makefile.in  TODO       config     configure.ac  ct-ng.comp  docs     licenses.d  samples  steps.mk
LICENSES  README       bootstrap  configure  contrib       ct-ng.in    kconfig  patches     scripts

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ./configure --prefix=/opt/crosstool-ng
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking whether sed understands -r -i -e... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for ranlib... ranlib
checking for objcopy... objcopy
checking for absolute path to objcopy... /usr/bin/objcopy
checking for objdump... objdump
checking for absolute path to objdump... /usr/bin/objdump
checking for readelf... readelf
checking for absolute path to readelf... /usr/bin/readelf
checking for bison... bison
checking for flex... flex
checking for gperf... gperf
checking for makeinfo... makeinfo
checking for cut... cut
checking for stat... stat
checking for readlink... readlink
checking for wget... wget
checking for tar... tar
checking for gzip... gzip
checking for bzip2... bzip2
checking for patch... /usr/bin/patch
checking for bash >= 3.1... /usr/bin/bash
checking for GNU awk... /usr/bin/awk
checking for GNU make >= 3.80... /usr/bin/make
checking whether /usr/bin/make sets $(MAKE)... yes
checking for GNU libtool >= 1.5.26... /usr/bin/libtool
checking for GNU libtoolize >= 1.5.26... /usr/bin/libtoolize
checking for GNU automake >= 1.10... /usr/bin/automake
checking for xz... xz
checking for cvs... cvs
checking for svn... svn
checking for inline... inline
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for working alloca.h... yes
checking for alloca... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking whether gettext is declared... yes
checking ncurses/ncurses.h usability... yes
checking ncurses/ncurses.h presence... yes
checking for ncurses/ncurses.h... yes
checking for library containing initscr... -lncursesw
configure: creating ./config.status
config.status: creating Makefile

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$

2.再去make编译crosstool-ng,然后出现和之前:

【已解决】cygwin中编译crosstool-ng出错:zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext’

一样的错误“zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext’ ”:

【已解决】Cygwin下make编译crosstool-ng出错:zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext’

3.然后对于mconf又出现”lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset’“的错误了:

【已解决】Cygwin 1.7.17下make编译crosstool-ng出错:lxdialog/menubox.o:menubox.c:(.text+0x7d): undefined reference to `_wattrset’

4.然后,又出现“nconf.c:1521:2: error: lvalue required as left operand of assignment”的错误:

【已解决】Cygwin下make编译crosstool-ng出错:nconf.c:1521:2: error: lvalue required as left operand of assignment

5.然后接着又出现“nconf.o:nconf.c:(.text+0x373): undefined reference to `_free_item’”的错误:

【已解决】Cygwin下make编译crosstool-ng出错:nconf.o:nconf.c:(.text+0×373): undefined reference to `_free_item’

最后就make编译完成了:

6.然后就是去用make install安装:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ make install
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  MKDIR   '/opt/crosstool-ng/bin/'
  INST    'ct-ng'
  RMDIR   '/opt/crosstool-ng/lib/ct-ng.1.18.0/'
  MKDIR   '/opt/crosstool-ng/lib/ct-ng.1.18.0/'
  INSTDIR 'config/'
  INSTDIR 'contrib/'
  INSTDIR 'patches/'
  INSTDIR 'scripts/'
  INST    'steps.mk'
  INST    'paths'
  INSTDIR 'samples/'
  INST    'kconfig/'
  MKDIR   '/opt/crosstool-ng/share/doc/crosstool-ng/ct-ng.1.18.0/'
  INST    'docs/*.txt'
  MKDIR   '/opt/crosstool-ng/share/man/man1/'
  INST    'ct-ng.1.gz'

For auto-completion, do not forget to install 'ct-ng.comp' into
your bash completion directory (usually /etc/bash_completion.d)

7.然后去确认一下:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ls /opt/crosstool-ng/ -lha
total 0
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 .
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 ..
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 bin
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 lib
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 share

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ls /opt/crosstool-ng/bin/ -lha
total 8.0K
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:43 .
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:43 ..
-rwxr-xr-x  1 Administrator None 4.9K Aug 24 22:43 ct-ng

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ls /opt/crosstool-ng/bin/lib -lha
ls: cannot access /opt/crosstool-ng/bin/lib: No such file or directory

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ls /opt/crosstool-ng/lib -lha
total 4.0K
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 .
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 ..
drwxr-xr-x+ 1 Administrator None 0 Aug 24 22:43 ct-ng.1.18.0

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0
$ ls /opt/crosstool-ng/lib/ct-ng.1.18.0/ -lha
total 42K
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:43 .
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:43 ..
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:18 config
drwxr-xr-x+ 1 Administrator None    0 Feb  1  2013 contrib
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:43 kconfig
drwxr-xr-x+ 1 Administrator None    0 Feb  1  2013 patches
-rw-r--r--  1 Administrator None  355 Aug 24 22:43 paths.mk
-rw-r--r--  1 Administrator None  379 Aug 24 22:43 paths.sh
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:43 samples
drwxr-xr-x+ 1 Administrator None    0 Aug 24 22:43 scripts
-rw-r--r--  1 Administrator None 2.3K Aug 24 22:43 steps.mk

如图:

make install ok for ct-ng

 

【总结】

此处,cygwin 1.7.17下,配置,编译,安装,crosstool-ng到cygwin下,相对来说,也不难。

转载请注明:在路上 » 【记录】Cygwin下配置编译和安装crosstool-ng

与本文相关的文章

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.167 seconds, using 22.35MB memory