File: pa_add_flags.m4

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (40 lines) | stat: -rw-r--r-- 1,322 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
dnl --------------------------------------------------------------------------
dnl PA_ADD_FLAGS(flagvar, flags [, real-flags [, success [, failure]]])
dnl
dnl  Add [real-flags] (default [flags]) to the variable [flagvar] if
dnl  and only if [flags] are accepted by all languages affected by
dnl  [flagvar], if those languages have been previously seen in the
dnl  script.
dnl --------------------------------------------------------------------------
AC_DEFUN([PA_ADD_FLAGS],
[
  AS_VAR_PUSHDEF([old], [_$0_$1_orig])
  AS_VAR_PUSHDEF([ok], [_$0_$1_ok])
  AS_VAR_PUSHDEF([flags], [$1])

  AS_VAR_COPY([old], [flags])
  AS_VAR_SET([flags], ["$flags $2"])
  AS_VAR_SET([ok], [yes])

  PA_LANG_FOREACH(PA_FLAGS_LANGLIST($1),
    [AS_VAR_IF([ok], [yes],
     [AC_MSG_CHECKING([if $]_AC_CC[ accepts $2])
      PA_BUILD_IFELSE([],
      [AC_MSG_RESULT([yes])],
      [AC_MSG_RESULT([no])
       AS_VAR_SET([ok], [no])])])
     ])

 AS_VAR_IF([ok], [yes],
  [m4_ifnblank([$3],[AS_VAR_SET([flags], ["$old $3"])])
   m4_foreach_w([_pa_add_flags_flag], [m4_ifblank([$3],[$2],[$3])],
   [AC_DEFINE(PA_SYM([$1_]_pa_add_flags_flag), 1,
    [Define to 1 if compiled with the ]_pa_add_flags_flag[ compiler flag])])
   $4],
  [AS_VAR_SET([flags], ["$old"])
   $5])

  AS_VAR_POPDEF([flags])
  AS_VAR_POPDEF([ok])
  AS_VAR_POPDEF([old])
])