Cross-compiling of common tool software

Source: Internet
Author: User
Tags chmod socket


Common tool software cross-compiling, continuous update ...






Iproute2, Libsocketcan, canutils reference URL:



1, http://www.embedu.org/Column/Column596.htm



2, Http://processors.wiki.ti.com/index.php/AM335X_DCAN_Driver_Guide#CAN_Utilities


First, libsocketcan-0.0.9.tar.bz2 cross-compiling
Because Canutils compilation requires Libsocketcan library support, download Libsocketcan is required.
Download Address: http://www.pengutronix.de/software/libsocketcan/download/The author of the download is Libsocketcan 0.0.9

1,./configure \
--host=arm-xilinx-linux-gnueabi \
--prefix=/usr/local/libsocketcan

2. Make

3. Sudo make install
The error is as follows:
.. /libtool:line 1088:arm-xilinx-linux-gnueabi-ranlib:command not found
MAKE[2]: * * [install-libltlibraries] Error 127
MAKE[2]: Leaving directory '/HOME/ZB/RUANJIANBAO/LIBSOCKETCAN-0.0.9/SRC '
MAKE[1]: * * [Install-am] Error 2
MAKE[1]: Leaving directory '/HOME/ZB/RUANJIANBAO/LIBSOCKETCAN-0.0.9/SRC '
Make: * * [install-recursive] Error 1


Workaround:
First enter the root user
Then configure the cross compiler under root user
Export Path=/home/zb/mygcc/codesourcery/sourcery_codebench_lite_for_xilinx_gnu_li Nux/bin: $PATH
Finally, under root user make install


Second, Canutils 3.0.0 cross-compiling
Note: Using the 3.0.0 version does not make an error

Download Address: Http://www.pengutronix.de/software/socket-can/download/canutils. The author download is canutils 3.0.0.
1,./configure--host=arm-xilinx-linux-gnueabi \
--prefix=/usr/local/canutils \
Libsocketcan_libs=-lsocketcan \
Ldflags=-l/home/zb/libsocketcan/lib \
Cppflags=-i/home/zb/libsocketcan/include

2, make 3, sudo make install

Third, Iproute2 2.6.36 cross-compiler Socket can test
Note: Only use 2.6.36, other versions of the IP command can not be used

Because the latest version of the BusyBox socket can is not supported, so in order to test and use the socket can, we need to compile the socket can tool. Here are two tools, each one

Iproute2 and Canutils.
(1) Download address: http://pkgs.fedoraproject.org/repo/pkgs/iproute/iproute2-2.6.39.tar.gz/ 8a3b6bc77c2ecf752284aa4a6fc630a6/iproute2-2.6.39.tar.gz. The author download is Iproute2 2.6.36.
(2) Decompression Iproute2-2.6.36.tar.xz, modify the makefile line 33rd.
#CC = gcc
CC = ARM-NONE-LINUX-GNUEABI-GCC
(3) because we only need IPROUT2 IP commands, we modify the 42nd line of the makefile.
#SUBDIRS =lib IP TC Bridge misc Netem genl Man
Subdirs=lib IP
(4) Modify the Execute make command, generate the IP command, copy to the Development Board file system directory.
(5) Use the IP command.
Ifconfig can0 down//close can0 for configuration
./IP Link set can0 up type can bitrate 250000//set Can0 baud rate


./ip-details link Show can0//display can0 information






Fourth. linuxptp1.6 Cross-compiling can only be used in version 1.6



(1) Source code download URL: https://sourceforge.net/projects/linuxptp/files/v1.6/



(2) Cross-compiling: Make Arch=arm cross_compile=arm-xilinx-linux-gnueabi-



(3) Compilation error:



Sk.c:58:30:error: ' Hwtstamp_tx_onestep_sync ' undeclared (first use of this function)
Sk.c:58:30:note:each undeclared identifier is reported only once for each function it appears in






CLOCKADJ.O:CLOCKADJ.C: (. Text+0x5d8): More undefined references to ' clock_adjtime ' follow
Collect2:ld returned 1 exit status
Make: * * [ptp4l] Error 1



(4) Problem solving:



1, sk.c lack of macros, I directly net_tstamp.h the kernel copy come//can no matter this step



2. Then comment out the 65 lines of Missing.h #ifndef have _clock _adjtime, 70 rows #endif和51行 #ifndef have_onestep_sync, 55 rows #endif






Fifth, Redhat under GPSD source installation GPSD



Under Ubuntu: Apt-get Install GPSD



(1) Download gpsd Source: http://www.catb.org/gpsd/#downloads



(2) Installation of scons---scons installation and use//installation SCons 2.1.0 or later



install a variety of dependencies first: yum install gcc yum install ncurses ncurses-devel yum install python-devel//install python2.5 above version






1. SCons is God's horse.



SCons is an automated build tool under Linux, similar to CMake.
2. Installation



Wget http://prdownloads.sourceforge.net/scons/scons-2.2.0.tar.gz.
Tar zxvf scons-2.2.0.tar.gz
CD scons-2.2.0
Python setup.py Install
Under normal circumstances, the SCons will be installed under ${python_install_dir}/bin/



(3) Installation Chrpath



Yum Install Chrpath



(4) under the GPSD source code execution:



1, SCons



2. SCons Install



3, SCons Udev-install



(5) Installation and operation of GPSD service---install as service


CD <GPSD source folder>
CP packaging/rpm/gpsd.init/etc/init.d/gpsd
chmod 755/ETC/INIT.D/GPSD
CP PACKAGING/RPM/GPSD.SYSCONFIG/ETC/SYSCONFIG/GPSD
chmod 644/etc/sysconfig/gpsd
chkconfig gpsd on













Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.