@cyysu
2018-08-10T01:22:28.000000Z
字数 30466
阅读 2169
- 时间:2017年11月15日14:22:40
- 作者:Kali
- 邮箱:cyysu.github.io@gmail.com/2869905223@qq.com/微信lwyx1413
- 版本:4.0
- 描述:在ARM平台移植htop
Linux字符界面系列教程
在移植之前需要下载ncurse软件包,他提供了字符界面常用的库tar xf ncurses.tar.gztar xf htop-1.0.2.tar.gzmkdir install_ncursesmkdir install_htop编译ncurses,由于htop依赖于ncurses库,因此需要先编译ncurses,进入ncurses目录,并配置交叉编译cd ncurses-5.9root@DZ:/home/mj/htop_arm/ncurses-5.9# ./configure --prefix=/home/mj/install_ncurses --host=arm-none-linux-gnueabi --without-cxx --without-cxx-binding --without-ada --without-manpages --enable-overwrite --without-debug --without-tests --with-shared --without-tests --without-progsconfigure: WARNING: If you wanted to set the --build type, don't use --host.If a cross compiler is detected then cross compile mode will be used.checking for egrep... grep -EConfiguring NCURSES 5.9 ABI 5 (Wed Nov 15 15:22:39 CST 2017)checking build system type... x86_64-unknown-linux-gnuchecking host system type... arm-none-linux-gnueabichecking target system type... arm-none-linux-gnueabiConfiguring for linux-gnueabichecking for prefix... /home/mj/install_ncurseschecking for arm-none-linux-gnueabi-gcc... arm-none-linux-gnueabi-gccchecking for C compiler default output... a.outchecking whether the C compiler works... yeschecking whether we are cross compiling... yeschecking for executable suffix...checking for object suffix... ochecking whether we are using the GNU C compiler... yeschecking whether arm-none-linux-gnueabi-gcc accepts -g... yeschecking version of arm-none-linux-gnueabi-gcc... 2011.03checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -Echecking whether arm-none-linux-gnueabi-gcc needs -traditional... nochecking whether arm-none-linux-gnueabi-gcc understands -c and -o together... yeschecking for POSIXized ISC... nochecking for arm-none-linux-gnueabi-gcc option to accept ANSI C... -DCC_HAS_PROTOSchecking if you want to ensure bool is consistent with C++... nochecking if you want to build C++ binding and demo... nochecking if you want to build with Ada95... nochecking if you want to install manpages... nochecking if you want to build programs such as tic... nochecking if you want to build test-programs... nochecking if you wish to install curses.h... yeschecking for mawk... mawkchecking for egrep... (cached) grep -Echecking for a BSD compatible install... /usr/bin/install -cchecking for tdlint... nochecking for lint... nochecking for alint... nochecking for splint... nochecking for lclint... nochecking whether ln -s works... yeschecking if ln -s -f options work... yeschecking for long file names... yeschecking if you want to use pkg-config... yeschecking for arm-none-linux-gnueabi-pkg-config... nochecking for pkg-config... /usr/bin/pkg-configchecking if we should install .pc files for /usr/bin/pkg-config... nochecking if we should assume mixed-case filenames... autochecking if filesystem supports mixed-case filenames... yeschecking whether make sets ${MAKE}... yeschecking for exctags... nochecking for ctags... ctagschecking for exetags... nochecking for etags... etagschecking for ctags... yeschecking for etags... yeschecking for makeflags variable...checking for arm-none-linux-gnueabi-ranlib... arm-none-linux-gnueabi-ranlibchecking for arm-none-linux-gnueabi-ld... arm-none-linux-gnueabi-ldchecking for arm-none-linux-gnueabi-ar... arm-none-linux-gnueabi-archecking for arm-none-linux-gnueabi-ar... (cached) arm-none-linux-gnueabi-archecking for options to update archives... -curvchecking if you have specified an install-prefix...checking for gcc... gccchecking for native build C compiler... gccchecking for native build C preprocessor... ${BUILD_CC} -Echecking for native build C flags...checking for native build C preprocessor-flags...checking for native build linker-flags...checking for native build linker-libraries...checking if libtool -version-number should be used... yeschecking if you want to build libraries with libtool... nochecking if you want to build shared libraries... yeschecking if you want to build static libraries... yeschecking if you want to build debug libraries... nochecking if you want to build profiling libraries... nochecking for specified models... shared normalchecking for default model... sharedchecking if you want to build a separate terminfo library... nochecking if you want to build a separate tic library... nochecking if you want to link with the GPM mouse library... maybechecking for gpm.h... nochecking for default loader flags...checking if rpath option should be used... nochecking if shared libraries should be relinked during install... yeschecking for an rpath option... -Wl,-rpath,checking if release/abi version should be used for shared libs... autochecking which arm-none-linux-gnueabi-gcc option to use... -fPICchecking if rpath-hack should be disabled... nochecking for updated LDFLAGS... maybechecking for ldd... lddchecking if you wish to install ncurses overwriting curses... yeschecking if external terminfo-database is used... yeschecking which terminfo source-file will be installed... ${top_srcdir}/misc/terminfo.srcchecking whether to use hashed database instead of directory/tree... nochecking for list of fallback descriptions...checking if you want modern xterm or antique... xterm-newchecking for list of terminfo directories... /home/mj/install_ncurses/share/terminfochecking for default terminfo directory... /home/mj/install_ncurses/share/terminfochecking if big-core option selected... nochecking if big-strings option selected... yeschecking if you want termcap-fallback support... nochecking if ~/.terminfo is wanted... yeschecking if you want to use restricted environment when running as root... yeschecking for remove... yeschecking for unlink... yeschecking for link... yeschecking for symlink... yeschecking if tic should use symbolic links... nochecking if tic should use hard links... yeschecking if you want broken-linker support code... nochecking if tputs should process BSD-style prefix padding... nochecking if we must define _GNU_SOURCE... yeschecking if SIGWINCH is defined... yeschecking for nl_langinfo and CODESET... yeschecking if you want wide-character code... nochecking whether to enable _LP64 definition in curses.h... nochecking for special C compiler options needed for large files... nochecking for _FILE_OFFSET_BITS value needed for large files... 64checking for _LARGE_FILES value needed for large files... nochecking for _LARGEFILE_SOURCE value needed for large files... nochecking for fseeko... yeschecking whether to use struct dirent64... nochecking if you want tparm not to use X/Open fixed-parameter list... yeschecking for type of bool... autochecking for alternate terminal capabilities file... Capschecking for type of chtype... autochecking for type of ospeed... shortchecking for type of mmask_t... autochecking for size CCHARW_MAX... 5checking if RCS identifiers should be compiled-in... nochecking format of man-pages... gzipchecking for manpage renaming... /home/mj/htop_arm/ncurses-5.9/man/man_db.renameschecking if manpage aliases will be installed... yeschecking if manpage symlinks should be used... yeschecking for manpage tbl... nochecking if you want to build with function extensions... yeschecking if you want to build with experimental SCREEN extensions... nochecking if you want to build with experimental terminal-driver... nochecking for extended use of const keyword... nochecking if you want to use extended colors... nochecking if you want to use extended mouse encoding... nochecking if you want $NCURSES_NO_PADDING code... yeschecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for signed char... yeschecking size of signed char... 1checking if you want to use signed Boolean array in term.h... nochecking if you want SIGWINCH handler... yeschecking if you want user-definable terminal capabilities like termcap... yeschecking if you want all development code... nochecking if you want hard-tabs code... nochecking if you want limited support for xmc... nochecking if you do not want to assume colors are white-on-black... yeschecking if you want hashmap scrolling-optimization code... yeschecking if you want colorfgbg code... nochecking if you want interop bindings... nochecking if you want to link with the pthread library... nochecking if you want experimental reentrant code... nochecking if you want experimental safe-sprintf code... nochecking if you want experimental wgetch-events code... nochecking if you want to display full commands during build... yeschecking if you want to see compiler warnings...configure: checking for arm-none-linux-gnueabi-gcc __attribute__ directives...... scanf... printf... unused... noreturnchecking if you want to enable runtime assertions... nochecking if you want to use dmalloc for testing... nochecking if you want to use dbmalloc for testing... nochecking if you want to use valgrind for testing... nochecking if you want to perform memory-leak testing... nochecking whether to add trace feature to all models... nochecking for gettimeofday... yeschecking if -lm needed for math functions... yeschecking for ANSI C header files... (cached) yeschecking for dirent.h that defines DIR... yeschecking for opendir in -ldir... nochecking whether time.h and sys/time.h may both be included... yeschecking for regcomp... yeschecking for regular-expression headers... regex.hchecking for fcntl.h... yeschecking for getopt.h... yeschecking for limits.h... yeschecking for locale.h... yeschecking for math.h... yeschecking for poll.h... yeschecking for sys/bsdtypes.h... nochecking for sys/ioctl.h... yeschecking for sys/param.h... yeschecking for sys/poll.h... yeschecking for sys/select.h... yeschecking for sys/time.h... yeschecking for sys/times.h... yeschecking for ttyent.h... yeschecking for unistd.h... (cached) yeschecking for wctype.h... yeschecking if sys/time.h works with sys/select.h... yeschecking for arm-none-linux-gnueabi-gcc option to accept ANSI C... none neededchecking for an ANSI C-conforming const... yeschecking for inline... inlinechecking if arm-none-linux-gnueabi-gcc supports options to tune inlining... yeschecking for signal global datatype... volatile sig_atomic_tchecking for type of chtype... longchecking if unsigned literals are legal... yeschecking if external errno is declared... yeschecking if external errno exists... nochecking if data-only library module links... unknownchecking for getcwd... yeschecking for getegid... yeschecking for geteuid... yeschecking for getttynam... yeschecking for issetugid... nochecking for poll... yeschecking for remove... (cached) yeschecking for select... yeschecking for setbuf... yeschecking for setbuffer... yeschecking for setvbuf... yeschecking for sigaction... yeschecking for sigvec... yeschecking for strdup... yeschecking for strstr... yeschecking for tcgetpgrp... yeschecking for times... yeschecking for vsnprintf... yeschecking for isascii... yeschecking whether sigaction needs _POSIX_SOURCE... nochecking if nanosleep really works... unknownchecking for termio.h... yeschecking for termios.h... yeschecking for unistd.h... (cached) yeschecking whether termios.h needs _POSIX_SOURCE... nochecking for tcgetattr... yeschecking for vsscanf function or workaround... vsscanfchecking for working mkstemp... checking for mkstemp... yesconfigure: WARNING: cross compiling: assume setvbuf params not reversedchecking return type of signal handlers... voidchecking for type sigaction_t... nochecking declaration of size-change... yeschecking for memmove... yeschecking if poll really works... unknownchecking for va_copy... yeschecking for __va_copy... yeschecking for pid_t... yeschecking for unistd.h... (cached) yeschecking for vfork.h... nochecking for fork... yeschecking for vfork... yeschecking for working fork... (cached) yeschecking for working vfork... (cached) yeschecking for openpty in -lutil... yeschecking for openpty header... pty.hchecking if we should include stdbool.h... yeschecking for builtin bool type... nochecking for size of bool... unknownconfigure: WARNING: Assuming unsigned for type of boolchecking for library subsets... termlib+ext_tinfo+base+ext_funcschecking default library suffix...checking default library-dependency suffix... .sochecking default object directory... obj_schecking where we will install curses.h... ${prefix}/includechecking for src modules... ncurses panel menu formchecking for tic... /usr/bin/ticconfigure: creating ./config.statusconfig.status: creating include/MKterm.h.awkconfig.status: creating include/curses.headconfig.status: creating include/ncurses_dll.hconfig.status: creating include/termcap.hconfig.status: creating include/unctrl.hconfig.status: creating include/Makefileconfig.status: creating ncurses/Makefileconfig.status: creating panel/Makefileconfig.status: creating menu/Makefileconfig.status: creating form/Makefileconfig.status: creating misc/Makefileconfig.status: creating misc/run_tic.shconfig.status: creating misc/ncurses-configconfig.status: creating man/ncurses5-config.1config.status: creating Makefileconfig.status: creating include/ncurses_cfg.hAppending rules for shared model (ncurses: termlib+ext_tinfo+base+ext_funcs)Appending rules for normal model (ncurses: termlib+ext_tinfo+base+ext_funcs)Appending rules for shared model (panel: termlib+ext_tinfo+base+ext_funcs)Appending rules for normal model (panel: termlib+ext_tinfo+base+ext_funcs)Appending rules for shared model (menu: termlib+ext_tinfo+base+ext_funcs)Appending rules for normal model (menu: termlib+ext_tinfo+base+ext_funcs)Appending rules for shared model (form: termlib+ext_tinfo+base+ext_funcs)Appending rules for normal model (form: termlib+ext_tinfo+base+ext_funcs)creating headers.sh** Configuration summary for NCURSES 5.9 20110404:extended funcs: yesxterm terminfo: xterm-newbin directory: /home/mj/install_ncurses/binlib directory: /home/mj/install_ncurses/libinclude directory: /home/mj/install_ncurses/includeman directory: /home/mj/install_ncurses/manterminfo directory: /home/mj/install_ncurses/share/terminfo# 直接进行安装操作root@DZ:/home/mj/htop_arm/ncurses-5.9# make && make installcd include && make DESTDIR="" allmake[1]: Entering directory '/home/mj/htop_arm/ncurses-5.9/include'cat curses.head >curses.hAWK=mawk sh ./MKkey_defs.sh ./Caps >>curses.hsh -c 'if test "chtype" = "cchar_t" ; then cat ./curses.wide >>curses.h ; fi'cat ./curses.tail >>curses.hsh ./MKhashsize.sh ./Caps >hashsize.hAWK=mawk sh ./MKncurses_def.sh ./ncurses_defs >ncurses_def.hAWK=mawk sh ./MKparametrized.sh ./Caps >parametrized.htouch config.hmawk -f MKterm.h.awk ./Caps > term.hsh ./edit_cfg.sh ../include/ncurses_cfg.h term.h** edit: HAVE_TCGETATTR 1** edit: HAVE_TERMIOS_H 1** edit: HAVE_TERMIO_H 1** edit: BROKEN_LINKER 0......../bin/sh ./run_tic.sh** Building terminfo database, please wait...Running /usr/bin/tic to install /home/mj/install_ncurses/share/terminfo ...You may see messages regarding extended capabilities, e.g., AX.These are extended terminal capabilities which are compiledusingtic -xIf you have ncurses 4.2 applications, you should read the INSTALLdocument, and install the terminfo without the -x option.1600 entries written to /home/mj/install_ncurses/share/terminfo** built new /home/mj/install_ncurses/share/terminfo** sym-linked /home/mj/install_ncurses/lib/terminfo for compatibilityinstalling stdinstalling stdcrtinstalling vt100installing vt300/usr/bin/install -c ncurses-config /home/mj/install_ncurses/bin/ncurses5-configmake[1]: Leaving directory '/home/mj/htop_arm/ncurses-5.9/misc'# 安装完测试结果root@DZ:/home/mj/install_ncurses# lsbin include lib shareroot@DZ:/home/mj/install_ncurses# pwd/home/mj/install_ncurses
接下来就是编译htop,进入htop目录,并配置htop交叉编译选项,注意需通过LDFLAGS指定ncurses库所在的目录并通过CPPFLAGS指定ncurses头文件所在的目录root@DZ:/home/mj/install_ncurses# cd ../htop_arm/htop-1.0.2/root@DZ:/home/mj/htop_arm/htop-1.0.2# ./configure --prefix=/home/mj/install_htop --disable-unicode --host=arm-none-linux-gnueabi LDFLAGS=-L/home/mj/install_ncurses/lib CPPFLAGS=-I/home/mj/install_ncurses/include/ncursesconfigure: WARNING: If you wanted to set the --build type, don't use --host.If a cross compiler is detected then cross compile mode will be used.checking for arm-none-linux-gnueabi-gcc... arm-none-linux-gnueabi-gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables...checking whether we are cross compiling... yeschecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether arm-none-linux-gnueabi-gcc accepts -g... yeschecking for arm-none-linux-gnueabi-gcc option to accept ISO C89... none neededchecking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -Echecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking minix/config.h usability... nochecking minix/config.h presence... nochecking for minix/config.h... nochecking whether it is safe to define __EXTENSIONS__... yeschecking build system type... x86_64-unknown-linux-gnuchecking host system type... arm-none-linux-gnueabichecking target system type... arm-none-linux-gnueabichecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for arm-none-linux-gnueabi-strip... arm-none-linux-gnueabi-stripchecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... gawkchecking whether make sets $(MAKE)... yeschecking for style of include used by make... GNUchecking dependency style of arm-none-linux-gnueabi-gcc... gcc3checking for arm-none-linux-gnueabi-gcc... (cached) arm-none-linux-gnueabi-gccchecking whether we are using the GNU C compiler... (cached) yeschecking whether arm-none-linux-gnueabi-gcc accepts -g... (cached) yeschecking for arm-none-linux-gnueabi-gcc option to accept ISO C89... (cached) none neededchecking whether arm-none-linux-gnueabi-gcc and cc understand -c and -o together... yeschecking how to print strings... printfchecking for a sed that does not truncate output... /bin/sedchecking for fgrep... /bin/grep -Fchecking for ld used by arm-none-linux-gnueabi-gcc... /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ldchecking if the linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) is GNU ld... yeschecking for BSD- or MS-compatible name lister (nm)... /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -Bchecking the name lister (/opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B) interface... BSD nmchecking whether ln -s works... yeschecking the maximum length of command line arguments... 1572864checking whether the shell understands some XSI constructs... yeschecking whether the shell understands "+="... yeschecking for /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld option to reload object files... -rchecking for arm-none-linux-gnueabi-objdump... arm-none-linux-gnueabi-objdumpchecking how to recognize dependent libraries... pass_allchecking for arm-none-linux-gnueabi-ar... arm-none-linux-gnueabi-archecking for arm-none-linux-gnueabi-strip... (cached) arm-none-linux-gnueabi-stripchecking for arm-none-linux-gnueabi-ranlib... arm-none-linux-gnueabi-ranlibchecking command to parse /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B output from arm-none-linux-gnueabi-gcc object... okchecking for dlfcn.h... yeschecking for objdir... .libschecking if arm-none-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... nochecking for arm-none-linux-gnueabi-gcc option to produce PIC... -fPIC -DPICchecking if arm-none-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yeschecking if arm-none-linux-gnueabi-gcc static flag -static works... yeschecking if arm-none-linux-gnueabi-gcc supports -c -o file.o... yeschecking if arm-none-linux-gnueabi-gcc supports -c -o file.o... (cached) yeschecking whether the arm-none-linux-gnueabi-gcc linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yeschecking dynamic linker characteristics... GNU/Linux ld.sochecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries... yeschecking whether to build shared libraries... nochecking whether to build static libraries... yeschecking for ceil in -lm... yeschecking for dirent.h that defines DIR... yeschecking for library containing opendir... none requiredchecking for ANSI C header files... (cached) yeschecking for stdlib.h... (cached) yeschecking for string.h... (cached) yeschecking for strings.h... (cached) yeschecking sys/param.h usability... yeschecking sys/param.h presence... yeschecking for sys/param.h... yeschecking sys/time.h usability... yeschecking sys/time.h presence... yeschecking for sys/time.h... yeschecking for unistd.h... (cached) yeschecking curses.h usability... nochecking curses.h presence... nochecking for curses.h... nochecking execinfo.h usability... yeschecking execinfo.h presence... yeschecking for execinfo.h... yeschecking for stdbool.h that conforms to C99... yeschecking for _Bool... yeschecking for an ANSI C-conforming const... yeschecking for pid_t... yeschecking for uid_t in sys/types.h... yeschecking whether closedir returns void... yeschecking return type of signal handlers... voidchecking whether lstat correctly handles trailing slash... nochecking whether stat accepts an empty string... yeschecking for memmove... yeschecking for strncasecmp... yeschecking for strstr... yeschecking for strdup... yeschecking whether gcc -std=c99 option works... yeschecking for refresh in -lncurses... yeschecking for curses.h... (cached) noconfigure: error: missing headers: curses.h curses.hroot@DZ:/home/mj/htop_arm/htop-1.0.2# ./configure --prefix=/home/mj/install_htop --disable-unicode --host=arm-none-linux-gnueabi LDFLAGS=-L/home/mj/install_ncurses/lib CPPFLAGS=-I/home/mj/install_ncurses/includeconfigure: WARNING: If you wanted to set the --build type, don't use --host.If a cross compiler is detected then cross compile mode will be used.checking for arm-none-linux-gnueabi-gcc... arm-none-linux-gnueabi-gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables...checking whether we are cross compiling... yeschecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether arm-none-linux-gnueabi-gcc accepts -g... yeschecking for arm-none-linux-gnueabi-gcc option to accept ISO C89... none neededchecking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -Echecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking minix/config.h usability... nochecking minix/config.h presence... nochecking for minix/config.h... nochecking whether it is safe to define __EXTENSIONS__... yeschecking build system type... x86_64-unknown-linux-gnuchecking host system type... arm-none-linux-gnueabichecking target system type... arm-none-linux-gnueabichecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for arm-none-linux-gnueabi-strip... arm-none-linux-gnueabi-stripchecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... gawkchecking whether make sets $(MAKE)... yeschecking for style of include used by make... GNUchecking dependency style of arm-none-linux-gnueabi-gcc... gcc3checking for arm-none-linux-gnueabi-gcc... (cached) arm-none-linux-gnueabi-gccchecking whether we are using the GNU C compiler... (cached) yeschecking whether arm-none-linux-gnueabi-gcc accepts -g... (cached) yeschecking for arm-none-linux-gnueabi-gcc option to accept ISO C89... (cached) none neededchecking whether arm-none-linux-gnueabi-gcc and cc understand -c and -o together... yeschecking how to print strings... printfchecking for a sed that does not truncate output... /bin/sedchecking for fgrep... /bin/grep -Fchecking for ld used by arm-none-linux-gnueabi-gcc... /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ldchecking if the linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) is GNU ld... yeschecking for BSD- or MS-compatible name lister (nm)... /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -Bchecking the name lister (/opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B) interface... BSD nmchecking whether ln -s works... yeschecking the maximum length of command line arguments... 1572864checking whether the shell understands some XSI constructs... yeschecking whether the shell understands "+="... yeschecking for /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld option to reload object files... -rchecking for arm-none-linux-gnueabi-objdump... arm-none-linux-gnueabi-objdumpchecking how to recognize dependent libraries... pass_allchecking for arm-none-linux-gnueabi-ar... arm-none-linux-gnueabi-archecking for arm-none-linux-gnueabi-strip... (cached) arm-none-linux-gnueabi-stripchecking for arm-none-linux-gnueabi-ranlib... arm-none-linux-gnueabi-ranlibchecking command to parse /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B output from arm-none-linux-gnueabi-gcc object... okchecking for dlfcn.h... yeschecking for objdir... .libschecking if arm-none-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... nochecking for arm-none-linux-gnueabi-gcc option to produce PIC... -fPIC -DPICchecking if arm-none-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yeschecking if arm-none-linux-gnueabi-gcc static flag -static works... yeschecking if arm-none-linux-gnueabi-gcc supports -c -o file.o... yeschecking if arm-none-linux-gnueabi-gcc supports -c -o file.o... (cached) yeschecking whether the arm-none-linux-gnueabi-gcc linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yeschecking dynamic linker characteristics... GNU/Linux ld.sochecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries... yeschecking whether to build shared libraries... nochecking whether to build static libraries... yeschecking for ceil in -lm... yeschecking for dirent.h that defines DIR... yeschecking for library containing opendir... none requiredchecking for ANSI C header files... (cached) yeschecking for stdlib.h... (cached) yeschecking for string.h... (cached) yeschecking for strings.h... (cached) yeschecking sys/param.h usability... yeschecking sys/param.h presence... yeschecking for sys/param.h... yeschecking sys/time.h usability... yeschecking sys/time.h presence... yeschecking for sys/time.h... yeschecking for unistd.h... (cached) yeschecking curses.h usability... yeschecking curses.h presence... yeschecking for curses.h... yeschecking execinfo.h usability... yeschecking execinfo.h presence... yeschecking for execinfo.h... yeschecking for stdbool.h that conforms to C99... yeschecking for _Bool... yeschecking for an ANSI C-conforming const... yeschecking for pid_t... yeschecking for uid_t in sys/types.h... yeschecking whether closedir returns void... yeschecking return type of signal handlers... voidchecking whether lstat correctly handles trailing slash... nochecking whether stat accepts an empty string... yeschecking for memmove... yeschecking for strncasecmp... yeschecking for strstr... yeschecking for strdup... yeschecking whether gcc -std=c99 option works... yeschecking for refresh in -lncurses... yeschecking for curses.h... (cached) yesconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating htop.1config.status: creating config.hconfig.status: executing depfiles commandsconfig.status: executing libtool commands# 直接进行安装操作root@DZ:/home/mj/htop_arm/htop-1.0.2# make && make installmake all-ammake[1]: Entering directory '/home/mj/htop_arm/htop-1.0.2'arm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-AvailableMetersPanel.o -MD -MP -MF .deps/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo './'`AvailableMetersPanel.cmv -f .deps/htop-AvailableMetersPanel.Tpo .deps/htop-AvailableMetersPanel.Poarm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-CategoriesPanel.o -MD -MP -MF .deps/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo './'`CategoriesPanel.cmv -f .deps/htop-CategoriesPanel.Tpo .deps/htop-CategoriesPanel.Poarm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-CheckItem.o -MD -MP -MF .deps/htop-CheckItem.Tpo -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo './'`CheckItem.cmv -f .deps/htop-CheckItem.Tpo .deps/htop-CheckItem.Poarm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-ClockMeter.o -MD -MP -MF .deps/htop-ClockMeter.Tpo -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo './'`ClockMeter.cmv -f .deps/htop-ClockMeter.Tpo .deps/htop-ClockMeter.Poarm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-ColorsPanel.o -MD -MP -MF .deps/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo './'`ColorsPanel.cmv -f .deps/htop-ColorsPanel.Tpo .deps/htop-ColorsPanel.Poarm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-ColumnsPanel.o -MD -MP -MF .deps/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo './'`ColumnsPanel.cmv -f .deps/htop-ColumnsPanel.Tpo .deps/htop-ColumnsPanel.Poarm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-CPUMeter.o -MD -MP -MF .deps/htop-CPUMeter.Tpo -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo './'`CPUMeter.cmv -f .deps/htop-CPUMeter.Tpo .deps/htop-CPUMeter.Poarm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/home/mj/install_ncurses/include -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/home/mj/install_htop/etc\" -g -O2 -MT htop-CRT.o -MD -MP -MF .deps/htop-CRT.Tpo -c -o htop-CRT.o `test -f 'CRT.c' || echo './'`CRT.c............make install-ammake[1]: Entering directory '/home/mj/htop_arm/htop-1.0.2'make[2]: Entering directory '/home/mj/htop_arm/htop-1.0.2'test -z "/home/mj/install_htop/bin" || /bin/mkdir -p "/home/mj/install_htop/bin"/bin/bash ./libtool --mode=install /usr/bin/install -c htop '/home/mj/install_htop/bin'libtool: install: /usr/bin/install -c htop /home/mj/install_htop/bin/htoptest -z "/home/mj/install_htop/share/applications" || /bin/mkdir -p "/home/mj/install_htop/share/applications"/usr/bin/install -c -m 644 htop.desktop '/home/mj/install_htop/share/applications'test -z "/home/mj/install_htop/share/man/man1" || /bin/mkdir -p "/home/mj/install_htop/share/man/man1"/usr/bin/install -c -m 644 htop.1 '/home/mj/install_htop/share/man/man1'test -z "/home/mj/install_htop/share/pixmaps" || /bin/mkdir -p "/home/mj/install_htop/share/pixmaps"/usr/bin/install -c -m 644 htop.png '/home/mj/install_htop/share/pixmaps'make[2]: Leaving directory '/home/mj/htop_arm/htop-1.0.2'make[1]: Leaving directory '/home/mj/htop_arm/htop-1.0.2'root@DZ:/home/mj/htop_arm/htop-1.0.2# file htophtop: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.16, not stripped
将ncurses编译生成的lib文件及htop的可执行文件移植到目标系统对应的文件夹,操作如下:root@DZ:/home/mj/install_htop/bin# scp htop root@master:/tmproot@master's password:htop 100% 511KB 511.3KB/s 00:00root@DZ:/home/mj/install_ncurses# cd lib/root@DZ:/home/mj/install_ncurses/lib# scp -r ./* root@master:/tmp# Cortex-A8平台端[root@3352-T tmp]# lsdbus/ libform.a libform_g.a libmenu.so.5.9* libncurses.so.5* libpanel.so* resolv.confhtop* libform.so* libmenu.a libmenu_g.a libncurses.so.5.9* libpanel.so.5* terminfo/libcurses.a libform.so.5* libmenu.so* libncurses.a libncurses_g.a libpanel.so.5.9* umconfig.txtlibcurses.so* libform.so.5.9* libmenu.so.5* libncurses.so* libpanel.a libpanel_g.a运行效果见下图:

以上内容有笔者自己编写,也有摘自互联网。摘自互联网部分笔者都会仔细阅读,确保符合笔者当时测试情况进行编写,当然在学习的过程中不可避免的有理解不到位的地方,还请读友批评指正。
支付宝 微信