a7e89971bbd73c5ea4664e24ca315a7aad083704
[packages.git] / XOrg / server / xorg-server-X11R7.2 / 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 # blogic@openwrt.org
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=xorg-server
12 PKG_RELEASE:=1
13 PKG_VERSION:=X11R7.2-1.2.0
14 PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/X11R7.2/src/xserver/
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_BUILD_DIR=$(BUILD_DIR)/Xorg/server/xorg-server-$(PKG_VERSION)/
17
18 include $(INCLUDE_DIR)/package.mk
19
20 EXTRA_CFLAGS+= -I${STAGING_DIR}/usr/include/X11/GL -I${STAGING_DIR}/usr/include/X11/dri/ -I${STAGING_DIR}/usr/include/X11/ -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
21
22 CONFIGURE_ARGS_KDRIVE=--enable-composite --enable-kdrive \
23                 --disable-dga --disable-dri --disable-xinerama \
24                 --disable-xf86misc --disable-xf86vidmode \
25                 --disable-xorg --disable-xorgcfg \
26                 --disable-xkb --disable-xnest --disable-xvfb \
27                 --disable-xevie --disable-xprint --disable-xtrap \
28                 --disable-dmx --disable-w100 \
29                 --with-default-font-path=built-ins \
30                 --enable-tslib --enable-xcalibrate 
31
32 CONFIGURE_VARS+=ac_cv_file__usr_share_sgml_X11_defs_ent=yes 
33 CONFIGURE_ARGS+=$(if $(CONFIG_XORG_BUILD_KDRIVE), $(CONFIGURE_ARGS_KDRIVE))
34
35 DEPENDS_SERVER:=+calibrateproto \
36                 +compositeproto \
37                 +damageproto \
38                 +fixesproto \
39                 +recordproto \
40                 +resourceproto \
41                 +scrnsaverproto \
42                 +videoproto \
43                 +xextproto \
44                 +xproto \
45                 +libXext \
46                 +libXdmcp \
47                 +libXfont \
48                 +libXrandr \
49                 +xtrans \
50                 +libX11 \
51                 +glproto \
52                 +xf86driproto \
53                 +applewmproto \
54                 +dmxproto \
55                 +printproto \
56                 +windowswmproto \
57                 +xf86rushproto \
58                 +xproxymanagementprotocol \
59                 +libdrm \
60                 +xf86miscproto \
61                 +xf86vidmodeproto \
62                 +xf86dgaproto \
63                 +trapproto \
64                 +xineramaproto \
65                 +evieext \
66                 +libxkbfile \
67                 +libXt \
68                 +libSM \
69                 +libxkbui \
70                 +libXxf86misc \
71                 +libXxf86vm \
72                 +libXaw \
73                 +libXmu \
74                 +libXpm \
75                 +libnotimpl \
76                 +Mesa \
77                 @DISPLAY_SUPPORT
78
79 DEPENDS_KDRIVE:=+calibrateproto \
80                 +compositeproto \
81                 +damageproto \
82                 +fixesproto \
83                 +recordproto \
84                 +resourceproto \
85                 +scrnsaverproto \
86                 +videoproto \
87                 +xextproto \
88                 +xproto \
89                 +libXext \
90                 +libXdmcp \
91                 +libXfont \
92                 +libXrandr \
93                 +xtrans \
94                 +libX11 \
95                 @DISPLAY_SUPPORT 
96
97 define Package/xorg-server/config
98         config XORG_BUILD_KDRIVE
99                 bool "Build kdrive instead of xserver"
100                 depends PACKAGE_xorg-server
101 endef
102
103 define Package/xorg-server/Default
104   SECTION:=xorg-server
105   CATEGORY:=Xorg
106   URL:=http://xorg.freedesktop.org/
107 endef
108
109 define Package/xorg-server
110 $(call Package/xorg-server/Default) 
111   TITLE:=Xorg server
112   MENU:=1
113   DEPENDS:=$(if $(CONFIG_XORG_BUILD_KDRIVE), $(DEPENDS_KDRIVE), $(DEPENDS_SERVER))
114 endef
115
116 define Package/xorg-server-config
117 $(call Package/xorg-server/Default) 
118   TITLE:=Xorg server configuration tools 
119   DEPENDS:=xorg-server
120 endef
121
122 define Build/Configure
123         (cd $(PKG_BUILD_DIR) \
124                 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
125                 $(CONFIGURE_VARS) \
126                 $(CONFIGURE_CMD) \
127                 $(CONFIGURE_ARGS_XTRA) \
128                 $(CONFIGURE_ARGS) \
129                 --with-default-font-path=built-ins \
130                 );
131 endef
132
133 define Build/Compile
134         $(MAKE) -C $(PKG_BUILD_DIR)
135         $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
136
137 endef
138
139 define Package/xorg-server/install
140         $(INSTALL_DIR) $(1)/usr/bin
141         $(CP) $(PKG_INSTALL_DIR)/usr/bin/Xorg $(1)/usr/bin/
142         cd $(1)/usr/bin; ln -s Xorg X
143         $(INSTALL_DIR) $(1)/usr/share
144         $(CP) $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/
145         $(INSTALL_DIR) $(1)/usr/lib/xserver
146         $(CP) $(PKG_INSTALL_DIR)/usr/lib/xserver/* $(1)/usr/lib/xserver
147         $(INSTALL_DIR) $(1)/usr/lib/xorg/
148         $(CP) -r $(PKG_INSTALL_DIR)/usr/lib/xorg/* $(1)/usr/lib/xorg/
149         find $(1)/usr/lib/xorg/ -name *.la | xargs rm -rf
150         $(INSTALL_DIR) $(1)/usr/lib/X11/
151         $(CP) -r $(PKG_INSTALL_DIR)/usr/lib/X11/* $(1)/usr/lib/X11/
152         rm -rf $(1)/usr/share/X11 $(1)/usr/lib/X11/xserver      
153         $(INSTALL_DIR) $(1)/var/log/
154         $(INSTALL_DIR) $(1)/etc/X11/
155         $(CP) files/xorg.conf $(1)/etc/X11/
156 endef
157
158 define Packages/xorg-server-config/install
159         $(INSTALL_DIR) $(1)/usr/bin
160     $(CP) $(PKG_INSTALL_DIR)/usr/bin/xorgconfig $(1)/usr/bin/
161 endef
162
163 define Build/InstallDev
164         $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
165         $(CP) $(PKG_BUILD_DIR)/xorg-server.pc $(1)/usr/lib/pkgconfig/
166 endef
167
168 $(eval $(call BuildPackage,xorg-server))
169 $(eval $(call BuildPackage,xorg-server-config))