1 |
commit: 34bd750be930dee47ba6114f211aa97935939ecc |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 6 00:49:22 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 6 00:49:22 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=34bd750b |
7 |
|
8 |
build: slim down autoconf-archive macro search |
9 |
|
10 |
Only copy in files that define the macros we need and not ones that |
11 |
reference the macros. This avoids copying a lot unused files in. |
12 |
|
13 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
14 |
|
15 |
autogen.sh | 13 +- |
16 |
m4/ax_append_compile_flags.m4 | 46 ---- |
17 |
m4/ax_append_flag.m4 | 50 ---- |
18 |
m4/ax_append_link_flags.m4 | 44 --- |
19 |
m4/ax_cc_maxopt.m4 | 191 ------------- |
20 |
m4/ax_cflags_force_c89.m4 | 72 ----- |
21 |
m4/ax_cflags_no_writable_strings.m4 | 99 ------- |
22 |
m4/ax_cflags_strict_prototypes.m4 | 97 ------- |
23 |
m4/ax_compiler_flags.m4 | 158 ----------- |
24 |
m4/ax_compiler_flags_cflags.m4 | 161 ----------- |
25 |
m4/ax_compiler_flags_cxxflags.m4 | 136 --------- |
26 |
m4/ax_compiler_flags_gir.m4 | 60 ---- |
27 |
m4/ax_compiler_flags_ldflags.m4 | 111 -------- |
28 |
m4/ax_compiler_version.m4 | 529 ------------------------------------ |
29 |
m4/ax_cxx_cppflags_std_lang.m4 | 41 --- |
30 |
m4/ax_cxx_cxxflags_std_lang.m4 | 36 --- |
31 |
m4/ax_cxx_ldflags_std_lang.m4 | 36 --- |
32 |
m4/ax_gcc_archflag.m4 | 267 ------------------ |
33 |
18 files changed, 10 insertions(+), 2137 deletions(-) |
34 |
|
35 |
diff --git a/autogen.sh b/autogen.sh |
36 |
index e583300..432152b 100755 |
37 |
--- a/autogen.sh |
38 |
+++ b/autogen.sh |
39 |
@@ -10,11 +10,18 @@ rm -f m4/*.m4 |
40 |
# not everyone has sys-devel/autoconf-archive installed |
41 |
has() { [[ " ${*:2} " == *" $1 "* ]] ; } |
42 |
import_ax() { |
43 |
- local macro content m4 lm4s=() |
44 |
+ local macro content m4 found lm4s=() |
45 |
content=$(sed -e '/^[[:space:]]*#/d' -e 's:\<dnl\>.*::' "$@") |
46 |
for macro in $(echo "${content}" | grep -o '\<AX[A-Z_]*\>' | sort -u) ; do |
47 |
- for m4 in $(grep -rl "\[${macro}\]" /usr/share/aclocal/) ; do |
48 |
- has ${m4} "${m4s[@]}" || lm4s+=( ${m4} ) |
49 |
+ if ! found=$(grep -rl "AC_DEFUN(\[${macro}\]" /usr/share/aclocal/) ; then |
50 |
+ echo "error: ${macro}: unable to locate m4 definition" |
51 |
+ exit 1 |
52 |
+ fi |
53 |
+ for m4 in ${found} ; do |
54 |
+ if ! has ${m4} "${m4s[@]}" "${lm4s[@]}" ; then |
55 |
+ echo "$*: ${macro}: ${m4}" |
56 |
+ lm4s+=( ${m4} ) |
57 |
+ fi |
58 |
done |
59 |
done |
60 |
if [[ ${#lm4s[@]} -gt 0 ]] ; then |
61 |
|
62 |
diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4 |
63 |
deleted file mode 100644 |
64 |
index 9c85635..0000000 |
65 |
--- a/m4/ax_append_compile_flags.m4 |
66 |
+++ /dev/null |
67 |
@@ -1,46 +0,0 @@ |
68 |
-# ============================================================================ |
69 |
-# https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html |
70 |
-# ============================================================================ |
71 |
-# |
72 |
-# SYNOPSIS |
73 |
-# |
74 |
-# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) |
75 |
-# |
76 |
-# DESCRIPTION |
77 |
-# |
78 |
-# For every FLAG1, FLAG2 it is checked whether the compiler works with the |
79 |
-# flag. If it does, the flag is added FLAGS-VARIABLE |
80 |
-# |
81 |
-# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. |
82 |
-# CFLAGS) is used. During the check the flag is always added to the |
83 |
-# current language's flags. |
84 |
-# |
85 |
-# If EXTRA-FLAGS is defined, it is added to the current language's default |
86 |
-# flags (e.g. CFLAGS) when the check is done. The check is thus made with |
87 |
-# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to |
88 |
-# force the compiler to issue an error when a bad flag is given. |
89 |
-# |
90 |
-# INPUT gives an alternative input source to AC_COMPILE_IFELSE. |
91 |
-# |
92 |
-# NOTE: This macro depends on the AX_APPEND_FLAG and |
93 |
-# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with |
94 |
-# AX_APPEND_LINK_FLAGS. |
95 |
-# |
96 |
-# LICENSE |
97 |
-# |
98 |
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com> |
99 |
-# |
100 |
-# Copying and distribution of this file, with or without modification, are |
101 |
-# permitted in any medium without royalty provided the copyright notice |
102 |
-# and this notice are preserved. This file is offered as-is, without any |
103 |
-# warranty. |
104 |
- |
105 |
-#serial 7 |
106 |
- |
107 |
-AC_DEFUN([AX_APPEND_COMPILE_FLAGS], |
108 |
-[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) |
109 |
-AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
110 |
-for flag in $1; do |
111 |
- AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4]) |
112 |
-done |
113 |
-])dnl AX_APPEND_COMPILE_FLAGS |
114 |
|
115 |
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4 |
116 |
deleted file mode 100644 |
117 |
index dd6d8b6..0000000 |
118 |
--- a/m4/ax_append_flag.m4 |
119 |
+++ /dev/null |
120 |
@@ -1,50 +0,0 @@ |
121 |
-# =========================================================================== |
122 |
-# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html |
123 |
-# =========================================================================== |
124 |
-# |
125 |
-# SYNOPSIS |
126 |
-# |
127 |
-# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) |
128 |
-# |
129 |
-# DESCRIPTION |
130 |
-# |
131 |
-# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space |
132 |
-# added in between. |
133 |
-# |
134 |
-# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. |
135 |
-# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains |
136 |
-# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly |
137 |
-# FLAG. |
138 |
-# |
139 |
-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. |
140 |
-# |
141 |
-# LICENSE |
142 |
-# |
143 |
-# Copyright (c) 2008 Guido U. Draheim <guidod@×××.de> |
144 |
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com> |
145 |
-# |
146 |
-# Copying and distribution of this file, with or without modification, are |
147 |
-# permitted in any medium without royalty provided the copyright notice |
148 |
-# and this notice are preserved. This file is offered as-is, without any |
149 |
-# warranty. |
150 |
- |
151 |
-#serial 8 |
152 |
- |
153 |
-AC_DEFUN([AX_APPEND_FLAG], |
154 |
-[dnl |
155 |
-AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF |
156 |
-AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) |
157 |
-AS_VAR_SET_IF(FLAGS,[ |
158 |
- AS_CASE([" AS_VAR_GET(FLAGS) "], |
159 |
- [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], |
160 |
- [ |
161 |
- AS_VAR_APPEND(FLAGS,[" $1"]) |
162 |
- AC_RUN_LOG([: FLAGS="$FLAGS"]) |
163 |
- ]) |
164 |
- ], |
165 |
- [ |
166 |
- AS_VAR_SET(FLAGS,[$1]) |
167 |
- AC_RUN_LOG([: FLAGS="$FLAGS"]) |
168 |
- ]) |
169 |
-AS_VAR_POPDEF([FLAGS])dnl |
170 |
-])dnl AX_APPEND_FLAG |
171 |
|
172 |
diff --git a/m4/ax_append_link_flags.m4 b/m4/ax_append_link_flags.m4 |
173 |
deleted file mode 100644 |
174 |
index 99b9fa5..0000000 |
175 |
--- a/m4/ax_append_link_flags.m4 |
176 |
+++ /dev/null |
177 |
@@ -1,44 +0,0 @@ |
178 |
-# =========================================================================== |
179 |
-# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html |
180 |
-# =========================================================================== |
181 |
-# |
182 |
-# SYNOPSIS |
183 |
-# |
184 |
-# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) |
185 |
-# |
186 |
-# DESCRIPTION |
187 |
-# |
188 |
-# For every FLAG1, FLAG2 it is checked whether the linker works with the |
189 |
-# flag. If it does, the flag is added FLAGS-VARIABLE |
190 |
-# |
191 |
-# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is |
192 |
-# used. During the check the flag is always added to the linker's flags. |
193 |
-# |
194 |
-# If EXTRA-FLAGS is defined, it is added to the linker's default flags |
195 |
-# when the check is done. The check is thus made with the flags: "LDFLAGS |
196 |
-# EXTRA-FLAGS FLAG". This can for example be used to force the linker to |
197 |
-# issue an error when a bad flag is given. |
198 |
-# |
199 |
-# INPUT gives an alternative input source to AC_COMPILE_IFELSE. |
200 |
-# |
201 |
-# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG. |
202 |
-# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS. |
203 |
-# |
204 |
-# LICENSE |
205 |
-# |
206 |
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@×××××.com> |
207 |
-# |
208 |
-# Copying and distribution of this file, with or without modification, are |
209 |
-# permitted in any medium without royalty provided the copyright notice |
210 |
-# and this notice are preserved. This file is offered as-is, without any |
211 |
-# warranty. |
212 |
- |
213 |
-#serial 7 |
214 |
- |
215 |
-AC_DEFUN([AX_APPEND_LINK_FLAGS], |
216 |
-[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) |
217 |
-AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
218 |
-for flag in $1; do |
219 |
- AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4]) |
220 |
-done |
221 |
-])dnl AX_APPEND_LINK_FLAGS |
222 |
|
223 |
diff --git a/m4/ax_cc_maxopt.m4 b/m4/ax_cc_maxopt.m4 |
224 |
deleted file mode 100644 |
225 |
index c463264..0000000 |
226 |
--- a/m4/ax_cc_maxopt.m4 |
227 |
+++ /dev/null |
228 |
@@ -1,191 +0,0 @@ |
229 |
-# =========================================================================== |
230 |
-# https://www.gnu.org/software/autoconf-archive/ax_cc_maxopt.html |
231 |
-# =========================================================================== |
232 |
-# |
233 |
-# SYNOPSIS |
234 |
-# |
235 |
-# AX_CC_MAXOPT |
236 |
-# |
237 |
-# DESCRIPTION |
238 |
-# |
239 |
-# Try to turn on "good" C optimization flags for various compilers and |
240 |
-# architectures, for some definition of "good". (In our case, good for |
241 |
-# FFTW and hopefully for other scientific codes. Modify as needed.) |
242 |
-# |
243 |
-# The user can override the flags by setting the CFLAGS environment |
244 |
-# variable. The user can also specify --enable-portable-binary in order to |
245 |
-# disable any optimization flags that might result in a binary that only |
246 |
-# runs on the host architecture. |
247 |
-# |
248 |
-# Note also that the flags assume that ANSI C aliasing rules are followed |
249 |
-# by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point |
250 |
-# computations can be re-ordered as needed. |
251 |
-# |
252 |
-# Requires macros: AX_CHECK_COMPILE_FLAG, AX_COMPILER_VENDOR, |
253 |
-# AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID. |
254 |
-# |
255 |
-# LICENSE |
256 |
-# |
257 |
-# Copyright (c) 2008 Steven G. Johnson <stevenj@××××××××.edu> |
258 |
-# Copyright (c) 2008 Matteo Frigo |
259 |
-# |
260 |
-# This program is free software: you can redistribute it and/or modify it |
261 |
-# under the terms of the GNU General Public License as published by the |
262 |
-# Free Software Foundation, either version 3 of the License, or (at your |
263 |
-# option) any later version. |
264 |
-# |
265 |
-# This program is distributed in the hope that it will be useful, but |
266 |
-# WITHOUT ANY WARRANTY; without even the implied warranty of |
267 |
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
268 |
-# Public License for more details. |
269 |
-# |
270 |
-# You should have received a copy of the GNU General Public License along |
271 |
-# with this program. If not, see <https://www.gnu.org/licenses/>. |
272 |
-# |
273 |
-# As a special exception, the respective Autoconf Macro's copyright owner |
274 |
-# gives unlimited permission to copy, distribute and modify the configure |
275 |
-# scripts that are the output of Autoconf when processing the Macro. You |
276 |
-# need not follow the terms of the GNU General Public License when using |
277 |
-# or distributing such scripts, even though portions of the text of the |
278 |
-# Macro appear in them. The GNU General Public License (GPL) does govern |
279 |
-# all other use of the material that constitutes the Autoconf Macro. |
280 |
-# |
281 |
-# This special exception to the GPL applies to versions of the Autoconf |
282 |
-# Macro released by the Autoconf Archive. When you make and distribute a |
283 |
-# modified version of the Autoconf Macro, you may extend this special |
284 |
-# exception to the GPL to apply to your modified version as well. |
285 |
- |
286 |
-#serial 18 |
287 |
- |
288 |
-AC_DEFUN([AX_CC_MAXOPT], |
289 |
-[ |
290 |
-AC_REQUIRE([AC_PROG_CC]) |
291 |
-AC_REQUIRE([AX_COMPILER_VENDOR]) |
292 |
-AC_REQUIRE([AC_CANONICAL_HOST]) |
293 |
- |
294 |
-AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])], |
295 |
- acx_maxopt_portable=$enableval, acx_maxopt_portable=no) |
296 |
- |
297 |
-# Try to determine "good" native compiler flags if none specified via CFLAGS |
298 |
-if test "$ac_test_CFLAGS" != "set"; then |
299 |
- case $ax_cv_c_compiler_vendor in |
300 |
- dec) CFLAGS="$CFLAGS -newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" |
301 |
- if test "x$acx_maxopt_portable" = xno; then |
302 |
- CFLAGS="$CFLAGS -arch host" |
303 |
- fi;; |
304 |
- |
305 |
- sun) CFLAGS="$CFLAGS -native -fast -xO5 -dalign" |
306 |
- if test "x$acx_maxopt_portable" = xyes; then |
307 |
- CFLAGS="$CFLAGS -xarch=generic" |
308 |
- fi;; |
309 |
- |
310 |
- hp) CFLAGS="$CFLAGS +Oall +Optrs_ansi +DSnative" |
311 |
- if test "x$acx_maxopt_portable" = xyes; then |
312 |
- CFLAGS="$CFLAGS +DAportable" |
313 |
- fi;; |
314 |
- |
315 |
- ibm) if test "x$acx_maxopt_portable" = xno; then |
316 |
- xlc_opt="-qarch=auto -qtune=auto" |
317 |
- else |
318 |
- xlc_opt="-qtune=auto" |
319 |
- fi |
320 |
- AX_CHECK_COMPILE_FLAG($xlc_opt, |
321 |
- CFLAGS="$CFLAGS -O3 -qansialias -w $xlc_opt", |
322 |
- [CFLAGS="$CFLAGS -O3 -qansialias -w" |
323 |
- echo "******************************************************" |
324 |
- echo "* You seem to have the IBM C compiler. It is *" |
325 |
- echo "* recommended for best performance that you use: *" |
326 |
- echo "* *" |
327 |
- echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" |
328 |
- echo "* ^^^ ^^^ *" |
329 |
- echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" |
330 |
- echo "* CPU you have. (Set the CFLAGS environment var. *" |
331 |
- echo "* and re-run configure.) For more info, man cc. *" |
332 |
- echo "******************************************************"]) |
333 |
- ;; |
334 |
- |
335 |
- intel) CFLAGS="$CFLAGS -O3 -ansi_alias" |
336 |
- if test "x$acx_maxopt_portable" = xno; then |
337 |
- icc_archflag=unknown |
338 |
- icc_flags="" |
339 |
- case $host_cpu in |
340 |
- i686*|x86_64*) |
341 |
- # icc accepts gcc assembly syntax, so these should work: |
342 |
- AX_GCC_X86_CPUID(0) |
343 |
- AX_GCC_X86_CPUID(1) |
344 |
- case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG |
345 |
- *:756e6547:6c65746e:49656e69) # Intel |
346 |
- case $ax_cv_gcc_x86_cpuid_1 in |
347 |
- *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) icc_flags="-xK" ;; |
348 |
- *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) icc_flags="-xSSE2 -xB -xK" ;; |
349 |
- *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) icc_flags="-xSSE3 -xP -xO -xB -xK" ;; |
350 |
- *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) icc_flags="-xSSSE3 -xT -xB -xK" ;; |
351 |
- *1?6[[7d]]?:*:*:*) icc_flags="-xSSE4.1 -xS -xT -xB -xK" ;; |
352 |
- *1?6[[aef]]?:*:*:*|*2?6[[5cef]]?:*:*:*) icc_flags="-xSSE4.2 -xS -xT -xB -xK" ;; |
353 |
- *2?6[[ad]]?:*:*:*) icc_flags="-xAVX -SSE4.2 -xS -xT -xB -xK" ;; |
354 |
- *3?6[[ae]]?:*:*:*) icc_flags="-xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; |
355 |
- *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) icc_flags="-xCORE-AVX2 -xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; |
356 |
- *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) icc_flags="-xSSE3 -xP -xO -xN -xW -xK" ;; |
357 |
- *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) icc_flags="-xSSE2 -xN -xW -xK" ;; |
358 |
- esac ;; |
359 |
- esac ;; |
360 |
- esac |
361 |
- if test "x$icc_flags" != x; then |
362 |
- for flag in $icc_flags; do |
363 |
- AX_CHECK_COMPILE_FLAG($flag, [icc_archflag=$flag; break]) |
364 |
- done |
365 |
- fi |
366 |
- AC_MSG_CHECKING([for icc architecture flag]) |
367 |
- AC_MSG_RESULT($icc_archflag) |
368 |
- if test "x$icc_archflag" != xunknown; then |
369 |
- CFLAGS="$CFLAGS $icc_archflag" |
370 |
- fi |
371 |
- fi |
372 |
- ;; |
373 |
- |
374 |
- gnu) |
375 |
- # default optimization flags for gcc on all systems |
376 |
- CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" |
377 |
- |
378 |
- # -malign-double for x86 systems |
379 |
- AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double") |
380 |
- |
381 |
- # -fstrict-aliasing for gcc-2.95+ |
382 |
- AX_CHECK_COMPILE_FLAG(-fstrict-aliasing, |
383 |
- CFLAGS="$CFLAGS -fstrict-aliasing") |
384 |
- |
385 |
- # note that we enable "unsafe" fp optimization with other compilers, too |
386 |
- AX_CHECK_COMPILE_FLAG(-ffast-math, CFLAGS="$CFLAGS -ffast-math") |
387 |
- |
388 |
- AX_GCC_ARCHFLAG($acx_maxopt_portable) |
389 |
- ;; |
390 |
- |
391 |
- microsoft) |
392 |
- # default optimization flags for MSVC opt builds |
393 |
- CFLAGS="$CFLAGS -O2" |
394 |
- ;; |
395 |
- esac |
396 |
- |
397 |
- if test -z "$CFLAGS"; then |
398 |
- echo "" |
399 |
- echo "********************************************************" |
400 |
- echo "* WARNING: Don't know the best CFLAGS for this system *" |
401 |
- echo "* Use ./configure CFLAGS=... to specify your own flags *" |
402 |
- echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" |
403 |
- echo "********************************************************" |
404 |
- echo "" |
405 |
- CFLAGS="$CFLAGS -O3" |
406 |
- fi |
407 |
- |
408 |
- AX_CHECK_COMPILE_FLAG($CFLAGS, [], [ |
409 |
- echo "" |
410 |
- echo "********************************************************" |
411 |
- echo "* WARNING: The guessed CFLAGS don't seem to work with *" |
412 |
- echo "* your compiler. *" |
413 |
- echo "* Use ./configure CFLAGS=... to specify your own flags *" |
414 |
- echo "********************************************************" |
415 |
- echo "" |
416 |
- ]) |
417 |
- |
418 |
-fi |
419 |
-]) |
420 |
|
421 |
diff --git a/m4/ax_cflags_force_c89.m4 b/m4/ax_cflags_force_c89.m4 |
422 |
deleted file mode 100644 |
423 |
index 815fb68..0000000 |
424 |
--- a/m4/ax_cflags_force_c89.m4 |
425 |
+++ /dev/null |
426 |
@@ -1,72 +0,0 @@ |
427 |
-# =========================================================================== |
428 |
-# https://www.gnu.org/software/autoconf-archive/ax_cflags_force_c89.html |
429 |
-# =========================================================================== |
430 |
-# |
431 |
-# SYNOPSIS |
432 |
-# |
433 |
-# AX_CFLAGS_FORCE_C89 [(shellvar [,default, [A/NA]])] |
434 |
-# |
435 |
-# DESCRIPTION |
436 |
-# |
437 |
-# Try to find a compiler option that enables strict C89 mode. |
438 |
-# |
439 |
-# For the GNU CC compiler it will be -ansi -pedantic. The result is added |
440 |
-# to the shellvar being CFLAGS by default. |
441 |
-# |
442 |
-# Currently this macro knows about GCC, Solaris C compiler, Digital Unix C |
443 |
-# compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC |
444 |
-# SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C |
445 |
-# compiler. |
446 |
-# |
447 |
-# - $1 shell-variable-to-add-to : CFLAGS |
448 |
-# - $2 add-value-if-not-found : nothing |
449 |
-# - $3 action-if-found : add value to shellvariable |
450 |
-# - $4 action-if-not-found : nothing |
451 |
-# |
452 |
-# NOTE: These macros depend on AX_APPEND_FLAG. |
453 |
-# |
454 |
-# LICENSE |
455 |
-# |
456 |
-# Copyright (c) 2009 Guido U. Draheim <guidod@×××.de> |
457 |
-# |
458 |
-# Copying and distribution of this file, with or without modification, are |
459 |
-# permitted in any medium without royalty provided the copyright notice |
460 |
-# and this notice are preserved. This file is offered as-is, without any |
461 |
-# warranty. |
462 |
- |
463 |
-#serial 12 |
464 |
- |
465 |
-AC_DEFUN([AX_CFLAGS_FORCE_C89],[dnl |
466 |
-AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl |
467 |
-AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_force_c89])dnl |
468 |
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for C89 mode], |
469 |
-VAR,[VAR="no, unknown" |
470 |
- AC_LANG_PUSH([C]) |
471 |
- ac_save_[]FLAGS="$[]FLAGS" |
472 |
-for ac_arg dnl |
473 |
-in "-pedantic % -ansi -pedantic" dnl GCC |
474 |
- "-xstrconst % -v -Xc" dnl Solaris C |
475 |
- "-std1 % -std1" dnl Digital Unix |
476 |
- " % -qlanglvl=ansi" dnl AIX |
477 |
- " % -ansi -ansiE" dnl IRIX |
478 |
- "+ESlit % -Aa" dnl HP-UX C |
479 |
- "-Xc % -Xc" dnl NEC SX-5 (Super-UX 10) |
480 |
- "-h conform % -h conform" dnl Cray C (Unicos) |
481 |
- # |
482 |
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` |
483 |
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
484 |
- [[return 0;]])], |
485 |
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break],[]) |
486 |
-done |
487 |
- FLAGS="$ac_save_[]FLAGS" |
488 |
- AC_LANG_POP([C]) |
489 |
-]) |
490 |
-AS_VAR_POPDEF([FLAGS])dnl |
491 |
-AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
492 |
-case ".$VAR" in |
493 |
- .ok|.ok,*) m4_ifvaln($3,$3) ;; |
494 |
- .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; |
495 |
- *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; |
496 |
-esac |
497 |
-AS_VAR_POPDEF([VAR])dnl |
498 |
-]) |
499 |
|
500 |
diff --git a/m4/ax_cflags_no_writable_strings.m4 b/m4/ax_cflags_no_writable_strings.m4 |
501 |
deleted file mode 100644 |
502 |
index 14478a6..0000000 |
503 |
--- a/m4/ax_cflags_no_writable_strings.m4 |
504 |
+++ /dev/null |
505 |
@@ -1,99 +0,0 @@ |
506 |
-# ================================================================================== |
507 |
-# https://www.gnu.org/software/autoconf-archive/ax_cflags_no_writable_strings.html |
508 |
-# ================================================================================== |
509 |
-# |
510 |
-# SYNOPSIS |
511 |
-# |
512 |
-# AX_CFLAGS_NO_WRITABLE_STRINGS [(shellvar [,default, [A/NA]])] |
513 |
-# |
514 |
-# DESCRIPTION |
515 |
-# |
516 |
-# Try to find a compiler option that makes all string literals readonly. |
517 |
-# |
518 |
-# The sanity check is done by looking at string.h which has a set of |
519 |
-# strcpy definitions that should be defined with const-modifiers to not |
520 |
-# emit a warning in all so many places. |
521 |
-# |
522 |
-# For the GNU CC compiler it will be -fno-writable-strings -Wwrite-strings |
523 |
-# The result is added to the shellvar being CFLAGS by default. |
524 |
-# |
525 |
-# DEFAULTS: |
526 |
-# |
527 |
-# - $1 shell-variable-to-add-to : CFLAGS |
528 |
-# - $2 add-value-if-not-found : nothing |
529 |
-# - $3 action-if-found : add value to shellvariable |
530 |
-# - $4 action-if-not-found : nothing |
531 |
-# |
532 |
-# NOTE: These macros depend on AX_APPEND_FLAG. |
533 |
-# |
534 |
-# LICENSE |
535 |
-# |
536 |
-# Copyright (c) 2008 Guido U. Draheim <guidod@×××.de> |
537 |
-# |
538 |
-# Copying and distribution of this file, with or without modification, are |
539 |
-# permitted in any medium without royalty provided the copyright notice |
540 |
-# and this notice are preserved. This file is offered as-is, without any |
541 |
-# warranty. |
542 |
- |
543 |
-#serial 16 |
544 |
- |
545 |
-AC_DEFUN([AX_FLAGS_NO_WRITABLE_STRINGS],[dnl |
546 |
-AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl |
547 |
-AS_VAR_PUSHDEF([VAR],[ax_cv_[]_AC_LANG_ABBREV[]flags_no_writable_strings])dnl |
548 |
-AC_CACHE_CHECK([m4_ifval([$1],[$1],FLAGS) making strings readonly], |
549 |
-VAR,[VAR="no, unknown" |
550 |
-ac_save_[]FLAGS="$[]FLAGS" |
551 |
-# IRIX C compiler: |
552 |
-# -use_readonly_const is the default for IRIX C, |
553 |
-# puts them into .rodata, but they are copied later. |
554 |
-# need to be "-G0 -rdatashared" for strictmode but |
555 |
-# I am not sure what effect that has really. - guidod |
556 |
-for ac_arg dnl |
557 |
-in "-pedantic -Werror % -fno-writable-strings -Wwrite-strings" dnl GCC |
558 |
- "-pedantic -Werror % -fconst-strings -Wwrite-strings" dnl newer GCC |
559 |
- "-pedantic % -fconst-strings %% no, const-strings is default" dnl newer GCC |
560 |
- "-v -Xc % -xstrconst" dnl Solaris C - strings go into readonly segment |
561 |
- "+w1 -Aa % +ESlit" dnl HP-UX C - strings go into readonly segment |
562 |
- "-w0 -std1 % -readonly_strings" dnl Digital Unix - again readonly segment |
563 |
- "-fullwarn -use_readonly_const %% ok, its the default" dnl IRIX C |
564 |
- # |
565 |
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` |
566 |
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[return 0;]])], |
567 |
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break],[]) |
568 |
-done |
569 |
-case ".$VAR" in |
570 |
- .|.no|.no,*) ;; |
571 |
- *) # sanity check - testing strcpy() from string.h |
572 |
- cp config.log config.tmp |
573 |
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[ |
574 |
- char test[16]; |
575 |
- if (strcpy (test, "test")) return 1;]])],[dnl the original did use test -n `$CC testprogram.c` |
576 |
- if test `diff config.log config.tmp | grep -i warning | wc -l` != 0 |
577 |
- then VAR="no, suppressed, string.h," ; fi], |
578 |
- [VAR="no, suppressed, string.h"]) |
579 |
- rm config.tmp |
580 |
- ;; |
581 |
-esac |
582 |
-FLAGS="$ac_save_[]FLAGS" |
583 |
-]) |
584 |
-AS_VAR_POPDEF([FLAGS])dnl |
585 |
-AC_REQUIRE([AX_APPEND_FLAG]) |
586 |
-case ".$VAR" in |
587 |
- .ok|.ok,*) m4_ifvaln($3,$3) ;; |
588 |
- .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; |
589 |
- *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; |
590 |
-esac |
591 |
-AS_VAR_POPDEF([VAR])dnl |
592 |
-])dnl AX_FLAGS_NO_WRITABLE_STRINGS |
593 |
- |
594 |
-AC_DEFUN([AX_CFLAGS_NO_WRITABLE_STRINGS],[dnl |
595 |
-AC_LANG_PUSH([C]) |
596 |
-AX_FLAGS_NO_WRITABLE_STRINGS([$1], [$2], [$3], [$4]) |
597 |
-AC_LANG_POP([C]) |
598 |
-]) |
599 |
- |
600 |
-AC_DEFUN([AX_CXXFLAGS_NO_WRITABLE_STRINGS],[dnl |
601 |
-AC_LANG_PUSH([C++]) |
602 |
-AX_FLAGS_NO_WRITABLE_STRINGS([$1], [$2], [$3], [$4]) |
603 |
-AC_LANG_POP([C++]) |
604 |
-]) |
605 |
|
606 |
diff --git a/m4/ax_cflags_strict_prototypes.m4 b/m4/ax_cflags_strict_prototypes.m4 |
607 |
deleted file mode 100644 |
608 |
index 1a910cf..0000000 |
609 |
--- a/m4/ax_cflags_strict_prototypes.m4 |
610 |
+++ /dev/null |
611 |
@@ -1,97 +0,0 @@ |
612 |
-# ================================================================================ |
613 |
-# https://www.gnu.org/software/autoconf-archive/ax_cflags_strict_prototypes.html |
614 |
-# ================================================================================ |
615 |
-# |
616 |
-# SYNOPSIS |
617 |
-# |
618 |
-# AX_CFLAGS_STRICT_PROTOTYPES [(shellvar [,default, [A/NA]] |
619 |
-# |
620 |
-# DESCRIPTION |
621 |
-# |
622 |
-# Try to find a compiler option that requires strict prototypes. |
623 |
-# |
624 |
-# The sanity check is done by looking at sys/signal.h which has a set of |
625 |
-# macro-definitions SIG_DFL and SIG_IGN that are cast to the local |
626 |
-# signal-handler type. If that signal-handler type is not fully qualified |
627 |
-# then the system headers are not seen as strictly prototype clean. |
628 |
-# |
629 |
-# For the GNU CC compiler it will be -fstrict-prototypes |
630 |
-# -Wstrict-prototypes The result is added to the shellvar being CFLAGS by |
631 |
-# default. |
632 |
-# |
633 |
-# DEFAULTS: |
634 |
-# |
635 |
-# - $1 shell-variable-to-add-to : CFLAGS |
636 |
-# - $2 add-value-if-not-found : nothing |
637 |
-# - $3 action-if-found : add value to shellvariable |
638 |
-# - $4 action-if-not-found : nothing |
639 |
-# |
640 |
-# NOTE: These macros depend on AX_APPEND_FLAG. |
641 |
-# |
642 |
-# LICENSE |
643 |
-# |
644 |
-# Copyright (c) 2008 Guido U. Draheim <guidod@×××.de> |
645 |
-# |
646 |
-# Copying and distribution of this file, with or without modification, are |
647 |
-# permitted in any medium without royalty provided the copyright notice |
648 |
-# and this notice are preserved. This file is offered as-is, without any |
649 |
-# warranty. |
650 |
- |
651 |
-#serial 18 |
652 |
- |
653 |
-AC_DEFUN([AX_FLAGS_STRICT_PROTOTYPES],[dnl |
654 |
-AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl |
655 |
-AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_strict_prototypes])dnl |
656 |
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes], |
657 |
-VAR,[VAR="no, unknown" |
658 |
-ac_save_[]FLAGS="$[]FLAGS" |
659 |
-for ac_arg dnl |
660 |
-in "-pedantic -Werror % -fstrict-prototypes -Wstrict-prototypes" dnl GCC |
661 |
- "-pedantic -Werror % -Wstrict-prototypes" dnl try to warn at least |
662 |
- "-pedantic -Werror % -Wmissing-prototypes" dnl try to warn at least |
663 |
- "-pedantic -Werror % -Werror-implicit-function-declaration" dnl |
664 |
- "-pedantic -Werror % -Wimplicit-function-declaration" dnl |
665 |
- "-pedantic % -Wstrict-prototypes %% no, unsupported" dnl oops |
666 |
- # |
667 |
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` |
668 |
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[return 0;]])], |
669 |
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break], []) |
670 |
-done |
671 |
-case ".$VAR" in |
672 |
- .|.no|.no,*) ;; |
673 |
- *) # sanity check with signal() from sys/signal.h |
674 |
- cp config.log config.tmp |
675 |
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[ |
676 |
- if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1; |
677 |
- if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;]])], |
678 |
- [dnl the original did use test -n `$CC testprogram.c` |
679 |
- if test `diff config.log config.tmp | grep -i warning | wc -l` != 0 |
680 |
-then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1 |
681 |
-then VAR="no, suppressed, signal.h," ; fi ; fi], |
682 |
- [VAR="no, suppressed, signal.h"]) |
683 |
- rm config.tmp |
684 |
- ;; |
685 |
-esac |
686 |
-FLAGS="$ac_save_[]FLAGS" |
687 |
-]) |
688 |
-AS_VAR_POPDEF([FLAGS])dnl |
689 |
-AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
690 |
-case ".$VAR" in |
691 |
- .ok|.ok,*) m4_ifvaln($3,$3) ;; |
692 |
- .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; |
693 |
- *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; |
694 |
-esac |
695 |
-AS_VAR_POPDEF([VAR])dnl |
696 |
-])dnl AX_FLAGS_STRICT_PROTOTYPES |
697 |
- |
698 |
-AC_DEFUN([AX_CFLAGS_STRICT_PROTOTYPES],[dnl |
699 |
-AC_LANG_PUSH([C]) |
700 |
-AX_FLAGS_STRICT_PROTOTYPES([$1], [$2], [$3], [$4]) |
701 |
-AC_LANG_POP([C]) |
702 |
-]) |
703 |
- |
704 |
-AC_DEFUN([AX_CXXFLAGS_STRICT_PROTOTYPES],[dnl |
705 |
-AC_LANG_PUSH([C++]) |
706 |
-AX_FLAGS_STRICT_PROTOTYPES([$1], [$2], [$3], [$4]) |
707 |
-AC_LANG_POP([C++]) |
708 |
-]) |
709 |
|
710 |
diff --git a/m4/ax_compiler_flags.m4 b/m4/ax_compiler_flags.m4 |
711 |
deleted file mode 100644 |
712 |
index ddb0456..0000000 |
713 |
--- a/m4/ax_compiler_flags.m4 |
714 |
+++ /dev/null |
715 |
@@ -1,158 +0,0 @@ |
716 |
-# =========================================================================== |
717 |
-# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html |
718 |
-# =========================================================================== |
719 |
-# |
720 |
-# SYNOPSIS |
721 |
-# |
722 |
-# AX_COMPILER_FLAGS([CFLAGS-VARIABLE], [LDFLAGS-VARIABLE], [IS-RELEASE], [EXTRA-BASE-CFLAGS], [EXTRA-YES-CFLAGS], [UNUSED], [UNUSED], [UNUSED], [EXTRA-BASE-LDFLAGS], [EXTRA-YES-LDFLAGS], [UNUSED], [UNUSED], [UNUSED]) |
723 |
-# |
724 |
-# DESCRIPTION |
725 |
-# |
726 |
-# Check for the presence of an --enable-compile-warnings option to |
727 |
-# configure, defaulting to "error" in normal operation, or "yes" if |
728 |
-# IS-RELEASE is equal to "yes". Return the value in the variable |
729 |
-# $ax_enable_compile_warnings. |
730 |
-# |
731 |
-# Depending on the value of --enable-compile-warnings, different compiler |
732 |
-# warnings are checked to see if they work with the current compiler and, |
733 |
-# if so, are appended to CFLAGS-VARIABLE and LDFLAGS-VARIABLE. This |
734 |
-# allows a consistent set of baseline compiler warnings to be used across |
735 |
-# a code base, irrespective of any warnings enabled locally by individual |
736 |
-# developers. By standardising the warnings used by all developers of a |
737 |
-# project, the project can commit to a zero-warnings policy, using -Werror |
738 |
-# to prevent compilation if new warnings are introduced. This makes |
739 |
-# catching bugs which are flagged by warnings a lot easier. |
740 |
-# |
741 |
-# By providing a consistent --enable-compile-warnings argument across all |
742 |
-# projects using this macro, continuous integration systems can easily be |
743 |
-# configured the same for all projects. Automated systems or build |
744 |
-# systems aimed at beginners may want to pass the --disable-Werror |
745 |
-# argument to unconditionally prevent warnings being fatal. |
746 |
-# |
747 |
-# --enable-compile-warnings can take the values: |
748 |
-# |
749 |
-# * no: Base compiler warnings only; not even -Wall. |
750 |
-# * yes: The above, plus a broad range of useful warnings. |
751 |
-# * error: The above, plus -Werror so that all warnings are fatal. |
752 |
-# Use --disable-Werror to override this and disable fatal |
753 |
-# warnings. |
754 |
-# |
755 |
-# The set of base and enabled flags can be augmented using the |
756 |
-# EXTRA-*-CFLAGS and EXTRA-*-LDFLAGS variables, which are tested and |
757 |
-# appended to the output variable if --enable-compile-warnings is not |
758 |
-# "no". Flags should not be disabled using these arguments, as the entire |
759 |
-# point of AX_COMPILER_FLAGS is to enforce a consistent set of useful |
760 |
-# compiler warnings on code, using warnings which have been chosen for low |
761 |
-# false positive rates. If a compiler emits false positives for a |
762 |
-# warning, a #pragma should be used in the code to disable the warning |
763 |
-# locally. See: |
764 |
-# |
765 |
-# https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas |
766 |
-# |
767 |
-# The EXTRA-* variables should only be used to supply extra warning flags, |
768 |
-# and not general purpose compiler flags, as they are controlled by |
769 |
-# configure options such as --disable-Werror. |
770 |
-# |
771 |
-# IS-RELEASE can be used to disable -Werror when making a release, which |
772 |
-# is useful for those hairy moments when you just want to get the release |
773 |
-# done as quickly as possible. Set it to "yes" to disable -Werror. By |
774 |
-# default, it uses the value of $ax_is_release, so if you are using the |
775 |
-# AX_IS_RELEASE macro, there is no need to pass this parameter. For |
776 |
-# example: |
777 |
-# |
778 |
-# AX_IS_RELEASE([git-directory]) |
779 |
-# AX_COMPILER_FLAGS() |
780 |
-# |
781 |
-# CFLAGS-VARIABLE defaults to WARN_CFLAGS, and LDFLAGS-VARIABLE defaults |
782 |
-# to WARN_LDFLAGS. Both variables are AC_SUBST-ed by this macro, but must |
783 |
-# be manually added to the CFLAGS and LDFLAGS variables for each target in |
784 |
-# the code base. |
785 |
-# |
786 |
-# If C++ language support is enabled with AC_PROG_CXX, which must occur |
787 |
-# before this macro in configure.ac, warning flags for the C++ compiler |
788 |
-# are AC_SUBST-ed as WARN_CXXFLAGS, and must be manually added to the |
789 |
-# CXXFLAGS variables for each target in the code base. EXTRA-*-CFLAGS can |
790 |
-# be used to augment the base and enabled flags. |
791 |
-# |
792 |
-# Warning flags for g-ir-scanner (from GObject Introspection) are |
793 |
-# AC_SUBST-ed as WARN_SCANNERFLAGS. This variable must be manually added |
794 |
-# to the SCANNERFLAGS variable for each GIR target in the code base. If |
795 |
-# extra g-ir-scanner flags need to be enabled, the AX_COMPILER_FLAGS_GIR |
796 |
-# macro must be invoked manually. |
797 |
-# |
798 |
-# AX_COMPILER_FLAGS may add support for other tools in future, in addition |
799 |
-# to the compiler and linker. No extra EXTRA-* variables will be added |
800 |
-# for those tools, and all extra support will still use the single |
801 |
-# --enable-compile-warnings configure option. For finer grained control |
802 |
-# over the flags for individual tools, use AX_COMPILER_FLAGS_CFLAGS, |
803 |
-# AX_COMPILER_FLAGS_LDFLAGS and AX_COMPILER_FLAGS_* for new tools. |
804 |
-# |
805 |
-# The UNUSED variables date from a previous version of this macro, and are |
806 |
-# automatically appended to the preceding non-UNUSED variable. They should |
807 |
-# be left empty in new uses of the macro. |
808 |
-# |
809 |
-# LICENSE |
810 |
-# |
811 |
-# Copyright (c) 2014, 2015 Philip Withnall <philip@××××××××××××.uk> |
812 |
-# Copyright (c) 2015 David King <amigadave@×××××××××.com> |
813 |
-# |
814 |
-# Copying and distribution of this file, with or without modification, are |
815 |
-# permitted in any medium without royalty provided the copyright notice |
816 |
-# and this notice are preserved. This file is offered as-is, without any |
817 |
-# warranty. |
818 |
- |
819 |
-#serial 14 |
820 |
- |
821 |
-# _AX_COMPILER_FLAGS_LANG([LANGNAME]) |
822 |
-m4_defun([_AX_COMPILER_FLAGS_LANG], |
823 |
-[m4_ifdef([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [], |
824 |
- [m4_define([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [])dnl |
825 |
- AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_]$1[FLAGS])])dnl |
826 |
-]) |
827 |
- |
828 |
-AC_DEFUN([AX_COMPILER_FLAGS],[ |
829 |
- # C support is enabled by default. |
830 |
- _AX_COMPILER_FLAGS_LANG([C]) |
831 |
- # Only enable C++ support if AC_PROG_CXX is called. The redefinition of |
832 |
- # AC_PROG_CXX is so that a fatal error is emitted if this macro is called |
833 |
- # before AC_PROG_CXX, which would otherwise cause no C++ warnings to be |
834 |
- # checked. |
835 |
- AC_PROVIDE_IFELSE([AC_PROG_CXX], |
836 |
- [_AX_COMPILER_FLAGS_LANG([CXX])], |
837 |
- [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AX_COMPILER_FLAGS_LANG([CXX])])]) |
838 |
- AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_LDFLAGS]) |
839 |
- |
840 |
- # Default value for IS-RELEASE is $ax_is_release |
841 |
- ax_compiler_flags_is_release=m4_tolower(m4_normalize(ifelse([$3],, |
842 |
- [$ax_is_release], |
843 |
- [$3]))) |
844 |
- |
845 |
- AC_ARG_ENABLE([compile-warnings], |
846 |
- AS_HELP_STRING([--enable-compile-warnings=@<:@no/yes/error@:>@], |
847 |
- [Enable compiler warnings and errors]),, |
848 |
- [AS_IF([test "$ax_compiler_flags_is_release" = "yes"], |
849 |
- [enable_compile_warnings="yes"], |
850 |
- [enable_compile_warnings="error"])]) |
851 |
- AC_ARG_ENABLE([Werror], |
852 |
- AS_HELP_STRING([--disable-Werror], |
853 |
- [Unconditionally make all compiler warnings non-fatal]),, |
854 |
- [enable_Werror=maybe]) |
855 |
- |
856 |
- # Return the user's chosen warning level |
857 |
- AS_IF([test "$enable_Werror" = "no" -a \ |
858 |
- "$enable_compile_warnings" = "error"],[ |
859 |
- enable_compile_warnings="yes" |
860 |
- ]) |
861 |
- |
862 |
- ax_enable_compile_warnings=$enable_compile_warnings |
863 |
- |
864 |
- AX_COMPILER_FLAGS_CFLAGS([$1],[$ax_compiler_flags_is_release], |
865 |
- [$4],[$5 $6 $7 $8]) |
866 |
- m4_ifdef([_AX_COMPILER_FLAGS_LANG_CXX_enabled], |
867 |
- [AX_COMPILER_FLAGS_CXXFLAGS([WARN_CXXFLAGS], |
868 |
- [$ax_compiler_flags_is_release], |
869 |
- [$4],[$5 $6 $7 $8])]) |
870 |
- AX_COMPILER_FLAGS_LDFLAGS([$2],[$ax_compiler_flags_is_release], |
871 |
- [$9],[$10 $11 $12 $13]) |
872 |
- AX_COMPILER_FLAGS_GIR([WARN_SCANNERFLAGS],[$ax_compiler_flags_is_release]) |
873 |
-])dnl AX_COMPILER_FLAGS |
874 |
|
875 |
diff --git a/m4/ax_compiler_flags_cflags.m4 b/m4/ax_compiler_flags_cflags.m4 |
876 |
deleted file mode 100644 |
877 |
index 916f918..0000000 |
878 |
--- a/m4/ax_compiler_flags_cflags.m4 |
879 |
+++ /dev/null |
880 |
@@ -1,161 +0,0 @@ |
881 |
-# ============================================================================= |
882 |
-# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_cflags.html |
883 |
-# ============================================================================= |
884 |
-# |
885 |
-# SYNOPSIS |
886 |
-# |
887 |
-# AX_COMPILER_FLAGS_CFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS]) |
888 |
-# |
889 |
-# DESCRIPTION |
890 |
-# |
891 |
-# Add warning flags for the C compiler to VARIABLE, which defaults to |
892 |
-# WARN_CFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be |
893 |
-# manually added to the CFLAGS variable for each target in the code base. |
894 |
-# |
895 |
-# This macro depends on the environment set up by AX_COMPILER_FLAGS. |
896 |
-# Specifically, it uses the value of $ax_enable_compile_warnings to decide |
897 |
-# which flags to enable. |
898 |
-# |
899 |
-# LICENSE |
900 |
-# |
901 |
-# Copyright (c) 2014, 2015 Philip Withnall <philip@××××××××××××.uk> |
902 |
-# Copyright (c) 2017, 2018 Reini Urban <rurban@××××.org> |
903 |
-# |
904 |
-# Copying and distribution of this file, with or without modification, are |
905 |
-# permitted in any medium without royalty provided the copyright notice |
906 |
-# and this notice are preserved. This file is offered as-is, without any |
907 |
-# warranty. |
908 |
- |
909 |
-#serial 17 |
910 |
- |
911 |
-AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[ |
912 |
- AC_REQUIRE([AC_PROG_SED]) |
913 |
- AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS]) |
914 |
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
915 |
- AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) |
916 |
- |
917 |
- # Variable names |
918 |
- m4_define([ax_warn_cflags_variable], |
919 |
- [m4_normalize(ifelse([$1],,[WARN_CFLAGS],[$1]))]) |
920 |
- |
921 |
- AC_LANG_PUSH([C]) |
922 |
- |
923 |
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ |
924 |
- [#ifndef __cplusplus |
925 |
- #error "no C++" |
926 |
- #endif]])], |
927 |
- [ax_compiler_cxx=yes;], |
928 |
- [ax_compiler_cxx=no;]) |
929 |
- |
930 |
- # Always pass -Werror=unknown-warning-option to get Clang to fail on bad |
931 |
- # flags, otherwise they are always appended to the warn_cflags variable, and |
932 |
- # Clang warns on them for every compilation unit. |
933 |
- # If this is passed to GCC, it will explode, so the flag must be enabled |
934 |
- # conditionally. |
935 |
- AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[ |
936 |
- ax_compiler_flags_test="-Werror=unknown-warning-option" |
937 |
- ],[ |
938 |
- ax_compiler_flags_test="" |
939 |
- ]) |
940 |
- |
941 |
- # Check that -Wno-suggest-attribute=format is supported |
942 |
- AX_CHECK_COMPILE_FLAG([-Wno-suggest-attribute=format],[ |
943 |
- ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" |
944 |
- ],[ |
945 |
- ax_compiler_no_suggest_attribute_flags="" |
946 |
- ]) |
947 |
- |
948 |
- # Base flags |
949 |
- AX_APPEND_COMPILE_FLAGS([ dnl |
950 |
- -fno-strict-aliasing dnl |
951 |
- $3 dnl |
952 |
- ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) |
953 |
- |
954 |
- AS_IF([test "$ax_enable_compile_warnings" != "no"],[ |
955 |
- if test "$ax_compiler_cxx" = "no" ; then |
956 |
- # C-only flags. Warn in C++ |
957 |
- AX_APPEND_COMPILE_FLAGS([ dnl |
958 |
- -Wnested-externs dnl |
959 |
- -Wmissing-prototypes dnl |
960 |
- -Wstrict-prototypes dnl |
961 |
- -Wdeclaration-after-statement dnl |
962 |
- -Wimplicit-function-declaration dnl |
963 |
- -Wold-style-definition dnl |
964 |
- -Wjump-misses-init dnl |
965 |
- ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) |
966 |
- fi |
967 |
- |
968 |
- # "yes" flags |
969 |
- AX_APPEND_COMPILE_FLAGS([ dnl |
970 |
- -Wall dnl |
971 |
- -Wextra dnl |
972 |
- -Wundef dnl |
973 |
- -Wwrite-strings dnl |
974 |
- -Wpointer-arith dnl |
975 |
- -Wmissing-declarations dnl |
976 |
- -Wredundant-decls dnl |
977 |
- -Wno-unused-parameter dnl |
978 |
- -Wno-missing-field-initializers dnl |
979 |
- -Wformat=2 dnl |
980 |
- -Wcast-align dnl |
981 |
- -Wformat-nonliteral dnl |
982 |
- -Wformat-security dnl |
983 |
- -Wsign-compare dnl |
984 |
- -Wstrict-aliasing dnl |
985 |
- -Wshadow dnl |
986 |
- -Winline dnl |
987 |
- -Wpacked dnl |
988 |
- -Wmissing-format-attribute dnl |
989 |
- -Wmissing-noreturn dnl |
990 |
- -Winit-self dnl |
991 |
- -Wredundant-decls dnl |
992 |
- -Wmissing-include-dirs dnl |
993 |
- -Wunused-but-set-variable dnl |
994 |
- -Warray-bounds dnl |
995 |
- -Wreturn-type dnl |
996 |
- -Wswitch-enum dnl |
997 |
- -Wswitch-default dnl |
998 |
- -Wduplicated-cond dnl |
999 |
- -Wduplicated-branches dnl |
1000 |
- -Wlogical-op dnl |
1001 |
- -Wrestrict dnl |
1002 |
- -Wnull-dereference dnl |
1003 |
- -Wdouble-promotion dnl |
1004 |
- $4 dnl |
1005 |
- $5 dnl |
1006 |
- $6 dnl |
1007 |
- $7 dnl |
1008 |
- ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) |
1009 |
- ]) |
1010 |
- AS_IF([test "$ax_enable_compile_warnings" = "error"],[ |
1011 |
- # "error" flags; -Werror has to be appended unconditionally because |
1012 |
- # it's not possible to test for |
1013 |
- # |
1014 |
- # suggest-attribute=format is disabled because it gives too many false |
1015 |
- # positives |
1016 |
- AX_APPEND_FLAG([-Werror],ax_warn_cflags_variable) |
1017 |
- |
1018 |
- AX_APPEND_COMPILE_FLAGS([ dnl |
1019 |
- [$ax_compiler_no_suggest_attribute_flags] dnl |
1020 |
- ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) |
1021 |
- ]) |
1022 |
- |
1023 |
- # In the flags below, when disabling specific flags, always add *both* |
1024 |
- # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) |
1025 |
- # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall, |
1026 |
- # which effectively turns that flag back on again as an error. |
1027 |
- for flag in $ax_warn_cflags_variable; do |
1028 |
- AS_CASE([$flag], |
1029 |
- [-Wno-*=*],[], |
1030 |
- [-Wno-*],[ |
1031 |
- AX_APPEND_COMPILE_FLAGS([-Wno-error=$(AS_ECHO([$flag]) | $SED 's/^-Wno-//')], |
1032 |
- ax_warn_cflags_variable, |
1033 |
- [$ax_compiler_flags_test]) |
1034 |
- ]) |
1035 |
- done |
1036 |
- |
1037 |
- AC_LANG_POP([C]) |
1038 |
- |
1039 |
- # Substitute the variables |
1040 |
- AC_SUBST(ax_warn_cflags_variable) |
1041 |
-])dnl AX_COMPILER_FLAGS |
1042 |
|
1043 |
diff --git a/m4/ax_compiler_flags_cxxflags.m4 b/m4/ax_compiler_flags_cxxflags.m4 |
1044 |
deleted file mode 100644 |
1045 |
index 3067d9b..0000000 |
1046 |
--- a/m4/ax_compiler_flags_cxxflags.m4 |
1047 |
+++ /dev/null |
1048 |
@@ -1,136 +0,0 @@ |
1049 |
-# =============================================================================== |
1050 |
-# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_cxxflags.html |
1051 |
-# =============================================================================== |
1052 |
-# |
1053 |
-# SYNOPSIS |
1054 |
-# |
1055 |
-# AX_COMPILER_FLAGS_CXXFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS]) |
1056 |
-# |
1057 |
-# DESCRIPTION |
1058 |
-# |
1059 |
-# Add warning flags for the C++ compiler to VARIABLE, which defaults to |
1060 |
-# WARN_CXXFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be |
1061 |
-# manually added to the CXXFLAGS variable for each target in the code |
1062 |
-# base. |
1063 |
-# |
1064 |
-# This macro depends on the environment set up by AX_COMPILER_FLAGS. |
1065 |
-# Specifically, it uses the value of $ax_enable_compile_warnings to decide |
1066 |
-# which flags to enable. |
1067 |
-# |
1068 |
-# LICENSE |
1069 |
-# |
1070 |
-# Copyright (c) 2015 David King <amigadave@×××××××××.com> |
1071 |
-# |
1072 |
-# Copying and distribution of this file, with or without modification, are |
1073 |
-# permitted in any medium without royalty provided the copyright notice |
1074 |
-# and this notice are preserved. This file is offered as-is, without any |
1075 |
-# warranty. |
1076 |
- |
1077 |
-#serial 10 |
1078 |
- |
1079 |
-AC_DEFUN([AX_COMPILER_FLAGS_CXXFLAGS],[ |
1080 |
- AC_REQUIRE([AC_PROG_SED]) |
1081 |
- AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS]) |
1082 |
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
1083 |
- AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) |
1084 |
- |
1085 |
- # Variable names |
1086 |
- m4_define([ax_warn_cxxflags_variable], |
1087 |
- [m4_normalize(ifelse([$1],,[WARN_CXXFLAGS],[$1]))]) |
1088 |
- |
1089 |
- AC_LANG_PUSH([C++]) |
1090 |
- |
1091 |
- # Always pass -Werror=unknown-warning-option to get Clang to fail on bad |
1092 |
- # flags, otherwise they are always appended to the warn_cxxflags variable, |
1093 |
- # and Clang warns on them for every compilation unit. |
1094 |
- # If this is passed to GCC, it will explode, so the flag must be enabled |
1095 |
- # conditionally. |
1096 |
- AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[ |
1097 |
- ax_compiler_flags_test="-Werror=unknown-warning-option" |
1098 |
- ],[ |
1099 |
- ax_compiler_flags_test="" |
1100 |
- ]) |
1101 |
- |
1102 |
- # Check that -Wno-suggest-attribute=format is supported |
1103 |
- AX_CHECK_COMPILE_FLAG([-Wno-suggest-attribute=format],[ |
1104 |
- ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" |
1105 |
- ],[ |
1106 |
- ax_compiler_no_suggest_attribute_flags="" |
1107 |
- ]) |
1108 |
- |
1109 |
- # Base flags |
1110 |
- AX_APPEND_COMPILE_FLAGS([ dnl |
1111 |
- -fno-strict-aliasing dnl |
1112 |
- $3 dnl |
1113 |
- ],ax_warn_cxxflags_variable,[$ax_compiler_flags_test]) |
1114 |
- |
1115 |
- AS_IF([test "$ax_enable_compile_warnings" != "no"],[ |
1116 |
- # "yes" flags |
1117 |
- AX_APPEND_COMPILE_FLAGS([ dnl |
1118 |
- -Wall dnl |
1119 |
- -Wextra dnl |
1120 |
- -Wundef dnl |
1121 |
- -Wwrite-strings dnl |
1122 |
- -Wpointer-arith dnl |
1123 |
- -Wmissing-declarations dnl |
1124 |
- -Wredundant-decls dnl |
1125 |
- -Wno-unused-parameter dnl |
1126 |
- -Wno-missing-field-initializers dnl |
1127 |
- -Wformat=2 dnl |
1128 |
- -Wcast-align dnl |
1129 |
- -Wformat-nonliteral dnl |
1130 |
- -Wformat-security dnl |
1131 |
- -Wsign-compare dnl |
1132 |
- -Wstrict-aliasing dnl |
1133 |
- -Wshadow dnl |
1134 |
- -Winline dnl |
1135 |
- -Wpacked dnl |
1136 |
- -Wmissing-format-attribute dnl |
1137 |
- -Wmissing-noreturn dnl |
1138 |
- -Winit-self dnl |
1139 |
- -Wredundant-decls dnl |
1140 |
- -Wmissing-include-dirs dnl |
1141 |
- -Wunused-but-set-variable dnl |
1142 |
- -Warray-bounds dnl |
1143 |
- -Wreturn-type dnl |
1144 |
- -Wno-overloaded-virtual dnl |
1145 |
- -Wswitch-enum dnl |
1146 |
- -Wswitch-default dnl |
1147 |
- $4 dnl |
1148 |
- $5 dnl |
1149 |
- $6 dnl |
1150 |
- $7 dnl |
1151 |
- ],ax_warn_cxxflags_variable,[$ax_compiler_flags_test]) |
1152 |
- ]) |
1153 |
- AS_IF([test "$ax_enable_compile_warnings" = "error"],[ |
1154 |
- # "error" flags; -Werror has to be appended unconditionally because |
1155 |
- # it's not possible to test for |
1156 |
- # |
1157 |
- # suggest-attribute=format is disabled because it gives too many false |
1158 |
- # positives |
1159 |
- AX_APPEND_FLAG([-Werror],ax_warn_cxxflags_variable) |
1160 |
- |
1161 |
- AX_APPEND_COMPILE_FLAGS([ dnl |
1162 |
- [$ax_compiler_no_suggest_attribute_flags] dnl |
1163 |
- ],ax_warn_cxxflags_variable,[$ax_compiler_flags_test]) |
1164 |
- ]) |
1165 |
- |
1166 |
- # In the flags below, when disabling specific flags, always add *both* |
1167 |
- # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) |
1168 |
- # we enable -Werror, disable a flag, and a build bot passes CXXFLAGS=-Wall, |
1169 |
- # which effectively turns that flag back on again as an error. |
1170 |
- for flag in $ax_warn_cxxflags_variable; do |
1171 |
- AS_CASE([$flag], |
1172 |
- [-Wno-*=*],[], |
1173 |
- [-Wno-*],[ |
1174 |
- AX_APPEND_COMPILE_FLAGS([-Wno-error=$(AS_ECHO([$flag]) | $SED 's/^-Wno-//')], |
1175 |
- ax_warn_cxxflags_variable, |
1176 |
- [$ax_compiler_flags_test]) |
1177 |
- ]) |
1178 |
- done |
1179 |
- |
1180 |
- AC_LANG_POP([C++]) |
1181 |
- |
1182 |
- # Substitute the variables |
1183 |
- AC_SUBST(ax_warn_cxxflags_variable) |
1184 |
-])dnl AX_COMPILER_FLAGS_CXXFLAGS |
1185 |
|
1186 |
diff --git a/m4/ax_compiler_flags_gir.m4 b/m4/ax_compiler_flags_gir.m4 |
1187 |
deleted file mode 100644 |
1188 |
index 5b4924a..0000000 |
1189 |
--- a/m4/ax_compiler_flags_gir.m4 |
1190 |
+++ /dev/null |
1191 |
@@ -1,60 +0,0 @@ |
1192 |
-# =========================================================================== |
1193 |
-# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_gir.html |
1194 |
-# =========================================================================== |
1195 |
-# |
1196 |
-# SYNOPSIS |
1197 |
-# |
1198 |
-# AX_COMPILER_FLAGS_GIR([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS]) |
1199 |
-# |
1200 |
-# DESCRIPTION |
1201 |
-# |
1202 |
-# Add warning flags for the g-ir-scanner (from GObject Introspection) to |
1203 |
-# VARIABLE, which defaults to WARN_SCANNERFLAGS. VARIABLE is AC_SUBST-ed |
1204 |
-# by this macro, but must be manually added to the SCANNERFLAGS variable |
1205 |
-# for each GIR target in the code base. |
1206 |
-# |
1207 |
-# This macro depends on the environment set up by AX_COMPILER_FLAGS. |
1208 |
-# Specifically, it uses the value of $ax_enable_compile_warnings to decide |
1209 |
-# which flags to enable. |
1210 |
-# |
1211 |
-# LICENSE |
1212 |
-# |
1213 |
-# Copyright (c) 2015 Philip Withnall <philip@××××××××××××.uk> |
1214 |
-# |
1215 |
-# Copying and distribution of this file, with or without modification, are |
1216 |
-# permitted in any medium without royalty provided the copyright notice |
1217 |
-# and this notice are preserved. This file is offered as-is, without any |
1218 |
-# warranty. |
1219 |
- |
1220 |
-#serial 6 |
1221 |
- |
1222 |
-AC_DEFUN([AX_COMPILER_FLAGS_GIR],[ |
1223 |
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
1224 |
- |
1225 |
- # Variable names |
1226 |
- m4_define([ax_warn_scannerflags_variable], |
1227 |
- [m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))]) |
1228 |
- |
1229 |
- # Base flags |
1230 |
- AX_APPEND_FLAG([$3],ax_warn_scannerflags_variable) |
1231 |
- |
1232 |
- AS_IF([test "$ax_enable_compile_warnings" != "no"],[ |
1233 |
- # "yes" flags |
1234 |
- AX_APPEND_FLAG([ dnl |
1235 |
- --warn-all dnl |
1236 |
- $4 dnl |
1237 |
- $5 dnl |
1238 |
- $6 dnl |
1239 |
- $7 dnl |
1240 |
- ],ax_warn_scannerflags_variable) |
1241 |
- ]) |
1242 |
- AS_IF([test "$ax_enable_compile_warnings" = "error"],[ |
1243 |
- # "error" flags |
1244 |
- AX_APPEND_FLAG([ dnl |
1245 |
- --warn-error dnl |
1246 |
- ],ax_warn_scannerflags_variable) |
1247 |
- ]) |
1248 |
- |
1249 |
- # Substitute the variables |
1250 |
- AC_SUBST(ax_warn_scannerflags_variable) |
1251 |
-])dnl AX_COMPILER_FLAGS |
1252 |
|
1253 |
diff --git a/m4/ax_compiler_flags_ldflags.m4 b/m4/ax_compiler_flags_ldflags.m4 |
1254 |
deleted file mode 100644 |
1255 |
index 976d119..0000000 |
1256 |
--- a/m4/ax_compiler_flags_ldflags.m4 |
1257 |
+++ /dev/null |
1258 |
@@ -1,111 +0,0 @@ |
1259 |
-# ============================================================================== |
1260 |
-# https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_ldflags.html |
1261 |
-# ============================================================================== |
1262 |
-# |
1263 |
-# SYNOPSIS |
1264 |
-# |
1265 |
-# AX_COMPILER_FLAGS_LDFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS]) |
1266 |
-# |
1267 |
-# DESCRIPTION |
1268 |
-# |
1269 |
-# Add warning flags for the linker to VARIABLE, which defaults to |
1270 |
-# WARN_LDFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be |
1271 |
-# manually added to the LDFLAGS variable for each target in the code base. |
1272 |
-# |
1273 |
-# This macro depends on the environment set up by AX_COMPILER_FLAGS. |
1274 |
-# Specifically, it uses the value of $ax_enable_compile_warnings to decide |
1275 |
-# which flags to enable. |
1276 |
-# |
1277 |
-# LICENSE |
1278 |
-# |
1279 |
-# Copyright (c) 2014, 2015 Philip Withnall <philip@××××××××××××.uk> |
1280 |
-# Copyright (c) 2017, 2018 Reini Urban <rurban@××××.org> |
1281 |
-# |
1282 |
-# Copying and distribution of this file, with or without modification, are |
1283 |
-# permitted in any medium without royalty provided the copyright notice |
1284 |
-# and this notice are preserved. This file is offered as-is, without any |
1285 |
-# warranty. |
1286 |
- |
1287 |
-#serial 9 |
1288 |
- |
1289 |
-AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[ |
1290 |
- AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS]) |
1291 |
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) |
1292 |
- AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) |
1293 |
- AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) |
1294 |
- |
1295 |
- # Variable names |
1296 |
- m4_define([ax_warn_ldflags_variable], |
1297 |
- [m4_normalize(ifelse([$1],,[WARN_LDFLAGS],[$1]))]) |
1298 |
- |
1299 |
- # Always pass -Werror=unknown-warning-option to get Clang to fail on bad |
1300 |
- # flags, otherwise they are always appended to the warn_ldflags variable, |
1301 |
- # and Clang warns on them for every compilation unit. |
1302 |
- # If this is passed to GCC, it will explode, so the flag must be enabled |
1303 |
- # conditionally. |
1304 |
- AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[ |
1305 |
- ax_compiler_flags_test="-Werror=unknown-warning-option" |
1306 |
- ],[ |
1307 |
- ax_compiler_flags_test="" |
1308 |
- ]) |
1309 |
- |
1310 |
- AX_CHECK_LINK_FLAG([-Wl,--as-needed], [ |
1311 |
- AX_APPEND_LINK_FLAGS([-Wl,--as-needed], |
1312 |
- [AM_LDFLAGS],[$ax_compiler_flags_test]) |
1313 |
- ]) |
1314 |
- AX_CHECK_LINK_FLAG([-Wl,-z,relro], [ |
1315 |
- AX_APPEND_LINK_FLAGS([-Wl,-z,relro], |
1316 |
- [AM_LDFLAGS],[$ax_compiler_flags_test]) |
1317 |
- ]) |
1318 |
- AX_CHECK_LINK_FLAG([-Wl,-z,now], [ |
1319 |
- AX_APPEND_LINK_FLAGS([-Wl,-z,now], |
1320 |
- [AM_LDFLAGS],[$ax_compiler_flags_test]) |
1321 |
- ]) |
1322 |
- AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [ |
1323 |
- AX_APPEND_LINK_FLAGS([-Wl,-z,noexecstack], |
1324 |
- [AM_LDFLAGS],[$ax_compiler_flags_test]) |
1325 |
- ]) |
1326 |
- # textonly, retpolineplt not yet |
1327 |
- |
1328 |
- # macOS and cygwin linker do not have --as-needed |
1329 |
- AX_CHECK_LINK_FLAG([-Wl,--no-as-needed], [ |
1330 |
- ax_compiler_flags_as_needed_option="-Wl,--no-as-needed" |
1331 |
- ], [ |
1332 |
- ax_compiler_flags_as_needed_option="" |
1333 |
- ]) |
1334 |
- |
1335 |
- # macOS linker speaks with a different accent |
1336 |
- ax_compiler_flags_fatal_warnings_option="" |
1337 |
- AX_CHECK_LINK_FLAG([-Wl,--fatal-warnings], [ |
1338 |
- ax_compiler_flags_fatal_warnings_option="-Wl,--fatal-warnings" |
1339 |
- ]) |
1340 |
- AX_CHECK_LINK_FLAG([-Wl,-fatal_warnings], [ |
1341 |
- ax_compiler_flags_fatal_warnings_option="-Wl,-fatal_warnings" |
1342 |
- ]) |
1343 |
- |
1344 |
- # Base flags |
1345 |
- AX_APPEND_LINK_FLAGS([ dnl |
1346 |
- $ax_compiler_flags_as_needed_option dnl |
1347 |
- $3 dnl |
1348 |
- ],ax_warn_ldflags_variable,[$ax_compiler_flags_test]) |
1349 |
- |
1350 |
- AS_IF([test "$ax_enable_compile_warnings" != "no"],[ |
1351 |
- # "yes" flags |
1352 |
- AX_APPEND_LINK_FLAGS([$4 $5 $6 $7], |
1353 |
- ax_warn_ldflags_variable, |
1354 |
- [$ax_compiler_flags_test]) |
1355 |
- ]) |
1356 |
- AS_IF([test "$ax_enable_compile_warnings" = "error"],[ |
1357 |
- # "error" flags; -Werror has to be appended unconditionally because |
1358 |
- # it's not possible to test for |
1359 |
- # |
1360 |
- # suggest-attribute=format is disabled because it gives too many false |
1361 |
- # positives |
1362 |
- AX_APPEND_LINK_FLAGS([ dnl |
1363 |
- $ax_compiler_flags_fatal_warnings_option dnl |
1364 |
- ],ax_warn_ldflags_variable,[$ax_compiler_flags_test]) |
1365 |
- ]) |
1366 |
- |
1367 |
- # Substitute the variables |
1368 |
- AC_SUBST(ax_warn_ldflags_variable) |
1369 |
-])dnl AX_COMPILER_FLAGS |
1370 |
|
1371 |
diff --git a/m4/ax_compiler_version.m4 b/m4/ax_compiler_version.m4 |
1372 |
deleted file mode 100644 |
1373 |
index 0581d1b..0000000 |
1374 |
--- a/m4/ax_compiler_version.m4 |
1375 |
+++ /dev/null |
1376 |
@@ -1,529 +0,0 @@ |
1377 |
-# =========================================================================== |
1378 |
-# https://www.gnu.org/software/autoconf-archive/ax_compiler_version.html |
1379 |
-# =========================================================================== |
1380 |
-# |
1381 |
-# SYNOPSIS |
1382 |
-# |
1383 |
-# AX_COMPILER_VERSION |
1384 |
-# |
1385 |
-# DESCRIPTION |
1386 |
-# |
1387 |
-# This macro retrieves the compiler version and returns it in the cache |
1388 |
-# variable $ax_cv_c_compiler_version for C and $ax_cv_cxx_compiler_version |
1389 |
-# for C++. |
1390 |
-# |
1391 |
-# Version is returned as epoch:major.minor.patchversion |
1392 |
-# |
1393 |
-# Epoch is used in order to have an increasing version number in case of |
1394 |
-# marketing change. |
1395 |
-# |
1396 |
-# Epoch use: * borland compiler use chronologically 0turboc for turboc |
1397 |
-# era, |
1398 |
-# |
1399 |
-# 1borlanc BORLANDC++ before 5, 2cppbuilder for cppbuilder era, |
1400 |
-# 3borlancpp for return of BORLANDC++ (after version 5.5), |
1401 |
-# 4cppbuilder for cppbuilder with year version, |
1402 |
-# and 5xe for XE era. |
1403 |
-# |
1404 |
-# An empty string is returned otherwise. |
1405 |
-# |
1406 |
-# LICENSE |
1407 |
-# |
1408 |
-# Copyright (c) 2014 Bastien ROUCARIES <roucaries.bastien+autoconf@×××××.com> |
1409 |
-# |
1410 |
-# Copying and distribution of this file, with or without modification, are |
1411 |
-# permitted in any medium without royalty provided the copyright notice |
1412 |
-# and this notice are preserved. This file is offered as-is, without any |
1413 |
-# warranty. |
1414 |
- |
1415 |
-#serial 12 |
1416 |
- |
1417 |
-# for intel |
1418 |
-AC_DEFUN([_AX_COMPILER_VERSION_INTEL], |
1419 |
- [ dnl |
1420 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1421 |
- [__INTEL_COMPILER/100],, |
1422 |
- AC_MSG_FAILURE([[[$0]] unknown intel compiler version])) |
1423 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1424 |
- [(__INTEL_COMPILER%100)/10],, |
1425 |
- AC_MSG_FAILURE([[[$0]] unknown intel compiler version])) |
1426 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1427 |
- [(__INTEL_COMPILER%10)],, |
1428 |
- AC_MSG_FAILURE([[[$0]] unknown intel compiler version])) |
1429 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1430 |
- ]) |
1431 |
- |
1432 |
-# for IBM |
1433 |
-AC_DEFUN([_AX_COMPILER_VERSION_IBM], |
1434 |
- [ dnl |
1435 |
- dnl check between z/OS C/C++ and XL C/C++ |
1436 |
- AC_COMPILE_IFELSE([ |
1437 |
- AC_LANG_PROGRAM([], |
1438 |
- [ |
1439 |
- #if defined(__COMPILER_VER__) |
1440 |
- choke me; |
1441 |
- #endif |
1442 |
- ])], |
1443 |
- [ |
1444 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1445 |
- [__xlC__/100],, |
1446 |
- AC_MSG_FAILURE([[[$0]] unknown IBM compiler major version])) |
1447 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1448 |
- [__xlC__%100],, |
1449 |
- AC_MSG_FAILURE([[[$0]] unknown IBM compiler minor version])) |
1450 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1451 |
- [__xlC_ver__/0x100],, |
1452 |
- AC_MSG_FAILURE([[[$0]] unknown IBM compiler patch version])) |
1453 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_build, |
1454 |
- [__xlC_ver__%0x100],, |
1455 |
- AC_MSG_FAILURE([[[$0]] unknown IBM compiler build version])) |
1456 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_build" |
1457 |
- ], |
1458 |
- [ |
1459 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1460 |
- [__xlC__%1000],, |
1461 |
- AC_MSG_FAILURE([[[$0]] unknown IBM compiler patch version])) |
1462 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1463 |
- [(__xlC__/10000)%10],, |
1464 |
- AC_MSG_FAILURE([[[$0]] unknown IBM compiler minor version])) |
1465 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1466 |
- [(__xlC__/100000)%10],, |
1467 |
- AC_MSG_FAILURE([[[$0]] unknown IBM compiler major version])) |
1468 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1469 |
- ]) |
1470 |
-]) |
1471 |
- |
1472 |
-# for pathscale |
1473 |
-AC_DEFUN([_AX_COMPILER_VERSION_PATHSCALE],[ |
1474 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1475 |
- __PATHCC__,, |
1476 |
- AC_MSG_FAILURE([[[$0]] unknown pathscale major])) |
1477 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1478 |
- __PATHCC_MINOR__,, |
1479 |
- AC_MSG_FAILURE([[[$0]] unknown pathscale minor])) |
1480 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1481 |
- [__PATHCC_PATCHLEVEL__],, |
1482 |
- AC_MSG_FAILURE([[[$0]] unknown pathscale patch level])) |
1483 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1484 |
- ]) |
1485 |
- |
1486 |
-# for clang |
1487 |
-AC_DEFUN([_AX_COMPILER_VERSION_CLANG],[ |
1488 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1489 |
- __clang_major__,, |
1490 |
- AC_MSG_FAILURE([[[$0]] unknown clang major])) |
1491 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1492 |
- __clang_minor__,, |
1493 |
- AC_MSG_FAILURE([[[$0]] unknown clang minor])) |
1494 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1495 |
- [__clang_patchlevel__],,0) |
1496 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1497 |
- ]) |
1498 |
- |
1499 |
-# for crayc |
1500 |
-AC_DEFUN([_AX_COMPILER_VERSION_CRAY],[ |
1501 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1502 |
- _RELEASE,, |
1503 |
- AC_MSG_FAILURE([[[$0]] unknown crayc release])) |
1504 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1505 |
- _RELEASE_MINOR,, |
1506 |
- AC_MSG_FAILURE([[[$0]] unknown crayc minor])) |
1507 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor" |
1508 |
- ]) |
1509 |
- |
1510 |
-# for fujitsu |
1511 |
-AC_DEFUN([_AX_COMPILER_VERSION_FUJITSU],[ |
1512 |
- AC_COMPUTE_INT(ax_cv_[]_AC_LANG_ABBREV[]_compiler_version, |
1513 |
- __FCC_VERSION,, |
1514 |
- AC_MSG_FAILURE([[[$0]]unknown fujitsu release])) |
1515 |
- ]) |
1516 |
- |
1517 |
-# for GNU |
1518 |
-AC_DEFUN([_AX_COMPILER_VERSION_GNU],[ |
1519 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1520 |
- __GNUC__,, |
1521 |
- AC_MSG_FAILURE([[[$0]] unknown gcc major])) |
1522 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1523 |
- __GNUC_MINOR__,, |
1524 |
- AC_MSG_FAILURE([[[$0]] unknown gcc minor])) |
1525 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1526 |
- [__GNUC_PATCHLEVEL__],, |
1527 |
- AC_MSG_FAILURE([[[$0]] unknown gcc patch level])) |
1528 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1529 |
- ]) |
1530 |
- |
1531 |
-# For sun |
1532 |
-AC_DEFUN([_AX_COMPILER_VERSION_SUN],[ |
1533 |
- m4_define([_AX_COMPILER_VERSION_SUN_NUMBER], |
1534 |
- [ |
1535 |
- #if defined(__SUNPRO_CC) |
1536 |
- __SUNPRO_CC |
1537 |
- #else |
1538 |
- __SUNPRO_C |
1539 |
- #endif |
1540 |
- ]) |
1541 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_until59, |
1542 |
- !!(_AX_COMPILER_VERSION_SUN_NUMBER < 0x1000),, |
1543 |
- AC_MSG_FAILURE([[[$0]] unknown sun release version])) |
1544 |
- AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_until59" = X1], |
1545 |
- [dnl |
1546 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1547 |
- _AX_COMPILER_VERSION_SUN_NUMBER % 0x10,, |
1548 |
- AC_MSG_FAILURE([[[$0]] unknown sun patch version])) |
1549 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1550 |
- (_AX_COMPILER_VERSION_SUN_NUMBER / 0x10) % 0x10,, |
1551 |
- AC_MSG_FAILURE([[[$0]] unknown sun minor version])) |
1552 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1553 |
- (_AX_COMPILER_VERSION_SUN_NUMBER / 0x100),, |
1554 |
- AC_MSG_FAILURE([[[$0]] unknown sun major version])) |
1555 |
- ], |
1556 |
- [dnl |
1557 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1558 |
- _AX_COMPILER_VERSION_SUN_NUMBER % 0x10,, |
1559 |
- AC_MSG_FAILURE([[[$0]] unknown sun patch version])) |
1560 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1561 |
- (_AX_COMPILER_VERSION_SUN_NUMBER / 0x100) % 0x100,, |
1562 |
- AC_MSG_FAILURE([[[$0]] unknown sun minor version])) |
1563 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1564 |
- (_AX_COMPILER_VERSION_SUN_NUMBER / 0x1000),, |
1565 |
- AC_MSG_FAILURE([[[$0]] unknown sun major version])) |
1566 |
- ]) |
1567 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1568 |
-]) |
1569 |
- |
1570 |
-AC_DEFUN([_AX_COMPILER_VERSION_HP],[ |
1571 |
- m4_define([_AX_COMPILER_VERSION_HP_NUMBER], |
1572 |
- [ |
1573 |
- #if defined(__HP_cc) |
1574 |
- __HP_cc |
1575 |
- #else |
1576 |
- __HP_aCC |
1577 |
- #endif |
1578 |
- ]) |
1579 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_untilA0121, |
1580 |
- !!(_AX_COMPILER_VERSION_HP_NUMBER <= 1),, |
1581 |
- AC_MSG_FAILURE([[[$0]] unknown hp release version])) |
1582 |
- AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_untilA0121" = X1], |
1583 |
- [dnl By default output last version with this behavior. |
1584 |
- dnl it is so old |
1585 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="01.21.00" |
1586 |
- ], |
1587 |
- [dnl |
1588 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1589 |
- (_AX_COMPILER_VERSION_HP_NUMBER % 100),, |
1590 |
- AC_MSG_FAILURE([[[$0]] unknown hp release version])) |
1591 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1592 |
- ((_AX_COMPILER_VERSION_HP_NUMBER / 100)%100),, |
1593 |
- AC_MSG_FAILURE([[[$0]] unknown hp minor version])) |
1594 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1595 |
- ((_AX_COMPILER_VERSION_HP_NUMBER / 10000)%100),, |
1596 |
- AC_MSG_FAILURE([[[$0]] unknown hp major version])) |
1597 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1598 |
- ]) |
1599 |
-]) |
1600 |
- |
1601 |
-AC_DEFUN([_AX_COMPILER_VERSION_DEC],[dnl |
1602 |
- m4_define([_AX_COMPILER_VERSION_DEC_NUMBER], |
1603 |
- [ |
1604 |
- #if defined(__DECC_VER) |
1605 |
- __DECC_VER |
1606 |
- #else |
1607 |
- __DECCXX_VER |
1608 |
- #endif |
1609 |
- ]) |
1610 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1611 |
- (_AX_COMPILER_VERSION_DEC_NUMBER % 10000),, |
1612 |
- AC_MSG_FAILURE([[[$0]] unknown dec release version])) |
1613 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1614 |
- ((_AX_COMPILER_VERSION_DEC_NUMBER / 100000UL)%100),, |
1615 |
- AC_MSG_FAILURE([[[$0]] unknown dec minor version])) |
1616 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1617 |
- ((_AX_COMPILER_VERSION_DEC_NUMBER / 10000000UL)%100),, |
1618 |
- AC_MSG_FAILURE([[[$0]] unknown dec major version])) |
1619 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1620 |
- ]) |
1621 |
- |
1622 |
-# borland |
1623 |
-AC_DEFUN([_AX_COMPILER_VERSION_BORLAND],[dnl |
1624 |
- m4_define([_AX_COMPILER_VERSION_TURBOC_NUMBER], |
1625 |
- [ |
1626 |
- #if defined(__TURBOC__) |
1627 |
- __TURBOC__ |
1628 |
- #else |
1629 |
- choke me |
1630 |
- #endif |
1631 |
- ]) |
1632 |
- m4_define([_AX_COMPILER_VERSION_BORLANDC_NUMBER], |
1633 |
- [ |
1634 |
- #if defined(__BORLANDC__) |
1635 |
- __BORLANDC__ |
1636 |
- #else |
1637 |
- __CODEGEARC__ |
1638 |
- #endif |
1639 |
- ]) |
1640 |
- AC_COMPILE_IFELSE( |
1641 |
- [AC_LANG_PROGRAM(, |
1642 |
- _AX_COMPILER_VERSION_TURBOC_NUMBER)], |
1643 |
- [dnl TURBOC |
1644 |
- AC_COMPUTE_INT( |
1645 |
- _ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw, |
1646 |
- _AX_COMPILER_VERSION_TURBOC_NUMBER,, |
1647 |
- AC_MSG_FAILURE([[[$0]] unknown turboc version])) |
1648 |
- AS_IF( |
1649 |
- [test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw -lt 661 || test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw -gt 1023], |
1650 |
- [dnl compute normal version |
1651 |
- AC_COMPUTE_INT( |
1652 |
- _ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1653 |
- _AX_COMPILER_VERSION_TURBOC_NUMBER % 0x100,, |
1654 |
- AC_MSG_FAILURE([[[$0]] unknown turboc minor version])) |
1655 |
- AC_COMPUTE_INT( |
1656 |
- _ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1657 |
- (_AX_COMPILER_VERSION_TURBOC_NUMBER/0x100)%0x100,, |
1658 |
- AC_MSG_FAILURE([[[$0]] unknown turboc major version])) |
1659 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor"], |
1660 |
- [dnl special version |
1661 |
- AS_CASE([$_ax_[]_AC_LANG_ABBREV[]_compiler_version_turboc_raw], |
1662 |
- [661],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:1.00"], |
1663 |
- [662],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:1.01"], |
1664 |
- [663],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="0turboc:2.00"], |
1665 |
- [ |
1666 |
- AC_MSG_WARN([[[$0]] unknown turboc version between 0x295 and 0x400 please report bug]) |
1667 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="" |
1668 |
- ]) |
1669 |
- ]) |
1670 |
- ], |
1671 |
- # borlandc |
1672 |
- [ |
1673 |
- AC_COMPUTE_INT( |
1674 |
- _ax_[]_AC_LANG_ABBREV[]_compiler_version_borlandc_raw, |
1675 |
- _AX_COMPILER_VERSION_BORLANDC_NUMBER,, |
1676 |
- AC_MSG_FAILURE([[[$0]] unknown borlandc version])) |
1677 |
- AS_CASE([$_ax_[]_AC_LANG_ABBREV[]_compiler_version_borlandc_raw], |
1678 |
- dnl BORLANDC++ before 5.5 |
1679 |
- [512] ,[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:2.00"], |
1680 |
- [1024],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:3.00"], |
1681 |
- [1024],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:3.00"], |
1682 |
- [1040],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:3.1"], |
1683 |
- [1106],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:4.0"], |
1684 |
- [1280],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:5.0"], |
1685 |
- [1312],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="1borlanc:5.02"], |
1686 |
- dnl C++ Builder era |
1687 |
- [1328],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="2cppbuilder:3.0"], |
1688 |
- [1344],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="2cppbuilder:4.0"], |
1689 |
- dnl BORLANDC++ after 5.5 |
1690 |
- [1360],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="3borlancpp:5.5"], |
1691 |
- [1361],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="3borlancpp:5.51"], |
1692 |
- [1378],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="3borlancpp:5.6.4"], |
1693 |
- dnl C++ Builder with year number |
1694 |
- [1392],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2006"], |
1695 |
- [1424],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2007"], |
1696 |
- [1555],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2009"], |
1697 |
- [1569],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="4cppbuilder:2010"], |
1698 |
- dnl XE version |
1699 |
- [1584],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe"], |
1700 |
- [1600],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe:2"], |
1701 |
- [1616],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe:3"], |
1702 |
- [1632],[ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="5xe:4"], |
1703 |
- [ |
1704 |
- AC_MSG_WARN([[[$0]] Unknown borlandc compiler version $_ax_[]_AC_LANG_ABBREV[]_compiler_version_borlandc_raw please report bug]) |
1705 |
- ]) |
1706 |
- ]) |
1707 |
- ]) |
1708 |
- |
1709 |
-# COMO |
1710 |
-AC_DEFUN([_AX_COMPILER_VERSION_COMEAU], |
1711 |
- [ dnl |
1712 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1713 |
- [__COMO_VERSION__%100],, |
1714 |
- AC_MSG_FAILURE([[[$0]] unknown comeau compiler minor version])) |
1715 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1716 |
- [(__COMO_VERSION__/100)%10],, |
1717 |
- AC_MSG_FAILURE([[[$0]] unknown comeau compiler major version])) |
1718 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor" |
1719 |
- ]) |
1720 |
- |
1721 |
-# KAI |
1722 |
-AC_DEFUN([_AX_COMPILER_VERSION_KAI],[ |
1723 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1724 |
- [__KCC_VERSION%100],, |
1725 |
- AC_MSG_FAILURE([[[$0]] unknown kay compiler patch version])) |
1726 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1727 |
- [(__KCC_VERSION/100)%10],, |
1728 |
- AC_MSG_FAILURE([[[$0]] unknown kay compiler minor version])) |
1729 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1730 |
- [(__KCC_VERSION/1000)%10],, |
1731 |
- AC_MSG_FAILURE([[[$0]] unknown kay compiler major version])) |
1732 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1733 |
- ]) |
1734 |
- |
1735 |
-dnl LCC |
1736 |
-dnl LCC does not output version... |
1737 |
- |
1738 |
-# SGI |
1739 |
-AC_DEFUN([_AX_COMPILER_VERSION_SGI],[ |
1740 |
- m4_define([_AX_COMPILER_VERSION_SGI_NUMBER], |
1741 |
- [ |
1742 |
- #if defined(_COMPILER_VERSION) |
1743 |
- _COMPILER_VERSION |
1744 |
- #else |
1745 |
- _SGI_COMPILER_VERSION |
1746 |
- #endif |
1747 |
- ]) |
1748 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1749 |
- [_AX_COMPILER_VERSION_SGI_NUMBER%10],, |
1750 |
- AC_MSG_FAILURE([[[$0]] unknown SGI compiler patch version])) |
1751 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1752 |
- [(_AX_COMPILER_VERSION_SGI_NUMBER/10)%10],, |
1753 |
- AC_MSG_FAILURE([[[$0]] unknown SGI compiler minor version])) |
1754 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1755 |
- [(_AX_COMPILER_VERSION_SGI_NUMBER/100)%10],, |
1756 |
- AC_MSG_FAILURE([[[$0]] unknown SGI compiler major version])) |
1757 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1758 |
- ]) |
1759 |
- |
1760 |
-# microsoft |
1761 |
-AC_DEFUN([_AX_COMPILER_VERSION_MICROSOFT],[ |
1762 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1763 |
- _MSC_VER%100,, |
1764 |
- AC_MSG_FAILURE([[[$0]] unknown microsoft compiler minor version])) |
1765 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1766 |
- (_MSC_VER/100)%100,, |
1767 |
- AC_MSG_FAILURE([[[$0]] unknown microsoft compiler major version])) |
1768 |
- dnl could be overridden |
1769 |
- _ax_[]_AC_LANG_ABBREV[]_compiler_version_patch=0 |
1770 |
- _ax_[]_AC_LANG_ABBREV[]_compiler_version_build=0 |
1771 |
- # special case for version 6 |
1772 |
- AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major" = "X12"], |
1773 |
- [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1774 |
- _MSC_FULL_VER%1000,, |
1775 |
- _ax_[]_AC_LANG_ABBREV[]_compiler_version_patch=0)]) |
1776 |
- # for version 7 |
1777 |
- AS_IF([test "X$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major" = "X13"], |
1778 |
- [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1779 |
- _MSC_FULL_VER%1000,, |
1780 |
- AC_MSG_FAILURE([[[$0]] unknown microsoft compiler patch version])) |
1781 |
- ]) |
1782 |
- # for version > 8 |
1783 |
- AS_IF([test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_major -ge 14], |
1784 |
- [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1785 |
- _MSC_FULL_VER%10000,, |
1786 |
- AC_MSG_FAILURE([[[$0]] unknown microsoft compiler patch version])) |
1787 |
- ]) |
1788 |
- AS_IF([test $_ax_[]_AC_LANG_ABBREV[]_compiler_version_major -ge 15], |
1789 |
- [AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_build, |
1790 |
- _MSC_BUILD,, |
1791 |
- AC_MSG_FAILURE([[[$0]] unknown microsoft compiler build version])) |
1792 |
- ]) |
1793 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_build" |
1794 |
- ]) |
1795 |
- |
1796 |
-# for metrowerks |
1797 |
-AC_DEFUN([_AX_COMPILER_VERSION_METROWERKS],[dnl |
1798 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1799 |
- __MWERKS__%0x100,, |
1800 |
- AC_MSG_FAILURE([[[$0]] unknown metrowerks compiler patch version])) |
1801 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1802 |
- (__MWERKS__/0x100)%0x10,, |
1803 |
- AC_MSG_FAILURE([[[$0]] unknown metrowerks compiler minor version])) |
1804 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1805 |
- (__MWERKS__/0x1000)%0x10,, |
1806 |
- AC_MSG_FAILURE([[[$0]] unknown metrowerks compiler major version])) |
1807 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1808 |
- ]) |
1809 |
- |
1810 |
-# for watcom |
1811 |
-AC_DEFUN([_AX_COMPILER_VERSION_WATCOM],[dnl |
1812 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1813 |
- __WATCOMC__%100,, |
1814 |
- AC_MSG_FAILURE([[[$0]] unknown watcom compiler minor version])) |
1815 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1816 |
- (__WATCOMC__/100)%100,, |
1817 |
- AC_MSG_FAILURE([[[$0]] unknown watcom compiler major version])) |
1818 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor" |
1819 |
- ]) |
1820 |
- |
1821 |
-# for PGI |
1822 |
-AC_DEFUN([_AX_COMPILER_VERSION_PORTLAND],[ |
1823 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1824 |
- __PGIC__,, |
1825 |
- AC_MSG_FAILURE([[[$0]] unknown pgi major])) |
1826 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1827 |
- __PGIC_MINOR__,, |
1828 |
- AC_MSG_FAILURE([[[$0]] unknown pgi minor])) |
1829 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1830 |
- [__PGIC_PATCHLEVEL__],, |
1831 |
- AC_MSG_FAILURE([[[$0]] unknown pgi patch level])) |
1832 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1833 |
- ]) |
1834 |
- |
1835 |
-# tcc |
1836 |
-AC_DEFUN([_AX_COMPILER_VERSION_TCC],[ |
1837 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version=[`tcc -v | $SED 's/^[ ]*tcc[ ]\+version[ ]\+\([0-9.]\+\).*/\1/g'`] |
1838 |
- ]) |
1839 |
- |
1840 |
-# for GNU |
1841 |
-AC_DEFUN([_AX_COMPILER_VERSION_SDCC],[ |
1842 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, |
1843 |
- /* avoid parse error with comments */ |
1844 |
- #if(defined(__SDCC_VERSION_MAJOR)) |
1845 |
- __SDCC_VERSION_MAJOR |
1846 |
- #else |
1847 |
- SDCC/100 |
1848 |
- #endif |
1849 |
- ,, |
1850 |
- AC_MSG_FAILURE([[[$0]] unknown sdcc major])) |
1851 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, |
1852 |
- /* avoid parse error with comments */ |
1853 |
- #if(defined(__SDCC_VERSION_MINOR)) |
1854 |
- __SDCC_VERSION_MINOR |
1855 |
- #else |
1856 |
- (SDCC%100)/10 |
1857 |
- #endif |
1858 |
- ,, |
1859 |
- AC_MSG_FAILURE([[[$0]] unknown sdcc minor])) |
1860 |
- AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, |
1861 |
- [ |
1862 |
- /* avoid parse error with comments */ |
1863 |
- #if(defined(__SDCC_VERSION_PATCH)) |
1864 |
- __SDCC_VERSION_PATCH |
1865 |
- #elsif(defined(_SDCC_VERSION_PATCHLEVEL)) |
1866 |
- __SDCC_VERSION_PATCHLEVEL |
1867 |
- #else |
1868 |
- SDCC%10 |
1869 |
- #endif |
1870 |
- ],, |
1871 |
- AC_MSG_FAILURE([[[$0]] unknown sdcc patch level])) |
1872 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" |
1873 |
- ]) |
1874 |
- |
1875 |
-# main entry point |
1876 |
-AC_DEFUN([AX_COMPILER_VERSION],[dnl |
1877 |
- AC_REQUIRE([AX_COMPILER_VENDOR]) |
1878 |
- AC_REQUIRE([AC_PROG_SED]) |
1879 |
- AC_CACHE_CHECK([for _AC_LANG compiler version], |
1880 |
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_version, |
1881 |
- [ dnl |
1882 |
- AS_CASE([$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor], |
1883 |
- [intel],[_AX_COMPILER_VERSION_INTEL], |
1884 |
- [ibm],[_AX_COMPILER_VERSION_IBM], |
1885 |
- [pathscale],[_AX_COMPILER_VERSION_PATHSCALE], |
1886 |
- [clang],[_AX_COMPILER_VERSION_CLANG], |
1887 |
- [cray],[_AX_COMPILER_VERSION_CRAY], |
1888 |
- [fujitsu],[_AX_COMPILER_VERSION_FUJITSU], |
1889 |
- [gnu],[_AX_COMPILER_VERSION_GNU], |
1890 |
- [sun],[_AX_COMPILER_VERSION_SUN], |
1891 |
- [hp],[_AX_COMPILER_VERSION_HP], |
1892 |
- [dec],[_AX_COMPILER_VERSION_DEC], |
1893 |
- [borland],[_AX_COMPILER_VERSION_BORLAND], |
1894 |
- [comeau],[_AX_COMPILER_VERSION_COMEAU], |
1895 |
- [kai],[_AX_COMPILER_VERSION_KAI], |
1896 |
- [sgi],[_AX_COMPILER_VERSION_SGI], |
1897 |
- [microsoft],[_AX_COMPILER_VERSION_MICROSOFT], |
1898 |
- [metrowerks],[_AX_COMPILER_VERSION_METROWERKS], |
1899 |
- [watcom],[_AX_COMPILER_VERSION_WATCOM], |
1900 |
- [portland],[_AX_COMPILER_VERSION_PORTLAND], |
1901 |
- [tcc],[_AX_COMPILER_VERSION_TCC], |
1902 |
- [sdcc],[_AX_COMPILER_VERSION_SDCC], |
1903 |
- [ax_cv_[]_AC_LANG_ABBREV[]_compiler_version=""]) |
1904 |
- ]) |
1905 |
-]) |
1906 |
|
1907 |
diff --git a/m4/ax_cxx_cppflags_std_lang.m4 b/m4/ax_cxx_cppflags_std_lang.m4 |
1908 |
deleted file mode 100644 |
1909 |
index ce2ac02..0000000 |
1910 |
--- a/m4/ax_cxx_cppflags_std_lang.m4 |
1911 |
+++ /dev/null |
1912 |
@@ -1,41 +0,0 @@ |
1913 |
-# ============================================================================= |
1914 |
-# https://www.gnu.org/software/autoconf-archive/ax_cxx_cppflags_std_lang.html |
1915 |
-# ============================================================================= |
1916 |
-# |
1917 |
-# SYNOPSIS |
1918 |
-# |
1919 |
-# AX_CXX_CPPFLAGS_STD_LANG(CPP-FLAGS) |
1920 |
-# |
1921 |
-# DESCRIPTION |
1922 |
-# |
1923 |
-# Append to CPP-FLAGS the set of flags that should be passed to the C++ |
1924 |
-# preprocessor in order to enable use of C++ features as defined in the |
1925 |
-# ANSI C++ standard (eg. use of standard iostream classes in the `std' |
1926 |
-# namespace, etc.). |
1927 |
-# |
1928 |
-# LICENSE |
1929 |
-# |
1930 |
-# Copyright (c) 2008 Ludovic Courtes <ludo@×××××××.org> |
1931 |
-# |
1932 |
-# Copying and distribution of this file, with or without modification, are |
1933 |
-# permitted in any medium without royalty provided the copyright notice |
1934 |
-# and this notice are preserved. This file is offered as-is, without any |
1935 |
-# warranty. |
1936 |
- |
1937 |
-#serial 10 |
1938 |
- |
1939 |
-AU_ALIAS([AC_CXX_CPPFLAGS_STD_LANG], [AX_CXX_CPPFLAGS_STD_LANG]) |
1940 |
-AC_DEFUN([AX_CXX_CPPFLAGS_STD_LANG], |
1941 |
- [AC_LANG_ASSERT([C++]) |
1942 |
- AC_REQUIRE([AX_COMPILER_VENDOR]) |
1943 |
- case "$ax_cv_cxx_compiler_vendor" in |
1944 |
- dec|compaq) |
1945 |
- # By default, Compaq CXX has an iostream classes implementation |
1946 |
- # that is _not_ in the `std' namespace. |
1947 |
- $1="$$1 -D__USE_STD_IOSTREAM=1";; |
1948 |
- hp) |
1949 |
- # When `configure' looks for a C++ header (eg. <iostream>) it invokes |
1950 |
- # `aCC -E $CPPFLAGS'. However, including standard C++ headers like |
1951 |
- # <iostream> fails if `-AA' is not supplied. |
1952 |
- $1="$$1 -AA";; |
1953 |
- esac]) |
1954 |
|
1955 |
diff --git a/m4/ax_cxx_cxxflags_std_lang.m4 b/m4/ax_cxx_cxxflags_std_lang.m4 |
1956 |
deleted file mode 100644 |
1957 |
index d430f71..0000000 |
1958 |
--- a/m4/ax_cxx_cxxflags_std_lang.m4 |
1959 |
+++ /dev/null |
1960 |
@@ -1,36 +0,0 @@ |
1961 |
-# ============================================================================= |
1962 |
-# https://www.gnu.org/software/autoconf-archive/ax_cxx_cxxflags_std_lang.html |
1963 |
-# ============================================================================= |
1964 |
-# |
1965 |
-# SYNOPSIS |
1966 |
-# |
1967 |
-# AX_CXX_CXXFLAGS_STD_LANG(CXX-FLAGS) |
1968 |
-# |
1969 |
-# DESCRIPTION |
1970 |
-# |
1971 |
-# Append to variable CXX-FLAGS the set of compile-time flags that should |
1972 |
-# be passed to the C++ compiler in order to enable use of C++ features as |
1973 |
-# defined in the ANSI C++ standard (eg. use of standard iostream classes |
1974 |
-# in the `std' namespace, etc.). Note that if you use GNU Libtool you may |
1975 |
-# need to prefix each of those flags with `-Xcompiler' so that Libtool |
1976 |
-# doesn't discard them (see Libtool's manual and `AC_LIBTOOLIZE_CFLAGS'). |
1977 |
-# |
1978 |
-# LICENSE |
1979 |
-# |
1980 |
-# Copyright (c) 2008 Ludovic Courtes <ludo@×××××××.org> |
1981 |
-# |
1982 |
-# Copying and distribution of this file, with or without modification, are |
1983 |
-# permitted in any medium without royalty provided the copyright notice |
1984 |
-# and this notice are preserved. This file is offered as-is, without any |
1985 |
-# warranty. |
1986 |
- |
1987 |
-#serial 8 |
1988 |
- |
1989 |
-AU_ALIAS([AC_CXX_CXXFLAGS_STD_LANG], [AX_CXX_CXXFLAGS_STD_LANG]) |
1990 |
-AC_DEFUN([AX_CXX_CXXFLAGS_STD_LANG], |
1991 |
- [AC_LANG_ASSERT([C++]) |
1992 |
- AC_REQUIRE([AX_COMPILER_VENDOR]) |
1993 |
- case "$ax_cv_cxx_compiler_vendor" in |
1994 |
- sgi) $1="$$1 -LANG:std -exceptions";; |
1995 |
- hp) $1="$$1 -AA";; |
1996 |
- esac]) |
1997 |
|
1998 |
diff --git a/m4/ax_cxx_ldflags_std_lang.m4 b/m4/ax_cxx_ldflags_std_lang.m4 |
1999 |
deleted file mode 100644 |
2000 |
index 3107163..0000000 |
2001 |
--- a/m4/ax_cxx_ldflags_std_lang.m4 |
2002 |
+++ /dev/null |
2003 |
@@ -1,36 +0,0 @@ |
2004 |
-# ============================================================================ |
2005 |
-# https://www.gnu.org/software/autoconf-archive/ax_cxx_ldflags_std_lang.html |
2006 |
-# ============================================================================ |
2007 |
-# |
2008 |
-# SYNOPSIS |
2009 |
-# |
2010 |
-# AX_CXX_LDFLAGS_STD_LANG(LD-FLAGS) |
2011 |
-# |
2012 |
-# DESCRIPTION |
2013 |
-# |
2014 |
-# Append to LD-FLAGS the set of link-time flags that should be passed to |
2015 |
-# the C++ compiler in order to enable use of C++ features as defined in |
2016 |
-# the ANSI C++ standard (eg. use of standard iostream classes in the `std' |
2017 |
-# namespace, etc.). Note that if you use GNU Libtool you may need to |
2018 |
-# prefix each of those switches with `-Xlinker' so that Libtool doesn't |
2019 |
-# discard them (see Libtool's manual and `AC_LIBTOOLIZE_LDFLAGS'). |
2020 |
-# |
2021 |
-# LICENSE |
2022 |
-# |
2023 |
-# Copyright (c) 2008 Ludovic Courtes <ludo@×××××××.org> |
2024 |
-# |
2025 |
-# Copying and distribution of this file, with or without modification, are |
2026 |
-# permitted in any medium without royalty provided the copyright notice |
2027 |
-# and this notice are preserved. This file is offered as-is, without any |
2028 |
-# warranty. |
2029 |
- |
2030 |
-#serial 8 |
2031 |
- |
2032 |
-AU_ALIAS([AC_CXX_LDFLAGS_STD_LANG], [AX_CXX_LDFLAGS_STD_LANG]) |
2033 |
-AC_DEFUN([AX_CXX_LDFLAGS_STD_LANG], |
2034 |
- [AC_LANG_ASSERT([C++]) |
2035 |
- AC_REQUIRE([AX_COMPILER_VENDOR]) |
2036 |
- case "$ax_cv_cxx_compiler_vendor" in |
2037 |
- sgi) $1="$$1 -LANG:std -exceptions";; |
2038 |
- hp) $1="$$1 -AA";; |
2039 |
- esac]) |
2040 |
|
2041 |
diff --git a/m4/ax_gcc_archflag.m4 b/m4/ax_gcc_archflag.m4 |
2042 |
deleted file mode 100644 |
2043 |
index c52b9b2..0000000 |
2044 |
--- a/m4/ax_gcc_archflag.m4 |
2045 |
+++ /dev/null |
2046 |
@@ -1,267 +0,0 @@ |
2047 |
-# =========================================================================== |
2048 |
-# https://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html |
2049 |
-# =========================================================================== |
2050 |
-# |
2051 |
-# SYNOPSIS |
2052 |
-# |
2053 |
-# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) |
2054 |
-# |
2055 |
-# DESCRIPTION |
2056 |
-# |
2057 |
-# This macro tries to guess the "native" arch corresponding to the target |
2058 |
-# architecture for use with gcc's -march=arch or -mtune=arch flags. If |
2059 |
-# found, the cache variable $ax_cv_gcc_archflag is set to this flag and |
2060 |
-# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is set to |
2061 |
-# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is |
2062 |
-# to add $ax_cv_gcc_archflag to the end of $CFLAGS. |
2063 |
-# |
2064 |
-# PORTABLE? should be either [yes] (default) or [no]. In the former case, |
2065 |
-# the flag is set to -mtune (or equivalent) so that the architecture is |
2066 |
-# only used for tuning, but the instruction set used is still portable. In |
2067 |
-# the latter case, the flag is set to -march (or equivalent) so that |
2068 |
-# architecture-specific instructions are enabled. |
2069 |
-# |
2070 |
-# The user can specify --with-gcc-arch=<arch> in order to override the |
2071 |
-# macro's choice of architecture, or --without-gcc-arch to disable this. |
2072 |
-# |
2073 |
-# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is |
2074 |
-# called unless the user specified --with-gcc-arch manually. |
2075 |
-# |
2076 |
-# Requires macros: AX_CHECK_COMPILE_FLAG, AX_GCC_X86_CPUID |
2077 |
-# |
2078 |
-# (The main emphasis here is on recent CPUs, on the principle that doing |
2079 |
-# high-performance computing on old hardware is uncommon.) |
2080 |
-# |
2081 |
-# LICENSE |
2082 |
-# |
2083 |
-# Copyright (c) 2008 Steven G. Johnson <stevenj@××××××××.edu> |
2084 |
-# Copyright (c) 2008 Matteo Frigo |
2085 |
-# Copyright (c) 2014 Tsukasa Oi |
2086 |
-# Copyright (c) 2017-2018 Alexey Kopytov |
2087 |
-# |
2088 |
-# This program is free software: you can redistribute it and/or modify it |
2089 |
-# under the terms of the GNU General Public License as published by the |
2090 |
-# Free Software Foundation, either version 3 of the License, or (at your |
2091 |
-# option) any later version. |
2092 |
-# |
2093 |
-# This program is distributed in the hope that it will be useful, but |
2094 |
-# WITHOUT ANY WARRANTY; without even the implied warranty of |
2095 |
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
2096 |
-# Public License for more details. |
2097 |
-# |
2098 |
-# You should have received a copy of the GNU General Public License along |
2099 |
-# with this program. If not, see <https://www.gnu.org/licenses/>. |
2100 |
-# |
2101 |
-# As a special exception, the respective Autoconf Macro's copyright owner |
2102 |
-# gives unlimited permission to copy, distribute and modify the configure |
2103 |
-# scripts that are the output of Autoconf when processing the Macro. You |
2104 |
-# need not follow the terms of the GNU General Public License when using |
2105 |
-# or distributing such scripts, even though portions of the text of the |
2106 |
-# Macro appear in them. The GNU General Public License (GPL) does govern |
2107 |
-# all other use of the material that constitutes the Autoconf Macro. |
2108 |
-# |
2109 |
-# This special exception to the GPL applies to versions of the Autoconf |
2110 |
-# Macro released by the Autoconf Archive. When you make and distribute a |
2111 |
-# modified version of the Autoconf Macro, you may extend this special |
2112 |
-# exception to the GPL to apply to your modified version as well. |
2113 |
- |
2114 |
-#serial 22 |
2115 |
- |
2116 |
-AC_DEFUN([AX_GCC_ARCHFLAG], |
2117 |
-[AC_REQUIRE([AC_PROG_CC]) |
2118 |
-AC_REQUIRE([AC_CANONICAL_HOST]) |
2119 |
-AC_REQUIRE([AC_PROG_SED]) |
2120 |
-AC_REQUIRE([AX_COMPILER_VENDOR]) |
2121 |
- |
2122 |
-AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])], |
2123 |
- ax_gcc_arch=$withval, ax_gcc_arch=yes) |
2124 |
- |
2125 |
-AC_MSG_CHECKING([for gcc architecture flag]) |
2126 |
-AC_MSG_RESULT([]) |
2127 |
-AC_CACHE_VAL(ax_cv_gcc_archflag, |
2128 |
-[ |
2129 |
-ax_cv_gcc_archflag="unknown" |
2130 |
- |
2131 |
-if test "$GCC" = yes; then |
2132 |
- |
2133 |
-if test "x$ax_gcc_arch" = xyes; then |
2134 |
-ax_gcc_arch="" |
2135 |
-if test "$cross_compiling" = no; then |
2136 |
-case $host_cpu in |
2137 |
- i[[3456]]86*|x86_64*|amd64*) # use cpuid codes |
2138 |
- AX_GCC_X86_CPUID(0) |
2139 |
- AX_GCC_X86_CPUID(1) |
2140 |
- case $ax_cv_gcc_x86_cpuid_0 in |
2141 |
- *:756e6547:6c65746e:49656e69) # Intel |
2142 |
- case $ax_cv_gcc_x86_cpuid_1 in |
2143 |
- *5[[4578]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; |
2144 |
- *5[[123]]?:*:*:*) ax_gcc_arch=pentium ;; |
2145 |
- *0?61?:*:*:*|?61?:*:*:*|61?:*:*:*) ax_gcc_arch=pentiumpro ;; |
2146 |
- *0?6[[356]]?:*:*:*|?6[[356]]?:*:*:*|6[[356]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; |
2147 |
- *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; |
2148 |
- *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; |
2149 |
- *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) ax_gcc_arch="yonah pentium-m pentium3 pentiumpro" ;; |
2150 |
- *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) ax_gcc_arch="core2 pentium-m pentium3 pentiumpro" ;; |
2151 |
- *1?6[[7d]]?:*:*:*) ax_gcc_arch="penryn core2 pentium-m pentium3 pentiumpro" ;; |
2152 |
- *1?6[[aef]]?:*:*:*|*2?6e?:*:*:*) ax_gcc_arch="nehalem corei7 core2 pentium-m pentium3 pentiumpro" ;; |
2153 |
- *2?6[[5cf]]?:*:*:*) ax_gcc_arch="westmere corei7 core2 pentium-m pentium3 pentiumpro" ;; |
2154 |
- *2?6[[ad]]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; |
2155 |
- *3?6[[ae]]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; |
2156 |
- *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; |
2157 |
- *3?6d?:*:*:*|*4?6[[7f]]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; |
2158 |
- *1?6c?:*:*:*|*2?6[[67]]?:*:*:*|*3?6[[56]]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;; |
2159 |
- *3?67?:*:*:*|*[[45]]?6[[ad]]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;; |
2160 |
- *000?f[[012]]?:*:*:*|?f[[012]]?:*:*:*|f[[012]]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; |
2161 |
- *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) ax_gcc_arch="nocona prescott pentium4 pentiumpro" ;; |
2162 |
- # fallback |
2163 |
- *5??:*:*:*) ax_gcc_arch=pentium ;; |
2164 |
- *??6??:*:*:*) ax_gcc_arch="core2 pentiumpro" ;; |
2165 |
- *6??:*:*:*) ax_gcc_arch=pentiumpro ;; |
2166 |
- *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; |
2167 |
- esac ;; |
2168 |
- *:68747541:444d4163:69746e65) # AMD |
2169 |
- case $ax_cv_gcc_x86_cpuid_1 in |
2170 |
- *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; |
2171 |
- *5[[8]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; |
2172 |
- *5[[9d]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; |
2173 |
- *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; |
2174 |
- *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; |
2175 |
- *6[[678a]]?:*:*:*) ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; |
2176 |
- *000?f[[4578bcef]]?:*:*:*|?f[[4578bcef]]?:*:*:*|f[[4578bcef]]?:*:*:*|*001?f[[4578bcf]]?:*:*:*|1?f[[4578bcf]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; |
2177 |
- *002?f[[13457bcf]]?:*:*:*|2?f[[13457bcf]]?:*:*:*|*004?f[[138bcf]]?:*:*:*|4?f[[138bcf]]?:*:*:*|*005?f[[df]]?:*:*:*|5?f[[df]]?:*:*:*|*006?f[[8bcf]]?:*:*:*|6?f[[8bcf]]?:*:*:*|*007?f[[cf]]?:*:*:*|7?f[[cf]]?:*:*:*|*00c?f1?:*:*:*|c?f1?:*:*:*|*020?f3?:*:*:*|20?f3?:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; |
2178 |
- *010?f[[245689a]]?:*:*:*|10?f[[245689a]]?:*:*:*|*030?f1?:*:*:*|30?f1?:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; |
2179 |
- *050?f[[12]]?:*:*:*|50?f[[12]]?:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; |
2180 |
- *060?f1?:*:*:*|60?f1?:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; |
2181 |
- *060?f2?:*:*:*|60?f2?:*:*:*|*061?f[[03]]?:*:*:*|61?f[[03]]?:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; |
2182 |
- *063?f0?:*:*:*|63?f0?:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; |
2183 |
- *07[[03]]?f0?:*:*:*|7[[03]]?f0?:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; |
2184 |
- # fallback |
2185 |
- *0[[13]]??f??:*:*:*|[[13]]??f??:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; |
2186 |
- *020?f??:*:*:*|20?f??:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; |
2187 |
- *05??f??:*:*:*|5??f??:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; |
2188 |
- *060?f??:*:*:*|60?f??:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; |
2189 |
- *061?f??:*:*:*|61?f??:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; |
2190 |
- *06??f??:*:*:*|6??f??:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; |
2191 |
- *070?f??:*:*:*|70?f??:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; |
2192 |
- *???f??:*:*:*) ax_gcc_arch="amdfam10 k8" ;; |
2193 |
- esac ;; |
2194 |
- *:746e6543:736c7561:48727561) # IDT / VIA (Centaur) |
2195 |
- case $ax_cv_gcc_x86_cpuid_1 in |
2196 |
- *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; |
2197 |
- *5[[89]]?:*:*:*) ax_gcc_arch=winchip2 ;; |
2198 |
- *66?:*:*:*) ax_gcc_arch=winchip2 ;; |
2199 |
- *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; |
2200 |
- *6[[9adf]]?:*:*:*) ax_gcc_arch="c3-2 c3" ;; |
2201 |
- esac ;; |
2202 |
- esac |
2203 |
- if test x"$ax_gcc_arch" = x; then # fallback |
2204 |
- case $host_cpu in |
2205 |
- i586*) ax_gcc_arch=pentium ;; |
2206 |
- i686*) ax_gcc_arch=pentiumpro ;; |
2207 |
- esac |
2208 |
- fi |
2209 |
- ;; |
2210 |
- |
2211 |
- sparc*) |
2212 |
- AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) |
2213 |
- cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` |
2214 |
- cputype=`echo "$cputype" | tr -d ' -' | $SED 's/SPARCIIi/SPARCII/' |tr $as_cr_LETTERS $as_cr_letters` |
2215 |
- case $cputype in |
2216 |
- *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; |
2217 |
- *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; |
2218 |
- *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; |
2219 |
- *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; |
2220 |
- *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; |
2221 |
- *cypress*) ax_gcc_arch=cypress ;; |
2222 |
- esac ;; |
2223 |
- |
2224 |
- alphaev5) ax_gcc_arch=ev5 ;; |
2225 |
- alphaev56) ax_gcc_arch=ev56 ;; |
2226 |
- alphapca56) ax_gcc_arch="pca56 ev56" ;; |
2227 |
- alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; |
2228 |
- alphaev6) ax_gcc_arch=ev6 ;; |
2229 |
- alphaev67) ax_gcc_arch=ev67 ;; |
2230 |
- alphaev68) ax_gcc_arch="ev68 ev67" ;; |
2231 |
- alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; |
2232 |
- alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; |
2233 |
- alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; |
2234 |
- |
2235 |
- powerpc*) |
2236 |
- cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | $SED 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` |
2237 |
- cputype=`echo $cputype | $SED -e 's/ppc//g;s/ *//g'` |
2238 |
- case $cputype in |
2239 |
- *750*) ax_gcc_arch="750 G3" ;; |
2240 |
- *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; |
2241 |
- *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; |
2242 |
- *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; |
2243 |
- *970*) ax_gcc_arch="970 G5 power4";; |
2244 |
- *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; |
2245 |
- *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; |
2246 |
- 603ev|8240) ax_gcc_arch="$cputype 603e 603";; |
2247 |
- *POWER7*) ax_gcc_arch="power7";; |
2248 |
- *POWER8*) ax_gcc_arch="power8";; |
2249 |
- *POWER9*) ax_gcc_arch="power9";; |
2250 |
- *POWER10*) ax_gcc_arch="power10";; |
2251 |
- *) ax_gcc_arch=$cputype ;; |
2252 |
- esac |
2253 |
- ax_gcc_arch="$ax_gcc_arch powerpc" |
2254 |
- ;; |
2255 |
- aarch64) |
2256 |
- cpuimpl=`grep 'CPU implementer' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` |
2257 |
- cpuarch=`grep 'CPU architecture' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` |
2258 |
- cpuvar=`grep 'CPU variant' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` |
2259 |
- case $cpuimpl in |
2260 |
- 0x42) case $cpuarch in |
2261 |
- 8) case $cpuvar in |
2262 |
- 0x0) ax_gcc_arch="thunderx2t99 vulcan armv8.1-a armv8-a+lse armv8-a native" ;; |
2263 |
- esac |
2264 |
- ;; |
2265 |
- esac |
2266 |
- ;; |
2267 |
- 0x43) case $cpuarch in |
2268 |
- 8) case $cpuvar in |
2269 |
- 0x0) ax_gcc_arch="thunderx armv8-a native" ;; |
2270 |
- 0x1) ax_gcc_arch="thunderx+lse armv8.1-a armv8-a+lse armv8-a native" ;; |
2271 |
- esac |
2272 |
- ;; |
2273 |
- esac |
2274 |
- ;; |
2275 |
- esac |
2276 |
- ;; |
2277 |
-esac |
2278 |
-fi # not cross-compiling |
2279 |
-fi # guess arch |
2280 |
- |
2281 |
-if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then |
2282 |
-if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code |
2283 |
- flag_prefixes="-mtune=" |
2284 |
- if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then flag_prefixes="-march="; fi |
2285 |
- # -mcpu=$arch and m$arch generate nonportable code on every arch except |
2286 |
- # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. |
2287 |
- case $host_cpu in i*86|x86_64*|amd64*) flag_prefixes="$flag_prefixes -mcpu= -m";; esac |
2288 |
-else |
2289 |
- flag_prefixes="-march= -mcpu= -m" |
2290 |
-fi |
2291 |
-for flag_prefix in $flag_prefixes; do |
2292 |
- for arch in $ax_gcc_arch; do |
2293 |
- flag="$flag_prefix$arch" |
2294 |
- AX_CHECK_COMPILE_FLAG($flag, [if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then |
2295 |
- if test "x[]m4_default([$1],yes)" = xyes; then |
2296 |
- if test "x$flag" = "x-march=$arch"; then flag=-mtune=$arch; fi |
2297 |
- fi |
2298 |
- fi; ax_cv_gcc_archflag=$flag; break]) |
2299 |
- done |
2300 |
- test "x$ax_cv_gcc_archflag" = xunknown || break |
2301 |
-done |
2302 |
-fi |
2303 |
- |
2304 |
-fi # $GCC=yes |
2305 |
-]) |
2306 |
-AC_MSG_CHECKING([for gcc architecture flag]) |
2307 |
-AC_MSG_RESULT($ax_cv_gcc_archflag) |
2308 |
-if test "x$ax_cv_gcc_archflag" = xunknown; then |
2309 |
- m4_default([$3],:) |
2310 |
-else |
2311 |
- m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) |
2312 |
-fi |
2313 |
-]) |