~drizzle-trunk/drizzle/development

1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
1
dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
dnl This file is free software; Sun Microsystems, Inc.
1085.1.4 by Monty Taylor
pandora-build v1
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
1992.6.4 by Monty Taylor
Added support for GCC Profile Mode (new in 4.5)
37
  AC_ARG_ENABLE([gcc-profile-mode],
38
      [AS_HELP_STRING([--enable-gcc-profile-mode],
39
         [Toggle gcc profile mode @<:@default=off@:>@])],
40
      [ac_gcc_profile_mode="$enableval"],
41
      [ac_gcc_profile_mode="no"])
42
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
43
  AC_ARG_ENABLE([profiling],
44
      [AS_HELP_STRING([--enable-profiling],
45
         [Toggle profiling @<:@default=off@:>@])],
46
      [ac_profiling="$enableval"],
47
      [ac_profiling="no"])
48
49
  AC_ARG_ENABLE([coverage],
50
      [AS_HELP_STRING([--enable-coverage],
51
         [Toggle coverage @<:@default=off@:>@])],
52
      [ac_coverage="$enableval"],
53
      [ac_coverage="no"])
54
55
  AS_IF([test "$GCC" = "yes"],[
56
57
    AS_IF([test "$ac_profiling" = "yes"],[
58
      CC_PROFILING="-pg"
1192.3.77 by Monty Taylor
Fixed dynamic loading with lcov and gprof.
59
      GCOV_LIBS="-pg -lgcov"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
60
      save_LIBS="${LIBS}"
61
      LIBS=""
62
      AC_CHECK_LIB(c_p, read)
63
      LIBC_P="${LIBS}"
64
      LIBS="${save_LIBS}"
65
      AC_SUBST(LIBC_P)
66
    ],[
67
      CC_PROFILING=" "
68
    ])
69
70
    AS_IF([test "$ac_coverage" = "yes"],
1192.3.77 by Monty Taylor
Fixed dynamic loading with lcov and gprof.
71
          [
72
            CC_COVERAGE="--coverage"
73
            GCOV_LIBS="-lgcov"
74
          ])
75
76
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
77
	 
2167.2.2 by Monty Taylor
Made sphinx -Werror dependent on the same thing gcc -Werror is dependent on.
78
    AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],[
79
      W_FAIL="-Werror"
80
      SPHINX_WARNINGS="-W"
2167.2.5 by Monty Taylor
Let's not vomit on tarball builds on missing po mentions.
81
      INTLTOOL_WARNINGS="yes"
2167.2.2 by Monty Taylor
Made sphinx -Werror dependent on the same thing gcc -Werror is dependent on.
82
    ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
83
84
    AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
85
      [ac_cv_safe_to_use_fdiagnostics_show_option_],
86
      [save_CFLAGS="$CFLAGS"
1093.2.1 by Monty Taylor
pandora-build v0.16
87
       CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
88
       AC_COMPILE_IFELSE(
89
         [AC_LANG_PROGRAM([],[])],
90
         [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
91
         [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
92
       CFLAGS="$save_CFLAGS"])
93
94
    AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
95
          [
96
            F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
97
          ])
98
1992.6.3 by Monty Taylor
Added check for and usage of -floop-parallelize-all.
99
    AC_CACHE_CHECK([whether it is safe to use -floop-parallelize-all],
100
      [ac_cv_safe_to_use_floop_parallelize_all_],
101
      [save_CFLAGS="$CFLAGS"
102
       CFLAGS="-floop-parallelize-all ${AM_CFLAGS} ${CFLAGS}"
103
       AC_COMPILE_IFELSE(
104
         [AC_LANG_PROGRAM([],[])],
105
         [ac_cv_safe_to_use_floop_parallelize_all_=yes],
106
         [ac_cv_safe_to_use_floop_parallelize_all_=no])
107
       CFLAGS="$save_CFLAGS"])
108
109
    AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
110
          [
111
            F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"
112
          ])
113
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
114
    NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
1093.4.1 by Monty Taylor
pandora-build v0.22 - fixes solaris build.
115
    NO_SHADOW="-Wno-shadow"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
116
1093.2.2 by mordred
pandora-build v0.18
117
    AS_IF([test "$INTELCC" = "yes"],[
1093.2.3 by mordred
pandora-build v0.20
118
      m4_if(PW_LESS_WARNINGS,[no],[
1953.1.6 by Monty Taylor
Fixed an ordering/logic error in pandora_warnings.
119
        BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
1093.2.3 by mordred
pandora-build v0.20
120
      ],[
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.
121
        dnl 2203 is like old-style-cast
122
        dnl 1684 is like strict-aliasing
1816.2.2 by Monty Taylor
Suppress warning about using enums as bitfields.
123
        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?
124
        dnl 1683 is a warning about _EXPLICIT_ casting, which we want
1953.1.6 by Monty Taylor
Fixed an ordering/logic error in pandora_warnings.
125
        BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
1093.2.3 by mordred
pandora-build v0.20
126
      ])
1093.2.2 by mordred
pandora-build v0.18
127
      CC_WARNINGS="${BASE_WARNINGS}"
128
      CXX_WARNINGS="${BASE_WARNINGS}"
1816.2.3 by Monty Taylor
Fixed some more ICC warnings. How did I get started on this this morning?
129
      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.
130
      
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
131
    ],[
1093.2.2 by mordred
pandora-build v0.18
132
      m4_if(PW_LESS_WARNINGS,[no],[
2221.1.2 by Monty Taylor
Port in pandora changes from libmemcached.
133
        BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing -Wswitch-enum "
1093.2.2 by mordred
pandora-build v0.18
134
        CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
135
        CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
1471.3.1 by Monty Taylor
Latest pandora-build. Moves the lint check to only run distcheck.
136
        NO_OLD_STYLE_CAST="-Wno-old-style-cast"
137
        NO_EFF_CXX="-Wno-effc++"
1093.2.2 by mordred
pandora-build v0.18
138
      ],[
1953.1.6 by Monty Taylor
Fixed an ordering/logic error in pandora_warnings.
139
        BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
1093.2.2 by mordred
pandora-build v0.18
140
      ])
141
142
      AS_IF([test "${ac_cv_assert}" = "no"],
143
            [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
144
  
1192.3.1 by Monty Taylor
pandora-build v0.64
145
      AC_CACHE_CHECK([whether it is safe to use -Wextra],
146
        [ac_cv_safe_to_use_Wextra_],
147
        [save_CFLAGS="$CFLAGS"
148
         CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
149
         AC_COMPILE_IFELSE([
150
           AC_LANG_PROGRAM(
151
           [[
152
#include <stdio.h>
153
           ]], [[]])
154
        ],
155
        [ac_cv_safe_to_use_Wextra_=yes],
156
        [ac_cv_safe_to_use_Wextra_=no])
157
      CFLAGS="$save_CFLAGS"])
158
1992.6.3 by Monty Taylor
Added check for and usage of -floop-parallelize-all.
159
      BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} ${BASE_WARNINGS_FULL}"
1192.3.1 by Monty Taylor
pandora-build v0.64
160
      AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
161
            [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
162
            [BASE_WARNINGS="${BASE_WARNINGS} -W"])
163
  
1948.1.8 by Monty Taylor
Removed setting flags for ICC that aren't, well, for ICC.
164
      AC_CACHE_CHECK([whether it is safe to use -Wformat],
165
        [ac_cv_safe_to_use_wformat_],
166
        [save_CFLAGS="$CFLAGS"
167
         dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
168
         dnl conversion warnings to all the tarball folks
169
         CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
170
         AC_COMPILE_IFELSE(
171
           [AC_LANG_PROGRAM([[
172
#include <stdio.h>
173
#include <stdint.h>
174
#include <inttypes.h>
175
void foo();
176
void foo()
177
{
178
  uint64_t test_u= 0;
179
  printf("This is a %" PRIu64 "test\n", test_u);
180
}
181
           ]],[[
182
foo();
183
           ]])],
184
           [ac_cv_safe_to_use_wformat_=yes],
185
           [ac_cv_safe_to_use_wformat_=no])
186
         CFLAGS="$save_CFLAGS"])
187
      AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
1953.1.6 by Monty Taylor
Fixed an ordering/logic error in pandora_warnings.
188
        BASE_WARNINGS="${BASE_WARNINGS} -Wformat -Wno-format-nonliteral -Wno-format-security"
189
        BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2 -Wno-format-nonliteral -Wno-format-security"
1948.1.8 by Monty Taylor
Removed setting flags for ICC that aren't, well, for ICC.
190
        ],[
1953.1.6 by Monty Taylor
Fixed an ordering/logic error in pandora_warnings.
191
        BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"
192
        BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format"
1948.1.8 by Monty Taylor
Removed setting flags for ICC that aren't, well, for ICC.
193
      ])
194
195
196
 
197
      AC_CACHE_CHECK([whether it is safe to use -Wconversion],
198
        [ac_cv_safe_to_use_wconversion_],
199
        [save_CFLAGS="$CFLAGS"
200
         dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
201
         dnl conversion warnings to all the tarball folks
202
         CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
203
         AC_COMPILE_IFELSE(
204
           [AC_LANG_PROGRAM([[
205
#include <stdbool.h>
206
void foo(bool a)
207
{
208
  (void)a;
209
}
210
           ]],[[
211
foo(0);
212
           ]])],
213
           [ac_cv_safe_to_use_wconversion_=yes],
214
           [ac_cv_safe_to_use_wconversion_=no])
215
         CFLAGS="$save_CFLAGS"])
216
  
217
      AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
218
        [W_CONVERSION="-Wconversion"
219
        AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
220
          [ac_cv_safe_to_use_Wconversion_],
221
          [save_CFLAGS="$CFLAGS"
222
           dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
223
           dnl conversion warnings to all the tarball folks
224
           CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
225
           AC_COMPILE_IFELSE(
226
             [AC_LANG_PROGRAM(
227
               [[
228
#include <netinet/in.h>
229
               ]],[[
230
uint16_t x= htons(80);
231
               ]])],
232
             [ac_cv_safe_to_use_Wconversion_=yes],
233
             [ac_cv_safe_to_use_Wconversion_=no])
234
           CFLAGS="$save_CFLAGS"])
235
  
236
        AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
237
              [NO_CONVERSION="-Wno-conversion"])
238
      ])
239
1992.6.7 by Monty Taylor
Revert -Wc++-compat change.
240
      CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
1093.2.2 by mordred
pandora-build v0.18
241
      CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
242
243
      AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
244
        [ac_cv_safe_to_use_Wmissing_declarations_],
245
        [AC_LANG_PUSH(C++)
246
         save_CXXFLAGS="$CXXFLAGS"
247
         CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
248
         AC_COMPILE_IFELSE([
249
           AC_LANG_PROGRAM(
250
           [[
251
#include <stdio.h>
252
           ]], [[]])
253
        ],
254
        [ac_cv_safe_to_use_Wmissing_declarations_=yes],
255
        [ac_cv_safe_to_use_Wmissing_declarations_=no])
256
        CXXFLAGS="$save_CXXFLAGS"
257
        AC_LANG_POP()
258
      ])
259
      AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
260
            [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
261
  
1929.1.37 by Monty Taylor
Wrap -Wframe-larger-than in a pandora test.
262
      AC_CACHE_CHECK([whether it is safe to use -Wframe-larger-than],
263
        [ac_cv_safe_to_use_Wframe_larger_than_],
264
        [AC_LANG_PUSH(C++)
265
         save_CXXFLAGS="$CXXFLAGS"
1929.1.38 by Monty Taylor
Fixed the check for Wframe-larger-than
266
         CXXFLAGS="-Werror -pedantic -Wframe-larger-than=32768 ${AM_CXXFLAGS}"
1929.1.37 by Monty Taylor
Wrap -Wframe-larger-than in a pandora test.
267
         AC_COMPILE_IFELSE([
268
           AC_LANG_PROGRAM(
269
           [[
270
#include <stdio.h>
271
           ]], [[]])
272
        ],
273
        [ac_cv_safe_to_use_Wframe_larger_than_=yes],
274
        [ac_cv_safe_to_use_Wframe_larger_than_=no])
275
        CXXFLAGS="$save_CXXFLAGS"
276
        AC_LANG_POP()
277
      ])
278
      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
279
            [CXX_WARNINGS="${CXX_WARNINGS} -Wframe-larger-than=32768"])
1929.1.37 by Monty Taylor
Wrap -Wframe-larger-than in a pandora test.
280
  
1093.2.2 by mordred
pandora-build v0.18
281
      AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
282
        [ac_cv_safe_to_use_Wlogical_op_],
283
        [save_CFLAGS="$CFLAGS"
284
         CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
285
         AC_COMPILE_IFELSE([
286
           AC_LANG_PROGRAM(
287
           [[
288
#include <stdio.h>
289
           ]], [[]])
290
        ],
291
        [ac_cv_safe_to_use_Wlogical_op_=yes],
292
        [ac_cv_safe_to_use_Wlogical_op_=no])
293
      CFLAGS="$save_CFLAGS"])
294
      AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
295
            [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
296
  
297
      AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
298
        [ac_cv_safe_to_use_Wredundant_decls_],
299
        [AC_LANG_PUSH(C++)
300
         save_CXXFLAGS="${CXXFLAGS}"
301
         CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
302
         AC_COMPILE_IFELSE(
303
           [AC_LANG_PROGRAM([
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
304
template <typename E> struct C { void foo(); };
305
template <typename E> void C<E>::foo() { }
306
template <> void C<int>::foo();
1093.2.2 by mordred
pandora-build v0.18
307
            AC_INCLUDES_DEFAULT])],
308
            [ac_cv_safe_to_use_Wredundant_decls_=yes],
309
            [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.
310
         CXXFLAGS="${save_CXXFLAGS}"
311
         AC_LANG_POP()])
1093.2.2 by mordred
pandora-build v0.18
312
      AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
313
            [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
314
            [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
1126.7.3 by mordred
pandora-build v0.60 - check for -Wattributes with -fvisibility=hidden issues.
315
316
      AC_CACHE_CHECK([whether it is safe to use -Wattributes from C++],
317
        [ac_cv_safe_to_use_Wattributes_],
318
        [AC_LANG_PUSH(C++)
319
         save_CXXFLAGS="${CXXFLAGS}"
320
         CXXFLAGS="${W_FAIL} -pedantic -Wattributes -fvisibility=hidden ${AM_CXXFLAGS}"
321
         AC_COMPILE_IFELSE(
322
           [AC_LANG_PROGRAM([
323
#include <google/protobuf/message.h>
324
#include <google/protobuf/descriptor.h>
325
326
327
const ::google::protobuf::EnumDescriptor* Table_TableOptions_RowType_descriptor();
328
enum Table_TableOptions_RowType {
329
  Table_TableOptions_RowType_ROW_TYPE_DEFAULT = 0,
330
  Table_TableOptions_RowType_ROW_TYPE_FIXED = 1,
331
  Table_TableOptions_RowType_ROW_TYPE_DYNAMIC = 2,
332
  Table_TableOptions_RowType_ROW_TYPE_COMPRESSED = 3,
333
  Table_TableOptions_RowType_ROW_TYPE_REDUNDANT = 4,
334
  Table_TableOptions_RowType_ROW_TYPE_COMPACT = 5,
335
  Table_TableOptions_RowType_ROW_TYPE_PAGE = 6
336
};
337
338
namespace google {
339
namespace protobuf {
340
template <>
341
inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
342
  return Table_TableOptions_RowType_descriptor();
343
}
344
}
345
}
346
            ])],
347
            [ac_cv_safe_to_use_Wattributes_=yes],
348
            [ac_cv_safe_to_use_Wattributes_=no])
349
          CXXFLAGS="${save_CXXFLAGS}"
350
          AC_LANG_POP()])
1192.3.1 by Monty Taylor
pandora-build v0.64
351
      AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
352
        [ac_cv_safe_to_use_Wno_attributes_],
353
        [save_CFLAGS="$CFLAGS"
354
         CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
355
         AC_COMPILE_IFELSE([
356
           AC_LANG_PROGRAM(
357
           [[
358
#include <stdio.h>
359
           ]], [[]])
360
        ],
361
        [ac_cv_safe_to_use_Wno_attributes_=yes],
362
        [ac_cv_safe_to_use_Wno_attributes_=no])
363
      CFLAGS="$save_CFLAGS"])
364
365
      dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
366
      dnl by using that. 
367
      AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
368
        AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
369
          CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
370
          NO_ATTRIBUTES="-Wno-attributes"])])
371
  
1093.2.2 by mordred
pandora-build v0.18
372
  
373
      NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1099.1.10 by Monty Taylor
Avoid cast-align warnings on InnoDB.
374
      dnl TODO: Figure out a better way to deal with this:
1192.3.1 by Monty Taylor
pandora-build v0.64
375
      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
376
      NO_WERROR="-Wno-error"
2023.3.27 by Monty Taylor
Updated for OSX.
377
      PERMISSIVE_WARNINGS="-Wno-error -Wno-unused-function -fpermissive"
2093.1.1 by Monty Taylor
Adds ability to build plugins static.
378
      PERMISSIVE_C_WARNINGS="-Wno-error -Wno-redundant-decls"
1531.4.1 by Monty Taylor
Added a suppression for boost for OSX.
379
      AS_IF([test "$host_vendor" = "apple"],[
380
        BOOSTSKIP_WARNINGS="-Wno-uninitialized"
381
      ])
1093.2.2 by mordred
pandora-build v0.18
382
    ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
383
  ])
384
385
  AS_IF([test "$SUNCC" = "yes"],[
386
387
    AS_IF([test "$ac_profiling" = "yes"],
388
          [CC_PROFILING="-xinstrument=datarace"])
389
390
    AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
391
          [W_FAIL="-errwarn=%all"])
392
393
    AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable],
394
      [ac_cv_paste_result],
395
      [
396
        save_CFLAGS="${CFLAGS}"
397
        CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}"
398
        AC_COMPILE_IFELSE(
399
          [AC_LANG_PROGRAM([
400
            AC_INCLUDES_DEFAULT
401
          ],[
402
            int x= 0;])],
403
          [ac_cv_paste_result=yes],
404
          [ac_cv_paste_result=no])
405
        CFLAGS="${save_CFLAGS}"
406
      ])
407
    AS_IF([test $ac_cv_paste_result = yes],
408
      [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"])
409
410
1085.1.4 by Monty Taylor
pandora-build v1
411
    m4_if(PW_LESS_WARNINGS, [no],[
2023.3.6 by Monty Taylor
Fixing some of the innodb c++ casting issues.
412
      CC_WARNINGS_FULL="-erroff=E_STATEMENT_NOT_REACHED,E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
1093.2.3 by mordred
pandora-build v0.20
413
      CXX_WARNINGS_FULL="-erroff=inllargeuse"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
414
    ],[
2023.3.6 by Monty Taylor
Fixing some of the innodb c++ casting issues.
415
      CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR,E_STATEMENT_NOT_REACHED"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
416
      CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
417
    ])
418
1724.1.1 by Monty Taylor
Rearranged how we set -fvisibility, allowing us to turn it on on a
419
    CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
420
    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
421
    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.
422
    BOOSTSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem"
2023.3.28 by mordred
Removed INNOBASE_SKIP_WARNINGS, but re-added them as PERMISSIVE_WARNINGS so that we can ignore some warnings on Sun Studio for bison-generated code (I don't care).
423
    PERMISSIVE_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint,hidef,wvarhidenmem,notused,badargtype2w,wunreachable"
2023.3.29 by Monty Taylor
Added back INNOBASE_SKIP_WARNINGS for solaris. Also dealt with unused params.
424
    INNOBASE_SKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit,wunreachable"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
425
    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
426
    NO_WERROR="-errwarn=%none"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
427
428
  ])
429
430
  AC_SUBST(NO_CONVERSION)
431
  AC_SUBST(NO_REDUNDANT_DECLS)
432
  AC_SUBST(NO_UNREACHED)
433
  AC_SUBST(NO_SHADOW)
434
  AC_SUBST(NO_STRICT_ALIASING)
1471.3.1 by Monty Taylor
Latest pandora-build. Moves the lint check to only run distcheck.
435
  AC_SUBST(NO_EFF_CXX)
436
  AC_SUBST(NO_OLD_STYLE_CAST)
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
437
  AC_SUBST(PROTOSKIP_WARNINGS)
2023.3.29 by Monty Taylor
Added back INNOBASE_SKIP_WARNINGS for solaris. Also dealt with unused params.
438
  AC_SUBST(INNOBASE_SKIP_WARNINGS)
1578.1.5 by Monty Taylor
Added suppression of warning for boost on solaris.
439
  AC_SUBST(BOOSTSKIP_WARNINGS)
2023.3.1 by Monty Taylor
A stab at C++-izing InnoDB.
440
  AC_SUBST(PERMISSIVE_WARNINGS)
2093.1.1 by Monty Taylor
Adds ability to build plugins static.
441
  AC_SUBST(PERMISSIVE_C_WARNINGS)
1093.9.17 by Monty Taylor
pandora-build v0.45 - added a -Wno-error option for chunks of code like generated protobuf files
442
  AC_SUBST(NO_WERROR)
1192.3.77 by Monty Taylor
Fixed dynamic loading with lcov and gprof.
443
  AC_SUBST([GCOV_LIBS])
2167.2.2 by Monty Taylor
Made sphinx -Werror dependent on the same thing gcc -Werror is dependent on.
444
  AC_SUBST([SPHINX_WARNINGS])
2167.2.5 by Monty Taylor
Let's not vomit on tarball builds on missing po mentions.
445
  AC_SUBST([INTLTOOL_WARNINGS])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
446
447
])