don't use included ltdl lib, standardize
[openwrt/svn-archive/archive.git] / libs / libgphoto2 / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libgphoto2
12 PKG_VERSION:=2.2.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/gphoto
17 PKG_MD5SUM:=69827311733e39fafa9f77bb05e55b77
18 PKG_CAT:=bzcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25
26 define Package/libgphoto2/Default
27 SECTION:=libs
28 CATEGORY:=Libraries
29 URL:=http://www.gphoto.org/
30 endef
31
32 define Package/libgphoto2
33 $(call Package/libgphoto2/Default)
34 DEPENDS:=+libusb +libexif +libjpeg +libpthread
35 TITLE:=The basic library of the gphoto2 program.
36 MENU:=1
37 endef
38
39 define Package/libgphoto2-drivers
40 $(call Package/libgphoto2/Default)
41 DEPENDS:=libgphoto2
42 TITLE:=Gphoto2 drivers for various cameras
43 endef
44
45 BIG_ENDIAN:=no
46 ifeq ($(ARCH),mips)
47 BIG_ENDIAN:=yes
48 endif
49 ifeq ($(ARCH),armeb)
50 BIG_ENDIAN:=yes
51 endif
52 ifeq ($(ARCH),powerpc)
53 BIG_ENDIAN:=yes
54 endif
55
56 define Build/Configure
57 $(call Build/Configure/Default, \
58 --enable-shared \
59 --enable-static \
60 --disable-rpath \
61 --with-gnu-ld \
62 --with-drivers=all \
63 --without-included-ltdl \
64 --without-libiconv-prefix \
65 --without-libintl-prefix \
66 , \
67 LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
68 LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
69 LIBUSB_CFLAGS="$$$$CPPFLAGS" \
70 LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
71 LIBS="-lltdl" \
72 ac_cv_c_gettext_without_libintl=yes \
73 ac_cv_c_bigendian=$(BIG_ENDIAN) \
74 )
75 endef
76
77 define Build/Compile
78 $(MAKE) -C $(PKG_BUILD_DIR) -j$(CONFIG_JLEVEL) \
79 DESTDIR="$(PKG_INSTALL_DIR)" \
80 LIBLTDL="" \
81 all install
82 endef
83
84 define Build/InstallDev
85 mkdir -p $(STAGING_DIR)/usr/bin
86 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(STAGING_DIR)/usr/bin/
87 mkdir -p $(STAGING_DIR)/usr/include
88 $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(STAGING_DIR)/usr/include/
89 mkdir -p $(STAGING_DIR)/usr/lib
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(STAGING_DIR)/usr/lib/
91 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(STAGING_DIR)/usr/lib/pkgconfig/
93 $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
94 $(SED) 's,-I$$$${prefix}/include,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
95 $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
96 $(SED) 's,-I$$$${includedir}/gphoto2,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
97 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
98 endef
99
100 define Build/UninstallDev
101 rm -rf $(STAGING_DIR)/usr/bin/gphoto2-config \
102 $(STAGING_DIR)/usr/bin/gphoto2-port-config \
103 $(STAGING_DIR)/usr/include/gphoto2* \
104 $(STAGING_DIR)/usr/lib/libgphoto*.{a,so*}
105 endef
106
107 define Package/libgphoto2/install
108 install -m0755 -d $(1)/usr/lib
109 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
110 endef
111
112 define Package/libgphoto2-drivers/install
113 install -d -m0755 $(1)/usr/lib/
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
115 rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
116 endef
117
118 $(eval $(call BuildPackage,libgphoto2))
119 $(eval $(call BuildPackage,libgphoto2-drivers))