public
Description: A mirror of QtWebKit
Homepage: http://trac.webkit.org/projects/webkit/wiki/QtWebKit
Clone URL: git://github.com/tronical/qtwebkit.git
2008-08-07  Kalle Vahlman  <zuh@iki.fi>

        Reviewed by David Kilzer.

        Check for correct flex version to avoid faulty builds

        A correct Webkit build requires flex 2.5.33 but autotools build 
        doesn't check for it
        https://bugs.webkit.org/show_bug.cgi?id=20253

        acinclude.m4: Import AX_COMPARE_VERSION macro
        configure.ac: Check for flex version

        * acinclude.m4:
        * configure.ac:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35622 
268f45cc-cd09-0410-ab3c-d52691b4dbfc
jmalonzo@webkit.org (author)
Thu Aug 07 05:08:52 -0700 2008
commit  850cecc4520554d39f30764ef828cab989969e95
tree    da7ce7819ae34b9ebb2be315b367d7d3144b34fe
parent  25eaf42b561bc13ad72d64dde431716c9ad0c55f
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
0
@@ -1,3 +1,18 @@
0
+2008-08-07 Kalle Vahlman <zuh@iki.fi>
0
+
0
+ Reviewed by David Kilzer.
0
+
0
+ Check for correct flex version to avoid faulty builds
0
+
0
+ A correct Webkit build requires flex 2.5.33 but autotools build doesn't check for it
0
+ https://bugs.webkit.org/show_bug.cgi?id=20253
0
+
0
+ acinclude.m4: Import AX_COMPARE_VERSION macro
0
+ configure.ac: Check for flex version
0
+
0
+ * acinclude.m4:
0
+ * configure.ac:
0
+
0
 2008-08-07 Simon Hausmann <hausmann@webkit.org>
0
 
0
         Rubber-stamped by Lars.
...
175
176
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
0
@@ -175,3 +175,182 @@ AC_SUBST(LTCOMPILE)
0
 AC_SUBST(LTCXXCOMPILE)
0
 # end dolt
0
 ])
0
+
0
+# ===========================================================================
0
+# http://autoconf-archive.cryp.to/ax_compare_version.html
0
+# ===========================================================================
0
+#
0
+# SYNOPSIS
0
+#
0
+# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
0
+#
0
+# DESCRIPTION
0
+#
0
+# This macro compares two version strings. Due to the various number of
0
+# minor-version numbers that can exist, and the fact that string
0
+# comparisons are not compatible with numeric comparisons, this is not
0
+# necessarily trivial to do in a autoconf script. This macro makes doing
0
+# these comparisons easy.
0
+#
0
+# The six basic comparisons are available, as well as checking equality
0
+# limited to a certain number of minor-version levels.
0
+#
0
+# The operator OP determines what type of comparison to do, and can be one
0
+# of:
0
+#
0
+# eq - equal (test A == B)
0
+# ne - not equal (test A != B)
0
+# le - less than or equal (test A <= B)
0
+# ge - greater than or equal (test A >= B)
0
+# lt - less than (test A < B)
0
+# gt - greater than (test A > B)
0
+#
0
+# Additionally, the eq and ne operator can have a number after it to limit
0
+# the test to that number of minor versions.
0
+#
0
+# eq0 - equal up to the length of the shorter version
0
+# ne0 - not equal up to the length of the shorter version
0
+# eqN - equal up to N sub-version levels
0
+# neN - not equal up to N sub-version levels
0
+#
0
+# When the condition is true, shell commands ACTION-IF-TRUE are run,
0
+# otherwise shell commands ACTION-IF-FALSE are run. The environment
0
+# variable 'ax_compare_version' is always set to either 'true' or 'false'
0
+# as well.
0
+#
0
+# Examples:
0
+#
0
+# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
0
+# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
0
+#
0
+# would both be true.
0
+#
0
+# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
0
+# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
0
+#
0
+# would both be false.
0
+#
0
+# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
0
+#
0
+# would be true because it is only comparing two minor versions.
0
+#
0
+# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
0
+#
0
+# would be true because it is only comparing the lesser number of minor
0
+# versions of the two values.
0
+#
0
+# Note: The characters that separate the version numbers do not matter. An
0
+# empty string is the same as version 0. OP is evaluated by autoconf, not
0
+# configure, so must be a string, not a variable.
0
+#
0
+# The author would like to acknowledge Guido Draheim whose advice about
0
+# the m4_case and m4_ifvaln functions make this macro only include the
0
+# portions necessary to perform the specific comparison specified by the
0
+# OP argument in the final configure script.
0
+#
0
+# LAST MODIFICATION
0
+#
0
+# 2008-04-12
0
+#
0
+# COPYLEFT
0
+#
0
+# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
0
+#
0
+# Copying and distribution of this file, with or without modification, are
0
+# permitted in any medium without royalty provided the copyright notice
0
+# and this notice are preserved.
0
+
0
+dnl #########################################################################
0
+AC_DEFUN([AX_COMPARE_VERSION], [
0
+ AC_PROG_AWK
0
+
0
+ # Used to indicate true or false condition
0
+ ax_compare_version=false
0
+
0
+ # Convert the two version strings to be compared into a format that
0
+ # allows a simple string comparison. The end result is that a version
0
+ # string of the form 1.12.5-r617 will be converted to the form
0
+ # 0001001200050617. In other words, each number is zero padded to four
0
+ # digits, and non digits are removed.
0
+ AS_VAR_PUSHDEF([A],[ax_compare_version_A])
0
+ A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
0
+ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
0
+ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
0
+ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
0
+ -e 's/[[^0-9]]//g'`
0
+
0
+ AS_VAR_PUSHDEF([B],[ax_compare_version_B])
0
+ B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
0
+ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
0
+ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
0
+ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
0
+ -e 's/[[^0-9]]//g'`
0
+
0
+ dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
0
+ dnl # then the first line is used to determine if the condition is true.
0
+ dnl # The sed right after the echo is to remove any indented white space.
0
+ m4_case(m4_tolower($2),
0
+ [lt],[
0
+ ax_compare_version=`echo "x$A
0
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
0
+ ],
0
+ [gt],[
0
+ ax_compare_version=`echo "x$A
0
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
0
+ ],
0
+ [le],[
0
+ ax_compare_version=`echo "x$A
0
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
0
+ ],
0
+ [ge],[
0
+ ax_compare_version=`echo "x$A
0
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
0
+ ],[
0
+ dnl Split the operator from the subversion count if present.
0
+ m4_bmatch(m4_substr($2,2),
0
+ [0],[
0
+ # A count of zero means use the length of the shorter version.
0
+ # Determine the number of characters in A and B.
0
+ ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
0
+ ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
0
+
0
+ # Set A to no more than B's length and B to no more than A's length.
0
+ A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
0
+ B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
0
+ ],
0
+ [[0-9]+],[
0
+ # A count greater than zero means use only that many subversions
0
+ A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
0
+ B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
0
+ ],
0
+ [.+],[
0
+ AC_WARNING(
0
+ [illegal OP numeric parameter: $2])
0
+ ],[])
0
+
0
+ # Pad zeros at end of numbers to make same length.
0
+ ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
0
+ B="$B`echo $A | sed 's/./0/g'`"
0
+ A="$ax_compare_version_tmp_A"
0
+
0
+ # Check for equality or inequality as necessary.
0
+ m4_case(m4_tolower(m4_substr($2,0,2)),
0
+ [eq],[
0
+ test "x$A" = "x$B" && ax_compare_version=true
0
+ ],
0
+ [ne],[
0
+ test "x$A" != "x$B" && ax_compare_version=true
0
+ ],[
0
+ AC_WARNING([illegal OP parameter: $2])
0
+ ])
0
+ ])
0
+
0
+ AS_VAR_POPDEF([A])dnl
0
+ AS_VAR_POPDEF([B])dnl
0
+
0
+ dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
0
+ if test "$ax_compare_version" = "true" ; then
0
+ m4_ifvaln([$4],[$4],[:])dnl
0
+ m4_ifvaln([$5],[else $5])dnl
0
+ fi
0
+]) dnl AX_COMPARE_VERSION
...
95
96
97
 
 
 
 
98
99
100
...
95
96
97
98
99
100
101
102
103
104
0
@@ -95,6 +95,10 @@ fi
0
 AC_PATH_PROG(FLEX, flex)
0
 if test -z "$FLEX"; then
0
    AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
0
+else
0
+ FLEX_VERSION=`$FLEX --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
0
+ AX_COMPARE_VERSION([2.5.33],[gt],[$FLEX_VERSION],
0
+ AC_MSG_ERROR([You need at least version 2.5.33 of the 'flex' lexer generator to compile WebKit]))
0
 fi
0
 
0
 AC_PATH_PROG(GPERF, gperf)

Comments

    No one has commented yet.