github:
https://github.com/ptpd/ptpd
step1:下载
git clone https://github.com/ptpd/ptpd.git
cd ptpd
autoreconf -vi
step4:编译配置
(1)主机编译配置
./configure
(2)交叉编译配置1
./configure CC=/opt/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc --host=arm-linux-gnueabi
(3)交叉编译配置2
source /opt/fsl-imx-fb/4.9.88-2.0.0/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
./configure --host=arm-poky-linux-gnueabi
step5:(交叉编译1时有此步骤)
-
交叉编译时,若出现undefined reference to `rpl_malloc’时,原因如下:
-
autotools认为工具链的libc中不包含malloc和realloc,会执行:
#define malloc rpl_malloc
#define realloc rpl_realloc
**解决方法:**在config.h中注释掉
//#define malloc rpl_malloc
step5
make
- 编译完成后在src目录下会生成一个ptpd2的文件
step6
cd src
file ptpd2