【问题】
折腾:
【记录】Cygwin下用arm-xscale-linux-gnueabi交叉编译log4c
结果直接出错:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ make cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run aclocal-1.10 configure.in:194: warning: macro `AM_PATH_EXPAT' not found in library cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run automake-1.10 --gnu /usr/share/automake-1.10/am/depend2.am: am__fastdepCXX does not appear in AM_CONDITIONAL /usr/share/automake-1.10/am/depend2.am: The usual way to define `am__fastdepCXX' is to add `AC_PROG_CXX' /usr/share/automake-1.10/am/depend2.am: to `configure.in' and run `aclocal' and `autoconf' again. tests/log4c/Makefile.am: C++ source seen but `CXX' is undefined tests/log4c/Makefile.am: The usual way to define `CXX' is to add `AC_PROG_CXX' tests/log4c/Makefile.am: to `configure.in' and run `autoconf' again. Makefile:232: recipe for target `Makefile.in' failed make: *** [Makefile.in] Error 1
【解决过程】
1.参考:
没啥帮助。
2.找了半天,也没看到有啥帮助资料。
3。搜:
am__fastdepCXX does not appear in AM_CONDITIONAL
倒是搜出很多东西。
4.参考:
去到log4c-1.2.1下面找configure.ac却没找到。
5.后来才发现,我此处的是configure.in,所以去看看:
log4c-1.2.1\configure.in
然后添加上对应的AC_PROG_CXX:
AM_INIT_AUTOMAKE("log4c", $VERSION) #add this by crifan li AC_PROG_CXX AC_CANONICAL_HOST # Need this to get pthread etc. AC_DEFINE(_GNU_SOURCE,1,"POSIXandGNU extensions") ##################### # Checks for programs #. AC_PROG_YACC AC_PROG_CC AC_PROG_CPP AM_PROG_LEX AC_PROG_AWK AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_LIBTOOL
5.然后再去make试试,结果貌似修复了,但是又出错了:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ make cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run aclocal-1.10 configure.in:197: warning: macro `AM_PATH_EXPAT' not found in library cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run automake-1.10 --gnu cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run autoconf configure.in:208: error: possibly undefined macro: AM_PATH_EXPAT If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. Makefile:259: recipe for target `configure' failed make: *** [configure] Error 1
6.想起来了,要不重新configure试试:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ ./configure --prefix=$HOME/develop/crosstool-ng/x-tools/armxscalelog4c --build=i686-pc-cygwin --target=arm-xscale-linux --host=arm-xscale-linux CC=arm-xscale-linux-gnueabi-gcc checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-xscale-linux-strip... no checking for strip... strip configure: WARNING: using cross tools not prefixed with host triplet checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for arm-xscale-linux-g++... no checking for arm-xscale-linux-c++... no checking for arm-xscale-linux-gpp... no checking for arm-xscale-linux-aCC... no checking for arm-xscale-linux-CC... no checking for arm-xscale-linux-cxx... no checking for arm-xscale-linux-cc++... no checking for arm-xscale-linux-cl.exe... no checking for arm-xscale-linux-FCC... no checking for arm-xscale-linux-KCC... no checking for arm-xscale-linux-RCC... no checking for arm-xscale-linux-xlC_r... no checking for arm-xscale-linux-xlC... no checking for g++... g++ 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... yes checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking build system type... i686-pc-cygwin checking host system type... arm-xscale-linux-gnu checking for bison... bison -y checking for arm-xscale-linux-gcc... arm-xscale-linux-gnueabi-gcc checking whether we are using the GNU C compiler... yes checking whether arm-xscale-linux-gnueabi-gcc accepts -g... yes checking for arm-xscale-linux-gnueabi-gcc option to accept ISO C89... none needed checking dependency style of arm-xscale-linux-gnueabi-gcc... gcc3 checking how to run the C preprocessor... arm-xscale-linux-gnueabi-gcc -E checking for flex... flex checking lex output file root... lex.yy checking lex library... none needed checking whether yytext is a pointer... no checking for gawk... (cached) gawk checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for arm-xscale-linux-ranlib... no checking for ranlib... ranlib checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by arm-xscale-linux-gnueabi-gcc... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... no checking for arm-xscale-linux-dumpbin... no checking for arm-xscale-linux-link... no checking for dumpbin... no checking for link... link -dump checking the name lister (nm) interface... BSD nm checking the maximum length of command line arguments... 8192 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert i686-pc-cygwin file names to arm-xscale-linux-gnu format... func_convert_file_noop checking how to convert i686-pc-cygwin file names to toolchain format... func_convert_file_noop checking for /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe option to reload object files... -r checking for arm-xscale-linux-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for arm-xscale-linux-dlltool... no checking for dlltool... dlltool checking how to associate runtime and link libraries... printf %s\n checking for arm-xscale-linux-ar... no checking for ar... ar checking for archiver @FILE support... @ checking for arm-xscale-linux-strip... strip checking for arm-xscale-linux-ranlib... ranlib checking command to parse nm output from arm-xscale-linux-gnueabi-gcc object... ok checking for sysroot... no checking for arm-xscale-linux-mt... no checking for mt... mt checking if mt is a manifest tool... no 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 dlfcn.h... yes checking for objdir... .libs checking if arm-xscale-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no checking for arm-xscale-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC checking if arm-xscale-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes checking if arm-xscale-linux-gnueabi-gcc static flag -static works... yes checking if arm-xscale-linux-gnueabi-gcc supports -c -o file.o... yes checking if arm-xscale-linux-gnueabi-gcc supports -c -o file.o... (cached) yes checking whether the arm-xscale-linux-gnueabi-gcc linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking whether -lc should be explicitly linked in... no 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... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking whether the g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... no checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for pthread_mutex_init in -lpthread... yes configure: Compile with rollingfile code checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for inttypes.h... (cached) yes checking langinfo.h usability... yes checking langinfo.h presence... yes checking for langinfo.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for unistd.h... (cached) yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking varargs.h usability... no checking varargs.h presence... no checking for varargs.h... no checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking for pthread.h... (cached) yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for working alloca.h... yes checking for alloca... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... no checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... yes checking for utime.h... yes checking for getpagesize... yes checking for working mmap... no checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... no checking whether utime accepts a null argument... guessing yes checking for vprintf... yes checking for _doprnt... no checking for gettimeofday... yes checking for memset... yes checking for munmap... yes checking for nl_langinfo... yes checking for strdup... yes checking for strerror... yes checking for strncasecmp... yes checking for strrchr... yes checking for strstr... yes checking for utime... yes checking for sbrk... yes checking for doxygen... /usr/bin/doxygen checking for dot... no checking for latex... /usr/bin/latex ./configure: line 16670: syntax error near unexpected token `1.95.1' ./configure: line 16670: ` AM_PATH_EXPAT(1.95.1)' CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $
其中,注意到,最后一行中:
./configure: line 16670: ` AM_PATH_EXPAT(1.95.1)'
包含了我们之前所说的AM_PATH_EXPAT
但是倒数第二行,却说了,有语法错误:
./configure: line 16670: syntax error near unexpected token `1.95.1'
7.不管,再去make试试,结果make会recheck,然后还是同样错误:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ make /bin/sh ./config.status --recheck running CONFIG_SHELL=/bin/sh /bin/sh ./configure --prefix=/home/CLi/develop/crosstool-ng/x-tools/armxscalelog4c --build=i686-pc-cygwin --target=arm-xscale-linux --host=arm-xscale-linux CC=arm-xscale-linux-gnueabi-gcc build_alias=i686-pc-cygwin host_alias=arm-xscale-linux target_alias=arm-xscale-linux --no-create --no-recursion checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-xscale-linux-strip... no checking for strip... strip configure: WARNING: using cross tools not prefixed with host triplet checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for arm-xscale-linux-g++... no checking for arm-xscale-linux-c++... no checking for arm-xscale-linux-gpp... no checking for arm-xscale-linux-aCC... no checking for arm-xscale-linux-CC... no checking for arm-xscale-linux-cxx... no checking for arm-xscale-linux-cc++... no checking for arm-xscale-linux-cl.exe... no checking for arm-xscale-linux-FCC... no checking for arm-xscale-linux-KCC... no checking for arm-xscale-linux-RCC... no checking for arm-xscale-linux-xlC_r... no checking for arm-xscale-linux-xlC... no checking for g++... g++ 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... yes checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking build system type... i686-pc-cygwin checking host system type... arm-xscale-linux-gnu checking for bison... bison -y checking for arm-xscale-linux-gcc... arm-xscale-linux-gnueabi-gcc checking whether we are using the GNU C compiler... yes checking whether arm-xscale-linux-gnueabi-gcc accepts -g... yes checking for arm-xscale-linux-gnueabi-gcc option to accept ISO C89... none needed checking dependency style of arm-xscale-linux-gnueabi-gcc... gcc3 checking how to run the C preprocessor... arm-xscale-linux-gnueabi-gcc -E checking for flex... flex checking lex output file root... lex.yy checking lex library... none needed checking whether yytext is a pointer... no checking for gawk... (cached) gawk checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for arm-xscale-linux-ranlib... no checking for ranlib... ranlib checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by arm-xscale-linux-gnueabi-gcc... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... no checking for arm-xscale-linux-dumpbin... no checking for arm-xscale-linux-link... no checking for dumpbin... no checking for link... link -dump checking the name lister (nm) interface... BSD nm checking the maximum length of command line arguments... 8192 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert i686-pc-cygwin file names to arm-xscale-linux-gnu format... func_convert_file_noop checking how to convert i686-pc-cygwin file names to toolchain format... func_convert_file_noop checking for /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe option to reload object files... -r checking for arm-xscale-linux-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for arm-xscale-linux-dlltool... no checking for dlltool... dlltool checking how to associate runtime and link libraries... printf %s\n checking for arm-xscale-linux-ar... no checking for ar... ar checking for archiver @FILE support... @ checking for arm-xscale-linux-strip... strip checking for arm-xscale-linux-ranlib... ranlib checking command to parse nm output from arm-xscale-linux-gnueabi-gcc object... ok checking for sysroot... no checking for arm-xscale-linux-mt... no checking for mt... mt checking if mt is a manifest tool... no 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 dlfcn.h... yes checking for objdir... .libs checking if arm-xscale-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no checking for arm-xscale-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC checking if arm-xscale-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes checking if arm-xscale-linux-gnueabi-gcc static flag -static works... yes checking if arm-xscale-linux-gnueabi-gcc supports -c -o file.o... yes checking if arm-xscale-linux-gnueabi-gcc supports -c -o file.o... (cached) yes checking whether the arm-xscale-linux-gnueabi-gcc linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking whether -lc should be explicitly linked in... no 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... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking whether the g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... no checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for pthread_mutex_init in -lpthread... yes configure: Compile with rollingfile code checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for inttypes.h... (cached) yes checking langinfo.h usability... yes checking langinfo.h presence... yes checking for langinfo.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for unistd.h... (cached) yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking varargs.h usability... no checking varargs.h presence... no checking for varargs.h... no checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking for pthread.h... (cached) yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for working alloca.h... yes checking for alloca... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... no checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... yes checking for utime.h... yes checking for getpagesize... yes checking for working mmap... no checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... no checking whether utime accepts a null argument... guessing yes checking for vprintf... yes checking for _doprnt... no checking for gettimeofday... yes checking for memset... yes checking for munmap... yes checking for nl_langinfo... yes checking for strdup... yes checking for strerror... yes checking for strncasecmp... yes checking for strrchr... yes checking for strstr... yes checking for utime... yes checking for sbrk... yes checking for doxygen... /usr/bin/doxygen checking for dot... no checking for latex... /usr/bin/latex ./configure: line 16670: syntax error near unexpected token `1.95.1' ./configure: line 16670: ` AM_PATH_EXPAT(1.95.1)' Makefile:256: recipe for target `config.status' failed make: *** [config.status] Error 2 CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $
8.再把:
log4c-1.2.1\configure.in
改为:
LT_VERSION=4:0:1 AC_SUBST(LOG4C_MAJOR_VERSION) AC_SUBST(LOG4C_MINOR_VERSION) AC_SUBST(LOG4C_MICRO_VERSION) AC_SUBST(LT_VERSION) AM_INIT_AUTOMAKE("log4c", $VERSION) AC_CANONICAL_HOST # Need this to get pthread etc. AC_DEFINE(_GNU_SOURCE,1,"POSIXandGNU extensions") ##################### # Checks for programs #. AC_PROG_YACC AC_PROG_CC AC_PROG_CPP AM_PROG_LEX AC_PROG_AWK AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB #add this by crifan li AC_PROG_CXX AC_PROG_LIBTOOL
再去配置一下,看看configure能否通过,结果还是最后出现语法错误:
checking for latex... /usr/bin/latex ./configure: line 16670: syntax error near unexpected token `1.95.1' ./configure: line 16670: ` AM_PATH_EXPAT(1.95.1)'
所以,还是把之前加的:
#add this by crifan li AC_PROG_CXX
去掉。
9.由于看到配置期间,说是各种交叉编译工具都找不到:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ ./configure --prefix=$HOME/develop/crosstool-ng/x-tools/armxscalelog4c --build=i686-pc-cygwin --target=arm-xscale-linux --host=arm-xscale-linux CC=arm-xscale-linux-gnueabi-gcc checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-xscale-linux-strip... no checking for strip... strip configure: WARNING: using cross tools not prefixed with host triplet checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for arm-xscale-linux-g++... no checking for arm-xscale-linux-c++... no checking for arm-xscale-linux-gpp... no checking for arm-xscale-linux-aCC... no checking for arm-xscale-linux-CC... no checking for arm-xscale-linux-cxx... no checking for arm-xscale-linux-cc++... no checking for arm-xscale-linux-cl.exe... no checking for arm-xscale-linux-FCC... no checking for arm-xscale-linux-KCC... no checking for arm-xscale-linux-RCC... no checking for arm-xscale-linux-xlC_r... no checking for arm-xscale-linux-xlC... no checking for g++... g++ 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... yes checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking build system type... i686-pc-cygwin checking host system type... arm-xscale-linux-gnu checking for bison... bison -y checking for arm-xscale-linux-gcc... arm-xscale-linux-gnueabi-gcc checking whether we are using the GNU C compiler... yes checking whether arm-xscale-linux-gnueabi-gcc accepts -g... yes checking for arm-xscale-linux-gnueabi-gcc option to accept ISO C89... none needed checking dependency style of arm-xscale-linux-gnueabi-gcc... gcc3 checking how to run the C preprocessor... arm-xscale-linux-gnueabi-gcc -E checking for flex... flex
即,其中都是no:
checking for arm-xscale-linux-g++... no checking for arm-xscale-linux-c++... no checking for arm-xscale-linux-gpp... no checking for arm-xscale-linux-aCC... no checking for arm-xscale-linux-CC... no checking for arm-xscale-linux-cxx... no checking for arm-xscale-linux-cc++... no checking for arm-xscale-linux-cl.exe... no checking for arm-xscale-linux-FCC... no checking for arm-xscale-linux-KCC... no checking for arm-xscale-linux-RCC... no checking for arm-xscale-linux-xlC_r... no checking for arm-xscale-linux-xlC... no
所以,改个配置,再试试,结果竟然还是语法出错:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ ./configure --prefix=$HOME/develop/crosstool-ng/x-tools/armxscalelog4c --build=i686-pc-cygwin --target=arm-xscale-linux-gnueabi --host=arm-xscale-linux-gnueabi CC=arm-xscale-linux-gnueabi-gcc checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-xscale-linux-gnueabi-strip... arm-xscale-linux-gnueabi-strip checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for arm-xscale-linux-gnueabi-g++... arm-xscale-linux-gnueabi-g++ 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-xscale-linux-gnueabi-g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of arm-xscale-linux-gnueabi-g++... gcc3 checking build system type... i686-pc-cygwin checking host system type... arm-xscale-linux-gnueabi checking for bison... bison -y checking for arm-xscale-linux-gnueabi-gcc... arm-xscale-linux-gnueabi-gcc checking whether we are using the GNU C compiler... yes checking whether arm-xscale-linux-gnueabi-gcc accepts -g... yes checking for arm-xscale-linux-gnueabi-gcc option to accept ISO C89... none needed checking dependency style of arm-xscale-linux-gnueabi-gcc... gcc3 checking how to run the C preprocessor... arm-xscale-linux-gnueabi-gcc -E checking for flex... flex checking lex output file root... lex.yy checking lex library... none needed checking whether yytext is a pointer... no checking for gawk... (cached) gawk checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for arm-xscale-linux-gnueabi-ranlib... arm-xscale-linux-gnueabi-ranlib checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by arm-xscale-linux-gnueabi-gcc... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin/arm-xscale-linux-gnueabi-nm -B checking the name lister (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin/arm-xscale-linux-gnueabi-nm -B) interface... BSD nm checking the maximum length of command line arguments... 8192 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert i686-pc-cygwin file names to arm-xscale-linux-gnueabi format... func_convert_file_noop checking how to convert i686-pc-cygwin file names to toolchain format... func_convert_file_noop checking for /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe option to reload object files... -r checking for arm-xscale-linux-gnueabi-objdump... arm-xscale-linux-gnueabi-objdump checking how to recognize dependent libraries... pass_all checking for arm-xscale-linux-gnueabi-dlltool... no checking for dlltool... dlltool configure: WARNING: using cross tools not prefixed with host triplet checking how to associate runtime and link libraries... printf %s\n checking for arm-xscale-linux-gnueabi-ar... arm-xscale-linux-gnueabi-ar checking for archiver @FILE support... @ checking for arm-xscale-linux-gnueabi-strip... (cached) arm-xscale-linux-gnueabi-strip checking for arm-xscale-linux-gnueabi-ranlib... (cached) arm-xscale-linux-gnueabi-ranlib checking command to parse /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin/arm-xscale-linux-gnueabi-nm -B output from arm-xscale-linux-gnueabi-gcc object... ok checking for sysroot... no checking for arm-xscale-linux-gnueabi-mt... no checking for mt... mt checking if mt is a manifest tool... no 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 dlfcn.h... yes checking for objdir... .libs checking if arm-xscale-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no checking for arm-xscale-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC checking if arm-xscale-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes checking if arm-xscale-linux-gnueabi-gcc static flag -static works... yes checking if arm-xscale-linux-gnueabi-gcc supports -c -o file.o... yes checking if arm-xscale-linux-gnueabi-gcc supports -c -o file.o... (cached) yes checking whether the arm-xscale-linux-gnueabi-gcc linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking whether -lc should be explicitly linked in... no 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... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... arm-xscale-linux-gnueabi-g++ -E checking for ld used by arm-xscale-linux-gnueabi-g++... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking whether the arm-xscale-linux-gnueabi-g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking for arm-xscale-linux-gnueabi-g++ option to produce PIC... -fPIC -DPIC checking if arm-xscale-linux-gnueabi-g++ PIC flag -fPIC -DPIC works... yes checking if arm-xscale-linux-gnueabi-g++ static flag -static works... yes checking if arm-xscale-linux-gnueabi-g++ supports -c -o file.o... yes checking if arm-xscale-linux-gnueabi-g++ supports -c -o file.o... (cached) yes checking whether the arm-xscale-linux-gnueabi-g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for pthread_mutex_init in -lpthread... yes configure: Compile with rollingfile code checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for inttypes.h... (cached) yes checking langinfo.h usability... yes checking langinfo.h presence... yes checking for langinfo.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for unistd.h... (cached) yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking varargs.h usability... no checking varargs.h presence... no checking for varargs.h... no checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking for pthread.h... (cached) yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for working alloca.h... yes checking for alloca... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... no checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... yes checking for utime.h... yes checking for getpagesize... yes checking for working mmap... no checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... no checking whether utime accepts a null argument... guessing yes checking for vprintf... yes checking for _doprnt... no checking for gettimeofday... yes checking for memset... yes checking for munmap... yes checking for nl_langinfo... yes checking for strdup... yes checking for strerror... yes checking for strncasecmp... yes checking for strrchr... yes checking for strstr... yes checking for utime... yes checking for sbrk... yes checking for doxygen... /usr/bin/doxygen checking for dot... no checking for latex... /usr/bin/latex ./configure: line 16670: syntax error near unexpected token `1.95.1' ./configure: line 16670: ` AM_PATH_EXPAT(1.95.1)' CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $
10.算了,还是先去试试make help,看看是否有make clean,结果也出错了:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ make help cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run aclocal-1.10 configure.in:195: warning: macro `AM_PATH_EXPAT' not found in library cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run automake-1.10 --gnu /usr/share/automake-1.10/am/depend2.am: am__fastdepCXX does not appear in AM_CONDITIONAL /usr/share/automake-1.10/am/depend2.am: The usual way to define `am__fastdepCXX' is to add `AC_PROG_CXX' /usr/share/automake-1.10/am/depend2.am: to `configure.in' and run `aclocal' and `autoconf' again. tests/log4c/Makefile.am: C++ source seen but `CXX' is undefined tests/log4c/Makefile.am: The usual way to define `CXX' is to add `AC_PROG_CXX' tests/log4c/Makefile.am: to `configure.in' and run `autoconf' again. Makefile:232: recipe for target `Makefile.in' failed make: *** [Makefile.in] Error 1 CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $
11.算了,干脆,重新自己手动下载一个官网的源码:
http://sourceforge.net/projects/log4c/files/log4c/1.2.1/
下载到:
解压:
CLi@PC-CLI-1 ~/develop/log4c $ tar xvzf log4c-1.2.1.tar.gz thirdparty/ CLi@PC-CLI-1 ~/develop/log4c $ tar xvzf log4c-1.2.1.tar.gz log4c-1.2.1/ log4c-1.2.1/config/ log4c-1.2.1/config/expat.m4 log4c-1.2.1/config/Makefile.am log4c-1.2.1/config/Makefile.in log4c-1.2.1/config/config.guess log4c-1.2.1/config/config.sub log4c-1.2.1/config/depcomp log4c-1.2.1/config/install-sh log4c-1.2.1/config/ltmain.sh log4c-1.2.1/config/missing log4c-1.2.1/config/ylwrap log4c-1.2.1/README log4c-1.2.1/configure.in log4c-1.2.1/aclocal.m4 log4c-1.2.1/Makefile.am log4c-1.2.1/Makefile.in log4c-1.2.1/log4c-config.in log4c-1.2.1/log4c.spec.in log4c-1.2.1/log4crc.sample.in log4c-1.2.1/configure log4c-1.2.1/AUTHORS log4c-1.2.1/COPYING log4c-1.2.1/ChangeLog log4c-1.2.1/INSTALL log4c-1.2.1/NEWS log4c-1.2.1/TODO log4c-1.2.1/log4c.m4 log4c-1.2.1/log4c.spec log4c-1.2.1/src/ log4c-1.2.1/src/log4c.h log4c-1.2.1/src/Makefile.am log4c-1.2.1/src/Makefile.in log4c-1.2.1/src/config.h.in log4c-1.2.1/src/sd/ log4c-1.2.1/src/sd/Makefile.am log4c-1.2.1/src/sd/Makefile.in log4c-1.2.1/src/sd/domnode-xml-parser.c log4c-1.2.1/src/sd/domnode-xml-scanner.c log4c-1.2.1/src/sd/error.h log4c-1.2.1/src/sd/defs.h log4c-1.2.1/src/sd/stack.h log4c-1.2.1/src/sd/stack.c log4c-1.2.1/src/sd/list.h log4c-1.2.1/src/sd/list.c log4c-1.2.1/src/sd/malloc.h log4c-1.2.1/src/sd/malloc.c log4c-1.2.1/src/sd/domnode.h log4c-1.2.1/src/sd/factory.h log4c-1.2.1/src/sd/factory.c log4c-1.2.1/src/sd/hash.h log4c-1.2.1/src/sd/hash.c log4c-1.2.1/src/sd/sprintf.h log4c-1.2.1/src/sd/sprintf.c log4c-1.2.1/src/sd/test.h log4c-1.2.1/src/sd/test.c log4c-1.2.1/src/sd/sd_xplatform.h log4c-1.2.1/src/sd/sd_xplatform.c log4c-1.2.1/src/sd/error.c log4c-1.2.1/src/sd/domnode-expat.c log4c-1.2.1/src/sd/domnode.c log4c-1.2.1/src/sd/domnode-xml.h log4c-1.2.1/src/sd/domnode-xml.c log4c-1.2.1/src/sd/domnode-xml-parser.h log4c-1.2.1/src/sd/domnode-xml-scanner.h log4c-1.2.1/src/sd/domnode-xml-parser.y log4c-1.2.1/src/sd/domnode-xml-scanner.l log4c-1.2.1/src/sd/sprintf.osf.c log4c-1.2.1/src/log4c/ log4c-1.2.1/src/log4c/config-win32.h log4c-1.2.1/src/log4c/buffer.h log4c-1.2.1/src/log4c/rc.h log4c-1.2.1/src/log4c/init.h log4c-1.2.1/src/log4c/defs.h log4c-1.2.1/src/log4c/version.h log4c-1.2.1/src/log4c/location_info.h log4c-1.2.1/src/log4c/logging_event.h log4c-1.2.1/src/log4c/priority.h log4c-1.2.1/src/log4c/layout_type_basic.h log4c-1.2.1/src/log4c/layout_type_dated.h log4c-1.2.1/src/log4c/layout_type_basic_r.h log4c-1.2.1/src/log4c/layout_type_dated_r.h log4c-1.2.1/src/log4c/layout.h log4c-1.2.1/src/log4c/appender_type_stream.h log4c-1.2.1/src/log4c/appender_type_stream2.h log4c-1.2.1/src/log4c/appender_type_syslog.h log4c-1.2.1/src/log4c/appender_type_mmap.h log4c-1.2.1/src/log4c/appender.h log4c-1.2.1/src/log4c/category.h log4c-1.2.1/src/log4c/appender_type_rollingfile.h log4c-1.2.1/src/log4c/rollingpolicy.h log4c-1.2.1/src/log4c/rollingpolicy_type_sizewin.h log4c-1.2.1/src/log4c/Makefile.am log4c-1.2.1/src/log4c/Makefile.in log4c-1.2.1/src/log4c/version.h.in log4c-1.2.1/src/log4c/rc.c log4c-1.2.1/src/log4c/init.c log4c-1.2.1/src/log4c/appender_type_stream.c log4c-1.2.1/src/log4c/appender_type_stream2.c log4c-1.2.1/src/log4c/appender_type_syslog.c log4c-1.2.1/src/log4c/appender_type_mmap.c log4c-1.2.1/src/log4c/layout_type_basic.c log4c-1.2.1/src/log4c/layout_type_dated.c log4c-1.2.1/src/log4c/layout_type_basic_r.c log4c-1.2.1/src/log4c/layout_type_dated_r.c log4c-1.2.1/src/log4c/version.c log4c-1.2.1/src/log4c/logging_event.c log4c-1.2.1/src/log4c/priority.c log4c-1.2.1/src/log4c/appender.c log4c-1.2.1/src/log4c/layout.c log4c-1.2.1/src/log4c/category.c log4c-1.2.1/src/log4c/appender_type_rollingfile.c log4c-1.2.1/src/log4c/rollingpolicy.c log4c-1.2.1/src/log4c/rollingpolicy_type_sizewin.c log4c-1.2.1/doc/ log4c-1.2.1/doc/Doxyfile.in log4c-1.2.1/doc/Makefile.am log4c-1.2.1/doc/Makefile.in log4c-1.2.1/doc/main.doc.in log4c-1.2.1/tests/ log4c-1.2.1/tests/Makefile.am log4c-1.2.1/tests/Makefile.in log4c-1.2.1/tests/log4c/ log4c-1.2.1/tests/log4c/Makefile.am log4c-1.2.1/tests/log4c/Makefile.in log4c-1.2.1/tests/log4c/bench.c log4c-1.2.1/tests/log4c/bench_fwrite.c log4c-1.2.1/tests/log4c/cpp_compile_test.cpp log4c-1.2.1/tests/log4c/test_category.c log4c-1.2.1/tests/log4c/test_layout_r.c log4c-1.2.1/tests/log4c/test_rc.c log4c-1.2.1/tests/log4c/test_rollingfile_appender.c log4c-1.2.1/tests/log4c/test_rollingfile_appender_mt.c log4c-1.2.1/tests/log4c/test_stream2.c log4c-1.2.1/tests/log4c/test_category.ref log4c-1.2.1/tests/log4c/test_rc.in log4c-1.2.1/tests/log4c/test_rc.ref log4c-1.2.1/examples/ log4c-1.2.1/examples/README log4c-1.2.1/examples/Makefile.am log4c-1.2.1/examples/Makefile.in log4c-1.2.1/examples/log4crc.in log4c-1.2.1/examples/example_formatters.c log4c-1.2.1/examples/example_appenders.c log4c-1.2.1/examples/userloc_formatter.c log4c-1.2.1/examples/application_1.c log4c-1.2.1/examples/application_2.c log4c-1.2.1/examples/application_3.c log4c-1.2.1/examples/application_3.h log4c-1.2.1/examples/log4crc log4c-1.2.1/examples/helloworld/ log4c-1.2.1/examples/helloworld/README log4c-1.2.1/examples/helloworld/Makefile.am log4c-1.2.1/examples/helloworld/Makefile.in log4c-1.2.1/examples/helloworld/helloworld.c log4c-1.2.1/examples/helloworld1/ log4c-1.2.1/examples/helloworld1/README log4c-1.2.1/examples/helloworld1/Makefile.am log4c-1.2.1/examples/helloworld1/Makefile.in log4c-1.2.1/examples/helloworld1/helloworld1.c log4c-1.2.1/examples/helloworld1/mylog.h CLi@PC-CLI-1 ~/develop/log4c $
重新配置:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ ./configure --prefix=$HOME/develop/crosstool-ng/x-tools/armxscalelog4c --build=i686-pc-cygwin --target=arm-xscale-linux-gnueabi --host=arm-xscale-linux-gnueabi CC=arm-xscale-linux-gnueabi-gcc checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for arm-xscale-linux-gnueabi-strip... arm-xscale-linux-gnueabi-strip checking build system type... i686-pc-cygwin checking host system type... arm-xscale-linux-gnueabi checking for bison... bison -y checking for arm-xscale-linux-gnueabi-gcc... arm-xscale-linux-gnueabi-gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... yes checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether arm-xscale-linux-gnueabi-gcc accepts -g... yes checking for arm-xscale-linux-gnueabi-gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of arm-xscale-linux-gnueabi-gcc... gcc3 checking how to run the C preprocessor... arm-xscale-linux-gnueabi-gcc -E checking for flex... flex checking lex output file root... lex.yy checking lex library... none needed checking whether yytext is a pointer... no checking for gawk... (cached) gawk checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for arm-xscale-linux-gnueabi-ranlib... arm-xscale-linux-gnueabi-ranlib checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ld used by arm-xscale-linux-gnueabi-gcc... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking for /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe option to reload object files... -r checking for BSD-compatible nm... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin/arm-xscale-linux-gnueabi-nm -B checking how to recognise dependent libraries... pass_all 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 dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for arm-xscale-linux-gnueabi-g++... arm-xscale-linux-gnueabi-g++ checking whether we are using the GNU C++ compiler... yes checking whether arm-xscale-linux-gnueabi-g++ accepts -g... yes checking dependency style of arm-xscale-linux-gnueabi-g++... gcc3 checking how to run the C++ preprocessor... arm-xscale-linux-gnueabi-g++ -E checking for arm-xscale-linux-gnueabi-g77... no checking for arm-xscale-linux-gnueabi-xlf... no checking for arm-xscale-linux-gnueabi-f77... no checking for arm-xscale-linux-gnueabi-frt... no checking for arm-xscale-linux-gnueabi-pgf77... no checking for arm-xscale-linux-gnueabi-cf77... no checking for arm-xscale-linux-gnueabi-fort77... no checking for arm-xscale-linux-gnueabi-fl32... no checking for arm-xscale-linux-gnueabi-af77... no checking for arm-xscale-linux-gnueabi-xlf90... no checking for arm-xscale-linux-gnueabi-f90... no checking for arm-xscale-linux-gnueabi-pgf90... no checking for arm-xscale-linux-gnueabi-pghpf... no checking for arm-xscale-linux-gnueabi-epcf90... no checking for arm-xscale-linux-gnueabi-gfortran... no checking for arm-xscale-linux-gnueabi-g95... no checking for arm-xscale-linux-gnueabi-xlf95... no checking for arm-xscale-linux-gnueabi-f95... no checking for arm-xscale-linux-gnueabi-fort... no checking for arm-xscale-linux-gnueabi-ifort... no checking for arm-xscale-linux-gnueabi-ifc... no checking for arm-xscale-linux-gnueabi-efc... no checking for arm-xscale-linux-gnueabi-pgf95... no checking for arm-xscale-linux-gnueabi-lf95... no checking for arm-xscale-linux-gnueabi-ftn... no checking for g77... g77 configure: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org. checking whether we are using the GNU Fortran 77 compiler... yes checking whether g77 accepts -g... yes checking the maximum length of command line arguments... 8192 checking command to parse /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin/arm-xscale-linux-gnueabi-nm -B output from arm-xscale-linux-gnueabi-gcc object... ok checking for objdir... .libs checking for arm-xscale-linux-gnueabi-ar... arm-xscale-linux-gnueabi-ar checking for arm-xscale-linux-gnueabi-ranlib... (cached) arm-xscale-linux-gnueabi-ranlib checking for arm-xscale-linux-gnueabi-strip... (cached) arm-xscale-linux-gnueabi-strip checking for correct ltmain.sh version... yes checking if arm-xscale-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no checking for arm-xscale-linux-gnueabi-gcc option to produce PIC... -fPIC checking if arm-xscale-linux-gnueabi-gcc PIC flag -fPIC works... yes checking if arm-xscale-linux-gnueabi-gcc static flag -static works... yes checking if arm-xscale-linux-gnueabi-gcc supports -c -o file.o... yes checking whether the arm-xscale-linux-gnueabi-gcc linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking whether -lc should be explicitly linked in... no 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... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by arm-xscale-linux-gnueabi-g++... /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe checking if the linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) is GNU ld... yes checking whether the arm-xscale-linux-gnueabi-g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking for arm-xscale-linux-gnueabi-g++ option to produce PIC... -fPIC checking if arm-xscale-linux-gnueabi-g++ PIC flag -fPIC works... yes checking if arm-xscale-linux-gnueabi-g++ static flag -static works... yes checking if arm-xscale-linux-gnueabi-g++ supports -c -o file.o... yes checking whether the arm-xscale-linux-gnueabi-g++ linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for g77 option to produce PIC... -fPIC checking if g77 PIC flag -fPIC works... no checking if g77 static flag -static works... yes checking if g77 supports -c -o file.o... yes checking whether the g77 linker (/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for pthread_mutex_init in -lpthread... yes configure: Compile with rollingfile code checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for inttypes.h... (cached) yes checking langinfo.h usability... yes checking langinfo.h presence... yes checking for langinfo.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking for unistd.h... (cached) yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking varargs.h usability... no checking varargs.h presence... no checking for varargs.h... no checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking for pthread.h... (cached) yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for working alloca.h... yes checking for alloca... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... no checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for getpagesize... yes checking for working mmap... no checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... no checking utime.h usability... yes checking utime.h presence... yes checking for utime.h... yes checking whether utime accepts a null argument... no checking for vprintf... yes checking for _doprnt... no checking for gettimeofday... yes checking for memset... yes checking for munmap... yes checking for nl_langinfo... yes checking for strdup... yes checking for strerror... yes checking for strncasecmp... yes checking for strrchr... yes checking for strstr... yes checking for utime... yes checking for sbrk... yes checking for doxygen... /usr/bin/doxygen checking for dot... no checking for latex... /usr/bin/latex checking for EXPAT - version >= 1.95.1... cross compiling; assumed OK... yes configure: creating ./config.status config.status: creating Makefile config.status: creating log4c-config config.status: creating log4crc.sample config.status: creating log4c.spec config.status: creating config/Makefile config.status: creating doc/Makefile config.status: creating doc/Doxyfile config.status: creating doc/main.doc config.status: creating src/Makefile config.status: creating src/log4c/Makefile config.status: creating src/log4c/version.h config.status: creating src/sd/Makefile config.status: creating tests/Makefile config.status: creating tests/log4c/Makefile config.status: creating examples/Makefile config.status: creating examples/log4crc config.status: creating examples/helloworld/Makefile config.status: creating examples/helloworld1/Makefile config.status: creating src/config.h config.status: executing depfiles commands config.status: executing default commands CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $
其中,注意到,对于expat,是assume OK:
checking for EXPAT - version >= 1.95.1... cross compiling; assumed OK... yes
12.不过,发现,此时,再去make,就可以正常make了:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ make make all-recursive make[1]: Entering directory `/home/CLi/develop/log4c/log4c-1.2.1' Making all in config make[2]: Entering directory `/home/CLi/develop/log4c/log4c-1.2.1/config' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/CLi/develop/log4c/log4c-1.2.1/config' Making all in src make[2]: Entering directory `/home/CLi/develop/log4c/log4c-1.2.1/src' make all-recursive make[3]: Entering directory `/home/CLi/develop/log4c/log4c-1.2.1/src' Making all in sd make[4]: Entering directory `/home/CLi/develop/log4c/log4c-1.2.1/src/sd' /bin/sh ../../libtool --tag=CC --mode=compile arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -Wall -MT stack.lo -MD -MP -MF .deps/stack.Tpo -c -o stack.lo stack.c mkdir .libs arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -Wall -MT stack.lo -MD -MP -MF .deps/stack.Tpo -c stack.c -fPIC -DPIC -o .libs/stack.o arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -Wall -MT stack.lo -MD -MP -MF .deps/stack.Tpo -c stack.c -o stack.o >/dev/null 2>&1 mv -f .deps/stack.Tpo .deps/stack.Plo /bin/sh ../../libtool --tag=CC --mode=compile arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -Wall -MT list.lo -MD -MP -MF .deps/list.Tpo -c -o list.lo list.c arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -Wall -MT list.lo -MD -MP -MF .deps/list.Tpo -c list.c -fPIC -DPIC -o .libs/list.o arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -Wall -MT list.lo -MD -MP -MF .deps/list.Tpo -c list.c -o list.o >/dev/null 2>&1 mv -f .deps/list.Tpo .deps/list.Plo /bin/sh ../../libtool --tag=CC --mode=compile arm-xscale-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -g -O2 -Wall -MT malloc.lo -MD -MP -MF .deps/malloc.Tpo -c -o malloc.lo malloc.c
至此,终于算是,解决了此问题,可以正常make了。
【总结】
Cygwin下用arm-xscale-linux-gnueabi交叉编译log4c,make的时候出现:
CLi@PC-CLI-1 ~/develop/log4c/log4c-1.2.1 $ make cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run aclocal-1.10 configure.in:194: warning: macro `AM_PATH_EXPAT' not found in library cd . && /bin/sh /home/CLi/develop/log4c/log4c-1.2.1/config/missing --run automake-1.10 --gnu /usr/share/automake-1.10/am/depend2.am: am__fastdepCXX does not appear in AM_CONDITIONAL /usr/share/automake-1.10/am/depend2.am: The usual way to define `am__fastdepCXX' is to add `AC_PROG_CXX' /usr/share/automake-1.10/am/depend2.am: to `configure.in' and run `aclocal' and `autoconf' again. tests/log4c/Makefile.am: C++ source seen but `CXX' is undefined tests/log4c/Makefile.am: The usual way to define `CXX' is to add `AC_PROG_CXX' tests/log4c/Makefile.am: to `configure.in' and run `autoconf' again. Makefile:232: recipe for target `Makefile.in' failed make: *** [Makefile.in] Error 1
的错误,则此处的解决办法是:
1.(无法用make clean等命令,所以只能去)重新用全新的代码:
2.重新用全新的配置:
./configure --prefix=$HOME/develop/crosstool-ng/x-tools/armxscalelog4c --build=i686-pc-cygwin --target=arm-xscale-linux-gnueabi --host=arm-xscale-linux-gnueabi CC=arm-xscale-linux-gnueabi-gcc
(注:
之前的配置是:
./configure --prefix=$HOME/develop/crosstool-ng/x-tools/armxscalelog4c --build=i686-pc-cygwin --target=arm-xscale-linux --host=arm-xscale-linux CC=arm-xscale-linux-gnueabi-gcc
)
3.然后再去make,就可以正常的make了。
就没有之前的那个错误了。
注:
其中,关于autoconf,makefile等等,有个资料值得参考:
例解 autoconf 和 automake 生成 Makefile 文件
转载请注明:在路上 » 【已解决】Cygwin下用arm-xscale-linux-gnueabi交叉编译log4c出错:configure.in:194: warning: macro `AM_PATH_EXPAT’ not found in library