~drizzle-trunk/drizzle/development

1085.1.4 by Monty Taylor
pandora-build v1
1
dnl  Copyright (C) 2009 Sun Microsystems
2
dnl This file is free software; Sun Microsystems
3
dnl gives unlimited permission to copy and/or distribute it,
4
dnl with or without modifications, as long as this notice is preserved.
5
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
6
dnl AC_PANDORA_WARNINGS([less-warnings|warnings-always-on])
7
dnl   less-warnings turn on a limited set of warnings
8
dnl   warnings-always-on always set warnings=error regardless of tarball/vc
1085.1.7 by Monty Taylor
pandora-build r0.7
9
10
dnl @TODO: remove less-warnings option as soon as Drizzle is clean enough to
11
dnl        allow it
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
12
 
13
AC_DEFUN([PANDORA_WARNINGS],[
1085.1.4 by Monty Taylor
pandora-build v1
14
  m4_define([PW_LESS_WARNINGS],[no])
15
  m4_define([PW_WARN_ALWAYS_ON],[no])
1085.1.7 by Monty Taylor
pandora-build r0.7
16
  ifdef([m4_define],,[define([m4_define],   defn([define]))])
17
  ifdef([m4_undefine],,[define([m4_undefine],   defn([undefine]))])
1085.3.4 by Monty Taylor
pandora-build v0.8
18
  m4_foreach([pw_arg],[$*],[
1085.1.4 by Monty Taylor
pandora-build v1
19
    m4_case(pw_arg,
20
      [less-warnings],[
21
        m4_undefine([PW_LESS_WARNINGS])
22
        m4_define([PW_LESS_WARNINGS],[yes])
23
      ],
24
      [warnings-always-on],[
25
        m4_undefine([PW_WARN_ALWAYS_ON])
26
        m4_define([PW_WARN_ALWAYS_ON],[yes])
27
    ]) 
28
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
29
30
  AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
1085.1.4 by Monty Taylor
pandora-build v1
31
  m4_if(PW_WARN_ALWAYS_ON, [yes],
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
32
    [ac_cv_warnings_as_errors=yes],
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
33
    AS_IF([test "$pandora_building_from_vc" = "yes"],
1085.1.4 by Monty Taylor
pandora-build v1
34
          [ac_cv_warnings_as_errors=yes],
35
          [ac_cv_warnings_as_errors=no]))
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
36
37
  AC_ARG_ENABLE([profiling],
38
      [AS_HELP_STRING([--enable-profiling],
39
         [Toggle profiling @<:@default=off@:>@])],
40
      [ac_profiling="$enableval"],
41
      [ac_profiling="no"])
42
43
  AC_ARG_ENABLE([coverage],
44
      [AS_HELP_STRING([--enable-coverage],
45
         [Toggle coverage @<:@default=off@:>@])],
46
      [ac_coverage="$enableval"],
47
      [ac_coverage="no"])
48
49
  AS_IF([test "$GCC" = "yes"],[
50
51
    AS_IF([test "$ac_profiling" = "yes"],[
52
      CC_PROFILING="-pg"
1192.3.77 by Monty Taylor
Fixed dynamic loading with lcov and gprof.
53
      GCOV_LIBS="-pg -lgcov"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
54
      save_LIBS="${LIBS}"
55
      LIBS=""
56
      AC_CHECK_LIB(c_p, read)
57
      LIBC_P="${LIBS}"
58
      LIBS="${save_LIBS}"
59
      AC_SUBST(LIBC_P)
60
    ],[
61
      CC_PROFILING=" "
62
    ])
63
64
    AS_IF([test "$ac_coverage" = "yes"],
1192.3.77 by Monty Taylor
Fixed dynamic loading with lcov and gprof.
65
          [
66
            CC_COVERAGE="--coverage"
67
            GCOV_LIBS="-lgcov"
68
          ])
69
70
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
71
	 
72
    AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
73
          [W_FAIL="-Werror"])
74
75
    AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
76
      [ac_cv_safe_to_use_fdiagnostics_show_option_],
77
      [save_CFLAGS="$CFLAGS"
1093.2.1 by Monty Taylor
pandora-build v0.16
78
       CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
79
       AC_COMPILE_IFELSE(
80
         [AC_LANG_PROGRAM([],[])],
81
         [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
82
         [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
83
       CFLAGS="$save_CFLAGS"])
84
85
    AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
86
          [
87
            F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
88
          ])
89
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
90
    AC_CACHE_CHECK([whether it is safe to use -Wformat],
91
      [ac_cv_safe_to_use_wformat_],
92
      [save_CFLAGS="$CFLAGS"
93
       dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
94
       dnl conversion warnings to all the tarball folks
95
       CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
96
       AC_COMPILE_IFELSE(
97
         [AC_LANG_PROGRAM([[
98
#include <stdio.h>
99
#include <stdint.h>
100
#include <inttypes.h>
101
void foo(bool a)
102
{
103
  uint64_t test_u= 0;
104
  printf("This is a %" PRIu64 "test\n", test_u);
105
}
106
         ]],[[
107
foo(0);
108
         ]])],
109
         [ac_cv_safe_to_use_wformat_=yes],
110
         [ac_cv_safe_to_use_wformat_=no])
111
       CFLAGS="$save_CFLAGS"])
112
    AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
113
      W_FORMAT="-Wformat"
114
      W_FORMAT_2="-Wformat=2"
115
      NO_FORMAT="-Wno-format"
116
      ],[
117
      W_FORMAT="-Wno-format"
118
      W_FORMAT_2="-Wno-format"
119
      NO_FORMAT="-Wno-format"
120
    ])
121
122
123
 
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
124
    AC_CACHE_CHECK([whether it is safe to use -Wconversion],
125
      [ac_cv_safe_to_use_wconversion_],
126
      [save_CFLAGS="$CFLAGS"
1085.1.7 by Monty Taylor
pandora-build r0.7
127
       dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
128
       dnl conversion warnings to all the tarball folks
1093.2.1 by Monty Taylor
pandora-build v0.16
129
       CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
130
       AC_COMPILE_IFELSE(
131
         [AC_LANG_PROGRAM([[
132
#include <stdbool.h>
133
void foo(bool a)
134
{
135
  (void)a;
136
}
137
         ]],[[
138
foo(0);
139
         ]])],
140
         [ac_cv_safe_to_use_wconversion_=yes],
141
         [ac_cv_safe_to_use_wconversion_=no])
142
       CFLAGS="$save_CFLAGS"])
143
144
    AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
145
      [W_CONVERSION="-Wconversion"
146
      AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
147
        [ac_cv_safe_to_use_Wconversion_],
148
        [save_CFLAGS="$CFLAGS"
1085.1.7 by Monty Taylor
pandora-build r0.7
149
         dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
150
         dnl conversion warnings to all the tarball folks
1093.2.1 by Monty Taylor
pandora-build v0.16
151
         CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
152
         AC_COMPILE_IFELSE(
153
           [AC_LANG_PROGRAM(
154
             [[
155
#include <netinet/in.h>
156
             ]],[[
157
uint16_t x= htons(80);
158
             ]])],
159
           [ac_cv_safe_to_use_Wconversion_=yes],
160
           [ac_cv_safe_to_use_Wconversion_=no])
161
         CFLAGS="$save_CFLAGS"])
162
163
      AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
164
            [NO_CONVERSION="-Wno-conversion"])
165
    ])
166
167
    NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
1093.4.1 by Monty Taylor
pandora-build v0.22 - fixes solaris build.
168
    NO_SHADOW="-Wno-shadow"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
169
1093.2.2 by mordred
pandora-build v0.18
170
    AS_IF([test "$INTELCC" = "yes"],[
1093.2.3 by mordred
pandora-build v0.20
171
      m4_if(PW_LESS_WARNINGS,[no],[
1816.2.2 by Monty Taylor
Suppress warning about using enums as bitfields.
172
        BASE_WARNINGS="-w1 -Werror -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
1093.2.3 by mordred
pandora-build v0.20
173
      ],[
1816.2.1 by Monty Taylor
Made ICC warning suppressions a little more sensible given what we can't accomplish any time in the near future.
174
        dnl 2203 is like old-style-cast
175
        dnl 1684 is like strict-aliasing
1816.2.2 by Monty Taylor
Suppress warning about using enums as bitfields.
176
        dnl 188 is about using enums as bitfields
1816.2.3 by Monty Taylor
Fixed some more ICC warnings. How did I get started on this this morning?
177
        dnl 1683 is a warning about _EXPLICIT_ casting, which we want
1816.2.7 by Monty Taylor
Turned on -Werror.
178
        BASE_WARNINGS="-w1 -Werror -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
1093.2.3 by mordred
pandora-build v0.20
179
      ])
1093.2.2 by mordred
pandora-build v0.18
180
      CC_WARNINGS="${BASE_WARNINGS}"
181
      CXX_WARNINGS="${BASE_WARNINGS}"
1816.2.3 by Monty Taylor
Fixed some more ICC warnings. How did I get started on this this morning?
182
      PROTOSKIP_WARNINGS="-diag-disable 188,981,967,2259,1683,1684,2203"
1816.2.1 by Monty Taylor
Made ICC warning suppressions a little more sensible given what we can't accomplish any time in the near future.
183
      
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
184
    ],[
1093.2.2 by mordred
pandora-build v0.18
185
      m4_if(PW_LESS_WARNINGS,[no],[
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
186
        BASE_WARNINGS_FULL="${W_FORMAT_2} ${W_CONVERSION} -Wstrict-aliasing"
1093.2.2 by mordred
pandora-build v0.18
187
        CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
188
        CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
1471.3.1 by Monty Taylor
Latest pandora-build. Moves the lint check to only run distcheck.
189
        NO_OLD_STYLE_CAST="-Wno-old-style-cast"
190
        NO_EFF_CXX="-Wno-effc++"
1093.2.2 by mordred
pandora-build v0.18
191
      ],[
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
192
        BASE_WARNINGS_FULL="${W_FORMAT_2} ${NO_STRICT_ALIASING}"
1093.2.2 by mordred
pandora-build v0.18
193
      ])
194
195
      AS_IF([test "${ac_cv_assert}" = "no"],
196
            [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
197
  
1192.3.1 by Monty Taylor
pandora-build v0.64
198
      AC_CACHE_CHECK([whether it is safe to use -Wextra],
199
        [ac_cv_safe_to_use_Wextra_],
200
        [save_CFLAGS="$CFLAGS"
201
         CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
202
         AC_COMPILE_IFELSE([
203
           AC_LANG_PROGRAM(
204
           [[
205
#include <stdio.h>
206
           ]], [[]])
207
        ],
208
        [ac_cv_safe_to_use_Wextra_=yes],
209
        [ac_cv_safe_to_use_Wextra_=no])
210
      CFLAGS="$save_CFLAGS"])
211
1929.1.37 by Monty Taylor
Wrap -Wframe-larger-than in a pandora test.
212
      BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${BASE_WARNINGS_FULL}"
1192.3.1 by Monty Taylor
pandora-build v0.64
213
      AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
214
            [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
215
            [BASE_WARNINGS="${BASE_WARNINGS} -W"])
216
  
1093.2.2 by mordred
pandora-build v0.18
217
      CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
218
      CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
219
220
      AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
221
        [ac_cv_safe_to_use_Wmissing_declarations_],
222
        [AC_LANG_PUSH(C++)
223
         save_CXXFLAGS="$CXXFLAGS"
224
         CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
225
         AC_COMPILE_IFELSE([
226
           AC_LANG_PROGRAM(
227
           [[
228
#include <stdio.h>
229
           ]], [[]])
230
        ],
231
        [ac_cv_safe_to_use_Wmissing_declarations_=yes],
232
        [ac_cv_safe_to_use_Wmissing_declarations_=no])
233
        CXXFLAGS="$save_CXXFLAGS"
234
        AC_LANG_POP()
235
      ])
236
      AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
237
            [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
238
  
1929.1.37 by Monty Taylor
Wrap -Wframe-larger-than in a pandora test.
239
      AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],
240
        [ac_cv_safe_to_use_Wframe_larger_than_],
241
        [AC_LANG_PUSH(C++)
242
         save_CXXFLAGS="$CXXFLAGS"
1929.1.38 by Monty Taylor
Fixed the check for Wframe-larger-than
243
         CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
1929.1.37 by Monty Taylor
Wrap -Wframe-larger-than in a pandora test.
244
         AC_COMPILE_IFELSE([
245
           AC_LANG_PROGRAM(
246
           [[
247
#include <stdio.h>
248
           ]], [[]])
249
        ],
250
        [ac_cv_safe_to_use_Wframe_larger_than_=yes],
251
        [ac_cv_safe_to_use_Wframe_larger_than_=no])
252
        CXXFLAGS="$save_CXXFLAGS"
253
        AC_LANG_POP()
254
      ])
255
      AS_IF([test "$ac_cv_safe_to_use_Wframe_larger_than_" = "yes"],
1929.1.38 by Monty Taylor
Fixed the check for Wframe-larger-than
256
            [CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
1929.1.37 by Monty Taylor
Wrap -Wframe-larger-than in a pandora test.
257
  
1093.2.2 by mordred
pandora-build v0.18
258
      AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
259
        [ac_cv_safe_to_use_Wlogical_op_],
260
        [save_CFLAGS="$CFLAGS"
261
         CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
262
         AC_COMPILE_IFELSE([
263
           AC_LANG_PROGRAM(
264
           [[
265
#include <stdio.h>
266
           ]], [[]])
267
        ],
268
        [ac_cv_safe_to_use_Wlogical_op_=yes],
269
        [ac_cv_safe_to_use_Wlogical_op_=no])
270
      CFLAGS="$save_CFLAGS"])
271
      AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
272
            [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
273
  
274
      AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
275
        [ac_cv_safe_to_use_Wredundant_decls_],
276
        [AC_LANG_PUSH(C++)
277
         save_CXXFLAGS="${CXXFLAGS}"
278
         CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
279
         AC_COMPILE_IFELSE(
280
           [AC_LANG_PROGRAM([
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
281
template <typename E> struct C { void foo(); };
282
template <typename E> void C<E>::foo() { }
283
template <> void C<int>::foo();
1093.2.2 by mordred
pandora-build v0.18
284
            AC_INCLUDES_DEFAULT])],
285
            [ac_cv_safe_to_use_Wredundant_decls_=yes],
286
            [ac_cv_safe_to_use_Wredundant_decls_=no])
1241.9.10 by Monty Taylor
pandora-build v0.85 - Fixed the C++ standard setting in the build checks.
287
         CXXFLAGS="${save_CXXFLAGS}"
288
         AC_LANG_POP()])
1093.2.2 by mordred
pandora-build v0.18
289
      AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
290
            [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
291
            [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
1126.7.3 by mordred
pandora-build v0.60 - check for -Wattributes with -fvisibility=hidden issues.
292
293
      AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
294
        [ac_cv_safe_to_use_Wattributes_],
295
        [AC_LANG_PUSH(C++)
296
         save_CXXFLAGS="${CXXFLAGS}"
297
         CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
298
         AC_COMPILE_IFELSE(
299
           [AC_LANG_PROGRAM([
300
#include <google/protobuf/message.h>
301
#include <google/protobuf/descriptor.h>
302
303
304
const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
305
enum Table_TableOptions_RowType {
306
  Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
307
  Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
308
  Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
309
  Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
310
  Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
311
  Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
312
  Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
313
};
314
315
namespace google {
316
namespace protobuf {
317
template <>
318
inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
319
  return Table_TableOptions_RowType_descriptor();
320
}
321
}
322
}
323
            ])],
324
            [ac_cv_safe_to_use_Wattributes_=yes],
325
            [ac_cv_safe_to_use_Wattributes_=no])
326
          CXXFLAGS="${save_CXXFLAGS}"
327
          AC_LANG_POP()])
1192.3.1 by Monty Taylor
pandora-build v0.64
328
      AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
329
        [ac_cv_safe_to_use_Wno_attributes_],
330
        [save_CFLAGS="$CFLAGS"
331
         CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
332
         AC_COMPILE_IFELSE([
333
           AC_LANG_PROGRAM(
334
           [[
335
#include <stdio.h>
336
           ]], [[]])
337
        ],
338
        [ac_cv_safe_to_use_Wno_attributes_=yes],
339
        [ac_cv_safe_to_use_Wno_attributes_=no])
340
      CFLAGS="$save_CFLAGS"])
341
342
      dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
343
      dnl by using that. 
344
      AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
345
        AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
346
          CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
347
          NO_ATTRIBUTES="-Wno-attributes"])])
348
  
1093.2.2 by mordred
pandora-build v0.18
349
  
350
      NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1099.1.10 by Monty Taylor
Avoid cast-align warnings on InnoDB.
351
      dnl TODO: Figure out a better way to deal with this:
1192.3.1 by Monty Taylor
pandora-build v0.64
352
      PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces ${NO_ATTRIBUTES}"
1093.9.17 by Monty Taylor
pandora-build v0.45 - added a -Wno-error option for chunks of code like generated protobuf files
353
      NO_WERROR="-Wno-error"
1099.1.10 by Monty Taylor
Avoid cast-align warnings on InnoDB.
354
      INNOBASE_SKIP_WARNINGS="-Wno-shadow -Wno-cast-align"
1531.4.1 by Monty Taylor
Added a suppression for boost for OSX.
355
      AS_IF([test "$host_vendor" = "apple"],[
356
        BOOSTSKIP_WARNINGS="-Wno-uninitialized"
357
      ])
1093.2.2 by mordred
pandora-build v0.18
358
    ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
359
  ])
360
361
  AS_IF([test "$SUNCC" = "yes"],[
362
363
    AS_IF([test "$ac_profiling" = "yes"],
364
          [CC_PROFILING="-xinstrument=datarace"])
365
366
    AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
367
          [W_FAIL="-errwarn=%all"])
368
369
    AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable],
370
      [ac_cv_paste_result],
371
      [
372
        save_CFLAGS="${CFLAGS}"
373
        CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}"
374
        AC_COMPILE_IFELSE(
375
          [AC_LANG_PROGRAM([
376
            AC_INCLUDES_DEFAULT
377
          ],[
378
            int x= 0;])],
379
          [ac_cv_paste_result=yes],
380
          [ac_cv_paste_result=no])
381
        CFLAGS="${save_CFLAGS}"
382
      ])
383
    AS_IF([test $ac_cv_paste_result = yes],
384
      [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"])
385
386
1085.1.4 by Monty Taylor
pandora-build v1
387
    m4_if(PW_LESS_WARNINGS, [no],[
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
388
      CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
1093.2.3 by mordred
pandora-build v0.20
389
      CXX_WARNINGS_FULL="-erroff=inllargeuse"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
390
    ],[
391
      CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
392
      CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
393
    ])
394
1724.1.1 by Monty Taylor
Rearranged how we set -fvisibility, allowing us to turn it on on a
395
    CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
396
    CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
1093.9.11 by Monty Taylor
pandora-build v0.41 - added more warning exceptions for protobuf
397
    PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
1531.4.4 by Monty Taylor
Added an additional warning solaris can't deal with.
398
    BOOSTSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
399
    NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1093.9.17 by Monty Taylor
pandora-build v0.45 - added a -Wno-error option for chunks of code like generated protobuf files
400
    NO_WERROR="-errwarn=%none"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
401
402
  ])
403
404
  AC_SUBST(NO_CONVERSION)
405
  AC_SUBST(NO_REDUNDANT_DECLS)
406
  AC_SUBST(NO_UNREACHED)
407
  AC_SUBST(NO_SHADOW)
408
  AC_SUBST(NO_STRICT_ALIASING)
1471.3.1 by Monty Taylor
Latest pandora-build. Moves the lint check to only run distcheck.
409
  AC_SUBST(NO_EFF_CXX)
410
  AC_SUBST(NO_OLD_STYLE_CAST)
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
411
  AC_SUBST(PROTOSKIP_WARNINGS)
1578.1.5 by Monty Taylor
Added suppression of warning for boost on solaris.
412
  AC_SUBST(BOOSTSKIP_WARNINGS)
1099.1.14 by Monty Taylor
pandora-build v0.31
413
  AC_SUBST(INNOBASE_SKIP_WARNINGS)
1093.9.17 by Monty Taylor
pandora-build v0.45 - added a -Wno-error option for chunks of code like generated protobuf files
414
  AC_SUBST(NO_WERROR)
1192.3.77 by Monty Taylor
Fixed dynamic loading with lcov and gprof.
415
  AC_SUBST([GCOV_LIBS])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
416
417
])