xref: /OK3568_Linux_fs/buildroot/package/x11r7/xserver_xorg-server/xserver_xorg-server.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# xserver_xorg-server
4#
5################################################################################
6
7XSERVER_XORG_SERVER_VERSION = 21.1.4_2023_04_07
8XSERVER_XORG_SERVER_SITE = $(call github,JeffyCN,xorg-xserver,$(XSERVER_XORG_SERVER_VERSION))
9XSERVER_XORG_SERVER_LICENSE = MIT
10XSERVER_XORG_SERVER_LICENSE_FILES = COPYING
11XSERVER_XORG_SERVER_SELINUX_MODULES = xdg xserver
12XSERVER_XORG_SERVER_INSTALL_STAGING = YES
13# xfont_font-util is needed only for autoreconf
14XSERVER_XORG_SERVER_AUTORECONF = YES
15XSERVER_XORG_SERVER_DEPENDENCIES = \
16	xfont_font-util \
17	xutil_util-macros \
18	xlib_libX11 \
19	xlib_libXau \
20	xlib_libXdmcp \
21	xlib_libXext \
22	xlib_libXfixes \
23	xlib_libXfont2 \
24	xlib_libXi \
25	xlib_libXrender \
26	xlib_libXres \
27	xlib_libXft \
28	xlib_libXcursor \
29	xlib_libXinerama \
30	xlib_libXrandr \
31	xlib_libXdamage \
32	xlib_libXxf86vm \
33	xlib_libxkbfile \
34	xlib_libxcvt \
35	xlib_xtrans \
36	xdata_xbitmaps \
37	xorgproto \
38	xkeyboard-config \
39	pixman \
40	mcookie \
41	host-pkgconf
42
43ifeq ($(BR2_PREFER_ROCKCHIP_RGA),y)
44XSERVER_XORG_SERVER_DEPENDENCIES += rockchip-rga
45endif
46
47# We force -O2 regardless of the optimization level chosen by the
48# user, as the X.org server is known to trigger some compiler bugs at
49# -Os on several architectures.
50XSERVER_XORG_SERVER_CONF_OPTS = \
51	--disable-config-hal \
52	--enable-record \
53	--disable-xnest \
54	--disable-unit-tests \
55	--with-builder-addr=buildroot@buildroot.org \
56	CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/pixman-1 -O2" \
57	--with-fontrootdir=/usr/share/fonts/X11/ \
58	--$(if $(BR2_PACKAGE_XSERVER_XORG_SERVER_XEPHYR),en,dis)able-xephyr \
59	--$(if $(BR2_PACKAGE_XSERVER_XORG_SERVER_XVFB),en,dis)able-xvfb \
60	--disable-xwayland
61
62ifeq ($(BR2_PACKAGE_SYSTEMD),y)
63XSERVER_XORG_SERVER_CONF_OPTS += \
64	--with-systemd-daemon \
65	--enable-systemd-logind
66XSERVER_XORG_SERVER_DEPENDENCIES += \
67	systemd
68else
69XSERVER_XORG_SERVER_CONF_OPTS += \
70	--without-systemd-daemon \
71	--disable-systemd-logind
72endif
73
74ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR),y)
75XSERVER_XORG_SERVER_CONF_OPTS += --enable-xorg
76XSERVER_XORG_SERVER_DEPENDENCIES += libpciaccess
77ifeq ($(BR2_PACKAGE_LIBDRM),y)
78XSERVER_XORG_SERVER_DEPENDENCIES += libdrm
79XSERVER_XORG_SERVER_CONF_OPTS += --enable-libdrm
80else
81XSERVER_XORG_SERVER_CONF_OPTS += --disable-libdrm
82endif
83else
84XSERVER_XORG_SERVER_CONF_OPTS += --disable-xorg
85endif
86
87ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_KDRIVE),y)
88XSERVER_XORG_SERVER_CONF_OPTS += \
89	--enable-kdrive \
90	--disable-glx \
91	--disable-dri
92
93ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_XEPHYR),y)
94XSERVER_XORG_SERVER_DEPENDENCIES += \
95	xcb-util-image \
96	xcb-util-keysyms \
97	xcb-util-renderutil \
98	xcb-util-wm
99endif
100else # modular
101XSERVER_XORG_SERVER_CONF_OPTS += --disable-kdrive
102endif
103
104ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
105XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri --enable-glx
106XSERVER_XORG_SERVER_DEPENDENCIES += libgl
107else
108XSERVER_XORG_SERVER_CONF_OPTS += --disable-dri --disable-glx
109endif
110
111# Optional packages
112ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
113XSERVER_XORG_SERVER_DEPENDENCIES += udev
114XSERVER_XORG_SERVER_CONF_OPTS += --enable-config-udev
115# udev kms support depends on libdrm and dri2
116ifeq ($(BR2_PACKAGE_LIBDRM),y)
117XSERVER_XORG_SERVER_CONF_OPTS += --enable-config-udev-kms
118else
119XSERVER_XORG_SERVER_CONF_OPTS += --disable-config-udev-kms
120endif
121endif
122
123ifeq ($(BR2_PACKAGE_DBUS),y)
124XSERVER_XORG_SERVER_DEPENDENCIES += dbus
125XSERVER_XORG_SERVER_CONF_OPTS += --enable-config-dbus
126endif
127
128ifeq ($(BR2_PACKAGE_FREETYPE),y)
129XSERVER_XORG_SERVER_DEPENDENCIES += freetype
130endif
131
132ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
133XSERVER_XORG_SERVER_DEPENDENCIES += libunwind
134XSERVER_XORG_SERVER_CONF_OPTS += --enable-libunwind
135else
136XSERVER_XORG_SERVER_CONF_OPTS += --disable-libunwind
137endif
138
139ifneq ($(BR2_PACKAGE_XLIB_LIBXVMC),y)
140XSERVER_XORG_SERVER_CONF_OPTS += --disable-xvmc
141endif
142
143ifeq ($(BR2_PACKAGE_XLIB_LIBXCOMPOSITE),y)
144XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libXcomposite
145else
146XSERVER_XORG_SERVER_CONF_OPTS += --disable-composite
147endif
148
149ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR),y)
150XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri2
151ifeq ($(BR2_PACKAGE_XLIB_LIBXSHMFENCE),y)
152XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libxshmfence
153XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri3
154ifeq ($(BR2_PACKAGE_HAS_LIBEGL)$(BR2_PACKAGE_LIBEPOXY),yy)
155XSERVER_XORG_SERVER_DEPENDENCIES += libepoxy
156XSERVER_XORG_SERVER_CONF_OPTS += --enable-glamor
157else
158XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor
159endif
160else
161XSERVER_XORG_SERVER_CONF_OPTS += --disable-dri3 --disable-glamor
162endif
163else
164XSERVER_XORG_SERVER_CONF_OPTS += --disable-dri2 --disable-dri3 --disable-glamor
165endif
166
167ifeq ($(BR2_PACKAGE_XLIB_LIBXSCRNSAVER),y)
168XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libXScrnSaver
169XSERVER_XORG_SERVER_CONF_OPTS += --enable-screensaver
170else
171XSERVER_XORG_SERVER_CONF_OPTS += --disable-screensaver
172endif
173
174ifeq ($(BR2_PACKAGE_OPENSSL),y)
175XSERVER_XORG_SERVER_CONF_OPTS += --with-sha1=libcrypto
176XSERVER_XORG_SERVER_DEPENDENCIES += openssl
177else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
178XSERVER_XORG_SERVER_CONF_OPTS += --with-sha1=libgcrypt
179XSERVER_XORG_SERVER_DEPENDENCIES += libgcrypt
180else
181XSERVER_XORG_SERVER_CONF_OPTS += --with-sha1=libsha1
182XSERVER_XORG_SERVER_DEPENDENCIES += libsha1
183endif
184
185define XSERVER_XORG_SERVER_INSTALL_INIT_SYSTEMD
186	$(INSTALL) -D -m 0644 package/x11r7/xserver_xorg-server/xorg.service \
187		$(TARGET_DIR)/usr/lib/systemd/system/xorg.service
188endef
189
190# init script conflicts with S90nodm
191ifneq ($(BR2_PACKAGE_NODM),y)
192define XSERVER_XORG_SERVER_INSTALL_INIT_SYSV
193	$(INSTALL) -D -m 755 package/x11r7/xserver_xorg-server/S40xorg \
194		$(TARGET_DIR)/etc/init.d/S40xorg
195endef
196endif
197
198define XSERVER_XORG_SERVER_INSTALL_TARGET_ENV
199        $(INSTALL) -D -m 0644 $(XSERVER_XORG_SERVER_PKGDIR)/x11.sh \
200                $(TARGET_DIR)/etc/profile.d/x11.sh
201endef
202XSERVER_XORG_SERVER_POST_INSTALL_TARGET_HOOKS += XSERVER_XORG_SERVER_INSTALL_TARGET_ENV
203
204define XSERVER_XORG_SERVER_INSTALL_MODESETTING_CONFIG
205	$(INSTALL) -D -m 0644 $(XSERVER_XORG_SERVER_PKGDIR)/20-modesetting.conf \
206		$(TARGET_DIR)/usr/share/X11/xorg.conf.d/20-modesetting.conf
207endef
208XSERVER_XORG_SERVER_POST_INSTALL_TARGET_HOOKS += XSERVER_XORG_SERVER_INSTALL_MODESETTING_CONFIG
209
210$(eval $(autotools-package))
211