summaryrefslogtreecommitdiff
blob: 6641d3e2cae5a1af1f009ae100a64a58b3f89a0b (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
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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
https://github.com/mgieseki/dvisvgm/pull/202

From 2dc8627a0864ea1543027e577ad96676a56bf4c5 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 4 Nov 2022 20:04:43 +0000
Subject: [PATCH 1/4] Cleanup obsolete m4 dist hack

autoconf & automake, at least nowadays, handle including m4/
correctly in dist tarballs (from `make dist`).

Previously, dist tarballs lacked m4/ax_*.m4 and therefore `autoreconf -fi`
would break the Makefile with:
```
make[3]: Entering directory '/var/tmp/portage/app-text/dvisvgm-2.14-r1/work/dvisvgm-2.14/libs/clipper'
Makefile:664: *** missing separator.  Stop.
```

On that line is an unexpanded @CODE_COVERAGE_RULES@.

Bug: https://bugs.gentoo.org/879539
Signed-off-by: Sam James <sam@gentoo.org>
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 EXTRA_DIST = COPYING
-SUBDIRS = libs m4 src tests doc
+SUBDIRS = libs src tests doc
 ACLOCAL_AMFLAGS = -I m4
 
 if USE_BUNDLED_LIBS
--- a/configure.ac
+++ b/configure.ac
@@ -228,7 +228,6 @@ AC_CONFIG_FILES([
 	libs/variant/Makefile
 	libs/woff2/Makefile
 	libs/xxHash/Makefile
-	m4/Makefile
 	src/Makefile
 	src/version.hpp
 	src/optimizer/Makefile
--- a/m4/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-M4_EXTRA_DIST = \
-	ax_check_compile_flag.m4 \
-	ax_code_coverage.m4 \
-	ax_cxx_compile_stdcxx.m4

From 2b03bccde2dd8a1b101f793159663446dd522ac9 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 4 Nov 2022 20:27:35 +0000
Subject: [PATCH 2/4] Update to newer autoconf-archive (AX_*) macros

Signed-off-by: Sam James <sam@gentoo.org>
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,8 @@
 ##
 ## Process this file with automake.
 
+include $(top_srcdir)/aminclude_static.am
+
 AUTOMAKE_OPTIONS = foreign
 EXTRA_DIST = COPYING
 SUBDIRS = libs src tests doc
--- a/configure.ac
+++ b/configure.ac
@@ -205,6 +205,7 @@ AS_IF([test "x$enable_manpage" != "xyes"],
 AM_CONDITIONAL([BUILD_MANPAGE], [test "x$enable_manpage" = "xyes"])
 
 AX_CODE_COVERAGE
+
 AS_IF([ test "$enable_code_coverage" = "yes" ], [
 	# disable optimization
 	changequote({,})
--- a/libs/brotli/Makefile.am
+++ b/libs/brotli/Makefile.am
@@ -81,7 +81,6 @@ libbrotli_a_SOURCES = \
 
 AM_CFLAGS = -Wall -I$(srcdir)/include
 
-@CODE_COVERAGE_RULES@
 endif
 
 EXTRA_DIST = LICENSE
--- a/libs/clipper/Makefile.am
+++ b/libs/clipper/Makefile.am
@@ -6,6 +6,4 @@ AM_CXXFLAGS = -Wall
 
 clipper.cpp: clipper.hpp
 
-@CODE_COVERAGE_RULES@
-
 CLEANFILES = *.gcda *.gcno
--- a/libs/ff-woff/Makefile.am
+++ b/libs/ff-woff/Makefile.am
@@ -85,6 +85,4 @@ EXTRA_DIST = LICENSE
 
 AM_CFLAGS = -I$(srcdir)/inc -I$(srcdir)/fontforge $(ZLIB_CFLAGS)
 
-@CODE_COVERAGE_RULES@
-
 CLEANFILES = *.gcda *.gcno
--- a/libs/md5/Makefile.am
+++ b/libs/md5/Makefile.am
@@ -6,7 +6,6 @@ AM_CXXFLAGS = -Wall
 
 md5.c: md5.h
 
-@CODE_COVERAGE_RULES@
 endif
 
 CLEANFILES = *.gcda *.gcno
--- a/libs/potrace/Makefile.am
+++ b/libs/potrace/Makefile.am
@@ -17,7 +17,6 @@ libpotrace_a_SOURCES = \
 
 AM_CFLAGS = -Wall -I$(srcdir)
 
-@CODE_COVERAGE_RULES@
 endif
 
 CLEANFILES = *.gcda *.gcno
--- a/libs/woff2/Makefile.am
+++ b/libs/woff2/Makefile.am
@@ -28,7 +28,6 @@ libwoff2_a_SOURCES = \
 
 AM_CXXFLAGS = -Wall -I$(srcdir)/include -I$(srcdir)/../brotli/include
 
-@CODE_COVERAGE_RULES@
 endif
 
 EXTRA_DIST = LICENSE
--- a/libs/xxHash/Makefile.am
+++ b/libs/xxHash/Makefile.am
@@ -6,7 +6,6 @@ AM_CXXFLAGS = -Wall
 
 xxhash.c: xxhash.h xxh3.h
 
-@CODE_COVERAGE_RULES@
 endif
 
 CLEANFILES = *.gcda *.gcno
--- /dev/null
+++ b/m4/ax_ac_append_to_file.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+#   https://www.gnu.org/software/autoconf-archive/ax_ac_append_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_AC_APPEND_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+#   Appends the specified data to the specified Autoconf is run. If you want
+#   to append to a file when configure is run use AX_APPEND_TO_FILE instead.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 10
+
+AC_DEFUN([AX_AC_APPEND_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+m4_esyscmd(
+AX_FILE_ESCAPES
+[
+printf "%s" "$2" >> "$1"
+])
+])
--- /dev/null
+++ b/m4/ax_ac_print_to_file.m4
@@ -0,0 +1,32 @@
+# ===========================================================================
+#   https://www.gnu.org/software/autoconf-archive/ax_ac_print_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_AC_PRINT_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+#   Writes the specified data to the specified file when Autoconf is run. If
+#   you want to print to a file when configure is run use AX_PRINT_TO_FILE
+#   instead.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 10
+
+AC_DEFUN([AX_AC_PRINT_TO_FILE],[
+m4_esyscmd(
+AC_REQUIRE([AX_FILE_ESCAPES])
+[
+printf "%s" "$2" > "$1"
+])
+])
--- /dev/null
+++ b/m4/ax_add_am_macro_static.m4
@@ -0,0 +1,28 @@
+# ===========================================================================
+#  https://www.gnu.org/software/autoconf-archive/ax_add_am_macro_static.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_ADD_AM_MACRO_STATIC([RULE])
+#
+# DESCRIPTION
+#
+#   Adds the specified rule to $AMINCLUDE.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 8
+
+AC_DEFUN([AX_ADD_AM_MACRO_STATIC],[
+  AC_REQUIRE([AX_AM_MACROS_STATIC])
+  AX_AC_APPEND_TO_FILE(AMINCLUDE_STATIC,[$1])
+])
--- /dev/null
+++ b/m4/ax_am_macros_static.m4
@@ -0,0 +1,38 @@
+# ===========================================================================
+#   https://www.gnu.org/software/autoconf-archive/ax_am_macros_static.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_AM_MACROS_STATIC
+#
+# DESCRIPTION
+#
+#   Adds support for macros that create Automake rules. You must manually
+#   add the following line
+#
+#     include $(top_srcdir)/aminclude_static.am
+#
+#   to your Makefile.am files.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#   Copyright (c) 2009 Allan Caffee <allan.caffee@gmail.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 11
+
+AC_DEFUN([AMINCLUDE_STATIC],[aminclude_static.am])
+
+AC_DEFUN([AX_AM_MACROS_STATIC],
+[
+AX_AC_PRINT_TO_FILE(AMINCLUDE_STATIC,[
+# ]AMINCLUDE_STATIC[ generated automatically by Autoconf
+# from AX_AM_MACROS_STATIC on ]m4_esyscmd([LC_ALL=C date])[
+])
+])
--- /dev/null
+++ b/m4/ax_file_escapes.m4
@@ -0,0 +1,30 @@
+# ===========================================================================
+#     https://www.gnu.org/software/autoconf-archive/ax_file_escapes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_FILE_ESCAPES
+#
+# DESCRIPTION
+#
+#   Writes the specified data to the specified file.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 8
+
+AC_DEFUN([AX_FILE_ESCAPES],[
+AX_DOLLAR="\$"
+AX_SRB="\\135"
+AX_SLB="\\133"
+AX_BS="\\\\"
+AX_DQ="\""
+])
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -225,6 +225,4 @@ $(srcdir)/psdefs.cpp: psdefs.ps
 
 psdefs.ps: ;
 
-@CODE_COVERAGE_RULES@
-
 CLEANFILES = *.gcda *.gcno
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -421,6 +421,4 @@ XMLStringTest_LDADD = $(TESTLIBS)
 EXTRA_DIST += check-conv genhashcheck.py normalize.xsl
 TESTS += check-conv
 
-@CODE_COVERAGE_RULES@
-
 CLEANFILES = *.gcda *.gcno hashcheck.cpp

From 8689f1ceb2284038627668e70ec7e15f99220a5c Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 4 Nov 2022 22:42:58 +0000
Subject: [PATCH 4/4] Upgrade to Autoconf 2.69

autoconf 2.69 is still pretty old and this only affects
folks who want to run autoreconf anyway.

Signed-off-by: Sam James <sam@gentoo.org>
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 #
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.59)
+AC_PREREQ([2.69])
 AC_INIT([dvisvgm],[2.14],[martin.gieseking@uos.de])
 DATE="August 2022"
 AC_CONFIG_SRCDIR(src)
@@ -18,13 +18,11 @@ AC_DEFINE_UNQUOTED([TARGET_SYSTEM], ["$target"])
 
 # Checks for programs.
 AC_PROG_CC
-AC_PROG_CC_C99
 AC_PROG_CXX
 AX_CXX_COMPILE_STDCXX([11])
 AM_PROG_AR
 LT_INIT
 
-AC_PROG_RANLIB
 AC_LANG(C)
 
 AX_CHECK_COMPILE_FLAG([-Wmismatched-tags -Wno-mismatched-tags], [CXXFLAGS="$CXXFLAGS -Wno-mismatched-tags"])
@@ -147,7 +145,7 @@ AC_CHECK_LIB(z, gzopen)
 
 # Check for header files.
 AC_HEADER_DIRENT
-AC_HEADER_STDC
+
 AC_CHECK_HEADERS_ONCE([libintl.h stdlib.h string.h strings.h unistd.h])
 
 # Check for typedefs, structures, and compiler characteristics.