• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Cross compiling question with CodeSourcery  (Read 3147 times)
bad_gui
Jr. Member
**

Karma: 0
Posts: 50


View Profile
« on: December 10, 2010, 06:20:23 PM »

I want to compile binaries for my Guruplug Server kernel Linux guruplug 2.6.32-00007-g56678ec #1 PREEMPT Mon Feb 8 03:49:55 PST 2010 armv5tel GNU/Linux

I downloaded CodeSourcery Sourcery G++ Lite 2010.09-51 for the EABI target

I downloaded the kernel headers for 2.6.32.7 from http://sheeva.with-linux.com/sheeva/

I want to build from source (mjpeg-streamer) but I can't figure out how to direct the cross compiler
to use the 2.6.32 kernel headers

I wrote a bash script to change environment variables in the shell in which I want to compile

Code:
#!/bin/bash
export CC=/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc
export CFLAGS="-march=armv5te -mtune=xscale"
export CXX=/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-g++
export LD=/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-ld
export AR=/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-ar
export AS=/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-as
export NM=/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-nm
export STRIP=/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-strip

When I source the bash script and then type make I get

Code:
:$ make
/Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc -march=armv5te -mtune=xscale -O2 -Wall -I/Opt/CodeSourcery/Sourcery_G++_Lite/arm-none-eabi/include   -c -o mjpg_streamer.o mjpg_streamer.c
mjpg_streamer.c:27:22: fatal error: videodev.h: No such file or directory
compilation terminated.
make: *** [mjpg_streamer.o] Error 1

I tried modifying the Makefile with no success
Code:
###############################################################
#
# Purpose: Makefile for "M-JPEG Streamer"
# Author.: Tom Stoeveken (TST)
# Version: 0.3
# License: GPL
#
###############################################################

#CC = gcc
CC = /Opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-gcc
CFLAGS += -O2 -Wall -I$ /Opt/CodeSourcery/Sourcery_G++_Lite/arm-none-eabi/include
EXTRA_CFLAGS = -I$ /Opt/Downloads/kernel_2.6.32.7_headers/usr/include
#CFLAGS += -O2 -DDEBUG -DLINUX -D_GNU_SOURCE -Wall
LFLAGS += -lpthread -ldl

APP_BINARY=mjpg_streamer
OBJECTS=mjpg_streamer.o utils.o

all: application plugins
&tc

What am I doing wrong?  I looked at the man pages for the original CFLAGS setting and I don't understand
where the LINUX and _GNU_SOURCE macros are defined.

The README states
Quote
Dependencies for the input plugin "input_uvc.so":
 * libjpeg
 * recent Linux-UVC driver (newer then revision #170)

Dependencies for the output plugin "output_autofocus.so":
 * libmath

Can I build against the lib on my desktop rather than the ones on the plug?
I installed the linux-UVC driver on the plug and I will get libjpeg and libmath
from Debian downloads.

Logged

bad_gui
Jr. Member
**

Karma: 0
Posts: 50


View Profile
« Reply #1 on: December 10, 2010, 06:59:24 PM »

I found a mjpeg-streamer binary package for arm here:

http://www.friendlyarm.net/forum/topic/279 if you scroll down you will find the version for
libjpeg62  http://mjpg-streamer-mini2440.googlecode.com/files/mjpg-streamer-mini2440-bin-libjpeg62.tar.gz

I followed the instructions here http://code.google.com/p/mjpg-streamer-mini2440/

This worked for me with a great picture using a Logitech Quickcam Ultravision.  I got a kernel freeze when trying
the java and javascript pages.  This camera isn't fully supported bu the UVC driver so it may not be the plug's fault.
Logged

Pages: [1]
Print
Jump to: