summaryrefslogtreecommitdiff
path: root/debian/rules
blob: d0e6f7a29161c55ebb5c212dfc80066eb2c725ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
#!/usr/bin/make -f
# debian/rules for the Debian xorg-server package.
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
# Copyright © 2005 David Nusinow <dnusinow@debian.org>

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include debian/xsfbs/xsfbs.mk

CFLAGS = -Wall -g
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	MAKEFLAGS += -j$(NUMJOBS)
endif

#CPPFLAGS += -DPRE_RELEASE=0

DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	confflags += --build=$(DEB_HOST_GNU_TYPE)
else
	confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif

ifeq ($(DEB_HOST_ARCH_OS), linux)
	build_xfbdev = --enable-xfbdev
	selinux = --enable-xselinux
else
	build_xfbdev = --disable-xfbdev
	selinux = --disable-xselinux
endif

ifeq ($(DEB_HOST_ARCH), hurd-i386)
	dri = --disable-dri --disable-dri2
	config_hal = --disable-config-hal
else
	dri = --enable-dri --enable-dri2
	config_hal = --enable-config-hal
endif

INSTALL=/usr/bin/install

VENDOR = $(shell lsb_release -i -s)

# disable-static is so we don't get libfoo.a for modules.  now if only we could
# kill the .las.
confflags += \
	     --disable-static \
	     --without-dtrace \
	     --disable-werror \
	     --disable-debug \
	     --with-int10=x86emu \
	     --with-os-vendor="$(VENDOR)" \
	     --with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(BUILDER))" \
	     --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,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins" \
	     --with-xkb-path=/usr/share/X11/xkb \
	     --with-xkb-output=/var/lib/xkb \
	     --disable-builddocs \
	     --disable-install-libxf86config \
	     --disable-null-root-cursor \
	     --enable-aiglx \
	     --enable-glx-tls \
	     --enable-registry \
	     --enable-composite \
	     --enable-mitshm \
	     --enable-xres \
	     --enable-record \
	     --enable-xv \
	     --enable-xvmc \
	     --enable-dga \
	     --enable-screensaver \
	     --enable-xdmcp \
	     --enable-xdm-auth-1 \
	     --enable-glx \
	     $(dri) \
	     --enable-xinerama \
	     --enable-xf86vidmode \
	     --enable-xace \
	     $(selinux) \
	     --disable-xcsecurity \
	     --disable-xcalibrate \
	     --disable-tslib \
	     --disable-multibuffer \
	     --enable-dbe \
	     --disable-xf86bigfont \
	     --enable-dpms \
	     --disable-config-dbus \
	     $(config_hal) \
	     --enable-xfree86-utils \
	     --enable-xorg \
	     --enable-dmx \
	     --enable-xvfb \
	     --enable-xnest \
	     --disable-xquartz \
	     --disable-xwin \
	     --enable-kdrive \
	     --enable-xephyr \
	     --disable-xsdl \
	     --disable-xfake \
	     $(build_xfbdev) \
	     --disable-install-setuid

configure: $(STAMP_DIR)/patch
	dh_testdir
	autoreconf -vfi

obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
	dh_testdir
	mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
	cd obj-$(DEB_BUILD_GNU_TYPE) && \
	../configure \
	  --prefix=/usr \
	  --mandir=\$${prefix}/share/man \
	  --infodir=\$${prefix}/share/info \
	  --sysconfdir=/etc \
	  --localstatedir=/var \
	  $(confflags) \
	  CFLAGS="$(CFLAGS)" \
	  CPPFLAGS="$(CPPFLAGS)"


build: build-stamp
build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
	dh_testdir
	cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
	>$@

clean: xsfclean
	dh_testdir
	dh_testroot
	rm -f build-stamp
	
	rm -f config.cache config.log config.status
	rm -f */config.cache */config.log */config.status
	rm -f conftest* */conftest*
	rm -rf autom4te.cache */autom4te.cache
	rm -rf obj-*
	# generated file, left over in the upstream tarball
	# see https://bugs.freedesktop.org/show_bug.cgi?id=9277
	rm -f hw/xfree86/common/xf86Build.h
	# more generated files
	rm -f include/dix-config.h include/do-not-use-config.h \
		include/xorg-config.h include/xorg-server.h
	rm -f $$(find -name Makefile.in)
	rm -f compile config.guess config.sub configure depcomp install-sh
	rm -f ltmain.sh missing INSTALL aclocal.m4 ylwrap
	rm -f include/do-not-use-config.h.in
	
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	
	cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
	
	# oh, yuck.
	find $(CURDIR)/debian/tmp/usr/lib/xorg -type f -name '*.la' | \
	  xargs rm -f
	
	install -m 755 debian/local/xvfb-run debian/tmp/usr/bin
	install debian/local/xvfb-run.1 debian/tmp/usr/share/man/man1


# stub to start building deb files, used by binary-indep and binary-arch
binary-initial:
	dh_testdir
	dh_testroot

# stub to build deb files, used by binary-indep and binary-arch
# (cf. /usr/share/debhelper/dh_make/debianm/rules)
binary-deb:
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-initial
	
	dh_installdocs -s
	dh_installchangelogs -s ChangeLog
	dh_install -s --sourcedir=debian/tmp --list-missing
	$(INSTALL) -d $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg
	$(INSTALL) -m644 $(CURDIR)/debian/videoabiver \
	           $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg/videoabiver
	$(INSTALL) -m644 $(CURDIR)/debian/inputabiver \
	           $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg/inputabiver
	$(INSTALL) -m644 $(CURDIR)/debian/serverminver \
	           $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg/serverminver
	$(INSTALL) -m 755 -d debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core
	$(INSTALL) -m 755 debian/xserver-xorg-core.bug.script debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core/script
	dh_installdebconf -s
	dh_installman -s
	dh_link -s
	dh_strip -s --dbg-package=xserver-xorg-core
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-deb


# Build architecture-independent files here
binary-indep: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-initial
	dh_install -i --sourcedir=debian/tmp
	dh_installdocs -i
	dh_installchangelogs -i

	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-deb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install