How to configure and build media-ctl

Luong Van Diep
Hi all!
I have got a FriendlyARM Tiny210v2 KIT.I want to use AV IN port.Now,I
install media-ctl but some error when make.
On PC install Ubuntu11.10,I configure step by step:
[code]
$ sudo apt-get install autoconf libtool

$ cd <Absolute Path to your media-ctl directory>

 

For the below two steps, you can use whatever tool chain you need

$ export CC=/opt/FriendlyARM/toolschain/arm/bin/arm-none-linux-gnueabi-gcc

$ export CPP=/opt/FriendlyARM/toolschain/arm/bin/arm-none-linux-gnueabi-cpp

 

$ autoreconf --install

$ ./configure
--with-kernel-headers=/usr/src/linux-headers-3.0.0-12-generic/include
--build=arm --host=i686 --prefix=opt/media
 

kernel headers path  is where we installed kernel headers during kernel
compilation.

And to know the hosttype please give "echo $HOSTTYPE" command .

 

$ make

$ make install 
[/code]
But errors exist at make command
[code]
root@ubuntu:~/media-ctl-b16cbe7# ls
configure.in  debian   libmediactl.pc.in    m4           src
COPYING.GPL   INSTALL  libv4l2subdev.pc.in  Makefile.am
root@ubuntu:~/media-ctl-b16cbe7# autoconf --install
autoconf: error: invalid option `--install'
Try `autoconf --help' for more information.
root@ubuntu:~/media-ctl-b16cbe7# autoreconf --install
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/config.guess'
libtoolize: copying file `config/config.sub'
libtoolize: copying file `config/install-sh'
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.in:8: installing `config/missing'
src/Makefile.am: installing `config/depcomp'
root@ubuntu:~/media-ctl-b16cbe7# sudo
PATH=/opt/FriendlyARM/toolschain/4.4.3/bin:$PATH  ./configure 
--with-kernel-headers=/lib/modules/3.0.0-12-generic/build/include 
--build=arm --host=i686  --prefix=/opt/media
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i686-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for i686-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... arm-unknown-none
checking host system type... i686-pc-none
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for i686-dumpbin... no
checking for i686-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert arm-unknown-none file names to i686-pc-none
format... func_convert_file_noop
checking how to convert arm-unknown-none file names to toolchain format...
func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for i686-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... unknown
checking for i686-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for i686-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for i686-strip... strip
checking for i686-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from gcc object... ok
checking for sysroot... no
checking for i686-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries...
yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking linux/media.h usability... yes
checking linux/media.h presence... yes
checking for linux/media.h... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking linux/v4l2-mediabus.h usability... yes
checking linux/v4l2-mediabus.h presence... yes
checking for linux/v4l2-mediabus.h... yes
checking linux/v4l2-subdev.h usability... yes
checking linux/v4l2-subdev.h presence... yes
checking for linux/v4l2-subdev.h... yes
checking linux/videodev2.h usability... yes
checking linux/videodev2.h presence... yes
checking for linux/videodev2.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for inline... inline
checking for size_t... yes
checking for struct stat.st_rdev... yes
checking whether sys/types.h defines makedev... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... no
checking for memset... yes
checking for strerror... yes
checking for strrchr... yes
checking for strtoul... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating libmediactl.pc
config.status: creating libv4l2subdev.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
root@ubuntu:~/media-ctl-b16cbe7# sudo
PATH=/opt/FriendlyARM/toolschain/4.4.3/bin:$PATH make 
make  all-recursive
make[1]: Entering directory `/root/media-ctl-b16cbe7'
Making all in src
make[2]: Entering directory `/root/media-ctl-b16cbe7/src'
/bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..
  -I/lib/modules/3.0.0-12-generic/build/include/include  -g -O2 -MT
media.lo -MD -MP -MF .deps/media.Tpo -c -o media.lo media.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I..
-I/lib/modules/3.0.0-12-generic/build/include/include -g -O2 -MT media.lo
-MD -MP -MF .deps/media.Tpo -c media.c -o media.o
In file included from media.c:34:0:
media.h: In function 'media_entity_type':
media.h:103:29: error: 'MEDIA_ENTITY_TYPE_MASK' undeclared (first use in
this function)
media.h:103:29: note: each undeclared identifier is reported only once for
each function it appears in
media.c: In function 'media_entity_remote_source':
media.c:41:21: error: 'MEDIA_PAD_FLAG_INPUT' undeclared (first use in this
function)
media.c:47:23: error: 'MEDIA_LINK_FLAG_ENABLED' undeclared (first use in
this function)
media.c: In function 'media_setup_link':
media.c:115:23: error: 'MEDIA_PAD_FLAG_OUTPUT' undeclared (first use in
this function)
media.c:120:21: error: 'MEDIA_PAD_FLAG_INPUT' undeclared (first use in this
function)
media.c:122:39: error: 'MEDIA_LINK_FLAG_IMMUTABLE' undeclared (first use in
this function)
media.c: In function 'media_reset_links':
media.c:147:22: error: 'MEDIA_LINK_FLAG_IMMUTABLE' undeclared (first use in
this function)
media.c:152:28: error: 'MEDIA_LINK_FLAG_ENABLED' undeclared (first use in
this function)
media.c: In function 'media_enum_entities':
media.c:267:26: error: 'MEDIA_ENTITY_ID_FLAG_NEXT' undeclared (first use in
this function)
media.c:290:36: error: 'MEDIA_ENTITY_TYPE_DEVNODE' undeclared (first use in
this function)
media.c:291:36: error: 'MEDIA_ENTITY_TYPE_V4L2_SUBDEV' undeclared (first
use in this function)
make[2]: *** [media.lo] Error 1
make[2]: Leaving directory `/root/media-ctl-b16cbe7/src'
make[1]: *** [all-recursive] Error 1
make[...stripped-down

vidya
I followed same steps and configured for me.