1 ################################################################################
5 ################################################################################
7 FREERDP_VERSION = 2.0.0-rc0
8 FREERDP_SITE = $(call github,FreeRDP,FreeRDP,$(FREERDP_VERSION))
9 FREERDP_DEPENDENCIES = libglib2 openssl zlib
10 FREERDP_LICENSE = Apache-2.0
11 FREERDP_LICENSE_FILES = LICENSE
13 FREERDP_INSTALL_STAGING = YES
15 FREERDP_CONF_OPTS = -DWITH_MANPAGES=OFF -Wno-dev
17 ifeq ($(BR2_PACKAGE_FREERDP_GSTREAMER),y)
18 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_0_10=ON
19 FREERDP_DEPENDENCIES += gstreamer gst-plugins-base libxml2
21 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_0_10=OFF
24 ifeq ($(BR2_PACKAGE_FREERDP_GSTREAMER1),y)
25 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_1_0=ON
26 FREERDP_DEPENDENCIES += gstreamer1 gst1-plugins-base
28 FREERDP_CONF_OPTS += -DWITH_GSTREAMER_1_0=OFF
31 ifeq ($(BR2_PACKAGE_CUPS),y)
32 FREERDP_CONF_OPTS += -DWITH_CUPS=ON
33 FREERDP_DEPENDENCIES += cups
35 FREERDP_CONF_OPTS += -DWITH_CUPS=OFF
38 ifeq ($(BR2_PACKAGE_FFMPEG),y)
39 FREERDP_CONF_OPTS += -DWITH_FFMPEG=ON
40 FREERDP_DEPENDENCIES += ffmpeg
42 FREERDP_CONF_OPTS += -DWITH_FFMPEG=OFF
45 ifeq ($(BR2_PACKAGE_ALSA_LIB_MIXER),y)
46 FREERDP_CONF_OPTS += -DWITH_ALSA=ON
47 FREERDP_DEPENDENCIES += alsa-lib
49 FREERDP_CONF_OPTS += -DWITH_ALSA=OFF
52 ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
53 FREERDP_CONF_OPTS += -DWITH_PULSEAUDIO=ON
54 FREERDP_DEPENDENCIES += pulseaudio
56 FREERDP_CONF_OPTS += -DWITH_PULSEAUDIO=OFF
59 # For the systemd journal
60 ifeq ($(BR2_PACKAGE_SYSTEMD),y)
61 FREERDP_CONF_OPTS += -DWITH_LIBSYSTEMD=ON
62 FREERDP_DEPENDENCIES += systemd
64 FREERDP_CONF_OPTS += -DWITH_LIBSYSTEMD=OFF
67 ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
68 FREERDP_CONF_OPTS += -DWITH_NEON=ON
70 FREERDP_CONF_OPTS += -DWITH_NEON=OFF
73 ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
74 FREERDP_CONF_OPTS += -DWITH_SSE2=ON
76 FREERDP_CONF_OPTS += -DWITH_SSE2=OFF
79 ifeq ($(BR2_arm)$(BR2_armeb),y)
80 FREERDP_CONF_OPTS += -DARM_FP_ABI=$(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
83 #---------------------------------------
84 # Enabling server and/or client
86 # Clients and server interface must always be enabled to build the
87 # corresponding libraries.
88 FREERDP_CONF_OPTS += -DWITH_SERVER_INTERFACE=ON
89 FREERDP_CONF_OPTS += -DWITH_CLIENT_INTERFACE=ON
91 ifeq ($(BR2_PACKAGE_FREERDP_SERVER),y)
92 FREERDP_CONF_OPTS += -DWITH_SERVER=ON
95 ifneq ($(BR2_PACKAGE_FREERDP_CLIENT_X11)$(BR2_PACKAGE_FREERDP_CLIENT_WL),)
96 FREERDP_CONF_OPTS += -DWITH_CLIENT=ON
99 #---------------------------------------
100 # Libraries for client and/or server
102 # The FreeRDP buildsystem uses non-orthogonal options. For example it
103 # is not possible to build the server and the wayland client without
104 # also building the X client. That's because the dependencies of the
105 # server (the X libraries) are a superset of those of the X client.
106 # So, as soon as FreeRDP is configured for the server and the wayland
107 # client, it will believe it also has to build the X client, because
108 # the libraries it needs are enabled.
110 # Furthermore, the shadow server is always built, even if there's nothing
111 # it can serve (i.e. the X libs are disabled).
113 # So, we do not care whether we build too much; we remove, as
114 # post-install hooks, whatever we do not want.
116 # If Xorg is enabled, and the server or the X client are, then libX11
117 # and libXext are forcibly enabled at the Kconfig level. However, if
118 # Xorg is enabled but neither the server nor the X client are, then
119 # there's nothing that guarantees those two libs are enabled. So we
120 # really must check for them.
121 ifeq ($(BR2_PACKAGE_XLIB_LIBX11)$(BR2_PACKAGE_XLIB_LIBXEXT),yy)
122 FREERDP_DEPENDENCIES += xlib_libX11 xlib_libXext
123 FREERDP_CONF_OPTS += -DWITH_X11=ON
125 FREERDP_CONF_OPTS += -DWITH_X11=OFF
128 # The following libs are either optional or mandatory only for either
129 # the server or the client. A mandatory library for either one is
130 # selected from Kconfig, so we can make it conditional here
131 ifeq ($(BR2_PACKAGE_XLIB_LIBXCURSOR),y)
132 FREERDP_CONF_OPTS += -DWITH_XCURSOR=ON
133 FREERDP_DEPENDENCIES += xlib_libXcursor
135 FREERDP_CONF_OPTS += -DWITH_XCURSOR=OFF
138 ifeq ($(BR2_PACKAGE_XLIB_LIBXDAMAGE),y)
139 FREERDP_CONF_OPTS += -DWITH_XDAMAGE=ON
140 FREERDP_DEPENDENCIES += xlib_libXdamage
142 FREERDP_CONF_OPTS += -DWITH_XDAMAGE=OFF
145 ifeq ($(BR2_PACKAGE_XLIB_LIBXFIXES),y)
146 FREERDP_CONF_OPTS += -DWITH_XFIXES=ON
147 FREERDP_DEPENDENCIES += xlib_libXfixes
149 FREERDP_CONF_OPTS += -DWITH_XFIXES=OFF
152 ifeq ($(BR2_PACKAGE_XLIB_LIBXI),y)
153 FREERDP_CONF_OPTS += -DWITH_XI=ON
154 FREERDP_DEPENDENCIES += xlib_libXi
156 FREERDP_CONF_OPTS += -DWITH_XI=OFF
159 ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA),y)
160 FREERDP_CONF_OPTS += -DWITH_XINERAMA=ON
161 FREERDP_DEPENDENCIES += xlib_libXinerama
163 FREERDP_CONF_OPTS += -DWITH_XINERAMA=OFF
166 ifeq ($(BR2_PACKAGE_XLIB_LIBXKBFILE),y)
167 FREERDP_CONF_OPTS += -DWITH_XKBFILE=ON
168 FREERDP_DEPENDENCIES += xlib_libxkbfile
170 FREERDP_CONF_OPTS += -DWITH_XKBFILE=OFF
173 ifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR),y)
174 FREERDP_CONF_OPTS += -DWITH_XRANDR=ON
175 FREERDP_DEPENDENCIES += xlib_libXrandr
177 FREERDP_CONF_OPTS += -DWITH_XRANDR=OFF
180 ifeq ($(BR2_PACKAGE_XLIB_LIBXRENDER),y)
181 FREERDP_CONF_OPTS += -DWITH_XRENDER=ON
182 FREERDP_DEPENDENCIES += xlib_libXrender
184 FREERDP_CONF_OPTS += -DWITH_XRENDER=OFF
187 ifeq ($(BR2_PACKAGE_XLIB_LIBXTST),y)
188 FREERDP_CONF_OPTS += -DWITH_XTEST=ON
189 FREERDP_DEPENDENCIES += xlib_libXtst
191 FREERDP_CONF_OPTS += -DWITH_XTEST=OFF
194 ifeq ($(BR2_PACKAGE_XLIB_LIBXV),y)
195 FREERDP_CONF_OPTS += -DWITH_XV=ON
196 FREERDP_DEPENDENCIES += xlib_libXv
198 FREERDP_CONF_OPTS += -DWITH_XV=OFF
201 ifeq ($(BR2_PACKAGE_WAYLAND),y)
202 FREERDP_DEPENDENCIES += wayland
203 FREERDP_CONF_OPTS += -DWITH_WAYLAND=ON
205 FREERDP_CONF_OPTS += -DWITH_WAYLAND=OFF
208 #---------------------------------------
209 # Post-install hooks to cleanup and install missing stuff
211 # Shadow server is always installed, no matter what, so we manually
212 # remove it if the user does not want the server.
213 ifeq ($(BR2_PACKAGE_FREERDP_SERVER),)
214 define FREERDP_RM_SHADOW_SERVER
215 rm -f $(TARGET_DIR)/usr/bin/freerdp-shadow
217 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_RM_SHADOW_SERVER
220 # X client is always built as soon as a client is enabled and the
221 # necessary libs are enabled (e.g. because of the server), so manually
222 # remove it if the user does not want it.
223 ifeq ($(BR2_PACKAGE_FREERDP_CLIENT_X11),)
224 define FREERDP_RM_CLIENT_X11
225 rm -f $(TARGET_DIR)/usr/bin/xfreerdp
226 rm -f $(TARGET_DIR)/usr/lib/libxfreerdp-client*
228 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_RM_CLIENT_X11
229 define FREERDP_RM_CLIENT_X11_LIB
230 rm -f $(STAGING_DIR)/usr/lib/libxfreerdp-client*
232 FREERDP_POST_INSTALL_STAGING_HOOKS += FREERDP_RM_CLIENT_X11_LIB
235 # Wayland client is always built as soon as wayland is enabled, so
236 # manually remove it if the user does not want it.
237 ifeq ($(BR2_PACKAGE_FREERDP_CLIENT_WL),)
238 define FREERDP_RM_CLIENT_WL
239 rm -f $(TARGET_DIR)/usr/bin/wlfreerdp
241 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_RM_CLIENT_WL
244 # Remove static libraries in unusual dir
245 define FREERDP_CLEANUP
246 rm -rf $(TARGET_DIR)/usr/lib/freerdp
248 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_CLEANUP
250 # Install the server key and certificate, so that a client can connect.
251 # A user can override them with its own in a post-build script, if needed.
252 # We install them even if the server is not enabled, since another server
253 # can be built and linked with libfreerdp (e.g. weston with the RDP
254 # backend). Key and cert are installed world-readable, so non-root users
255 # can start a server.
256 define FREERDP_INSTALL_KEYS
257 $(INSTALL) -m 0644 -D $(@D)/server/Sample/server.key \
258 $(TARGET_DIR)/etc/freerdp/keys/server.key
259 $(INSTALL) -m 0644 -D $(@D)/server/Sample/server.crt \
260 $(TARGET_DIR)/etc/freerdp/keys/server.crt
262 FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_INSTALL_KEYS
264 $(eval $(cmake-package))