make use of feature-flags: let libX11 provide the feature "drawing-backend"
[packages.git] / Xorg / xorg / lib / libX11 / Makefile
1 #
2 # Copyright (C) 2007-2009 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:=libX11
11 PKG_RELEASE:=1
12 PKG_VERSION:=1.3.2
13
14 PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/individual/lib/
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_BUILD_DIR:=$(BUILD_DIR)/Xorg/$(PKG_NAME)-$(PKG_VERSION)/
17 PKG_MD5SUM:=001d780829f936e34851ef7cd37b4dfd
18
19 PKG_FIXUP:=libtool
20 PKG_INSTALL:=1
21 PKG_BUILD_DEPENDS:=xproto xextproto xf86bigfontproto kbproto inputproto \
22                    xtrans xcmiscproto bigreqsproto
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/libX11
27   SECTION:=xorg-lib
28   CATEGORY:=Xorg
29   SUBMENU:=libraries
30   DEPENDS:=+libXdmcp +libXau
31   TITLE:=libX11
32   URL:=http://xorg.freedesktop.org/
33 endef
34
35 define Feature/libX11
36   TARGET_NAME:=drawing-backend
37   TARGET_TITLE:=Drawing Backend
38   NAME:=libX11
39 endef
40
41 define Build/Configure
42         $(call Build/Configure/Default, \
43                 --enable-malloc0returnsnull \
44                 --enable-xf86bigfont \
45                 --without-xcb \
46                 --without-launchd \
47         )
48 endef
49
50 define Build/Compile
51         $(MAKE) -C $(PKG_BUILD_DIR)/src/util \
52                 CC="$(HOSTCC)" \
53         CFLAGS="$(HOST_CFLAGS)" \
54         LDFLAGS="$(HOST_LDFLAGS)"
55
56         $(call Build/Compile/Default)
57 endef
58
59 define Build/InstallDev
60         $(INSTALL_DIR) $(1)/usr/{lib/pkgconfig,include/X11}
61         $(CP) \
62                 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,la,a} \
63                 $(1)/usr/lib/
64
65         $(INSTALL_DATA) \
66                 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
67                 $(1)/usr/lib/pkgconfig/
68
69         $(INSTALL_DATA) \
70                 $(PKG_INSTALL_DIR)/usr/include/X11/* \
71                 $(1)/usr/include/X11/
72 endef
73
74 define Package/libX11/install
75         $(INSTALL_DIR) $(1)/usr/lib
76         $(CP) \
77                 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
78                 $(1)/usr/lib/
79 endef
80
81 $(eval $(call Feature,libX11))
82 $(eval $(call BuildPackage,libX11))