70ab9d5ff8ee3262f6e03245e313da32671d8664
[openwrt/svn-archive/archive.git] / libs / libv4l / Makefile
1 #
2 # Copyright (C) 2009 David Cooper <dave@kupesoft.com>
3 # Copyright (C) 2009 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libv4l
12 PKG_VERSION:=0.6.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://people.atrpms.net/~hdegoede/
17 PKG_MD5SUM:=0d0d96d77c98871d2e5466c10cb30a0a
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libv4l
22 SECTION:=libs
23 CATEGORY:=Libraries
24 TITLE:=Video 4 Linux wrapper libraries
25 URL:=http://people.atrpms.net/~hdegoede/
26 DEPENDS:=+libpthread
27 endef
28
29 define Package/libv4l/description
30 libv4l is a collection of libraries which adds a thin abstraction layer on
31 top of video4linux2 devices. The purpose of this (thin) layer is to make it
32 easy for application writers to support a wide variety of devices without
33 having to write separate code for different devices in the same class. libv4l
34 consists of 3 different libraries: libv4lconvert, libv4l1 and libv4l2.
35
36 libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices, independent
37 of the drivers for those devices supporting v4l1 compatibility (which many
38 v4l2 drivers do not).
39
40 libv4l2 offers the v4l2 API on top of v4l2 devices, while adding for the
41 application transparent libv4lconvert conversion where necessary.
42 endef
43
44 TARGET_CFLAGS += $(FPIC)
45
46 define Build/Compile
47 $(MAKE) -C $(PKG_BUILD_DIR) \
48 DESTDIR="$(PKG_INSTALL_DIR)" PREFIX="/usr" \
49 $(CONFIGURE_VARS) \
50 all install
51 $(MAKE) -C $(PKG_BUILD_DIR) \
52 DESTDIR="$(PKG_INSTALL_DIR)" PREFIX="/usr" \
53 $(CONFIGURE_VARS) \
54 LINKTYPE="static" \
55 all install
56 endef
57
58 define Build/InstallDev
59 $(INSTALL_DIR) $(1)/usr/include
60 $(CP) $(PKG_INSTALL_DIR)/usr/include/libv4l{1,2,convert}.h $(1)/usr/include/
61 $(INSTALL_DIR) $(1)/usr/lib
62 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.{a,so*} $(1)/usr/lib/
63 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libv4l{1,2,convert}.pc $(1)/usr/lib/pkgconfig/
65 endef
66
67 define Package/libv4l/install
68 $(INSTALL_DIR) $(1)/usr/lib
69 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.so.* $(1)/usr/lib/
70 $(INSTALL_DIR) $(1)/usr/lib/libv4l
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l
72 endef
73
74 $(eval $(call BuildPackage,libv4l))
75