@cyysu
2018-08-10T01:22:28.000000Z
字数 30466
阅读 2080
- 时间: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.gz
tar xf htop-1.0.2.tar.gz
mkdir install_ncurses
mkdir install_htop
编译ncurses,由于htop依赖于ncurses库,因此需要先编译ncurses,进入ncurses目录,并配置交叉编译
cd ncurses-5.9
root@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-progs
configure: 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 -E
Configuring NCURSES 5.9 ABI 5 (Wed Nov 15 15:22:39 CST 2017)
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-none-linux-gnueabi
checking target system type... arm-none-linux-gnueabi
Configuring for linux-gnueabi
checking for prefix... /home/mj/install_ncurses
checking for arm-none-linux-gnueabi-gcc... arm-none-linux-gnueabi-gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for executable suffix...
checking for object suffix... o
checking whether we are using the GNU C compiler... yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... yes
checking version of arm-none-linux-gnueabi-gcc... 2011.03
checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -E
checking whether arm-none-linux-gnueabi-gcc needs -traditional... no
checking whether arm-none-linux-gnueabi-gcc understands -c and -o together... yes
checking for POSIXized ISC... no
checking for arm-none-linux-gnueabi-gcc option to accept ANSI C... -DCC_HAS_PROTOS
checking if you want to ensure bool is consistent with C++... no
checking if you want to build C++ binding and demo... no
checking if you want to build with Ada95... no
checking if you want to install manpages... no
checking if you want to build programs such as tic... no
checking if you want to build test-programs... no
checking if you wish to install curses.h... yes
checking for mawk... mawk
checking for egrep... (cached) grep -E
checking for a BSD compatible install... /usr/bin/install -c
checking for tdlint... no
checking for lint... no
checking for alint... no
checking for splint... no
checking for lclint... no
checking whether ln -s works... yes
checking if ln -s -f options work... yes
checking for long file names... yes
checking if you want to use pkg-config... yes
checking for arm-none-linux-gnueabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking if we should install .pc files for /usr/bin/pkg-config... no
checking if we should assume mixed-case filenames... auto
checking if filesystem supports mixed-case filenames... yes
checking whether make sets ${MAKE}... yes
checking for exctags... no
checking for ctags... ctags
checking for exetags... no
checking for etags... etags
checking for ctags... yes
checking for etags... yes
checking for makeflags variable...
checking for arm-none-linux-gnueabi-ranlib... arm-none-linux-gnueabi-ranlib
checking for arm-none-linux-gnueabi-ld... arm-none-linux-gnueabi-ld
checking for arm-none-linux-gnueabi-ar... arm-none-linux-gnueabi-ar
checking for arm-none-linux-gnueabi-ar... (cached) arm-none-linux-gnueabi-ar
checking for options to update archives... -curv
checking if you have specified an install-prefix...
checking for gcc... gcc
checking for native build C compiler... gcc
checking for native build C preprocessor... ${BUILD_CC} -E
checking 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... yes
checking if you want to build libraries with libtool... no
checking if you want to build shared libraries... yes
checking if you want to build static libraries... yes
checking if you want to build debug libraries... no
checking if you want to build profiling libraries... no
checking for specified models... shared normal
checking for default model... shared
checking if you want to build a separate terminfo library... no
checking if you want to build a separate tic library... no
checking if you want to link with the GPM mouse library... maybe
checking for gpm.h... no
checking for default loader flags...
checking if rpath option should be used... no
checking if shared libraries should be relinked during install... yes
checking for an rpath option... -Wl,-rpath,
checking if release/abi version should be used for shared libs... auto
checking which arm-none-linux-gnueabi-gcc option to use... -fPIC
checking if rpath-hack should be disabled... no
checking for updated LDFLAGS... maybe
checking for ldd... ldd
checking if you wish to install ncurses overwriting curses... yes
checking if external terminfo-database is used... yes
checking which terminfo source-file will be installed... ${top_srcdir}/misc/terminfo.src
checking whether to use hashed database instead of directory/tree... no
checking for list of fallback descriptions...
checking if you want modern xterm or antique... xterm-new
checking for list of terminfo directories... /home/mj/install_ncurses/share/terminfo
checking for default terminfo directory... /home/mj/install_ncurses/share/terminfo
checking if big-core option selected... no
checking if big-strings option selected... yes
checking if you want termcap-fallback support... no
checking if ~/.terminfo is wanted... yes
checking if you want to use restricted environment when running as root... yes
checking for remove... yes
checking for unlink... yes
checking for link... yes
checking for symlink... yes
checking if tic should use symbolic links... no
checking if tic should use hard links... yes
checking if you want broken-linker support code... no
checking if tputs should process BSD-style prefix padding... no
checking if we must define _GNU_SOURCE... yes
checking if SIGWINCH is defined... yes
checking for nl_langinfo and CODESET... yes
checking if you want wide-character code... no
checking whether to enable _LP64 definition in curses.h... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGE_FILES value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for fseeko... yes
checking whether to use struct dirent64... no
checking if you want tparm not to use X/Open fixed-parameter list... yes
checking for type of bool... auto
checking for alternate terminal capabilities file... Caps
checking for type of chtype... auto
checking for type of ospeed... short
checking for type of mmask_t... auto
checking for size CCHARW_MAX... 5
checking if RCS identifiers should be compiled-in... no
checking format of man-pages... gzip
checking for manpage renaming... /home/mj/htop_arm/ncurses-5.9/man/man_db.renames
checking if manpage aliases will be installed... yes
checking if manpage symlinks should be used... yes
checking for manpage tbl... no
checking if you want to build with function extensions... yes
checking if you want to build with experimental SCREEN extensions... no
checking if you want to build with experimental terminal-driver... no
checking for extended use of const keyword... no
checking if you want to use extended colors... no
checking if you want to use extended mouse encoding... no
checking if you want $NCURSES_NO_PADDING code... yes
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 signed char... yes
checking size of signed char... 1
checking if you want to use signed Boolean array in term.h... no
checking if you want SIGWINCH handler... yes
checking if you want user-definable terminal capabilities like termcap... yes
checking if you want all development code... no
checking if you want hard-tabs code... no
checking if you want limited support for xmc... no
checking if you do not want to assume colors are white-on-black... yes
checking if you want hashmap scrolling-optimization code... yes
checking if you want colorfgbg code... no
checking if you want interop bindings... no
checking if you want to link with the pthread library... no
checking if you want experimental reentrant code... no
checking if you want experimental safe-sprintf code... no
checking if you want experimental wgetch-events code... no
checking if you want to display full commands during build... yes
checking if you want to see compiler warnings...
configure: checking for arm-none-linux-gnueabi-gcc __attribute__ directives...
... scanf
... printf
... unused
... noreturn
checking if you want to enable runtime assertions... no
checking if you want to use dmalloc for testing... no
checking if you want to use dbmalloc for testing... no
checking if you want to use valgrind for testing... no
checking if you want to perform memory-leak testing... no
checking whether to add trace feature to all models... no
checking for gettimeofday... yes
checking if -lm needed for math functions... yes
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking whether time.h and sys/time.h may both be included... yes
checking for regcomp... yes
checking for regular-expression headers... regex.h
checking for fcntl.h... yes
checking for getopt.h... yes
checking for limits.h... yes
checking for locale.h... yes
checking for math.h... yes
checking for poll.h... yes
checking for sys/bsdtypes.h... no
checking for sys/ioctl.h... yes
checking for sys/param.h... yes
checking for sys/poll.h... yes
checking for sys/select.h... yes
checking for sys/time.h... yes
checking for sys/times.h... yes
checking for ttyent.h... yes
checking for unistd.h... (cached) yes
checking for wctype.h... yes
checking if sys/time.h works with sys/select.h... yes
checking for arm-none-linux-gnueabi-gcc option to accept ANSI C... none needed
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking if arm-none-linux-gnueabi-gcc supports options to tune inlining... yes
checking for signal global datatype... volatile sig_atomic_t
checking for type of chtype... long
checking if unsigned literals are legal... yes
checking if external errno is declared... yes
checking if external errno exists... no
checking if data-only library module links... unknown
checking for getcwd... yes
checking for getegid... yes
checking for geteuid... yes
checking for getttynam... yes
checking for issetugid... no
checking for poll... yes
checking for remove... (cached) yes
checking for select... yes
checking for setbuf... yes
checking for setbuffer... yes
checking for setvbuf... yes
checking for sigaction... yes
checking for sigvec... yes
checking for strdup... yes
checking for strstr... yes
checking for tcgetpgrp... yes
checking for times... yes
checking for vsnprintf... yes
checking for isascii... yes
checking whether sigaction needs _POSIX_SOURCE... no
checking if nanosleep really works... unknown
checking for termio.h... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking whether termios.h needs _POSIX_SOURCE... no
checking for tcgetattr... yes
checking for vsscanf function or workaround... vsscanf
checking for working mkstemp... checking for mkstemp... yes
configure: WARNING: cross compiling: assume setvbuf params not reversed
checking return type of signal handlers... void
checking for type sigaction_t... no
checking declaration of size-change... yes
checking for memmove... yes
checking if poll really works... unknown
checking for va_copy... yes
checking for __va_copy... yes
checking for pid_t... yes
checking for unistd.h... (cached) yes
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... (cached) yes
checking for working vfork... (cached) yes
checking for openpty in -lutil... yes
checking for openpty header... pty.h
checking if we should include stdbool.h... yes
checking for builtin bool type... no
checking for size of bool... unknown
configure: WARNING: Assuming unsigned for type of bool
checking for library subsets... termlib+ext_tinfo+base+ext_funcs
checking default library suffix...
checking default library-dependency suffix... .so
checking default object directory... obj_s
checking where we will install curses.h... ${prefix}/include
checking for src modules... ncurses panel menu form
checking for tic... /usr/bin/tic
configure: creating ./config.status
config.status: creating include/MKterm.h.awk
config.status: creating include/curses.head
config.status: creating include/ncurses_dll.h
config.status: creating include/termcap.h
config.status: creating include/unctrl.h
config.status: creating include/Makefile
config.status: creating ncurses/Makefile
config.status: creating panel/Makefile
config.status: creating menu/Makefile
config.status: creating form/Makefile
config.status: creating misc/Makefile
config.status: creating misc/run_tic.sh
config.status: creating misc/ncurses-config
config.status: creating man/ncurses5-config.1
config.status: creating Makefile
config.status: creating include/ncurses_cfg.h
Appending 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: yes
xterm terminfo: xterm-new
bin directory: /home/mj/install_ncurses/bin
lib directory: /home/mj/install_ncurses/lib
include directory: /home/mj/install_ncurses/include
man directory: /home/mj/install_ncurses/man
terminfo directory: /home/mj/install_ncurses/share/terminfo
# 直接进行安装操作
root@DZ:/home/mj/htop_arm/ncurses-5.9# make && make install
cd include && make DESTDIR="" all
make[1]: Entering directory '/home/mj/htop_arm/ncurses-5.9/include'
cat curses.head >curses.h
AWK=mawk sh ./MKkey_defs.sh ./Caps >>curses.h
sh -c 'if test "chtype" = "cchar_t" ; then cat ./curses.wide >>curses.h ; fi'
cat ./curses.tail >>curses.h
sh ./MKhashsize.sh ./Caps >hashsize.h
AWK=mawk sh ./MKncurses_def.sh ./ncurses_defs >ncurses_def.h
AWK=mawk sh ./MKparametrized.sh ./Caps >parametrized.h
touch config.h
mawk -f MKterm.h.awk ./Caps > term.h
sh ./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 compiled
using
tic -x
If you have ncurses 4.2 applications, you should read the INSTALL
document, 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 compatibility
installing std
installing stdcrt
installing vt100
installing vt300
/usr/bin/install -c ncurses-config /home/mj/install_ncurses/bin/ncurses5-config
make[1]: Leaving directory '/home/mj/htop_arm/ncurses-5.9/misc'
# 安装完测试结果
root@DZ:/home/mj/install_ncurses# ls
bin include lib share
root@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/ncurses
configure: 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-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... yes
checking for arm-none-linux-gnueabi-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-none-linux-gnueabi
checking target system type... arm-none-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-none-linux-gnueabi-strip... arm-none-linux-gnueabi-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of arm-none-linux-gnueabi-gcc... gcc3
checking for arm-none-linux-gnueabi-gcc... (cached) arm-none-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... (cached) yes
checking for arm-none-linux-gnueabi-gcc option to accept ISO C89... (cached) none needed
checking whether arm-none-linux-gnueabi-gcc and cc understand -c and -o together... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by arm-none-linux-gnueabi-gcc... /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld
checking if the linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B
checking the name lister (/opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld option to reload object files... -r
checking for arm-none-linux-gnueabi-objdump... arm-none-linux-gnueabi-objdump
checking how to recognize dependent libraries... pass_all
checking for arm-none-linux-gnueabi-ar... arm-none-linux-gnueabi-ar
checking for arm-none-linux-gnueabi-strip... (cached) arm-none-linux-gnueabi-strip
checking for arm-none-linux-gnueabi-ranlib... arm-none-linux-gnueabi-ranlib
checking command to parse /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B output from arm-none-linux-gnueabi-gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-none-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-none-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if arm-none-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-none-linux-gnueabi-gcc static flag -static works... yes
checking if arm-none-linux-gnueabi-gcc supports -c -o file.o... yes
checking if arm-none-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the arm-none-linux-gnueabi-gcc linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ceil in -lm... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking curses.h usability... no
checking curses.h presence... no
checking for curses.h... no
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for uid_t in sys/types.h... yes
checking whether closedir returns void... yes
checking return type of signal handlers... void
checking whether lstat correctly handles trailing slash... no
checking whether stat accepts an empty string... yes
checking for memmove... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strdup... yes
checking whether gcc -std=c99 option works... yes
checking for refresh in -lncurses... yes
checking for curses.h... (cached) no
configure: error: missing headers: curses.h curses.h
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/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-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... yes
checking for arm-none-linux-gnueabi-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-none-linux-gnueabi
checking target system type... arm-none-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-none-linux-gnueabi-strip... arm-none-linux-gnueabi-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of arm-none-linux-gnueabi-gcc... gcc3
checking for arm-none-linux-gnueabi-gcc... (cached) arm-none-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... (cached) yes
checking for arm-none-linux-gnueabi-gcc option to accept ISO C89... (cached) none needed
checking whether arm-none-linux-gnueabi-gcc and cc understand -c and -o together... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by arm-none-linux-gnueabi-gcc... /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld
checking if the linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B
checking the name lister (/opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld option to reload object files... -r
checking for arm-none-linux-gnueabi-objdump... arm-none-linux-gnueabi-objdump
checking how to recognize dependent libraries... pass_all
checking for arm-none-linux-gnueabi-ar... arm-none-linux-gnueabi-ar
checking for arm-none-linux-gnueabi-strip... (cached) arm-none-linux-gnueabi-strip
checking for arm-none-linux-gnueabi-ranlib... arm-none-linux-gnueabi-ranlib
checking command to parse /opt/arm-2011.03/bin/arm-none-linux-gnueabi-nm -B output from arm-none-linux-gnueabi-gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-none-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-none-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if arm-none-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-none-linux-gnueabi-gcc static flag -static works... yes
checking if arm-none-linux-gnueabi-gcc supports -c -o file.o... yes
checking if arm-none-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the arm-none-linux-gnueabi-gcc linker (/opt/arm-2011.03/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ceil in -lm... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for uid_t in sys/types.h... yes
checking whether closedir returns void... yes
checking return type of signal handlers... void
checking whether lstat correctly handles trailing slash... no
checking whether stat accepts an empty string... yes
checking for memmove... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strdup... yes
checking whether gcc -std=c99 option works... yes
checking for refresh in -lncurses... yes
checking for curses.h... (cached) yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating htop.1
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
# 直接进行安装操作
root@DZ:/home/mj/htop_arm/htop-1.0.2# make && make install
make all-am
make[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.c
mv -f .deps/htop-AvailableMetersPanel.Tpo .deps/htop-AvailableMetersPanel.Po
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-CategoriesPanel.o -MD -MP -MF .deps/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo './'`CategoriesPanel.c
mv -f .deps/htop-CategoriesPanel.Tpo .deps/htop-CategoriesPanel.Po
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-CheckItem.o -MD -MP -MF .deps/htop-CheckItem.Tpo -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo './'`CheckItem.c
mv -f .deps/htop-CheckItem.Tpo .deps/htop-CheckItem.Po
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-ClockMeter.o -MD -MP -MF .deps/htop-ClockMeter.Tpo -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo './'`ClockMeter.c
mv -f .deps/htop-ClockMeter.Tpo .deps/htop-ClockMeter.Po
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-ColorsPanel.o -MD -MP -MF .deps/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo './'`ColorsPanel.c
mv -f .deps/htop-ColorsPanel.Tpo .deps/htop-ColorsPanel.Po
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-ColumnsPanel.o -MD -MP -MF .deps/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo './'`ColumnsPanel.c
mv -f .deps/htop-ColumnsPanel.Tpo .deps/htop-ColumnsPanel.Po
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-CPUMeter.o -MD -MP -MF .deps/htop-CPUMeter.Tpo -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo './'`CPUMeter.c
mv -f .deps/htop-CPUMeter.Tpo .deps/htop-CPUMeter.Po
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-CRT.o -MD -MP -MF .deps/htop-CRT.Tpo -c -o htop-CRT.o `test -f 'CRT.c' || echo './'`CRT.c
....
....
....
make install-am
make[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/htop
test -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 htop
htop: 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:/tmp
root@master's password:
htop 100% 511KB 511.3KB/s 00:00
root@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]# ls
dbus/ libform.a libform_g.a libmenu.so.5.9* libncurses.so.5* libpanel.so* resolv.conf
htop* 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.txt
libcurses.so* libform.so.5.9* libmenu.so.5* libncurses.so* libpanel.a libpanel_g.a
运行效果见下图:
以上内容有笔者自己编写,也有摘自互联网。摘自互联网部分笔者都会仔细阅读,确保符合笔者当时测试情况进行编写,当然在学习的过程中不可避免的有理解不到位的地方,还请读友批评指正。
支付宝 微信