Cross compiling linux-gpib for Raspbian
dave penkler <[email protected]>
| Newsgroups | gmane.linux.hardware.gpib.general |
|---|---|
| Message-ID | <CAL=kjP1-_gcnRfJp-pHnLN_TOUDZHQd18Q4F70ZtBhZpZ31zfg@mail.gmail.com> |
Folks, Now that Frank has made the jump to separate the package into kernel and user parts - cross compilation has become a lot easier. Here is a procedure that I tested out recently. Prerequisites ------------- You have downloaded the raspbian tools and kernel and compiled the kernel sources as per the instructions in https://www.raspberrypi.org/documentation/linux/kernel/building.md In the following it is assumed that: 1. the linux-gpib-kernel sources are in ~/gpib/linux-gpib-kernel-4.2.0 2. the linux-gpib-user sources are in ~/gpib/linux-gpib-user-4.2.0 3. the raspbian toolchain is installed in ~/tools 4. the raspbian kernel source tree is in ~/raspbian-linux 5. the ext4 partition of the raspberry pi sd-card is mounted on /mnt/ext4 Modify the procedure below accordingly if your setup is different. Procedure --------- 1: Set your PATH for the Makfiles to find the build tools export > PATH=$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin 2: Set the environment variables for cross compilation export CROSS_COMPILE=arm-linux-gnueabihf- > export ARCH=arm > export CC=arm-linux-gnueabihf-gcc 3: Build and install the kernel modules cd ~/gpib/linux-gpib-kernel-4.2.0 > ./configure --prefix=/mnt/ext4 --with-linux-srcdir=$HOME/raspbian-linux/ > --host=arm > make > sudo -E make INSTALL_MOD_PATH=/mnt/ext4 install 4: Build and install the user space package cd ~/gpib/linux-gpib-user-4.2.0 > ./configure --prefix=/mnt/ext4/usr/local --sysconfdir=/etc --host=arm > make > sudo -E make install At this point you can unmount the sd-card partition(s), install the card in your pi system and test out the gpib installation. Notes ----- Cross compilation for the perl binding is broken as its Makefile is still not made with the standard autotools. If you are uncomfortable with the sudo -E option you can include the shell variable assignments in each of the sudo make commands instead: sudo make INSTALL_MOD_PATH=/mnt/ext4 install > CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm CC=arm-linux-gnueabihf-gcc cheers, -Dave _______________________________________________ Linux-gpib-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-gpib-general