Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sandbox:master commit in: m4/
Date: Sun, 13 Jan 2019 11:39:10
Message-Id: 1547379531.ab30b4c73772c4b98a0d36e0f290f60bc8f16907.mgorny@gentoo
1 commit: ab30b4c73772c4b98a0d36e0f290f60bc8f16907
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 13 11:33:24 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 13 11:38:51 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=ab30b4c7
7
8 m4: ax_* update via autogen.sh
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 m4/ax_append_compile_flags.m4 | 31 +++++---------------------
13 m4/ax_append_flag.m4 | 31 +++++---------------------
14 m4/ax_append_link_flags.m4 | 31 +++++---------------------
15 m4/ax_cflags_force_c89.m4 | 41 +++++++++--------------------------
16 m4/ax_cflags_no_writable_strings.m4 | 42 +++++++++---------------------------
17 m4/ax_cflags_strict_prototypes.m4 | 43 ++++++++++---------------------------
18 m4/ax_check_compile_flag.m4 | 31 +++++---------------------
19 m4/ax_check_link_flag.m4 | 31 +++++---------------------
20 m4/ax_compiler_flags_cflags.m4 | 35 ++++++++++++++++++++++++------
21 m4/ax_compiler_flags_ldflags.m4 | 23 ++++++++++++++++++--
22 10 files changed, 105 insertions(+), 234 deletions(-)
23
24 diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4
25 index 5b6f1af..9c85635 100644
26 --- a/m4/ax_append_compile_flags.m4
27 +++ b/m4/ax_append_compile_flags.m4
28 @@ -30,33 +30,12 @@
29 #
30 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com>
31 #
32 -# This program is free software: you can redistribute it and/or modify it
33 -# under the terms of the GNU General Public License as published by the
34 -# Free Software Foundation, either version 3 of the License, or (at your
35 -# option) any later version.
36 -#
37 -# This program is distributed in the hope that it will be useful, but
38 -# WITHOUT ANY WARRANTY; without even the implied warranty of
39 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40 -# Public License for more details.
41 -#
42 -# You should have received a copy of the GNU General Public License along
43 -# with this program. If not, see <https://www.gnu.org/licenses/>.
44 -#
45 -# As a special exception, the respective Autoconf Macro's copyright owner
46 -# gives unlimited permission to copy, distribute and modify the configure
47 -# scripts that are the output of Autoconf when processing the Macro. You
48 -# need not follow the terms of the GNU General Public License when using
49 -# or distributing such scripts, even though portions of the text of the
50 -# Macro appear in them. The GNU General Public License (GPL) does govern
51 -# all other use of the material that constitutes the Autoconf Macro.
52 -#
53 -# This special exception to the GPL applies to versions of the Autoconf
54 -# Macro released by the Autoconf Archive. When you make and distribute a
55 -# modified version of the Autoconf Macro, you may extend this special
56 -# exception to the GPL to apply to your modified version as well.
57 +# Copying and distribution of this file, with or without modification, are
58 +# permitted in any medium without royalty provided the copyright notice
59 +# and this notice are preserved. This file is offered as-is, without any
60 +# warranty.
61
62 -#serial 6
63 +#serial 7
64
65 AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
66 [AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
67
68 diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
69 index e8c5312..dd6d8b6 100644
70 --- a/m4/ax_append_flag.m4
71 +++ b/m4/ax_append_flag.m4
72 @@ -23,33 +23,12 @@
73 # Copyright (c) 2008 Guido U. Draheim <guidod@×××.de>
74 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com>
75 #
76 -# This program is free software: you can redistribute it and/or modify it
77 -# under the terms of the GNU General Public License as published by the
78 -# Free Software Foundation, either version 3 of the License, or (at your
79 -# option) any later version.
80 -#
81 -# This program is distributed in the hope that it will be useful, but
82 -# WITHOUT ANY WARRANTY; without even the implied warranty of
83 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
84 -# Public License for more details.
85 -#
86 -# You should have received a copy of the GNU General Public License along
87 -# with this program. If not, see <https://www.gnu.org/licenses/>.
88 -#
89 -# As a special exception, the respective Autoconf Macro's copyright owner
90 -# gives unlimited permission to copy, distribute and modify the configure
91 -# scripts that are the output of Autoconf when processing the Macro. You
92 -# need not follow the terms of the GNU General Public License when using
93 -# or distributing such scripts, even though portions of the text of the
94 -# Macro appear in them. The GNU General Public License (GPL) does govern
95 -# all other use of the material that constitutes the Autoconf Macro.
96 -#
97 -# This special exception to the GPL applies to versions of the Autoconf
98 -# Macro released by the Autoconf Archive. When you make and distribute a
99 -# modified version of the Autoconf Macro, you may extend this special
100 -# exception to the GPL to apply to your modified version as well.
101 +# Copying and distribution of this file, with or without modification, are
102 +# permitted in any medium without royalty provided the copyright notice
103 +# and this notice are preserved. This file is offered as-is, without any
104 +# warranty.
105
106 -#serial 7
107 +#serial 8
108
109 AC_DEFUN([AX_APPEND_FLAG],
110 [dnl
111
112 diff --git a/m4/ax_append_link_flags.m4 b/m4/ax_append_link_flags.m4
113 index 6f7f174..99b9fa5 100644
114 --- a/m4/ax_append_link_flags.m4
115 +++ b/m4/ax_append_link_flags.m4
116 @@ -28,33 +28,12 @@
117 #
118 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com>
119 #
120 -# This program is free software: you can redistribute it and/or modify it
121 -# under the terms of the GNU General Public License as published by the
122 -# Free Software Foundation, either version 3 of the License, or (at your
123 -# option) any later version.
124 -#
125 -# This program is distributed in the hope that it will be useful, but
126 -# WITHOUT ANY WARRANTY; without even the implied warranty of
127 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
128 -# Public License for more details.
129 -#
130 -# You should have received a copy of the GNU General Public License along
131 -# with this program. If not, see <https://www.gnu.org/licenses/>.
132 -#
133 -# As a special exception, the respective Autoconf Macro's copyright owner
134 -# gives unlimited permission to copy, distribute and modify the configure
135 -# scripts that are the output of Autoconf when processing the Macro. You
136 -# need not follow the terms of the GNU General Public License when using
137 -# or distributing such scripts, even though portions of the text of the
138 -# Macro appear in them. The GNU General Public License (GPL) does govern
139 -# all other use of the material that constitutes the Autoconf Macro.
140 -#
141 -# This special exception to the GPL applies to versions of the Autoconf
142 -# Macro released by the Autoconf Archive. When you make and distribute a
143 -# modified version of the Autoconf Macro, you may extend this special
144 -# exception to the GPL to apply to your modified version as well.
145 +# Copying and distribution of this file, with or without modification, are
146 +# permitted in any medium without royalty provided the copyright notice
147 +# and this notice are preserved. This file is offered as-is, without any
148 +# warranty.
149
150 -#serial 6
151 +#serial 7
152
153 AC_DEFUN([AX_APPEND_LINK_FLAGS],
154 [AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
155
156 diff --git a/m4/ax_cflags_force_c89.m4 b/m4/ax_cflags_force_c89.m4
157 index 59b33c1..815fb68 100644
158 --- a/m4/ax_cflags_force_c89.m4
159 +++ b/m4/ax_cflags_force_c89.m4
160 @@ -29,41 +29,19 @@
161 #
162 # Copyright (c) 2009 Guido U. Draheim <guidod@×××.de>
163 #
164 -# This program is free software; you can redistribute it and/or modify it
165 -# under the terms of the GNU General Public License as published by the
166 -# Free Software Foundation; either version 3 of the License, or (at your
167 -# option) any later version.
168 -#
169 -# This program is distributed in the hope that it will be useful, but
170 -# WITHOUT ANY WARRANTY; without even the implied warranty of
171 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
172 -# Public License for more details.
173 -#
174 -# You should have received a copy of the GNU General Public License along
175 -# with this program. If not, see <https://www.gnu.org/licenses/>.
176 -#
177 -# As a special exception, the respective Autoconf Macro's copyright owner
178 -# gives unlimited permission to copy, distribute and modify the configure
179 -# scripts that are the output of Autoconf when processing the Macro. You
180 -# need not follow the terms of the GNU General Public License when using
181 -# or distributing such scripts, even though portions of the text of the
182 -# Macro appear in them. The GNU General Public License (GPL) does govern
183 -# all other use of the material that constitutes the Autoconf Macro.
184 -#
185 -# This special exception to the GPL applies to versions of the Autoconf
186 -# Macro released by the Autoconf Archive. When you make and distribute a
187 -# modified version of the Autoconf Macro, you may extend this special
188 -# exception to the GPL to apply to your modified version as well.
189 +# Copying and distribution of this file, with or without modification, are
190 +# permitted in any medium without royalty provided the copyright notice
191 +# and this notice are preserved. This file is offered as-is, without any
192 +# warranty.
193
194 -#serial 10
195 +#serial 12
196
197 AC_DEFUN([AX_CFLAGS_FORCE_C89],[dnl
198 AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
199 AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_force_c89])dnl
200 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for C89 mode],
201 VAR,[VAR="no, unknown"
202 - AC_LANG_SAVE
203 - AC_LANG_C
204 + AC_LANG_PUSH([C])
205 ac_save_[]FLAGS="$[]FLAGS"
206 for ac_arg dnl
207 in "-pedantic % -ansi -pedantic" dnl GCC
208 @@ -76,11 +54,12 @@ in "-pedantic % -ansi -pedantic" dnl GCC
209 "-h conform % -h conform" dnl Cray C (Unicos)
210 #
211 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
212 - AC_TRY_COMPILE([],[return 0;],
213 - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
214 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
215 + [[return 0;]])],
216 + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break],[])
217 done
218 FLAGS="$ac_save_[]FLAGS"
219 - AC_LANG_RESTORE
220 + AC_LANG_POP([C])
221 ])
222 AS_VAR_POPDEF([FLAGS])dnl
223 AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
224
225 diff --git a/m4/ax_cflags_no_writable_strings.m4 b/m4/ax_cflags_no_writable_strings.m4
226 index 48831fa..14478a6 100644
227 --- a/m4/ax_cflags_no_writable_strings.m4
228 +++ b/m4/ax_cflags_no_writable_strings.m4
229 @@ -30,33 +30,12 @@
230 #
231 # Copyright (c) 2008 Guido U. Draheim <guidod@×××.de>
232 #
233 -# This program is free software; you can redistribute it and/or modify it
234 -# under the terms of the GNU General Public License as published by the
235 -# Free Software Foundation; either version 3 of the License, or (at your
236 -# option) any later version.
237 -#
238 -# This program is distributed in the hope that it will be useful, but
239 -# WITHOUT ANY WARRANTY; without even the implied warranty of
240 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
241 -# Public License for more details.
242 -#
243 -# You should have received a copy of the GNU General Public License along
244 -# with this program. If not, see <https://www.gnu.org/licenses/>.
245 -#
246 -# As a special exception, the respective Autoconf Macro's copyright owner
247 -# gives unlimited permission to copy, distribute and modify the configure
248 -# scripts that are the output of Autoconf when processing the Macro. You
249 -# need not follow the terms of the GNU General Public License when using
250 -# or distributing such scripts, even though portions of the text of the
251 -# Macro appear in them. The GNU General Public License (GPL) does govern
252 -# all other use of the material that constitutes the Autoconf Macro.
253 -#
254 -# This special exception to the GPL applies to versions of the Autoconf
255 -# Macro released by the Autoconf Archive. When you make and distribute a
256 -# modified version of the Autoconf Macro, you may extend this special
257 -# exception to the GPL to apply to your modified version as well.
258 +# Copying and distribution of this file, with or without modification, are
259 +# permitted in any medium without royalty provided the copyright notice
260 +# and this notice are preserved. This file is offered as-is, without any
261 +# warranty.
262
263 -#serial 14
264 +#serial 16
265
266 AC_DEFUN([AX_FLAGS_NO_WRITABLE_STRINGS],[dnl
267 AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
268 @@ -79,18 +58,17 @@ in "-pedantic -Werror % -fno-writable-strings -Wwrite-strings" dnl GCC
269 "-fullwarn -use_readonly_const %% ok, its the default" dnl IRIX C
270 #
271 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
272 - AC_TRY_COMPILE([],[return 0;],
273 - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
274 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[return 0;]])],
275 + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break],[])
276 done
277 case ".$VAR" in
278 .|.no|.no,*) ;;
279 *) # sanity check - testing strcpy() from string.h
280 cp config.log config.tmp
281 - AC_TRY_COMPILE([#include <string.h>],[
282 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[
283 char test[16];
284 - if (strcpy (test, "test")) return 1;],
285 - dnl the original did use test -n `$CC testprogram.c`
286 - [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
287 + if (strcpy (test, "test")) return 1;]])],[dnl the original did use test -n `$CC testprogram.c`
288 + if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
289 then VAR="no, suppressed, string.h," ; fi],
290 [VAR="no, suppressed, string.h"])
291 rm config.tmp
292
293 diff --git a/m4/ax_cflags_strict_prototypes.m4 b/m4/ax_cflags_strict_prototypes.m4
294 index 1bc5db4..1a910cf 100644
295 --- a/m4/ax_cflags_strict_prototypes.m4
296 +++ b/m4/ax_cflags_strict_prototypes.m4
297 @@ -32,33 +32,12 @@
298 #
299 # Copyright (c) 2008 Guido U. Draheim <guidod@×××.de>
300 #
301 -# This program is free software; you can redistribute it and/or modify it
302 -# under the terms of the GNU General Public License as published by the
303 -# Free Software Foundation; either version 3 of the License, or (at your
304 -# option) any later version.
305 -#
306 -# This program is distributed in the hope that it will be useful, but
307 -# WITHOUT ANY WARRANTY; without even the implied warranty of
308 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
309 -# Public License for more details.
310 -#
311 -# You should have received a copy of the GNU General Public License along
312 -# with this program. If not, see <https://www.gnu.org/licenses/>.
313 -#
314 -# As a special exception, the respective Autoconf Macro's copyright owner
315 -# gives unlimited permission to copy, distribute and modify the configure
316 -# scripts that are the output of Autoconf when processing the Macro. You
317 -# need not follow the terms of the GNU General Public License when using
318 -# or distributing such scripts, even though portions of the text of the
319 -# Macro appear in them. The GNU General Public License (GPL) does govern
320 -# all other use of the material that constitutes the Autoconf Macro.
321 -#
322 -# This special exception to the GPL applies to versions of the Autoconf
323 -# Macro released by the Autoconf Archive. When you make and distribute a
324 -# modified version of the Autoconf Macro, you may extend this special
325 -# exception to the GPL to apply to your modified version as well.
326 +# Copying and distribution of this file, with or without modification, are
327 +# permitted in any medium without royalty provided the copyright notice
328 +# and this notice are preserved. This file is offered as-is, without any
329 +# warranty.
330
331 -#serial 16
332 +#serial 18
333
334 AC_DEFUN([AX_FLAGS_STRICT_PROTOTYPES],[dnl
335 AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
336 @@ -75,18 +54,18 @@ in "-pedantic -Werror % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
337 "-pedantic % -Wstrict-prototypes %% no, unsupported" dnl oops
338 #
339 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
340 - AC_TRY_COMPILE([],[return 0;],
341 - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
342 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[return 0;]])],
343 + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break], [])
344 done
345 case ".$VAR" in
346 .|.no|.no,*) ;;
347 *) # sanity check with signal() from sys/signal.h
348 cp config.log config.tmp
349 - AC_TRY_COMPILE([#include <signal.h>],[
350 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[
351 if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
352 - if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
353 - dnl the original did use test -n `$CC testprogram.c`
354 - [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
355 + if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;]])],
356 + [dnl the original did use test -n `$CC testprogram.c`
357 + if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
358 then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
359 then VAR="no, suppressed, signal.h," ; fi ; fi],
360 [VAR="no, suppressed, signal.h"])
361
362 diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
363 index dcabb92..bd753b3 100644
364 --- a/m4/ax_check_compile_flag.m4
365 +++ b/m4/ax_check_compile_flag.m4
366 @@ -29,33 +29,12 @@
367 # Copyright (c) 2008 Guido U. Draheim <guidod@×××.de>
368 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com>
369 #
370 -# This program is free software: you can redistribute it and/or modify it
371 -# under the terms of the GNU General Public License as published by the
372 -# Free Software Foundation, either version 3 of the License, or (at your
373 -# option) any later version.
374 -#
375 -# This program is distributed in the hope that it will be useful, but
376 -# WITHOUT ANY WARRANTY; without even the implied warranty of
377 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
378 -# Public License for more details.
379 -#
380 -# You should have received a copy of the GNU General Public License along
381 -# with this program. If not, see <https://www.gnu.org/licenses/>.
382 -#
383 -# As a special exception, the respective Autoconf Macro's copyright owner
384 -# gives unlimited permission to copy, distribute and modify the configure
385 -# scripts that are the output of Autoconf when processing the Macro. You
386 -# need not follow the terms of the GNU General Public License when using
387 -# or distributing such scripts, even though portions of the text of the
388 -# Macro appear in them. The GNU General Public License (GPL) does govern
389 -# all other use of the material that constitutes the Autoconf Macro.
390 -#
391 -# This special exception to the GPL applies to versions of the Autoconf
392 -# Macro released by the Autoconf Archive. When you make and distribute a
393 -# modified version of the Autoconf Macro, you may extend this special
394 -# exception to the GPL to apply to your modified version as well.
395 +# Copying and distribution of this file, with or without modification, are
396 +# permitted in any medium without royalty provided the copyright notice
397 +# and this notice are preserved. This file is offered as-is, without any
398 +# warranty.
399
400 -#serial 5
401 +#serial 6
402
403 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
404 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
405
406 diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4
407 index 819409a..03a30ce 100644
408 --- a/m4/ax_check_link_flag.m4
409 +++ b/m4/ax_check_link_flag.m4
410 @@ -29,33 +29,12 @@
411 # Copyright (c) 2008 Guido U. Draheim <guidod@×××.de>
412 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com>
413 #
414 -# This program is free software: you can redistribute it and/or modify it
415 -# under the terms of the GNU General Public License as published by the
416 -# Free Software Foundation, either version 3 of the License, or (at your
417 -# option) any later version.
418 -#
419 -# This program is distributed in the hope that it will be useful, but
420 -# WITHOUT ANY WARRANTY; without even the implied warranty of
421 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
422 -# Public License for more details.
423 -#
424 -# You should have received a copy of the GNU General Public License along
425 -# with this program. If not, see <https://www.gnu.org/licenses/>.
426 -#
427 -# As a special exception, the respective Autoconf Macro's copyright owner
428 -# gives unlimited permission to copy, distribute and modify the configure
429 -# scripts that are the output of Autoconf when processing the Macro. You
430 -# need not follow the terms of the GNU General Public License when using
431 -# or distributing such scripts, even though portions of the text of the
432 -# Macro appear in them. The GNU General Public License (GPL) does govern
433 -# all other use of the material that constitutes the Autoconf Macro.
434 -#
435 -# This special exception to the GPL applies to versions of the Autoconf
436 -# Macro released by the Autoconf Archive. When you make and distribute a
437 -# modified version of the Autoconf Macro, you may extend this special
438 -# exception to the GPL to apply to your modified version as well.
439 +# Copying and distribution of this file, with or without modification, are
440 +# permitted in any medium without royalty provided the copyright notice
441 +# and this notice are preserved. This file is offered as-is, without any
442 +# warranty.
443
444 -#serial 5
445 +#serial 6
446
447 AC_DEFUN([AX_CHECK_LINK_FLAG],
448 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
449
450 diff --git a/m4/ax_compiler_flags_cflags.m4 b/m4/ax_compiler_flags_cflags.m4
451 index aeb16e3..916f918 100644
452 --- a/m4/ax_compiler_flags_cflags.m4
453 +++ b/m4/ax_compiler_flags_cflags.m4
454 @@ -19,13 +19,14 @@
455 # LICENSE
456 #
457 # Copyright (c) 2014, 2015 Philip Withnall <philip@××××××××××××.uk>
458 +# Copyright (c) 2017, 2018 Reini Urban <rurban@××××.org>
459 #
460 # Copying and distribution of this file, with or without modification, are
461 # permitted in any medium without royalty provided the copyright notice
462 # and this notice are preserved. This file is offered as-is, without any
463 # warranty.
464
465 -#serial 14
466 +#serial 17
467
468 AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
469 AC_REQUIRE([AC_PROG_SED])
470 @@ -39,6 +40,13 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
471
472 AC_LANG_PUSH([C])
473
474 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
475 + [#ifndef __cplusplus
476 + #error "no C++"
477 + #endif]])],
478 + [ax_compiler_cxx=yes;],
479 + [ax_compiler_cxx=no;])
480 +
481 # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
482 # flags, otherwise they are always appended to the warn_cflags variable, and
483 # Clang warns on them for every compilation unit.
484 @@ -64,23 +72,31 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
485 ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
486
487 AS_IF([test "$ax_enable_compile_warnings" != "no"],[
488 + if test "$ax_compiler_cxx" = "no" ; then
489 + # C-only flags. Warn in C++
490 + AX_APPEND_COMPILE_FLAGS([ dnl
491 + -Wnested-externs dnl
492 + -Wmissing-prototypes dnl
493 + -Wstrict-prototypes dnl
494 + -Wdeclaration-after-statement dnl
495 + -Wimplicit-function-declaration dnl
496 + -Wold-style-definition dnl
497 + -Wjump-misses-init dnl
498 + ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
499 + fi
500 +
501 # "yes" flags
502 AX_APPEND_COMPILE_FLAGS([ dnl
503 -Wall dnl
504 -Wextra dnl
505 -Wundef dnl
506 - -Wnested-externs dnl
507 -Wwrite-strings dnl
508 -Wpointer-arith dnl
509 -Wmissing-declarations dnl
510 - -Wmissing-prototypes dnl
511 - -Wstrict-prototypes dnl
512 -Wredundant-decls dnl
513 -Wno-unused-parameter dnl
514 -Wno-missing-field-initializers dnl
515 - -Wdeclaration-after-statement dnl
516 -Wformat=2 dnl
517 - -Wold-style-definition dnl
518 -Wcast-align dnl
519 -Wformat-nonliteral dnl
520 -Wformat-security dnl
521 @@ -96,10 +112,15 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
522 -Wmissing-include-dirs dnl
523 -Wunused-but-set-variable dnl
524 -Warray-bounds dnl
525 - -Wimplicit-function-declaration dnl
526 -Wreturn-type dnl
527 -Wswitch-enum dnl
528 -Wswitch-default dnl
529 + -Wduplicated-cond dnl
530 + -Wduplicated-branches dnl
531 + -Wlogical-op dnl
532 + -Wrestrict dnl
533 + -Wnull-dereference dnl
534 + -Wdouble-promotion dnl
535 $4 dnl
536 $5 dnl
537 $6 dnl
538
539 diff --git a/m4/ax_compiler_flags_ldflags.m4 b/m4/ax_compiler_flags_ldflags.m4
540 index 842e329..976d119 100644
541 --- a/m4/ax_compiler_flags_ldflags.m4
542 +++ b/m4/ax_compiler_flags_ldflags.m4
543 @@ -19,13 +19,14 @@
544 # LICENSE
545 #
546 # Copyright (c) 2014, 2015 Philip Withnall <philip@××××××××××××.uk>
547 +# Copyright (c) 2017, 2018 Reini Urban <rurban@××××.org>
548 #
549 # Copying and distribution of this file, with or without modification, are
550 # permitted in any medium without royalty provided the copyright notice
551 # and this notice are preserved. This file is offered as-is, without any
552 # warranty.
553
554 -#serial 8
555 +#serial 9
556
557 AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
558 AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
559 @@ -48,7 +49,25 @@ AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
560 ax_compiler_flags_test=""
561 ])
562
563 - # macOS linker does not have --as-needed
564 + AX_CHECK_LINK_FLAG([-Wl,--as-needed], [
565 + AX_APPEND_LINK_FLAGS([-Wl,--as-needed],
566 + [AM_LDFLAGS],[$ax_compiler_flags_test])
567 + ])
568 + AX_CHECK_LINK_FLAG([-Wl,-z,relro], [
569 + AX_APPEND_LINK_FLAGS([-Wl,-z,relro],
570 + [AM_LDFLAGS],[$ax_compiler_flags_test])
571 + ])
572 + AX_CHECK_LINK_FLAG([-Wl,-z,now], [
573 + AX_APPEND_LINK_FLAGS([-Wl,-z,now],
574 + [AM_LDFLAGS],[$ax_compiler_flags_test])
575 + ])
576 + AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [
577 + AX_APPEND_LINK_FLAGS([-Wl,-z,noexecstack],
578 + [AM_LDFLAGS],[$ax_compiler_flags_test])
579 + ])
580 + # textonly, retpolineplt not yet
581 +
582 + # macOS and cygwin linker do not have --as-needed
583 AX_CHECK_LINK_FLAG([-Wl,--no-as-needed], [
584 ax_compiler_flags_as_needed_option="-Wl,--no-as-needed"
585 ], [