Steps:
1. Download LOG4C Source code
2. Unzip the source package, I extracted the path is:/home/cc/downloads/log4c-1.2.4
3. Execute the following shell script:
#!/bin/shmkdir/home/cc/software/log4c-arm-linux cd/home/cc/software/log4c-arm-linuxcc=/usr/local/ CROSSTOOL-4.9.1/BIN/ARM-UNKNOWN-LINUX-GNUEABI-GCC /home/cc/downloads/log4c-1.2.4/configure \
--build=x86_64-linux-gnu --host=arm-linux--prefix=/home/cc/software/log4c-arm-linux -- Without-expatmakemake Install
If you do not make an error, the LOG4C is installed correctly at this time. Using log4c in a C language program requires only the following configuration makefile:
all:$ (OBJS)
[Tab]arm-unknown-linux-gnueabi-gcc-o name $ (OBJS) -ldl -l/home/cc/software/log4c-arm-linux/lib -llog4c
main.o:main.o
[TAB]ARM-UNKNOWN-LINUX-GNUEABI-GCC Main.c-o Main.o-i/home/cc/software/log4c-arm-linux/include
Shell Script Description:
Lines 4th and 5th:
CC=/USR/LOCAL/CROSSTOOL-4.9.1/BIN/ARM-UNKNOWN-LINUX-GNUEABI-GCC: Compiling with the Arm-linux cross compiler
Other options can be used to search for their own effects.
External notes:
In writing this article, I think of a question: how can the cross-compiler get the log4c to install on the x86pc machine without error, that is, the 3rd step above the shell script
There is no error when executing to make install. Because I contact this is not very long, for a moment to dig a hole, buried later.
It should be explained that the above steps are measured by me, and in the program project using the LOG4C function, compiled through.
LOG4C steps for compiling the Arm-linux environment on ubuntu15.10