2 # debian/rules for the Debian xorg-server package.
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
4 # Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
5 # Copyright © 2005 David Nusinow <dnusinow@debian.org>
7 # Uncomment this to turn on verbose mode.
10 # Set up the $(STAMP_DIR) directory, and use it for quilt' stamp:
12 QUILT_STAMPFN
:= $(STAMP_DIR
)/patch
13 $(STAMP_DIR
)/stampdir
:
17 include /usr
/share
/quilt
/quilt.make
19 ifneq (,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
20 NUMJOBS
= $(patsubst parallel
=%,%,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
21 MAKEFLAGS
+= -j
$(NUMJOBS
)
24 DEB_HOST_MULTIARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_MULTIARCH
)
25 DEB_HOST_ARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH
)
26 DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
27 DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
28 DEB_HOST_ARCH_OS ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH_OS
)
29 ifeq ($(DEB_BUILD_GNU_TYPE
), $(DEB_HOST_GNU_TYPE
))
30 confflags
+= --build
=$(DEB_HOST_GNU_TYPE
)
32 confflags
+= --build
=$(DEB_BUILD_GNU_TYPE
) --host
=$(DEB_HOST_GNU_TYPE
)
35 # udeb is arch-dependent...
36 ifneq (, $(filter %-udeb
, $(shell dh_listpackages
-s
)))
40 # ...but let's support disabling it to speed up debug builds:
41 ifneq (,$(filter noudeb
,$(DEB_BUILD_OPTIONS
)))
43 DH_INSTALL_OPTIONS
= -Nxserver-xorg-core-udeb
47 ifeq ($(DEB_HOST_ARCH_OS
), linux
)
48 selinux
= --enable-xselinux
49 build_xmir
= --enable-xmir
51 selinux
= --disable-xselinux
54 # Mir isn't built on PPC
55 ifneq (,$(filter $(DEB_HOST_ARCH
), arm64 powerpc ppc64el
))
56 build_xmir
= --disable-xmir
59 ifeq ($(DEB_HOST_ARCH_OS
), hurd
)
60 dri
= --disable-dri
--disable-dri2
--disable-dri3
62 dri
= --enable-dri
--enable-dri2
63 ifeq ($(DEB_HOST_ARCH_OS
), linux
)
66 # disable dri3 on kbsd until xtrans fd passing is enabled
71 config_backend
= --disable-config-dbus
--disable-config-hal
72 ifeq ($(DEB_HOST_ARCH_OS
), linux
)
73 config_backend
+= --enable-config-udev
74 else ifeq ($(DEB_HOST_ARCH_OS
), kfreebsd
)
75 config_backend
+= --disable-config-udev
--enable-config-devd
76 libs
= $(shell pkg-config
--libs libbsd-overlay
)
77 cppflags = $(shell pkg-config
--cflags libbsd-overlay
)
79 config_backend
+= --disable-config-udev
82 vars
= $(shell DEB_BUILD_MAINT_OPTIONS
="hardening=+pie" DEB_LDFLAGS_MAINT_APPEND
="-Wl,-Bsymbolic" DEB_CPPFLAGS_MAINT_APPEND
="-DPRE_RELEASE=0 $(cppflags)" dpkg-buildflags
--export=configure
) LIBS
="$(libs)"
84 ifneq (,$(filter nocheck
, $(DEB_BUILD_OPTIONS
)))
85 config_tests
= --disable-unit-tests
87 config_tests
= --enable-unit-tests
90 INSTALL
=/usr
/bin
/install
92 VENDOR
= $(shell lsb_release
-i
-s
)
93 SUPPORT
= For technical support please see http
://www.ubuntu.com
/support
95 SOURCE_NAME
:= xorg-server
96 SOURCE_VERSION
:= $(shell dpkg-parsechangelog | awk
-F
': ' '/^Version: / {print $$2}')
98 # Add a workaround for LP: #1266492
99 confflags
+= lt_cv_prog_compiler_static_works
=no
101 # Add a workaround for LP: #1266492
102 confflags
+= lt_cv_prog_compiler_static_works
=no
104 # disable-static is so we don't get libfoo.a for modules. now if only we could
107 --disable-silent-rules \
110 --disable-strict-compilation \
113 --with-int10
=x86emu \
114 --with-extra-module-dir
="/usr/lib/${DEB_HOST_MULTIARCH}/xorg/extra-modules,/usr/lib/xorg/extra-modules" \
115 --with-os-vendor
="$(VENDOR)" \
116 --with-builderstring
="$(SOURCE_NAME) $(SOURCE_VERSION) ($(SUPPORT))" \
117 --with-xkb-path
=/usr
/share
/X11
/xkb \
118 --with-xkb-output
=/var
/lib
/xkb \
119 --disable-install-libxf86config \
122 --disable-xcsecurity \
125 --disable-xf86bigfont \
129 --disable-linux-acpi \
130 --disable-linux-apm \
135 --disable-install-setuid
138 --with-default-font-path
="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
147 --enable-screensaver \
149 --enable-xdm-auth-1 \
154 --enable-xf86vidmode \
157 --enable-xfree86-utils \
165 --with-sha1
=libgcrypt \
166 --enable-xcsecurity \
167 $(config_backend_main
) \
171 --with-default-font-path
="built-ins" \
175 --disable-composite \
180 --disable-screensaver \
182 --disable-xdm-auth-1 \
187 --disable-xf86vidmode \
190 --disable-xfree86-utils \
198 --with-sha1
=libnettle \
199 $(config_backend_udeb
) \
202 $(QUILT_STAMPFN
): $(STAMP_DIR
)/stampdir
204 $(STAMP_DIR
)/autoreconf
: $(STAMP_DIR
)/stampdir
$(QUILT_STAMPFN
)
209 $(STAMP_DIR
)/build-source
: $(STAMP_DIR
)/autoreconf
210 mkdir
-p build-source
212 --owner
=0 --group
=0 \
213 --transform
's,^,xorg-server/,' \
214 --exclude
=stampdir
--exclude
=debian \
215 --exclude
=build-
* --exclude
=autom4te.cache \
216 -cf
- * | xz
> build-source
/xorg-server.
tar.xz
219 $(STAMP_DIR
)/configure-
%: $(STAMP_DIR
)/autoreconf
225 --mandir=\
$${prefix}/share
/man \
226 --infodir=\
$${prefix}/share
/info \
228 --localstatedir
=/var \
234 $(STAMP_DIR
)/build-
%: $(STAMP_DIR
)/configure-
%
236 cd build-
$* && $(MAKE
)
239 $(STAMP_DIR
)/tests-
%: $(STAMP_DIR
)/build-
%
240 cd build-
$* && $(MAKE
) check VERBOSE
=1
244 build
: $(STAMP_DIR
)/build-main
245 build
: $(STAMP_DIR
)/tests-main
247 build
: $(STAMP_DIR
)/build-udeb
248 build
: $(STAMP_DIR
)/tests-udeb
251 build-indep
: $(STAMP_DIR
)/build-source build
256 rm -f config.cache config.log config.status
257 rm -f
*/config.cache
*/config.log
*/config.status
258 rm -f conftest
* */conftest
*
259 rm -rf autom4te.cache
*/autom4te.cache
261 rm -f compile config.guess config.sub configure depcomp install-sh
262 rm -f ltmain.sh missing INSTALL aclocal.m4 ylwrap
263 rm -f
include/do-not-use-config.h.in
264 rm -f m4
/lt
*.m4 m4
/libtool.m4
265 find
-name Makefile.in
-delete
275 cd build-main
&& $(MAKE
) DESTDIR
=$(CURDIR
)/debian
/tmp
/main
install
277 cd build-udeb
&& $(MAKE
) DESTDIR
=$(CURDIR
)/debian
/tmp
/udeb
install
281 find debian
/tmp
/*/usr
/lib
/xorg
-type f
-name
'*.la' | \
284 # remove modules not needed in d-i
285 rm -rf debian
/tmp
/udeb
/usr
/lib
/xorg
/modules
/multimedia
286 rm -f debian
/tmp
/udeb
/usr
/lib
/xorg
/modules
/libxaa.so
287 rm -f debian
/tmp
/udeb
/usr
/lib
/xorg
/modules
/libexa.so
288 rm -f debian
/tmp
/udeb
/usr
/lib
/xorg
/modules
/libwfb.so
289 rm -f debian
/tmp
/udeb
/usr
/lib
/xorg
/modules
/libxf8_16bpp.so
291 # we don't ship these from the udeb build, reduce noise from dh_install
293 rm -rf debian
/tmp
/udeb
/usr
/include
294 rm -rf debian
/tmp
/udeb
/usr
/share
/aclocal
295 rm -rf debian
/tmp
/udeb
/usr
/share
/man
296 rm -rf debian
/tmp
/udeb
/usr
/lib
/pkgconfig
298 install -m
755 debian
/local
/xvfb-run debian
/tmp
/main
/usr
/bin
299 # Make sure Xvfb at least starts up
300 PATH
=debian
/tmp
/main
/usr
/bin
/:/bin
:/usr
/bin \
301 debian
/tmp
/main
/usr
/bin
/xvfb-run
-s
"-screen 0 1280x1024x24 -nolisten tcp -noreset" true
303 install debian
/local
/xvfb-run
.1 debian
/tmp
/main
/usr
/share
/man
/man1
304 ifneq ($(DEB_HOST_ARCH_OS
), linux
)
305 install -d debian
/tmp
/main
/usr
/share
/X11
/xorg.conf.d
306 install -m
644 debian
/local
/10-*.conf debian
/tmp
/main
/usr
/share
/X11
/xorg.conf.d
308 install -d debian
/tmp
/udeb
/usr
/share
/X11
/xorg.conf.d
309 install -m
644 debian
/local
/10-*.conf debian
/tmp
/udeb
/usr
/share
/X11
/xorg.conf.d
313 # stub to start building deb files, used by binary-indep and binary-arch
318 # stub to build deb files, used by binary-indep and binary-arch
329 # Only read the first line, the rest of the file is used to determine
330 # when the minimal version as to be bumped:
331 SERVERMINVER
= debian
/serverminver
332 serverminver
= $(shell head
-1 $(SERVERMINVER
))
335 abibumpcheck
: debian
/serverminver
$(QUILT_STAMPFN
)
336 @echo Checking for the need of an ABI bump
337 # Build an updated version of the file:
338 head
-1 $(SERVERMINVER
) > $(SERVERMINVER
).new
339 perl
-ne
'print "$$1:$$2.$$3\n" if /^#define\s+(ABI_(?:VIDEODRV|XINPUT)_VERSION)\s+SET_ABI_VERSION\(\s*(\d+)\s*,\s*(\d+)\s*\)/' hw
/xfree86
/common
/xf86Module.h|
sort >> $(SERVERMINVER
).new
340 # Compare both files:
341 @if
! cmp
--quiet
$(SERVERMINVER
) $(SERVERMINVER
).new
; then \
342 echo
"serverminver bump required, ABI changed!";\
343 echo
"When bumping major or minor, always bump required xorg-server minimum";\
344 echo
"version too, the newly built drivers are not backwards compatible!";\
345 diff
-u
$(SERVERMINVER
) $(SERVERMINVER
).new
; \
348 echo
"ABI unchanged"; \
349 rm -f
$(SERVERMINVER
).new
; \
352 # Build architecture-dependent files here.
353 binary-arch
: build
install
354 $(MAKE
) -f debian
/rules DH_OPTIONS
=-s binary-initial
357 dh_installchangelogs
-s
358 dh_install
$(DH_INSTALL_OPTIONS
) -s
--list-missing
359 $(INSTALL
) -d
$(CURDIR
)/debian
/xserver-xorg-dev
/usr
/share
/xserver-xorg
360 # Extract only the major ABI version:
361 abi_videodrv
=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig pkg-config --variable=abi_videodrv xorg-server|cut -d . -f 1`; \
362 echo videoabi
=xorg-video-abi-
$$abi_videodrv > debian
/xserver-xorg-core.substvars
&& \
363 echo
"xorg-video-abi-$$abi_videodrv, xserver-xorg-core (>= $(serverminver))" > debian
/xserver-xorg-dev
/usr
/share
/xserver-xorg
/videodrvdep
364 abi_xinput
=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig pkg-config --variable=abi_xinput xorg-server|cut -d . -f 1`; \
365 echo inputabi
=xorg-input-abi-
$$abi_xinput >> debian
/xserver-xorg-core.substvars
&& \
366 echo
"xorg-input-abi-$$abi_xinput, xserver-xorg-core (>= $(serverminver))" > debian
/xserver-xorg-dev
/usr
/share
/xserver-xorg
/xinputdep
368 # The udeb uses the same substvars:
369 cp debian
/xserver-xorg-core.substvars debian
/xserver-xorg-core-udeb.substvars
371 $(INSTALL
) -m
755 -d debian
/xserver-xorg-core
/usr
/share
/bug
/xserver-xorg-core
372 $(INSTALL
) -m
755 debian
/xserver-xorg-core.bug.script debian
/xserver-xorg-core
/usr
/share
/bug
/xserver-xorg-core
/script
373 ifeq ($(DEB_HOST_ARCH_OS
), linux
)
374 install -d debian
/xserver-xorg-core
/lib
/udev
/rules.d
375 install -m
644 debian
/local
/64-xorg-xkb.rules debian
/xserver-xorg-core
/lib
/udev
/rules.d
377 install -d debian
/xserver-xorg-core-udeb
/lib
/udev
/rules.d
378 install -m
644 debian
/local
/64-xorg-xkb.rules debian
/xserver-xorg-core-udeb
/lib
/udev
/rules.d
384 dh_strip
-pxserver-xorg-xmir
-pxserver-xorg-core
--dbg-package
=xserver-xorg-core-dbg
385 dh_strip
-s
-Nxserver-xorg-core
-Nxserver-xorg-core-dbg
386 $(MAKE
) -f debian
/rules DH_OPTIONS
=-s binary-deb
389 # Build architecture-independent files here
390 binary-indep
: build-indep
install check
391 $(MAKE
) -f debian
/rules DH_OPTIONS
=-i binary-initial
394 dh_installchangelogs
-i ChangeLog
396 $(MAKE
) -f debian
/rules DH_OPTIONS
=-i binary-deb
401 binary
: binary-indep binary-arch
402 .PHONY
: build
clean binary-indep binary-arch binary
install