66757112f1b923ebfdc8c248ad037b941e7c8f4f
[openwrt/svn-archive/archive.git] / libs / jpeg / 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=jpeg
11 PKG_VERSION:=6b
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)src.v$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.ijg.org/files/ \
16 ftp://ftp.uu.net/graphics/jpeg/
17 PKG_MD5SUM:=dbd5f3b47ed13132f04c685d608a7547
18
19 PKG_FIXUP = libtool
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/jpeg/Default
24 TITLE:=The Independent JPEG Group's JPEG
25 URL:=http://www.ijg.org/
26 endef
27
28 define Package/libjpeg
29 $(call Package/jpeg/Default)
30 SECTION:=libs
31 CATEGORY:=Libraries
32 TITLE+= runtime library
33 endef
34
35 define Package/jpeg-tools
36 $(call Package/jpeg/Default)
37 SECTION:=utils
38 CATEGORY:=Utilities
39 DEPENDS:=+libjpeg
40 TITLE+= manipulation tools
41 endef
42
43 TARGET_CFLAGS += $(FPIC)
44
45 CONFIGURE_ARGS += \
46 --enable-shared \
47 --enable-static \
48
49 define Build/Prepare
50 $(call Build/Prepare/Default)
51 # replace the old upstream libtool stuff with our own
52 ln -sf $(STAGING_DIR)/host/bin/libtool $(PKG_BUILD_DIR)/
53 ln -sf $(STAGING_DIR)/host/share/libtool/config.sub $(PKG_BUILD_DIR)/
54 ln -sf $(STAGING_DIR)/host/share/libtool/config.guess $(PKG_BUILD_DIR)/
55 ln -sf $(STAGING_DIR)/host/share/libtool/ltmain.sh $(PKG_BUILD_DIR)/
56 ln -sf /bin/true $(PKG_BUILD_DIR)/ltconfig
57 endef
58
59 define Build/Compile
60 rm -rf $(PKG_INSTALL_DIR)
61 mkdir -p $(PKG_INSTALL_DIR)/usr/{include,lib,bin,man/man1}
62 $(MAKE) -C $(PKG_BUILD_DIR) \
63 LIBTOOL="./libtool --tag=CC" \
64 prefix="$(PKG_INSTALL_DIR)/usr" \
65 exec_prefix="$(PKG_INSTALL_DIR)/usr" \
66 all install install-headers install-lib
67 endef
68
69 define Build/InstallDev
70 mkdir -p $(1)/usr/include
71 $(CP) $(PKG_INSTALL_DIR)/usr/include/jpeglib.h $(1)/usr/include/
72 $(CP) $(PKG_BUILD_DIR)/jpegint.h $(1)/usr/include/
73 $(CP) $(PKG_INSTALL_DIR)/usr/include/j{config,error,morecfg}.h $(1)/usr/include/
74 mkdir -p $(1)/usr/lib
75 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.{a,so*} $(1)/usr/lib/
76 endef
77
78 define Package/libjpeg/install
79 $(INSTALL_DIR) $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.so.* $(1)/usr/lib/
81 endef
82
83 define Package/jpeg-tools/install
84 $(INSTALL_DIR) $(1)/usr/bin
85 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/*jpeg* $(1)/usr/bin/
86 endef
87
88 $(eval $(call BuildPackage,libjpeg))
89 $(eval $(call BuildPackage,jpeg-tools))