pf2 0.9.0 → 1.0.0.alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -4
  3. data/Rakefile +3 -9
  4. data/doc/development.md +6 -0
  5. data/ext/pf2/debug.h +12 -0
  6. data/ext/pf2/extconf.rb +23 -6
  7. data/ext/{pf2c → pf2}/sample.c +6 -0
  8. data/ext/{pf2c → pf2}/sample.h +4 -0
  9. data/ext/{pf2c → pf2}/serializer.c +1 -1
  10. data/ext/{pf2c → pf2}/session.c +70 -20
  11. data/ext/{pf2c → pf2}/session.h +5 -0
  12. data/lib/pf2/cli.rb +3 -11
  13. data/lib/pf2/reporter/firefox_profiler_ser2.rb +17 -13
  14. data/lib/pf2/reporter/stack_weaver.rb +8 -0
  15. data/lib/pf2/reporter.rb +0 -1
  16. data/lib/pf2/version.rb +1 -1
  17. data/lib/pf2.rb +1 -1
  18. metadata +18 -135
  19. data/Cargo.lock +0 -630
  20. data/Cargo.toml +0 -3
  21. data/crates/backtrace-sys2/.gitignore +0 -1
  22. data/crates/backtrace-sys2/Cargo.toml +0 -9
  23. data/crates/backtrace-sys2/build.rs +0 -45
  24. data/crates/backtrace-sys2/src/lib.rs +0 -5
  25. data/crates/backtrace-sys2/src/libbacktrace/.gitignore +0 -15
  26. data/crates/backtrace-sys2/src/libbacktrace/Isaac.Newton-Opticks.txt +0 -9286
  27. data/crates/backtrace-sys2/src/libbacktrace/LICENSE +0 -29
  28. data/crates/backtrace-sys2/src/libbacktrace/Makefile.am +0 -708
  29. data/crates/backtrace-sys2/src/libbacktrace/Makefile.in +0 -2820
  30. data/crates/backtrace-sys2/src/libbacktrace/README.md +0 -46
  31. data/crates/backtrace-sys2/src/libbacktrace/aclocal.m4 +0 -864
  32. data/crates/backtrace-sys2/src/libbacktrace/alloc.c +0 -167
  33. data/crates/backtrace-sys2/src/libbacktrace/allocfail.c +0 -136
  34. data/crates/backtrace-sys2/src/libbacktrace/allocfail.sh +0 -104
  35. data/crates/backtrace-sys2/src/libbacktrace/atomic.c +0 -113
  36. data/crates/backtrace-sys2/src/libbacktrace/backtrace-supported.h.in +0 -66
  37. data/crates/backtrace-sys2/src/libbacktrace/backtrace.c +0 -129
  38. data/crates/backtrace-sys2/src/libbacktrace/backtrace.h +0 -189
  39. data/crates/backtrace-sys2/src/libbacktrace/btest.c +0 -517
  40. data/crates/backtrace-sys2/src/libbacktrace/compile +0 -348
  41. data/crates/backtrace-sys2/src/libbacktrace/config/enable.m4 +0 -38
  42. data/crates/backtrace-sys2/src/libbacktrace/config/lead-dot.m4 +0 -31
  43. data/crates/backtrace-sys2/src/libbacktrace/config/libtool.m4 +0 -7545
  44. data/crates/backtrace-sys2/src/libbacktrace/config/ltoptions.m4 +0 -369
  45. data/crates/backtrace-sys2/src/libbacktrace/config/ltsugar.m4 +0 -123
  46. data/crates/backtrace-sys2/src/libbacktrace/config/ltversion.m4 +0 -23
  47. data/crates/backtrace-sys2/src/libbacktrace/config/lt~obsolete.m4 +0 -98
  48. data/crates/backtrace-sys2/src/libbacktrace/config/multi.m4 +0 -68
  49. data/crates/backtrace-sys2/src/libbacktrace/config/override.m4 +0 -117
  50. data/crates/backtrace-sys2/src/libbacktrace/config/unwind_ipinfo.m4 +0 -37
  51. data/crates/backtrace-sys2/src/libbacktrace/config/warnings.m4 +0 -227
  52. data/crates/backtrace-sys2/src/libbacktrace/config.guess +0 -1700
  53. data/crates/backtrace-sys2/src/libbacktrace/config.h.in +0 -185
  54. data/crates/backtrace-sys2/src/libbacktrace/config.sub +0 -1885
  55. data/crates/backtrace-sys2/src/libbacktrace/configure +0 -15929
  56. data/crates/backtrace-sys2/src/libbacktrace/configure.ac +0 -632
  57. data/crates/backtrace-sys2/src/libbacktrace/dwarf.c +0 -4409
  58. data/crates/backtrace-sys2/src/libbacktrace/edtest.c +0 -120
  59. data/crates/backtrace-sys2/src/libbacktrace/edtest2.c +0 -43
  60. data/crates/backtrace-sys2/src/libbacktrace/elf.c +0 -7465
  61. data/crates/backtrace-sys2/src/libbacktrace/fileline.c +0 -407
  62. data/crates/backtrace-sys2/src/libbacktrace/filenames.h +0 -52
  63. data/crates/backtrace-sys2/src/libbacktrace/filetype.awk +0 -13
  64. data/crates/backtrace-sys2/src/libbacktrace/install-debuginfo-for-buildid.sh.in +0 -65
  65. data/crates/backtrace-sys2/src/libbacktrace/install-sh +0 -501
  66. data/crates/backtrace-sys2/src/libbacktrace/instrumented_alloc.c +0 -114
  67. data/crates/backtrace-sys2/src/libbacktrace/internal.h +0 -428
  68. data/crates/backtrace-sys2/src/libbacktrace/ltmain.sh +0 -8636
  69. data/crates/backtrace-sys2/src/libbacktrace/macho.c +0 -1361
  70. data/crates/backtrace-sys2/src/libbacktrace/missing +0 -215
  71. data/crates/backtrace-sys2/src/libbacktrace/mmap.c +0 -331
  72. data/crates/backtrace-sys2/src/libbacktrace/mmapio.c +0 -110
  73. data/crates/backtrace-sys2/src/libbacktrace/move-if-change +0 -83
  74. data/crates/backtrace-sys2/src/libbacktrace/mtest.c +0 -410
  75. data/crates/backtrace-sys2/src/libbacktrace/nounwind.c +0 -66
  76. data/crates/backtrace-sys2/src/libbacktrace/pecoff.c +0 -1123
  77. data/crates/backtrace-sys2/src/libbacktrace/posix.c +0 -104
  78. data/crates/backtrace-sys2/src/libbacktrace/print.c +0 -117
  79. data/crates/backtrace-sys2/src/libbacktrace/read.c +0 -110
  80. data/crates/backtrace-sys2/src/libbacktrace/simple.c +0 -108
  81. data/crates/backtrace-sys2/src/libbacktrace/sort.c +0 -108
  82. data/crates/backtrace-sys2/src/libbacktrace/state.c +0 -72
  83. data/crates/backtrace-sys2/src/libbacktrace/stest.c +0 -137
  84. data/crates/backtrace-sys2/src/libbacktrace/test-driver +0 -148
  85. data/crates/backtrace-sys2/src/libbacktrace/test_format.c +0 -55
  86. data/crates/backtrace-sys2/src/libbacktrace/testlib.c +0 -234
  87. data/crates/backtrace-sys2/src/libbacktrace/testlib.h +0 -110
  88. data/crates/backtrace-sys2/src/libbacktrace/ttest.c +0 -161
  89. data/crates/backtrace-sys2/src/libbacktrace/unittest.c +0 -92
  90. data/crates/backtrace-sys2/src/libbacktrace/unknown.c +0 -65
  91. data/crates/backtrace-sys2/src/libbacktrace/xcoff.c +0 -1617
  92. data/crates/backtrace-sys2/src/libbacktrace/xztest.c +0 -508
  93. data/crates/backtrace-sys2/src/libbacktrace/zstdtest.c +0 -523
  94. data/crates/backtrace-sys2/src/libbacktrace/ztest.c +0 -541
  95. data/ext/pf2/Cargo.toml +0 -25
  96. data/ext/pf2/build.rs +0 -10
  97. data/ext/pf2/src/backtrace.rs +0 -127
  98. data/ext/pf2/src/lib.rs +0 -22
  99. data/ext/pf2/src/profile.rs +0 -69
  100. data/ext/pf2/src/profile_serializer.rs +0 -241
  101. data/ext/pf2/src/ringbuffer.rs +0 -150
  102. data/ext/pf2/src/ruby_c_api_helper.c +0 -6
  103. data/ext/pf2/src/ruby_init.rs +0 -40
  104. data/ext/pf2/src/ruby_internal_apis.rs +0 -77
  105. data/ext/pf2/src/sample.rs +0 -67
  106. data/ext/pf2/src/scheduler.rs +0 -10
  107. data/ext/pf2/src/serialization/profile.rs +0 -48
  108. data/ext/pf2/src/serialization/serializer.rs +0 -329
  109. data/ext/pf2/src/serialization.rs +0 -2
  110. data/ext/pf2/src/session/configuration.rs +0 -114
  111. data/ext/pf2/src/session/new_thread_watcher.rs +0 -80
  112. data/ext/pf2/src/session/ruby_object.rs +0 -90
  113. data/ext/pf2/src/session.rs +0 -248
  114. data/ext/pf2/src/siginfo_t.c +0 -5
  115. data/ext/pf2/src/signal_scheduler.rs +0 -201
  116. data/ext/pf2/src/signal_scheduler_unsupported_platform.rs +0 -39
  117. data/ext/pf2/src/timer_thread_scheduler.rs +0 -179
  118. data/ext/pf2/src/util.rs +0 -31
  119. data/ext/pf2c/extconf.rb +0 -21
  120. data/lib/pf2/reporter/firefox_profiler.rb +0 -397
  121. data/rust-toolchain.toml +0 -2
  122. data/rustfmt.toml +0 -1
  123. /data/ext/{pf2c → pf2}/backtrace_state.c +0 -0
  124. /data/ext/{pf2c → pf2}/backtrace_state.h +0 -0
  125. /data/ext/{pf2c → pf2}/configuration.c +0 -0
  126. /data/ext/{pf2c → pf2}/configuration.h +0 -0
  127. /data/ext/{pf2c → pf2}/pf2.c +0 -0
  128. /data/ext/{pf2c → pf2}/pf2.h +0 -0
  129. /data/ext/{pf2c → pf2}/ringbuffer.c +0 -0
  130. /data/ext/{pf2c → pf2}/ringbuffer.h +0 -0
  131. /data/ext/{pf2c → pf2}/serializer.h +0 -0
@@ -1,117 +0,0 @@
1
- dnl Fix Autoconf bugs by overriding broken internal Autoconf
2
- dnl macros with backports of fixes from newer releases.
3
- dnl
4
- dnl The override bits of this file should be a no-op for the newest
5
- dnl Autoconf version, which means they can be removed once the complete
6
- dnl tree has moved to a new enough Autoconf version.
7
- dnl
8
- dnl The _GCC_AUTOCONF_VERSION_TEST ensures that exactly the desired
9
- dnl Autoconf version is used. It should be kept for consistency.
10
-
11
- dnl Use ifdef/ifelse over m4_ifdef/m4_ifelse to be clean for 2.13.
12
- ifdef([m4_PACKAGE_VERSION], [
13
-
14
- dnl Provide m4_copy_force and m4_rename_force for old Autoconf versions.
15
-
16
- m4_ifndef([m4_copy_force],
17
- [m4_define([m4_copy_force],
18
- [m4_ifdef([$2], [m4_undefine([$2])])m4_copy($@)])])
19
-
20
- m4_ifndef([m4_rename_force],
21
- [m4_define([m4_rename_force],
22
- [m4_ifdef([$2], [m4_undefine([$2])])m4_rename($@)])])
23
-
24
- dnl AC_DEFUN a commonly used macro so this file is picked up.
25
- m4_copy([AC_PREREQ], [_AC_PREREQ])
26
- AC_DEFUN([AC_PREREQ], [frob])
27
- m4_copy_force([_AC_PREREQ], [AC_PREREQ])
28
-
29
-
30
- dnl Ensure exactly this Autoconf version is used
31
- m4_ifndef([_GCC_AUTOCONF_VERSION],
32
- [m4_define([_GCC_AUTOCONF_VERSION], [2.69])])
33
-
34
- dnl Test for the exact version when AC_INIT is expanded.
35
- dnl This allows to update the tree in steps (for testing)
36
- dnl by putting
37
- dnl m4_define([_GCC_AUTOCONF_VERSION], [X.Y])
38
- dnl in configure.ac before AC_INIT,
39
- dnl without rewriting this file.
40
- dnl Or for updating the whole tree at once with the definition above.
41
- AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
42
- [m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
43
- m4_defn([m4_PACKAGE_VERSION]), [],
44
- [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
45
- ])
46
- dnl don't do this for libbacktrace
47
- dnl m4_define([AC_INIT], m4_defn([AC_INIT])[
48
- dnl _GCC_AUTOCONF_VERSION_CHECK
49
- dnl ])
50
-
51
-
52
- dnl Ensure we do not use a buggy M4.
53
- m4_if(m4_index([..wi.d.], [.d.]), [-1],
54
- [m4_fatal(m4_do([m4 with buggy strstr detected. Please install
55
- GNU M4 1.4.16 or newer and set the M4 environment variable]))])
56
-
57
-
58
- dnl Fix 2.64 cross compile detection for AVR and RTEMS
59
- dnl by not trying to compile fopen.
60
- m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.64],
61
- [m4_foreach([_GCC_LANG], [C, C++, Fortran, Fortran 77],
62
- [m4_define([_AC_LANG_IO_PROGRAM(]_GCC_LANG[)], m4_defn([AC_LANG_PROGRAM(]_GCC_LANG[)]))])])
63
-
64
- m4_version_prereq([2.66],, [
65
- dnl We need AC_CHECK_DECL which works for overloaded C++ functions.
66
-
67
- # _AC_CHECK_DECL_BODY
68
- # -------------------
69
- # Shell function body for AC_CHECK_DECL.
70
- m4_define([_AC_CHECK_DECL_BODY],
71
- [ AS_LINENO_PUSH([$[]1])
72
- [as_decl_name=`echo $][2|sed 's/ *(.*//'`]
73
- [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
74
- AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
75
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
76
- [@%:@ifndef $[]as_decl_name
77
- @%:@ifdef __cplusplus
78
- (void) $[]as_decl_use;
79
- @%:@else
80
- (void) $[]as_decl_name;
81
- @%:@endif
82
- @%:@endif
83
- ])],
84
- [AS_VAR_SET([$[]3], [yes])],
85
- [AS_VAR_SET([$[]3], [no])])])
86
- AS_LINENO_POP
87
- ])# _AC_CHECK_DECL_BODY
88
-
89
- # _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND,
90
- # INCLUDES)
91
- # -------------------------------------------------------------
92
- # Helper to AC_CHECK_DECLS, which generates the check for a single
93
- # SYMBOL with INCLUDES, performs the AC_DEFINE, then expands
94
- # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
95
- m4_define([_AC_CHECK_DECLS],
96
- [AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
97
- [AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])),
98
- [$ac_have_decl],
99
- [Define to 1 if you have the declaration of `$1',
100
- and to 0 if you don't.])]dnl
101
- [m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])
102
-
103
- ])
104
-
105
- dnl If flex/lex are not found, the top level configure sets LEX to
106
- dnl "/path_to/missing flex". When AC_PROG_LEX tries to find the flex
107
- dnl output file, it calls $LEX to do so, but the current lightweight
108
- dnl "missing" won't create a file. This results in an error.
109
- dnl Avoid calling the bulk of AC_PROG_LEX when $LEX is "missing".
110
- AC_DEFUN_ONCE([AC_PROG_LEX],
111
- [AC_CHECK_PROGS(LEX, flex lex, :)
112
- case "$LEX" in
113
- :|*"missing "*) ;;
114
- *) _AC_PROG_LEX_YYTEXT_DECL ;;
115
- esac])
116
-
117
- ])
@@ -1,37 +0,0 @@
1
- dnl
2
- dnl Check whether _Unwind_GetIPInfo is available without doing a link
3
- dnl test so we can use this with libstdc++-v3 and libjava. Need to
4
- dnl use $target to set defaults because automatic checking is not possible
5
- dnl without a link test (and maybe even with a link test).
6
- dnl
7
-
8
- AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [
9
- AC_ARG_WITH(system-libunwind,
10
- [ --with-system-libunwind use installed libunwind])
11
- # If system-libunwind was not specifically set, pick a default setting.
12
- if test x$with_system_libunwind = x; then
13
- case ${target} in
14
- ia64-*-hpux*) with_system_libunwind=yes ;;
15
- *) with_system_libunwind=no ;;
16
- esac
17
- fi
18
- # Based on system-libunwind and target, do we have ipinfo?
19
- if test x$with_system_libunwind = xyes; then
20
- case ${target} in
21
- ia64-*-*) have_unwind_getipinfo=no ;;
22
- *) have_unwind_getipinfo=yes ;;
23
- esac
24
- else
25
- # Darwin before version 9 does not have _Unwind_GetIPInfo.
26
- changequote(,)
27
- case ${target} in
28
- *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;;
29
- *) have_unwind_getipinfo=yes ;;
30
- esac
31
- changequote([,])
32
- fi
33
-
34
- if test x$have_unwind_getipinfo = xyes; then
35
- AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.])
36
- fi
37
- ])
@@ -1,227 +0,0 @@
1
- # Autoconf include file defining macros related to compile-time warnings.
2
-
3
- # Copyright 2004, 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
4
-
5
- #This file is part of GCC.
6
-
7
- #GCC is free software; you can redistribute it and/or modify it under
8
- #the terms of the GNU General Public License as published by the Free
9
- #Software Foundation; either version 3, or (at your option) any later
10
- #version.
11
-
12
- #GCC is distributed in the hope that it will be useful, but WITHOUT
13
- #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
- #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
- #for more details.
16
-
17
- #You should have received a copy of the GNU General Public License
18
- #along with GCC; see the file COPYING3. If not see
19
- #<http://www.gnu.org/licenses/>.
20
-
21
- # ACX_PROG_CC_WARNING_OPTS(WARNINGS, [VARIABLE = WARN_CFLAGS])
22
- # Sets @VARIABLE@ to the subset of the given options which the
23
- # compiler accepts.
24
- AC_DEFUN([ACX_PROG_CC_WARNING_OPTS],
25
- [AC_REQUIRE([AC_PROG_CC])dnl
26
- AC_LANG_PUSH(C)
27
- m4_pushdef([acx_Var], [m4_default([$2], [WARN_CFLAGS])])dnl
28
- AC_SUBST(acx_Var)dnl
29
- m4_expand_once([acx_Var=
30
- ],m4_quote(acx_Var=))dnl
31
- save_CFLAGS="$CFLAGS"
32
- for real_option in $1; do
33
- # Do the check with the no- prefix removed since gcc silently
34
- # accepts any -Wno-* option on purpose
35
- case $real_option in
36
- -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
37
- *) option=$real_option ;;
38
- esac
39
- AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
40
- AC_CACHE_CHECK([whether $CC supports $option], acx_Woption,
41
- [CFLAGS="$option"
42
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
43
- [AS_VAR_SET(acx_Woption, yes)],
44
- [AS_VAR_SET(acx_Woption, no)])
45
- ])
46
- AS_IF([test AS_VAR_GET(acx_Woption) = yes],
47
- [acx_Var="$acx_Var${acx_Var:+ }$real_option"])
48
- AS_VAR_POPDEF([acx_Woption])dnl
49
- done
50
- CFLAGS="$save_CFLAGS"
51
- m4_popdef([acx_Var])dnl
52
- AC_LANG_POP(C)
53
- ])# ACX_PROG_CC_WARNING_OPTS
54
-
55
- # ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC])
56
- # Append to VARIABLE "-pedantic" + the argument, if the compiler is GCC
57
- # and accepts all of those options simultaneously, otherwise to nothing.
58
- AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
59
- [AC_REQUIRE([AC_PROG_CC])dnl
60
- AC_LANG_PUSH(C)
61
- m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl
62
- AC_SUBST(acx_Var)dnl
63
- m4_expand_once([acx_Var=
64
- ],m4_quote(acx_Var=))dnl
65
- # Do the check with the no- prefix removed from the warning options
66
- # since gcc silently accepts any -Wno-* option on purpose
67
- m4_pushdef([acx_Woptions], [m4_bpatsubst([$1], [-Wno-], [-W])])dnl
68
- AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_]acx_Woptions)dnl
69
- AS_IF([test "$GCC" = yes],
70
- [AC_CACHE_CHECK([whether $CC supports -pedantic ]acx_Woptions, acx_Pedantic,
71
- [save_CFLAGS="$CFLAGS"
72
- CFLAGS="-pedantic acx_Woptions"
73
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
74
- [AS_VAR_SET(acx_Pedantic, yes)],
75
- [AS_VAR_SET(acx_Pedantic, no)])
76
- CFLAGS="$save_CFLAGS"])
77
- AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
78
- [acx_Var="$acx_Var${acx_Var:+ }-pedantic $1"])
79
- ])
80
- AS_VAR_POPDEF([acx_Pedantic])dnl
81
- m4_popdef([acx_Woptions])dnl
82
- m4_popdef([acx_Var])dnl
83
- AC_LANG_POP(C)
84
- ])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
85
-
86
- # ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z], [VARIABLE = WERROR])
87
- # sets @VARIABLE@ to "-Werror" if the compiler is GCC >=x.y.z, or if
88
- # --enable-werror-always was given on the command line, otherwise
89
- # to nothing.
90
- # If the argument is the word "manual" instead of a version number,
91
- # then @VARIABLE@ will be set to -Werror only if --enable-werror-always
92
- # appeared on the configure command line.
93
- AC_DEFUN([ACX_PROG_CC_WARNINGS_ARE_ERRORS],
94
- [AC_REQUIRE([AC_PROG_CC])dnl
95
- AC_LANG_PUSH(C)
96
- m4_pushdef([acx_Var], [m4_default([$2], [WERROR])])dnl
97
- AC_SUBST(acx_Var)dnl
98
- m4_expand_once([acx_Var=
99
- ],m4_quote(acx_Var=))dnl
100
- AC_ARG_ENABLE(werror-always,
101
- AS_HELP_STRING([--enable-werror-always],
102
- [enable -Werror despite compiler version]),
103
- [], [enable_werror_always=no])
104
- AS_IF([test $enable_werror_always = yes],
105
- [acx_Var="$acx_Var${acx_Var:+ }-Werror"])
106
- m4_if($1, [manual],,
107
- [AS_VAR_PUSHDEF([acx_GCCvers], [acx_cv_prog_cc_gcc_$1_or_newer])dnl
108
- AC_CACHE_CHECK([whether $CC is GCC >=$1], acx_GCCvers,
109
- [set fnord `echo $1 | tr '.' ' '`
110
- shift
111
- AC_PREPROC_IFELSE(
112
- [#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ \
113
- < [$]1 * 10000 + [$]2 * 100 + [$]3
114
- #error insufficient
115
- #endif],
116
- [AS_VAR_SET(acx_GCCvers, yes)],
117
- [AS_VAR_SET(acx_GCCvers, no)])])
118
- AS_IF([test AS_VAR_GET(acx_GCCvers) = yes],
119
- [acx_Var="$acx_Var${acx_Var:+ }-Werror"])
120
- AS_VAR_POPDEF([acx_GCCvers])])
121
- m4_popdef([acx_Var])dnl
122
- AC_LANG_POP(C)
123
- ])# ACX_PROG_CC_WARNINGS_ARE_ERRORS
124
-
125
- # ACX_PROG_CXX_WARNING_OPTS(WARNINGS, [VARIABLE = WARN_CXXFLAGS])
126
- # Sets @VARIABLE@ to the subset of the given options which the
127
- # compiler accepts.
128
- AC_DEFUN([ACX_PROG_CXX_WARNING_OPTS],
129
- [AC_REQUIRE([AC_PROG_CXX])dnl
130
- AC_LANG_PUSH(C++)
131
- m4_pushdef([acx_Var], [m4_default([$2], [WARN_CXXFLAGS])])dnl
132
- AC_SUBST(acx_Var)dnl
133
- m4_expand_once([acx_Var=
134
- ],m4_quote(acx_Var=))dnl
135
- save_CXXFLAGS="$CXXFLAGS"
136
- for real_option in $1; do
137
- # Do the check with the no- prefix removed since gcc silently
138
- # accepts any -Wno-* option on purpose
139
- case $real_option in
140
- -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
141
- *) option=$real_option ;;
142
- esac
143
- AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
144
- AC_CACHE_CHECK([whether $CXX supports $option], acx_Woption,
145
- [CXXFLAGS="$option"
146
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
147
- [AS_VAR_SET(acx_Woption, yes)],
148
- [AS_VAR_SET(acx_Woption, no)])
149
- ])
150
- AS_IF([test AS_VAR_GET(acx_Woption) = yes],
151
- [acx_Var="$acx_Var${acx_Var:+ }$real_option"])
152
- AS_VAR_POPDEF([acx_Woption])dnl
153
- done
154
- CXXFLAGS="$save_CXXFLAGS"
155
- m4_popdef([acx_Var])dnl
156
- AC_LANG_POP(C++)
157
- ])# ACX_PROG_CXX_WARNING_OPTS
158
-
159
- # ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC])
160
- # Append to VARIABLE "-pedantic" + the argument, if the compiler is G++
161
- # and accepts all of those options simultaneously, otherwise to nothing.
162
- AC_DEFUN([ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC],
163
- [AC_REQUIRE([AC_PROG_CXX])dnl
164
- AC_LANG_PUSH(C++)
165
- m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl
166
- AC_SUBST(acx_Var)dnl
167
- m4_expand_once([acx_Var=
168
- ],m4_quote(acx_Var=))dnl
169
- # Do the check with the no- prefix removed from the warning options
170
- # since gcc silently accepts any -Wno-* option on purpose
171
- m4_pushdef([acx_Woptions], [m4_bpatsubst([$1], [-Wno-], [-W])])dnl
172
- AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_]acx_Woptions)dnl
173
- AS_IF([test "$GXX" = yes],
174
- [AC_CACHE_CHECK([whether $CXX supports -pedantic ]acx_Woptions, acx_Pedantic,
175
- [save_CXXFLAGS="$CXXFLAGS"
176
- CXXFLAGS="-pedantic acx_Woptions"
177
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
178
- [AS_VAR_SET(acx_Pedantic, yes)],
179
- [AS_VAR_SET(acx_Pedantic, no)])
180
- CXXFLAGS="$save_CXXFLAGS"])
181
- AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
182
- [acx_Var="$acx_Var${acx_Var:+ }-pedantic $1"])
183
- ])
184
- AS_VAR_POPDEF([acx_Pedantic])dnl
185
- m4_popdef([acx_Woptions])dnl
186
- m4_popdef([acx_Var])dnl
187
- AC_LANG_POP(C++)
188
- ])# ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC
189
-
190
- # ACX_PROG_CXX_WARNINGS_ARE_ERRORS([x.y.z], [VARIABLE = WERROR])
191
- # sets @VARIABLE@ to "-Werror" if the compiler is G++ >=x.y.z, or if
192
- # --enable-werror-always was given on the command line, otherwise
193
- # to nothing.
194
- # If the argument is the word "manual" instead of a version number,
195
- # then @VARIABLE@ will be set to -Werror only if --enable-werror-always
196
- # appeared on the configure command line.
197
- AC_DEFUN([ACX_PROG_CXX_WARNINGS_ARE_ERRORS],
198
- [AC_REQUIRE([AC_PROG_CXX])dnl
199
- AC_LANG_PUSH(C++)
200
- m4_pushdef([acx_Var], [m4_default([$2], [WERROR])])dnl
201
- AC_SUBST(acx_Var)dnl
202
- m4_expand_once([acx_Var=
203
- ],m4_quote(acx_Var=))dnl
204
- AC_ARG_ENABLE(werror-always,
205
- AS_HELP_STRING([--enable-werror-always],
206
- [enable -Werror despite compiler version]),
207
- [], [enable_werror_always=no])
208
- AS_IF([test $enable_werror_always = yes],
209
- [acx_Var="$acx_Var${acx_Var:+ }-Werror"])
210
- m4_if($1, [manual],,
211
- [AS_VAR_PUSHDEF([acx_GXXvers], [acx_cv_prog_cxx_gxx_$1_or_newer])dnl
212
- AC_CACHE_CHECK([whether $CXX is G++ >=$1], acx_GXXvers,
213
- [set fnord `echo $1 | tr '.' ' '`
214
- shift
215
- AC_PREPROC_IFELSE(
216
- [#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ \
217
- < [$]1 * 10000 + [$]2 * 100 + [$]3
218
- #error insufficient
219
- #endif],
220
- [AS_VAR_SET(acx_GXXvers, yes)],
221
- [AS_VAR_SET(acx_GXXvers, no)])])
222
- AS_IF([test AS_VAR_GET(acx_GXXvers) = yes],
223
- [acx_Var="$acx_Var${acx_Var:+ }-Werror"])
224
- AS_VAR_POPDEF([acx_GXXvers])])
225
- m4_popdef([acx_Var])dnl
226
- AC_LANG_POP(C++)
227
- ])# ACX_PROG_CXX_WARNINGS_ARE_ERRORS