summaryrefslogtreecommitdiff
blob: 4d9795bdde7f6a4cc5bf81251ef15eb6be867709 (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
From: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Date: Mon, 29 Feb 2016 14:59:51 +0200
Subject: [PATCH] build: fix ./configure --disable-dtd-validation

When configured with --disable-dtd-validation:

  CPPAS    src/dtddata.o
src/dtddata.S: Assembler messages:
src/dtddata.S:39: Error: file not found: src/wayland.dtd.embed
Makefile:1520: recipe for target 'src/dtddata.o' failed

This is because the variable name used does not match the implicit
variable name in autoconf.

Fix the variable name, making both --disable-dtd-validation and
--enable-dtd-validation to what they should.

Do not try to build dtddata.S if dtd-validation is disabled. It depends
on wayland.dtd.embed which is created by configure only if
dtd-validation is enabled.

If not building dtddata.S, also make sure the extern definitions in
scanner.c are compiled out.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=575212
Reported-by: leio@gentoo.org
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
[Mart: Added Makefile.in and configure changes to patch file to avoid autoreconf]
Signed-off-by: Mart Raudsepp <leio@gentoo.org>
---
 Makefile.am   |  5 ++++-
 Makefile.in   | 20 ++++++++++++--------
 configure     | 18 ++++++++++++++++--
 configure.ac  |  5 +++--
 src/scanner.c |  6 +++---
 5 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e850abc..49e25a6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,11 +23,14 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA =
 
 bin_PROGRAMS = wayland-scanner
-wayland_scanner_SOURCES = src/scanner.c src/dtddata.S
+wayland_scanner_SOURCES = src/scanner.c
 wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(LIBXML_CFLAGS) $(AM_CFLAGS)
 wayland_scanner_LDADD = $(EXPAT_LIBS) $(LIBXML_LIBS) libwayland-util.la
 pkgconfig_DATA += src/wayland-scanner.pc
 
+if DTD_VALIDATION
+wayland_scanner_SOURCES += src/dtddata.S
+endif
 src/dtddata.o: protocol/wayland.dtd
 
 if USE_HOST_SCANNER
diff --git a/Makefile.in b/Makefile.in
index 6d9ffb2..32e6d51 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -82,8 +82,9 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = wayland-scanner$(EXEEXT)
-@ENABLE_LIBRARIES_TRUE@am__append_1 = libwayland-private.la
-@ENABLE_LIBRARIES_TRUE@am__append_2 = src/wayland-client.pc \
+@DTD_VALIDATION_TRUE@am__append_1 = src/dtddata.S
+@ENABLE_LIBRARIES_TRUE@am__append_2 = libwayland-private.la
+@ENABLE_LIBRARIES_TRUE@am__append_3 = src/wayland-client.pc \
 @ENABLE_LIBRARIES_TRUE@	src/wayland-server.pc \
 @ENABLE_LIBRARIES_TRUE@	cursor/wayland-cursor.pc
 @ENABLE_LIBRARIES_TRUE@TESTS = array-test$(EXEEXT) \
@@ -101,7 +102,7 @@ bin_PROGRAMS = wayland-scanner$(EXEEXT)
 @ENABLE_LIBRARIES_TRUE@	resources-test$(EXEEXT) \
 @ENABLE_LIBRARIES_TRUE@	message-test$(EXEEXT) \
 @ENABLE_LIBRARIES_TRUE@	headers-test$(EXEEXT) $(am__EXEEXT_1)
-@ENABLE_CPP_TEST_TRUE@@ENABLE_LIBRARIES_TRUE@am__append_3 = cpp-compile-test
+@ENABLE_CPP_TEST_TRUE@@ENABLE_LIBRARIES_TRUE@am__append_4 = cpp-compile-test
 @ENABLE_LIBRARIES_TRUE@check_PROGRAMS = $(am__EXEEXT_2) \
 @ENABLE_LIBRARIES_TRUE@	exec-fd-leak-checker$(EXEEXT)
 @ENABLE_LIBRARIES_TRUE@noinst_PROGRAMS = fixed-benchmark$(EXEEXT)
@@ -382,8 +383,10 @@ am__socket_test_SOURCES_DIST = tests/socket-test.c
 @ENABLE_LIBRARIES_TRUE@	tests/socket-test.$(OBJEXT)
 socket_test_OBJECTS = $(am_socket_test_OBJECTS)
 @ENABLE_LIBRARIES_TRUE@socket_test_DEPENDENCIES = libtest-runner.la
+am__wayland_scanner_SOURCES_DIST = src/scanner.c src/dtddata.S
+@DTD_VALIDATION_TRUE@am__objects_1 = src/dtddata.$(OBJEXT)
 am_wayland_scanner_OBJECTS = src/wayland_scanner-scanner.$(OBJEXT) \
-	src/dtddata.$(OBJEXT)
+	$(am__objects_1)
 wayland_scanner_OBJECTS = $(am_wayland_scanner_OBJECTS)
 wayland_scanner_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) libwayland-util.la
@@ -491,7 +494,8 @@ DIST_SOURCES = $(am__libtest_runner_la_SOURCES_DIST) \
 	$(am__resources_test_SOURCES_DIST) \
 	$(am__sanity_test_SOURCES_DIST) \
 	$(am__signal_test_SOURCES_DIST) \
-	$(am__socket_test_SOURCES_DIST) $(wayland_scanner_SOURCES)
+	$(am__socket_test_SOURCES_DIST) \
+	$(am__wayland_scanner_SOURCES_DIST)
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
 	ctags-recursive dvi-recursive html-recursive info-recursive \
 	install-data-recursive install-dvi-recursive \
@@ -918,8 +922,8 @@ dist_pkgdata_DATA = \
 	protocol/wayland.dtd
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = src/wayland-scanner.pc $(am__append_2)
-wayland_scanner_SOURCES = src/scanner.c src/dtddata.S
+pkgconfig_DATA = src/wayland-scanner.pc $(am__append_3)
+wayland_scanner_SOURCES = src/scanner.c $(am__append_1)
 wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(LIBXML_CFLAGS) $(AM_CFLAGS)
 wayland_scanner_LDADD = $(EXPAT_LIBS) $(LIBXML_LIBS) libwayland-util.la
 @USE_HOST_SCANNER_FALSE@wayland_scanner = $(top_builddir)/wayland-scanner
@@ -929,7 +933,7 @@ libwayland_util_la_SOURCES = \
 	src/wayland-util.c			\
 	src/wayland-util.h
 
-noinst_LTLIBRARIES = libwayland-util.la $(am__append_1)
+noinst_LTLIBRARIES = libwayland-util.la $(am__append_2)
 @ENABLE_LIBRARIES_TRUE@lib_LTLIBRARIES = libwayland-server.la \
 @ENABLE_LIBRARIES_TRUE@	libwayland-client.la \
 @ENABLE_LIBRARIES_TRUE@	libwayland-cursor.la
diff --git a/configure.ac b/configure.ac
index f54a8b9..b27f34b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,7 +76,7 @@ AC_ARG_ENABLE([dtd-validation],
 	      [AC_HELP_STRING([--disable-dtd-validation],
 			      [Disable DTD validation of the protocol])],
 	      [],
-	      [enable_dtdvalidation=yes])
+	      [enable_dtd_validation=yes])
 
 AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
 
@@ -112,7 +112,8 @@ PKG_CHECK_MODULES(EXPAT, [expat], [],
 	 AC_SUBST(EXPAT_LIBS)
 	])
 
-if test "x$enable_dtdvalidation" = "xyes"; then
+AM_CONDITIONAL([DTD_VALIDATION], [test "x$enable_dtd_validation" = "xyes"])
+if test "x$enable_dtd_validation" = "xyes"; then
 	PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
 	AC_DEFINE(HAVE_LIBXML, 1, [libxml-2.0 is available])
 	AC_CONFIG_LINKS([src/wayland.dtd.embed:protocol/wayland.dtd])
diff --git a/configure b/configure
index 83e4971..6340d4f 100755
--- a/configure
+++ b/configure
@@ -711,6 +711,8 @@ HAVE_XSLTPROC_TRUE
 XSLTPROC
 LIBXML_LIBS
 LIBXML_CFLAGS
+DTD_VALIDATION_FALSE
+DTD_VALIDATION_TRUE
 EXPAT_LIBS
 EXPAT_CFLAGS
 FFI_LIBS
@@ -15728,7 +15730,7 @@ fi
 if test "${enable_dtd_validation+set}" = set; then :
   enableval=$enable_dtd_validation;
 else
-  enable_dtdvalidation=yes
+  enable_dtd_validation=yes
 fi
 
 
@@ -16114,7 +16116,15 @@ $as_echo "yes" >&6; }
 
 fi
 
-if test "x$enable_dtdvalidation" = "xyes"; then
+ if test "x$enable_dtd_validation" = "xyes"; then
+  DTD_VALIDATION_TRUE=
+  DTD_VALIDATION_FALSE='#'
+else
+  DTD_VALIDATION_TRUE='#'
+  DTD_VALIDATION_FALSE=
+fi
+
+if test "x$enable_dtd_validation" = "xyes"; then
 
 pkg_failed=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML" >&5
@@ -16669,6 +16679,10 @@ if test -z "${ENABLE_LIBRARIES_TRUE}" && test -z "${ENABLE_LIBRARIES_FALSE}"; th
   as_fn_error $? "conditional \"ENABLE_LIBRARIES\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${DTD_VALIDATION_TRUE}" && test -z "${DTD_VALIDATION_FALSE}"; then
+  as_fn_error $? "conditional \"DTD_VALIDATION\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_XSLTPROC_TRUE}" && test -z "${HAVE_XSLTPROC_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_XSLTPROC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/src/scanner.c b/src/scanner.c
index d3e2328..04747e3 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -40,13 +40,13 @@
 
 #if HAVE_LIBXML
 #include <libxml/parser.h>
-#endif
-
-#include "wayland-util.h"
 
 /* Embedded wayland.dtd file, see dtddata.S */
 extern char DTD_DATA_begin;
 extern int DTD_DATA_len;
+#endif
+
+#include "wayland-util.h"
 
 enum side {
 	CLIENT,
-- 
2.6.4