Artifact
0974cae40784e692c07cfe79264099d428f346d82a075b12ff84a52b621679c9:
0000: 23 20 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d # ==============
0010: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 23 20 =============.#
0050: 20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 6e 75 https://www.gnu
0060: 2e 6f 72 67 2f 73 6f 66 74 77 61 72 65 2f 61 75 .org/software/au
0070: 74 6f 63 6f 6e 66 2d 61 72 63 68 69 76 65 2f 61 toconf-archive/a
0080: 78 5f 63 68 65 63 6b 5f 63 6f 6d 70 69 6c 65 5f x_check_compile_
0090: 66 6c 61 67 2e 68 74 6d 6c 0a 23 20 3d 3d 3d 3d flag.html.# ====
00a0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
00b0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
00c0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
00d0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
00e0: 3d 3d 3d 3d 3d 3d 3d 0a 23 0a 23 20 53 59 4e 4f =======.#.# SYNO
00f0: 50 53 49 53 0a 23 0a 23 20 20 20 41 58 5f 43 48 PSIS.#.# AX_CH
0100: 45 43 4b 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41 47 ECK_COMPILE_FLAG
0110: 28 46 4c 41 47 2c 20 5b 41 43 54 49 4f 4e 2d 53 (FLAG, [ACTION-S
0120: 55 43 43 45 53 53 5d 2c 20 5b 41 43 54 49 4f 4e UCCESS], [ACTION
0130: 2d 46 41 49 4c 55 52 45 5d 2c 20 5b 45 58 54 52 -FAILURE], [EXTR
0140: 41 2d 46 4c 41 47 53 5d 2c 20 5b 49 4e 50 55 54 A-FLAGS], [INPUT
0150: 5d 29 0a 23 0a 23 20 44 45 53 43 52 49 50 54 49 ]).#.# DESCRIPTI
0160: 4f 4e 0a 23 0a 23 20 20 20 43 68 65 63 6b 20 77 ON.#.# Check w
0170: 68 65 74 68 65 72 20 74 68 65 20 67 69 76 65 6e hether the given
0180: 20 46 4c 41 47 20 77 6f 72 6b 73 20 77 69 74 68 FLAG works with
0190: 20 74 68 65 20 63 75 72 72 65 6e 74 20 6c 61 6e the current lan
01a0: 67 75 61 67 65 27 73 20 63 6f 6d 70 69 6c 65 72 guage's compiler
01b0: 0a 23 20 20 20 6f 72 20 67 69 76 65 73 20 61 6e .# or gives an
01c0: 20 65 72 72 6f 72 2e 20 20 28 57 61 72 6e 69 6e error. (Warnin
01d0: 67 73 2c 20 68 6f 77 65 76 65 72 2c 20 61 72 65 gs, however, are
01e0: 20 69 67 6e 6f 72 65 64 29 0a 23 0a 23 20 20 20 ignored).#.#
01f0: 41 43 54 49 4f 4e 2d 53 55 43 43 45 53 53 2f 41 ACTION-SUCCESS/A
0200: 43 54 49 4f 4e 2d 46 41 49 4c 55 52 45 20 61 72 CTION-FAILURE ar
0210: 65 20 73 68 65 6c 6c 20 63 6f 6d 6d 61 6e 64 73 e shell commands
0220: 20 74 6f 20 65 78 65 63 75 74 65 20 6f 6e 0a 23 to execute on.#
0230: 20 20 20 73 75 63 63 65 73 73 2f 66 61 69 6c 75 success/failu
0240: 72 65 2e 0a 23 0a 23 20 20 20 49 66 20 45 58 54 re..#.# If EXT
0250: 52 41 2d 46 4c 41 47 53 20 69 73 20 64 65 66 69 RA-FLAGS is defi
0260: 6e 65 64 2c 20 69 74 20 69 73 20 61 64 64 65 64 ned, it is added
0270: 20 74 6f 20 74 68 65 20 63 75 72 72 65 6e 74 20 to the current
0280: 6c 61 6e 67 75 61 67 65 27 73 20 64 65 66 61 75 language's defau
0290: 6c 74 0a 23 20 20 20 66 6c 61 67 73 20 28 65 2e lt.# flags (e.
02a0: 67 2e 20 43 46 4c 41 47 53 29 20 77 68 65 6e 20 g. CFLAGS) when
02b0: 74 68 65 20 63 68 65 63 6b 20 69 73 20 64 6f 6e the check is don
02c0: 65 2e 20 20 54 68 65 20 63 68 65 63 6b 20 69 73 e. The check is
02d0: 20 74 68 75 73 20 6d 61 64 65 20 77 69 74 68 0a thus made with.
02e0: 23 20 20 20 74 68 65 20 66 6c 61 67 73 3a 20 22 # the flags: "
02f0: 43 46 4c 41 47 53 20 45 58 54 52 41 2d 46 4c 41 CFLAGS EXTRA-FLA
0300: 47 53 20 46 4c 41 47 22 2e 20 20 54 68 69 73 20 GS FLAG". This
0310: 63 61 6e 20 66 6f 72 20 65 78 61 6d 70 6c 65 20 can for example
0320: 62 65 20 75 73 65 64 20 74 6f 0a 23 20 20 20 66 be used to.# f
0330: 6f 72 63 65 20 74 68 65 20 63 6f 6d 70 69 6c 65 orce the compile
0340: 72 20 74 6f 20 69 73 73 75 65 20 61 6e 20 65 72 r to issue an er
0350: 72 6f 72 20 77 68 65 6e 20 61 20 62 61 64 20 66 ror when a bad f
0360: 6c 61 67 20 69 73 20 67 69 76 65 6e 2e 0a 23 0a lag is given..#.
0370: 23 20 20 20 49 4e 50 55 54 20 67 69 76 65 73 20 # INPUT gives
0380: 61 6e 20 61 6c 74 65 72 6e 61 74 69 76 65 20 69 an alternative i
0390: 6e 70 75 74 20 73 6f 75 72 63 65 20 74 6f 20 41 nput source to A
03a0: 43 5f 4c 49 4e 4b 5f 49 46 45 4c 53 45 2e 0a 23 C_LINK_IFELSE..#
03b0: 0a 23 20 20 20 4e 4f 54 45 3a 20 49 6d 70 6c 65 .# NOTE: Imple
03c0: 6d 65 6e 74 61 74 69 6f 6e 20 62 61 73 65 64 20 mentation based
03d0: 6f 6e 20 41 58 5f 43 46 4c 41 47 53 5f 47 43 43 on AX_CFLAGS_GCC
03e0: 5f 4f 50 54 49 4f 4e 2e 20 50 6c 65 61 73 65 20 _OPTION. Please
03f0: 6b 65 65 70 20 74 68 69 73 0a 23 20 20 20 6d 61 keep this.# ma
0400: 63 72 6f 20 69 6e 20 73 79 6e 63 20 77 69 74 68 cro in sync with
0410: 20 41 58 5f 43 48 45 43 4b 5f 7b 50 52 45 50 52 AX_CHECK_{PREPR
0420: 4f 43 2c 4c 49 4e 4b 7d 5f 46 4c 41 47 2e 0a 23 OC,LINK}_FLAG..#
0430: 0a 23 20 4c 49 43 45 4e 53 45 0a 23 0a 23 20 20 .# LICENSE.#.#
0440: 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 Copyright (c) 2
0450: 30 30 38 20 47 75 69 64 6f 20 55 2e 20 44 72 61 008 Guido U. Dra
0460: 68 65 69 6d 20 3c 67 75 69 64 6f 64 40 67 6d 78 heim <guidod@gmx
0470: 2e 64 65 3e 0a 23 20 20 20 43 6f 70 79 72 69 67 .de>.# Copyrig
0480: 68 74 20 28 63 29 20 32 30 31 31 20 4d 61 61 72 ht (c) 2011 Maar
0490: 74 65 6e 20 42 6f 73 6d 61 6e 73 20 3c 6d 6b 62 ten Bosmans <mkb
04a0: 6f 73 6d 61 6e 73 40 67 6d 61 69 6c 2e 63 6f 6d [email protected]
04b0: 3e 0a 23 0a 23 20 20 20 43 6f 70 79 69 6e 67 20 >.#.# Copying
04c0: 61 6e 64 20 64 69 73 74 72 69 62 75 74 69 6f 6e and distribution
04d0: 20 6f 66 20 74 68 69 73 20 66 69 6c 65 2c 20 77 of this file, w
04e0: 69 74 68 20 6f 72 20 77 69 74 68 6f 75 74 20 6d ith or without m
04f0: 6f 64 69 66 69 63 61 74 69 6f 6e 2c 20 61 72 65 odification, are
0500: 0a 23 20 20 20 70 65 72 6d 69 74 74 65 64 20 69 .# permitted i
0510: 6e 20 61 6e 79 20 6d 65 64 69 75 6d 20 77 69 74 n any medium wit
0520: 68 6f 75 74 20 72 6f 79 61 6c 74 79 20 70 72 6f hout royalty pro
0530: 76 69 64 65 64 20 74 68 65 20 63 6f 70 79 72 69 vided the copyri
0540: 67 68 74 20 6e 6f 74 69 63 65 0a 23 20 20 20 61 ght notice.# a
0550: 6e 64 20 74 68 69 73 20 6e 6f 74 69 63 65 20 61 nd this notice a
0560: 72 65 20 70 72 65 73 65 72 76 65 64 2e 20 20 54 re preserved. T
0570: 68 69 73 20 66 69 6c 65 20 69 73 20 6f 66 66 65 his file is offe
0580: 72 65 64 20 61 73 2d 69 73 2c 20 77 69 74 68 6f red as-is, witho
0590: 75 74 20 61 6e 79 0a 23 20 20 20 77 61 72 72 61 ut any.# warra
05a0: 6e 74 79 2e 0a 0a 23 73 65 72 69 61 6c 20 36 0a nty...#serial 6.
05b0: 0a 41 43 5f 44 45 46 55 4e 28 5b 41 58 5f 43 48 .AC_DEFUN([AX_CH
05c0: 45 43 4b 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41 47 ECK_COMPILE_FLAG
05d0: 5d 2c 0a 5b 41 43 5f 50 52 45 52 45 51 28 32 2e ],.[AC_PREREQ(2.
05e0: 36 34 29 64 6e 6c 20 66 6f 72 20 5f 41 43 5f 4c 64)dnl for _AC_L
05f0: 41 4e 47 5f 50 52 45 46 49 58 20 61 6e 64 20 41 ANG_PREFIX and A
0600: 53 5f 56 41 52 5f 49 46 0a 41 53 5f 56 41 52 5f S_VAR_IF.AS_VAR_
0610: 50 55 53 48 44 45 46 28 5b 43 41 43 48 45 56 41 PUSHDEF([CACHEVA
0620: 52 5d 2c 5b 61 78 5f 63 76 5f 63 68 65 63 6b 5f R],[ax_cv_check_
0630: 5b 5d 5f 41 43 5f 4c 41 4e 47 5f 41 42 42 52 45 []_AC_LANG_ABBRE
0640: 56 5b 5d 66 6c 61 67 73 5f 24 34 5f 24 31 5d 29 V[]flags_$4_$1])
0650: 64 6e 6c 0a 41 43 5f 43 41 43 48 45 5f 43 48 45 dnl.AC_CACHE_CHE
0660: 43 4b 28 5b 77 68 65 74 68 65 72 20 5f 41 43 5f CK([whether _AC_
0670: 4c 41 4e 47 20 63 6f 6d 70 69 6c 65 72 20 61 63 LANG compiler ac
0680: 63 65 70 74 73 20 24 31 5d 2c 20 43 41 43 48 45 cepts $1], CACHE
0690: 56 41 52 2c 20 5b 0a 20 20 61 78 5f 63 68 65 63 VAR, [. ax_chec
06a0: 6b 5f 73 61 76 65 5f 66 6c 61 67 73 3d 24 5b 5d k_save_flags=$[]
06b0: 5f 41 43 5f 4c 41 4e 47 5f 50 52 45 46 49 58 5b _AC_LANG_PREFIX[
06c0: 5d 46 4c 41 47 53 0a 20 20 5f 41 43 5f 4c 41 4e ]FLAGS. _AC_LAN
06d0: 47 5f 50 52 45 46 49 58 5b 5d 46 4c 41 47 53 3d G_PREFIX[]FLAGS=
06e0: 22 24 5b 5d 5f 41 43 5f 4c 41 4e 47 5f 50 52 45 "$[]_AC_LANG_PRE
06f0: 46 49 58 5b 5d 46 4c 41 47 53 20 24 34 20 24 31 FIX[]FLAGS $4 $1
0700: 22 0a 20 20 41 43 5f 4c 49 4e 4b 5f 49 46 45 4c ". AC_LINK_IFEL
0710: 53 45 28 5b 6d 34 5f 64 65 66 61 75 6c 74 28 5b SE([m4_default([
0720: 24 35 5d 2c 5b 41 43 5f 4c 41 4e 47 5f 50 52 4f $5],[AC_LANG_PRO
0730: 47 52 41 4d 28 29 5d 29 5d 2c 0a 20 20 20 20 5b GRAM()])],. [
0740: 41 53 5f 56 41 52 5f 53 45 54 28 43 41 43 48 45 AS_VAR_SET(CACHE
0750: 56 41 52 2c 5b 79 65 73 5d 29 5d 2c 0a 20 20 20 VAR,[yes])],.
0760: 20 5b 41 53 5f 56 41 52 5f 53 45 54 28 43 41 43 [AS_VAR_SET(CAC
0770: 48 45 56 41 52 2c 5b 6e 6f 5d 29 5d 29 0a 20 20 HEVAR,[no])]).
0780: 5f 41 43 5f 4c 41 4e 47 5f 50 52 45 46 49 58 5b _AC_LANG_PREFIX[
0790: 5d 46 4c 41 47 53 3d 24 61 78 5f 63 68 65 63 6b ]FLAGS=$ax_check
07a0: 5f 73 61 76 65 5f 66 6c 61 67 73 5d 29 0a 41 53 _save_flags]).AS
07b0: 5f 56 41 52 5f 49 46 28 43 41 43 48 45 56 41 52 _VAR_IF(CACHEVAR
07c0: 2c 79 65 73 2c 0a 20 20 5b 6d 34 5f 64 65 66 61 ,yes,. [m4_defa
07d0: 75 6c 74 28 5b 24 32 5d 2c 20 3a 29 5d 2c 0a 20 ult([$2], :)],.
07e0: 20 5b 6d 34 5f 64 65 66 61 75 6c 74 28 5b 24 33 [m4_default([$3
07f0: 5d 2c 20 3a 29 5d 29 0a 41 53 5f 56 41 52 5f 50 ], :)]).AS_VAR_P
0800: 4f 50 44 45 46 28 5b 43 41 43 48 45 56 41 52 5d OPDEF([CACHEVAR]
0810: 29 64 6e 6c 0a 5d 29 64 6e 6c 20 41 58 5f 43 48 )dnl.])dnl AX_CH
0820: 45 43 4b 5f 43 4f 4d 50 49 4c 45 5f 46 4c 41 47 ECK_COMPILE_FLAG
0830: 53 0a S.