Merge lp:~linuxjedi/libdrizzle/bootstrap-update-april-2013 into lp:libdrizzle
- bootstrap-update-april-2013
- Merge into libdrizzle-redux
Proposed by
Andrew Hutchings
Status: | Merged |
---|---|
Merged at revision: | 121 |
Proposed branch: | lp:~linuxjedi/libdrizzle/bootstrap-update-april-2013 |
Merge into: | lp:libdrizzle |
Diff against target: |
1275 lines (+487/-164) 5 files modified
bootstrap.sh (+358/-127) configure.ac (+3/-0) libdrizzle/sha1.cc (+1/-1) m4/ax_harden_compiler_flags.m4 (+114/-25) tests/unit/numbers.c (+11/-11) |
To merge this branch: | bzr merge lp:~linuxjedi/libdrizzle/bootstrap-update-april-2013 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Aker | Pending | ||
Review via email: mp+161343@code.launchpad.net |
Commit message
Description of the change
Fixes for MinGW after bootstrap update merges.
To post a comment you must log in.
Revision history for this message
Andrew Hutchings (linuxjedi) wrote : | # |
- 124. By Andrew Hutchings
-
Fix numbers test for RHEL 6.3
Revision history for this message
Brian Aker (brianaker) wrote : | # |
It might be better to just suppress that waring.
Sent from my Ti85
On Apr 28, 2013, at 13:43, Andrew Hutchings <email address hidden> wrote:
> sha1 fix is probably "the wrong thing" but it was to kill this warning:
>
> sha1.cc:138: warning: assuming that the loop counter does not overflow
> --
> https:/
> You are requested to review the proposed merge of lp:~linuxjedi/libdrizzle/bootstrap-update-april-2013 into lp:libdrizzle.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bootstrap.sh' |
2 | --- bootstrap.sh 2013-01-10 12:04:23 +0000 |
3 | +++ bootstrap.sh 2013-04-28 22:03:24 +0000 |
4 | @@ -1,6 +1,6 @@ |
5 | #!/bin/bash |
6 | # |
7 | -# Copyright (C) 2012 Brian Aker |
8 | +# Copyright (C) 2012-2013 Brian Aker |
9 | # All rights reserved. |
10 | # |
11 | # Redistribution and use in source and binary forms, with or without |
12 | @@ -151,7 +151,8 @@ |
13 | fi |
14 | } |
15 | |
16 | -# Valid values are: darwin,fedora,rhel,ubuntu |
17 | +# Validate the distribution name, or toss an erro |
18 | +# values: darwin,fedora,rhel,ubuntu,debian,opensuse |
19 | function set_VENDOR_DISTRIBUTION () |
20 | { |
21 | local dist=`echo "$1" | tr '[A-Z]' '[a-z]'` |
22 | @@ -165,9 +166,15 @@ |
23 | rhel) |
24 | VENDOR_DISTRIBUTION='rhel' |
25 | ;; |
26 | + debian) |
27 | + VENDOR_DISTRIBUTION='debian' |
28 | + ;; |
29 | ubuntu) |
30 | VENDOR_DISTRIBUTION='ubuntu' |
31 | ;; |
32 | + suse) |
33 | + VENDOR_DISTRIBUTION='opensuse' |
34 | + ;; |
35 | opensuse) |
36 | VENDOR_DISTRIBUTION='opensuse' |
37 | ;; |
38 | @@ -177,21 +184,57 @@ |
39 | esac |
40 | } |
41 | |
42 | +# Validate a Vendor's release name/number |
43 | function set_VENDOR_RELEASE () |
44 | { |
45 | local release=`echo "$1" | tr '[A-Z]' '[a-z]'` |
46 | - case "$VENDOR_DISTRIBUTION" in |
47 | + |
48 | + if $DEBUG; then |
49 | + echo "VENDOR_DISTRIBUTION:$VENDOR_DISTRIBUTION" |
50 | + echo "VENDOR_RELEASE:$release" |
51 | + fi |
52 | + |
53 | + case $VENDOR_DISTRIBUTION in |
54 | darwin) |
55 | - VENDOR_RELEASE='mountain' |
56 | + case $release in |
57 | + 10.6*) |
58 | + VENDOR_RELEASE='snow_leopard' |
59 | + ;; |
60 | + 10.7*) |
61 | + VENDOR_RELEASE='mountain' |
62 | + ;; |
63 | + mountain) |
64 | + VENDOR_RELEASE='mountain' |
65 | + ;; |
66 | + 10.8.*) |
67 | + echo "mountain_lion" |
68 | + VENDOR_RELEASE='mountain_lion' |
69 | + ;; |
70 | + *) |
71 | + echo $VENDOR_RELEASE |
72 | + VENDOR_RELEASE='unknown' |
73 | + ;; |
74 | + esac |
75 | ;; |
76 | fedora) |
77 | VENDOR_RELEASE="$release" |
78 | + if [[ "x$VENDOR_RELEASE" == '18' ]]; then |
79 | + VENDOR_RELEASE='sphericalcow' |
80 | + fi |
81 | ;; |
82 | rhel) |
83 | VENDOR_RELEASE="$release" |
84 | ;; |
85 | + debian) |
86 | + VENDOR_RELEASE="$release" |
87 | + ;; |
88 | ubuntu) |
89 | VENDOR_RELEASE="$release" |
90 | + if [[ "x$VENDOR_RELEASE" == 'x12.04' ]]; then |
91 | + VENDOR_RELEASE="precise" |
92 | + elif [[ "x$VENDOR_RELEASE" == 'x12.10' ]]; then |
93 | + VENDOR_RELEASE="quantal" |
94 | + fi |
95 | ;; |
96 | opensuse) |
97 | VENDOR_RELEASE="$release" |
98 | @@ -206,7 +249,7 @@ |
99 | } |
100 | |
101 | |
102 | -# Valid values are: apple, redhat, centos, canonical |
103 | +# Valid values are: apple, redhat, centos, canonical, oracle, suse |
104 | function set_VENDOR () |
105 | { |
106 | local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'` |
107 | @@ -218,12 +261,30 @@ |
108 | redhat) |
109 | VENDOR='redhat' |
110 | ;; |
111 | + fedora) |
112 | + VENDOR='redhat' |
113 | + ;; |
114 | + redhat-release-server-*) |
115 | + VENDOR='redhat' |
116 | + ;; |
117 | + enterprise-release-*) |
118 | + VENDOR='oracle' |
119 | + ;; |
120 | centos) |
121 | VENDOR='centos' |
122 | ;; |
123 | canonical) |
124 | VENDOR='canonical' |
125 | ;; |
126 | + ubuntu) |
127 | + VENDOR='canonical' |
128 | + ;; |
129 | + debian) |
130 | + VENDOR='debian' |
131 | + ;; |
132 | + opensuse) |
133 | + VENDOR='suse' |
134 | + ;; |
135 | suse) |
136 | VENDOR='suse' |
137 | ;; |
138 | @@ -234,6 +295,27 @@ |
139 | |
140 | set_VENDOR_DISTRIBUTION $2 |
141 | set_VENDOR_RELEASE $3 |
142 | + |
143 | + # Set which vendor/versions we trust for autoreconf |
144 | + case $VENDOR_DISTRIBUTION in |
145 | + fedora) |
146 | + if [[ "x$VENDOR_RELEASE" == 'x18' ]]; then |
147 | + AUTORECONF_REBUILD_HOST=true |
148 | + elif [[ "x$VENDOR_RELEASE" == 'xsphericalcow' ]]; then |
149 | + AUTORECONF_REBUILD_HOST=true |
150 | + elif [[ "x$VENDOR_RELEASE" == 'x19' ]]; then |
151 | + AUTORECONF_REBUILD_HOST=true |
152 | + fi |
153 | + ;; |
154 | + canonical) |
155 | + if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then |
156 | + AUTORECONF_REBUILD_HOST=true |
157 | + elif [[ "x$VENDOR_RELEASE" == 'xquantal' ]]; then |
158 | + AUTORECONF_REBUILD_HOST=true |
159 | + fi |
160 | + ;; |
161 | + esac |
162 | + |
163 | } |
164 | |
165 | function determine_target_platform () |
166 | @@ -242,14 +324,14 @@ |
167 | UNAME_KERNEL=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
168 | UNAME_KERNEL_RELEASE=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE=unknown |
169 | |
170 | - if [[ $(uname) == 'Darwin' ]]; then |
171 | + if [[ -x '/usr/bin/sw_vers' ]]; then |
172 | + local _VERSION=`/usr/bin/sw_vers -productVersion` |
173 | + set_VENDOR 'apple' 'darwin' $_VERSION |
174 | + elif [[ $(uname) == 'Darwin' ]]; then |
175 | set_VENDOR 'apple' 'darwin' 'mountain' |
176 | elif [[ -f '/etc/fedora-release' ]]; then |
177 | local fedora_version=`cat /etc/fedora-release | awk ' { print $3 } '` |
178 | set_VENDOR 'redhat' 'fedora' $fedora_version |
179 | - if [[ "x$VENDOR_RELEASE" == 'x17' ]]; then |
180 | - AUTORECONF_REBUILD_HOST=true |
181 | - fi |
182 | elif [[ -f '/etc/centos-release' ]]; then |
183 | local centos_version=`cat /etc/centos-release | awk ' { print $7 } '` |
184 | set_VENDOR 'centos' 'rhel' $centos_version |
185 | @@ -259,14 +341,18 @@ |
186 | set_VENDOR 'suse' $suse_distribution $suse_version |
187 | elif [[ -f '/etc/redhat-release' ]]; then |
188 | local rhel_version=`cat /etc/redhat-release | awk ' { print $7 } '` |
189 | - set_VENDOR 'redhat' 'rhel' $rhel_version |
190 | + local _vendor=`rpm -qf /etc/redhat-release` |
191 | + set_VENDOR $_vendor 'rhel' $rhel_version |
192 | + elif [[ -f '/etc/os-release' ]]; then |
193 | + source '/etc/os-release' |
194 | + set_VENDOR $ID $ID $VERSION_ID |
195 | + elif [[ -x '/usr/bin/lsb_release' ]]; then |
196 | + local _ID=`/usr/bin/lsb_release -s -i` |
197 | + local _VERSION=`/usr/bin/lsb_release -s -r` |
198 | + set_VENDOR $_ID $_ID $_VERSION_ID |
199 | elif [[ -f '/etc/lsb-release' ]]; then |
200 | - local debian_DISTRIB_ID=`cat /etc/lsb-release | grep DISTRIB_ID | awk -F= ' { print $2 } '` |
201 | - local debian_version=`cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F= ' { print $2 } '` |
202 | - set_VENDOR 'canonical' $debian_DISTRIB_ID $debian_version |
203 | - if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then |
204 | - AUTORECONF_REBUILD_HOST=true |
205 | - fi |
206 | + source '/etc/lsb-release' |
207 | + set_VENDOR 'canonical' $DISTRIB_ID $DISTRIB_CODENAME |
208 | fi |
209 | |
210 | rebuild_host_os |
211 | @@ -296,42 +382,48 @@ |
212 | # Arguments for configure |
213 | local BUILD_CONFIGURE_ARG= |
214 | |
215 | - # Set ENV DEBUG in order to enable debugging |
216 | - if $DEBUG; then |
217 | - BUILD_CONFIGURE_ARG='--enable-debug' |
218 | - fi |
219 | - |
220 | - # Set ENV ASSERT in order to enable assert |
221 | - if [[ -n "$ASSERT" ]]; then |
222 | - local ASSERT_ARG= |
223 | - ASSERT_ARG='--enable-assert' |
224 | - BUILD_CONFIGURE_ARG="$ASSERT_ARG $BUILD_CONFIGURE_ARG" |
225 | + # If ENV DEBUG is set we enable both debug and asssert, otherwise we see if this is a VCS checkout and if so enable assert |
226 | + # Set ENV ASSERT in order to enable assert. |
227 | + # If we are doing a valgrind run, we always compile with assert disabled |
228 | + if $valgrind_run; then |
229 | + BUILD_CONFIGURE_ARG+= " CXXFLAGS=-DNDEBUG " |
230 | + BUILD_CONFIGURE_ARG+= " CFLAGS=-DNDEBUG " |
231 | + else |
232 | + if $DEBUG; then |
233 | + BUILD_CONFIGURE_ARG+=' --enable-debug --enable-assert' |
234 | + elif [[ -n "$VCS_CHECKOUT" ]]; then |
235 | + BUILD_CONFIGURE_ARG+=' --enable-assert' |
236 | + fi |
237 | fi |
238 | |
239 | if [[ -n "$CONFIGURE_ARG" ]]; then |
240 | - BUILD_CONFIGURE_ARG= "$BUILD_CONFIGURE_ARG $CONFIGURE_ARG" |
241 | + BUILD_CONFIGURE_ARG+=" $CONFIGURE_ARG" |
242 | + fi |
243 | + |
244 | + if [[ -n "$PREFIX_ARG" ]]; then |
245 | + BUILD_CONFIGURE_ARG+=" $PREFIX_ARG" |
246 | fi |
247 | |
248 | ret=1; |
249 | # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV |
250 | case $HOST_OS in |
251 | *-darwin-*) |
252 | - CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG $PREFIX_ARG" |
253 | + CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG" |
254 | ret=$? |
255 | ;; |
256 | rhel-5*) |
257 | command_exists 'gcc44' || die "Could not locate gcc44" |
258 | - CC=gcc44 CXX=gcc44 $top_srcdir/configure $BUILD_CONFIGURE_ARG $PREFIX_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 configure $BUILD_CONFIGURE_ARG $PREFIX_ARG" |
259 | + CC=gcc44 CXX=gcc44 $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 configure $BUILD_CONFIGURE_ARG" |
260 | ret=$? |
261 | ;; |
262 | *) |
263 | - $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG |
264 | + $CONFIGURE $BUILD_CONFIGURE_ARG |
265 | ret=$? |
266 | ;; |
267 | esac |
268 | |
269 | if [ $ret -ne 0 ]; then |
270 | - die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG" |
271 | + die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG" |
272 | fi |
273 | |
274 | if [ ! -f 'Makefile' ]; then |
275 | @@ -353,7 +445,7 @@ |
276 | function setup_valgrind_command () { |
277 | VALGRIND_PROGRAM=`type -p valgrind` |
278 | if [[ -n "$VALGRIND_PROGRAM" ]]; then |
279 | - VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE" |
280 | + VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --malloc-fill=A5 --free-fill=DE --xml=yes --xml-file=\"valgrind-%p.xml\"" |
281 | fi |
282 | } |
283 | |
284 | @@ -367,6 +459,10 @@ |
285 | die "OLD_CONFIGURE_ARG($OLD_CONFIGURE_ARG) was set on push, programmer error!" |
286 | fi |
287 | |
288 | + if [[ -n "$OLD_PREFIX" ]]; then |
289 | + die "OLD_PREFIX($OLD_PREFIX) was set on push, programmer error!" |
290 | + fi |
291 | + |
292 | if [[ -n "$OLD_MAKE" ]]; then |
293 | die "OLD_MAKE($OLD_MAKE) was set on push, programmer error!" |
294 | fi |
295 | @@ -402,6 +498,10 @@ |
296 | CONFIGURE_ARG=$OLD_CONFIGURE_ARG |
297 | fi |
298 | |
299 | + if [[ -n "$OLD_PREFIX" ]]; then |
300 | + PREFIX_ARG=$OLD_PREFIX |
301 | + fi |
302 | + |
303 | if [[ -n "$OLD_MAKE" ]]; then |
304 | MAKE=$OLD_MAKE |
305 | fi |
306 | @@ -412,56 +512,11 @@ |
307 | |
308 | OLD_CONFIGURE= |
309 | OLD_CONFIGURE_ARG= |
310 | + OLD_PREFIX= |
311 | OLD_MAKE= |
312 | OLD_TESTS_ENVIRONMENT= |
313 | - echo "reset happened" |
314 | -} |
315 | - |
316 | -function push_PREFIX_ARG () |
317 | -{ |
318 | - if [[ -n "$OLD_PREFIX_ARG" ]]; then |
319 | - die "OLD_PREFIX_ARG was set on push, programmer error!" |
320 | - fi |
321 | - |
322 | - if [[ -n "$PREFIX_ARG" ]]; then |
323 | - OLD_PREFIX_ARG=$PREFIX_ARG |
324 | - PREFIX_ARG= |
325 | - fi |
326 | - |
327 | - if [[ -n "$1" ]]; then |
328 | - PREFIX_ARG="--prefix=$1" |
329 | - fi |
330 | -} |
331 | - |
332 | -function pop_PREFIX_ARG () |
333 | -{ |
334 | - if [[ -n "$OLD_PREFIX_ARG" ]]; then |
335 | - PREFIX_ARG=$OLD_PREFIX_ARG |
336 | - OLD_PREFIX_ARG= |
337 | - else |
338 | - PREFIX_ARG= |
339 | - fi |
340 | -} |
341 | - |
342 | -function push_TESTS_ENVIRONMENT () |
343 | -{ |
344 | - if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then |
345 | - die "OLD_TESTS_ENVIRONMENT was set on push, programmer error!" |
346 | - fi |
347 | - |
348 | - if [[ -n "$TESTS_ENVIRONMENT" ]]; then |
349 | - OLD_TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT |
350 | - TESTS_ENVIRONMENT= |
351 | - fi |
352 | -} |
353 | - |
354 | -function pop_TESTS_ENVIRONMENT () |
355 | -{ |
356 | - TESTS_ENVIRONMENT= |
357 | - if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then |
358 | - TESTS_ENVIRONMENT=$OLD_TESTS_ENVIRONMENT |
359 | - OLD_TESTS_ENVIRONMENT= |
360 | - fi |
361 | + |
362 | + export -n CC CXX |
363 | } |
364 | |
365 | function safe_pushd () |
366 | @@ -490,11 +545,6 @@ |
367 | |
368 | function make_valgrind () |
369 | { |
370 | - if [[ "$VENDOR_DISTRIBUTION" == 'darwin' ]]; then |
371 | - make_darwin_malloc |
372 | - return |
373 | - fi |
374 | - |
375 | # If the env VALGRIND_COMMAND is set then we assume it is valid |
376 | local valgrind_was_set=false |
377 | if [[ -z "$VALGRIND_COMMAND" ]]; then |
378 | @@ -512,10 +562,12 @@ |
379 | return 1 |
380 | fi |
381 | |
382 | + save_BUILD |
383 | + |
384 | + valgrind_run=true |
385 | + |
386 | # If we are required to run configure, do so now |
387 | - run_configure_if_required |
388 | - |
389 | - push_TESTS_ENVIRONMENT |
390 | + run_configure |
391 | |
392 | # If we don't have a configure, then most likely we will be missing libtool |
393 | assert_file 'configure' |
394 | @@ -525,15 +577,29 @@ |
395 | TESTS_ENVIRONMENT="$VALGRIND_COMMAND" |
396 | fi |
397 | |
398 | - make_target 'check' || return 1 |
399 | - |
400 | - pop_TESTS_ENVIRONMENT |
401 | + make_target 'check' |
402 | + ret=$? |
403 | + |
404 | + # If we aren't going to error, we will clean up our environment |
405 | + if [ "$ret" -eq 0 ]; then |
406 | + make 'distclean' |
407 | + fi |
408 | + |
409 | + valgrind_run=false |
410 | + |
411 | + restore_BUILD |
412 | + |
413 | + if [ "$ret" -ne 0 ]; then |
414 | + return 1 |
415 | + fi |
416 | } |
417 | |
418 | function make_install_system () |
419 | { |
420 | local INSTALL_LOCATION=$(mktemp -d /tmp/XXXXXXXXXX) |
421 | - push_PREFIX_ARG $INSTALL_LOCATION |
422 | + |
423 | + save_BUILD |
424 | + PREFIX_ARG="--prefix=$INSTALL_LOCATION" |
425 | |
426 | if [ ! -d $INSTALL_LOCATION ] ; then |
427 | die "ASSERT temp directory not found '$INSTALL_LOCATION'" |
428 | @@ -541,17 +607,12 @@ |
429 | |
430 | run_configure #install_buid_dir |
431 | |
432 | - push_TESTS_ENVIRONMENT |
433 | - |
434 | make_target 'install' |
435 | |
436 | make_target 'installcheck' |
437 | |
438 | make_target 'uninstall' |
439 | |
440 | - pop_TESTS_ENVIRONMENT |
441 | - pop_PREFIX_ARG |
442 | - |
443 | rm -r -f $INSTALL_LOCATION |
444 | make 'distclean' |
445 | |
446 | @@ -559,6 +620,7 @@ |
447 | die "ASSERT Makefile should not exist" |
448 | fi |
449 | |
450 | + restore_BUILD |
451 | safe_popd |
452 | } |
453 | |
454 | @@ -625,7 +687,29 @@ |
455 | return 0 |
456 | } |
457 | |
458 | -function make_skeleton_mingw () |
459 | +function check_clang () |
460 | +{ |
461 | + command_exists 'clang' |
462 | + ret=$? |
463 | + if [ "$ret" -ne 0 ]; then |
464 | + return 1 |
465 | + fi |
466 | + |
467 | + return 0 |
468 | +} |
469 | + |
470 | +function check_clang_analyzer () |
471 | +{ |
472 | + command_exists 'scan-build' |
473 | + ret=$? |
474 | + if [ "$ret" -ne 0 ]; then |
475 | + return 1 |
476 | + fi |
477 | + |
478 | + return 0 |
479 | +} |
480 | + |
481 | +function make_skeleton () |
482 | { |
483 | run_configure |
484 | ret=$? |
485 | @@ -642,8 +726,6 @@ |
486 | if command_exists 'wine'; then |
487 | TESTS_ENVIRONMENT='wine' |
488 | fi |
489 | - elif command_exists 'wineconsole'; then |
490 | - TESTS_ENVIRONMENT='wineconsole --backend=curses' |
491 | fi |
492 | |
493 | if [[ -n "$TESTS_ENVIRONMENT" ]]; then |
494 | @@ -662,9 +744,8 @@ |
495 | |
496 | function make_for_mingw () |
497 | { |
498 | - check_mingw |
499 | if ! check_mingw; then |
500 | - die 'mingw64 tools were not found' |
501 | + return 1 |
502 | fi |
503 | |
504 | # Make sure it is clean |
505 | @@ -678,10 +759,73 @@ |
506 | |
507 | CONFIGURE='mingw64-configure' |
508 | MAKE='mingw64-make' |
509 | - CONFIGURE_ARGS='--enable-static' |
510 | - |
511 | - make_skeleton_mingw |
512 | - ret=$? |
513 | + CONFIGURE_ARGS='--enable-static --disable-shared' |
514 | + |
515 | + make_skeleton |
516 | + ret=$? |
517 | + |
518 | + restore_BUILD |
519 | + |
520 | + return $ret |
521 | +} |
522 | + |
523 | +function make_for_clang () |
524 | +{ |
525 | + if ! check_clang; then |
526 | + return 1 |
527 | + fi |
528 | + |
529 | + # Make sure it is clean |
530 | + if [ -f Makefile -o -f configure ]; then |
531 | + make_maintainer_clean |
532 | + fi |
533 | + |
534 | + run_autoreconf |
535 | + |
536 | + save_BUILD |
537 | + |
538 | + CC=clang CXX=clang++ |
539 | + export CC CXX |
540 | + |
541 | + make_skeleton |
542 | + ret=$? |
543 | + |
544 | + make_target 'check' |
545 | + |
546 | + restore_BUILD |
547 | + |
548 | + return $ret |
549 | +} |
550 | + |
551 | +function make_for_clang_analyzer () |
552 | +{ |
553 | + if ! check_clang; then |
554 | + return 1 |
555 | + fi |
556 | + |
557 | + if ! check_clang_analyzer; then |
558 | + die 'clang-analyzer was not found' |
559 | + fi |
560 | + |
561 | + # Make sure it is clean |
562 | + if [ -f Makefile -o -f configure ]; then |
563 | + make_maintainer_clean |
564 | + fi |
565 | + |
566 | + run_autoreconf |
567 | + |
568 | + save_BUILD |
569 | + |
570 | + CC=clang CXX=clang++ |
571 | + export CC CXX |
572 | + CONFIGURE_ARGS='--enable-debug' |
573 | + |
574 | + make_skeleton |
575 | + ret=$? |
576 | + |
577 | + make_target 'clean' 'warn' |
578 | + |
579 | + scan-build -o clang-html make -j4 -k |
580 | |
581 | restore_BUILD |
582 | |
583 | @@ -710,6 +854,8 @@ |
584 | make_valgrind |
585 | make_gdb |
586 | make_rpm |
587 | + make_for_clang |
588 | + make_for_clang_analyzer |
589 | |
590 | if [ check_mingw -eq 0 ]; then |
591 | make_for_mingw |
592 | @@ -815,11 +961,11 @@ |
593 | |
594 | function make_gdb () |
595 | { |
596 | + save_BUILD |
597 | + |
598 | if command_exists 'gdb'; then |
599 | run_configure_if_required |
600 | |
601 | - push_TESTS_ENVIRONMENT |
602 | - |
603 | # Set ENV GDB_COMMAND |
604 | if [[ -z "$GDB_COMMAND" ]]; then |
605 | setup_gdb_command |
606 | @@ -839,8 +985,6 @@ |
607 | rm 'gdb.txt' |
608 | fi |
609 | |
610 | - pop_TESTS_ENVIRONMENT |
611 | - |
612 | if [ -f '.gdb_history' ]; then |
613 | rm '.gdb_history' |
614 | fi |
615 | @@ -852,6 +996,8 @@ |
616 | echo 'gdb was not present' |
617 | return 1 |
618 | fi |
619 | + |
620 | + restore_BUILD |
621 | } |
622 | |
623 | # $1 target to compile |
624 | @@ -883,9 +1029,9 @@ |
625 | |
626 | if [ $ret -ne 0 ]; then |
627 | if [ -n "$2" ]; then |
628 | - warn "Cannot execute $MAKE $1: $ret" |
629 | + warn "Failed to execute $MAKE $1: $ret" |
630 | else |
631 | - die "Cannot execute $MAKE $1: $ret" |
632 | + die "Failed to execute $MAKE $1: $ret" |
633 | fi |
634 | fi |
635 | |
636 | @@ -951,6 +1097,13 @@ |
637 | assert_file 'Makefile' 'configure did not produce a Makefile' |
638 | } |
639 | |
640 | +function run_make_maintainer_clean_if_possible () |
641 | +{ |
642 | + if [ -f 'Makefile' ]; then |
643 | + make_maintainer_clean |
644 | + fi |
645 | +} |
646 | + |
647 | function run_autoreconf_if_required () |
648 | { |
649 | if [ ! -x 'configure' ]; then |
650 | @@ -958,6 +1111,7 @@ |
651 | fi |
652 | |
653 | assert_exec_file 'configure' |
654 | + bash -n configure |
655 | } |
656 | |
657 | function run_autoreconf () |
658 | @@ -971,7 +1125,7 @@ |
659 | run $BOOTSTRAP_LIBTOOLIZE '--copy' '--install' '--force' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE" |
660 | fi |
661 | |
662 | - run $AUTORECONF || die "Cannot execute $AUTORECONF" |
663 | + run $AUTORECONF $AUTORECONF_ARGS || die "Cannot execute $AUTORECONF" |
664 | |
665 | eval 'bash -n configure' || die "autoreconf generated a malformed configure" |
666 | } |
667 | @@ -1023,6 +1177,14 @@ |
668 | ;; |
669 | h) # help |
670 | echo "bootstrap.sh [options] optional_target ..." |
671 | + echo " -a # Just run autoreconf"; |
672 | + echo " -p # Print ENV"; |
673 | + echo " -c # Just run configure"; |
674 | + echo " -m # Just run maintainer-clean"; |
675 | + echo " -t # Make target"; |
676 | + echo " -d # Enable debug"; |
677 | + echo " -h # Show help"; |
678 | + echo " -v # Be more verbose in output"; |
679 | exit |
680 | ;; |
681 | v) # verbose |
682 | @@ -1057,6 +1219,8 @@ |
683 | VCS_CHECKOUT=svn |
684 | elif [[ -d '.hg' ]]; then |
685 | VCS_CHECKOUT=hg |
686 | + else |
687 | + VCS_CHECKOUT= |
688 | fi |
689 | |
690 | if [[ -n "$VCS_CHECKOUT" ]]; then |
691 | @@ -1122,6 +1286,7 @@ |
692 | |
693 | if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then |
694 | echo "Couldn't find user supplied libtoolize, it is required" |
695 | + return 1 |
696 | fi |
697 | else |
698 | # If we are using OSX, we first check to see glibtoolize is available |
699 | @@ -1130,21 +1295,27 @@ |
700 | |
701 | if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then |
702 | echo "Couldn't find glibtoolize, it is required on OSX" |
703 | + return 1 |
704 | fi |
705 | else |
706 | BOOTSTRAP_LIBTOOLIZE=`type -p libtoolize` |
707 | |
708 | if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then |
709 | echo "Couldn't find libtoolize, it is required" |
710 | + return 1 |
711 | fi |
712 | fi |
713 | fi |
714 | + |
715 | if $VERBOSE; then |
716 | LIBTOOLIZE_OPTIONS="--verbose $BOOTSTRAP_LIBTOOLIZE_OPTIONS" |
717 | fi |
718 | + |
719 | if $DEBUG; then |
720 | LIBTOOLIZE_OPTIONS="--debug $BOOTSTRAP_LIBTOOLIZE_OPTIONS" |
721 | fi |
722 | + |
723 | + # Here we set LIBTOOLIZE to true since we are going to invoke it via BOOTSTRAP_LIBTOOLIZE |
724 | LIBTOOLIZE=true |
725 | fi |
726 | |
727 | @@ -1182,7 +1353,7 @@ |
728 | fi |
729 | |
730 | if [[ -n "$GNU_BUILD_FLAGS" ]]; then |
731 | - AUTORECONF="$AUTORECONF $GNU_BUILD_FLAGS" |
732 | + AUTORECONF_ARGS="$GNU_BUILD_FLAGS" |
733 | fi |
734 | fi |
735 | |
736 | @@ -1200,6 +1371,9 @@ |
737 | echo 'BOOTSTRAP ENV' |
738 | echo "AUTORECONF=$AUTORECONF" |
739 | echo "HOST_OS=$HOST_OS" |
740 | + echo "VENDOR=$VENDOR" |
741 | + echo "VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION" |
742 | + echo "VENDOR_RELEASE=$VENDOR_RELEASE" |
743 | |
744 | echo "getopt()" |
745 | if $AUTORECONF_OPTION; then |
746 | @@ -1333,18 +1507,25 @@ |
747 | ;; |
748 | 'make_default') |
749 | ;; |
750 | - 'test-*') |
751 | - ;; |
752 | - 'valgrind-*') |
753 | - ;; |
754 | - 'gdb-*') |
755 | + 'clang') |
756 | + ;; |
757 | + 'clang-analyzer') |
758 | + ;; |
759 | + test-*) |
760 | + ;; |
761 | + valgrind-*) |
762 | + ;; |
763 | + gdb-*) |
764 | ;; |
765 | 'dist') |
766 | ;; |
767 | *) |
768 | - die "Unknown MAKE_TARGET option: $1" |
769 | + echo "Matched default" |
770 | + return 1 |
771 | ;; |
772 | esac |
773 | + |
774 | + return 0 |
775 | } |
776 | |
777 | function bootstrap () |
778 | @@ -1355,7 +1536,9 @@ |
779 | |
780 | # Set up whatever we need to do to use autoreconf later |
781 | require_libtoolise |
782 | - autoreconf_setup |
783 | + if ! autoreconf_setup; then |
784 | + return 1 |
785 | + fi |
786 | |
787 | if [ -z "$MAKE_TARGET" ]; then |
788 | MAKE_TARGET="make_default" |
789 | @@ -1377,7 +1560,7 @@ |
790 | |
791 | # Set ENV PREFIX in order to set --prefix for ./configure |
792 | if [[ -n "$PREFIX" ]]; then |
793 | - push_PREFIX_ARG $PREFIX |
794 | + PREFIX_ARG="--prefix=$PREFIX" |
795 | fi |
796 | |
797 | # We should always have a target by this point |
798 | @@ -1390,8 +1573,15 @@ |
799 | # If we are running inside of Jenkins, we want to only run some of the possible tests |
800 | if $jenkins_build_environment; then |
801 | check_make_target $target |
802 | + ret=$? |
803 | + if [ $ret -ne 0 ]; then |
804 | + die "Unknown MAKE_TARGET option: $target" |
805 | + fi |
806 | fi |
807 | |
808 | + local snapshot_run=false |
809 | + local valgrind_run=false |
810 | + |
811 | case $target in |
812 | 'self') |
813 | self_test |
814 | @@ -1417,26 +1607,48 @@ |
815 | 'make_default') |
816 | make_default |
817 | ;; |
818 | + 'clang') |
819 | + if ! check_clang; then |
820 | + die "clang was not found" |
821 | + fi |
822 | + |
823 | + if ! make_for_clang; then |
824 | + die "Failed to build clang: $?" |
825 | + fi |
826 | + ;; |
827 | + 'clang-analyzer') |
828 | + if ! check_clang_analyzer; then |
829 | + die "clang-analyzer was not found" |
830 | + fi |
831 | + if ! check_clang; then |
832 | + die "clang was not found" |
833 | + fi |
834 | + |
835 | + if ! make_for_clang_analyzer; then |
836 | + die "Failed to build clang-analyzer: $?" |
837 | + fi |
838 | + ;; |
839 | 'mingw') |
840 | - check_mingw |
841 | if ! check_mingw; then |
842 | die "mingw was not found" |
843 | fi |
844 | |
845 | - make_for_mingw |
846 | - check_ret=$? |
847 | - |
848 | if ! make_for_mingw; then |
849 | die "Failed to build mingw: $?" |
850 | fi |
851 | ;; |
852 | 'snapshot') |
853 | make_for_snapshot |
854 | + snapshot_run=true |
855 | ;; |
856 | 'rpm') |
857 | make_rpm |
858 | ;; |
859 | + 'darwin_malloc') |
860 | + make_darwin_malloc |
861 | + ;; |
862 | 'valgrind') |
863 | + make_maintainer_clean |
864 | make_valgrind |
865 | ;; |
866 | 'universe') |
867 | @@ -1450,6 +1662,13 @@ |
868 | make_target "$target" |
869 | ;; |
870 | esac |
871 | + |
872 | + if $jenkins_build_environment; then |
873 | + if ! $snapshot_run; then |
874 | + run_make_maintainer_clean_if_possible |
875 | + fi |
876 | + fi |
877 | + |
878 | done |
879 | } |
880 | |
881 | @@ -1474,6 +1693,7 @@ |
882 | |
883 | local OLD_CONFIGURE= |
884 | local OLD_CONFIGURE_ARG= |
885 | + local OLD_PREFIX= |
886 | local OLD_MAKE= |
887 | local OLD_TESTS_ENVIRONMENT= |
888 | |
889 | @@ -1517,7 +1737,16 @@ |
890 | # We don't want Jenkins overriding other variables, so we NULL them. |
891 | if [ -z "$MAKE_TARGET" ]; then |
892 | if $jenkins_build_environment; then |
893 | - MAKE_TARGET='jenkins' |
894 | + if [[ -n "$label" ]]; then |
895 | + check_make_target $label |
896 | + if [ $? -eq 0 ]; then |
897 | + MAKE_TARGET="$label" |
898 | + fi |
899 | + fi |
900 | + |
901 | + if [ -z "$MAKE_TARGET" ]; then |
902 | + MAKE_TARGET='check' |
903 | + fi |
904 | fi |
905 | fi |
906 | |
907 | @@ -1620,11 +1849,13 @@ |
908 | export AUTOM4TE |
909 | export AUTOMAKE |
910 | export AUTORECONF |
911 | +export CONFIGURE_ARG |
912 | export DEBUG |
913 | export GNU_BUILD_FLAGS |
914 | export LIBTOOLIZE |
915 | export LIBTOOLIZE_OPTIONS |
916 | export MAKE |
917 | +export PREFIX_ARG |
918 | export TESTS_ENVIRONMENT |
919 | export VERBOSE |
920 | export WARNINGS |
921 | |
922 | === modified file 'configure.ac' |
923 | --- configure.ac 2013-04-25 10:26:18 +0000 |
924 | +++ configure.ac 2013-04-28 22:03:24 +0000 |
925 | @@ -44,6 +44,9 @@ |
926 | LT_INIT |
927 | LT_LANG([C++]) |
928 | |
929 | +AC_PROG_CC_C99 |
930 | +AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])]) |
931 | + |
932 | AX_PLATFORM |
933 | AX_ASSERT |
934 | |
935 | |
936 | === modified file 'libdrizzle/sha1.cc' |
937 | --- libdrizzle/sha1.cc 2012-12-19 12:07:00 +0000 |
938 | +++ libdrizzle/sha1.cc 2013-04-28 22:03:24 +0000 |
939 | @@ -128,7 +128,7 @@ |
940 | void |
941 | SHA1Update(SHA1_CTX *context, const uint8_t *data, size_t len) |
942 | { |
943 | - size_t i, j; |
944 | + uint32_t i, j; |
945 | |
946 | j = (size_t)((context->count >> 3) & 63); |
947 | context->count += (len << 3); |
948 | |
949 | === modified file 'm4/ax_harden_compiler_flags.m4' |
950 | --- m4/ax_harden_compiler_flags.m4 2013-04-26 19:50:55 +0000 |
951 | +++ m4/ax_harden_compiler_flags.m4 2013-04-28 22:03:24 +0000 |
952 | @@ -1,3 +1,4 @@ |
953 | +# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
954 | # =========================================================================== |
955 | # https://github.com/BrianAker/ddm4/ |
956 | # =========================================================================== |
957 | @@ -14,7 +15,7 @@ |
958 | # |
959 | # LICENSE |
960 | # |
961 | -# Copyright (C) 2012 Brian Aker |
962 | +# Copyright (C) 2012-2013 Brian Aker |
963 | # All rights reserved. |
964 | # |
965 | # Redistribution and use in source and binary forms, with or without |
966 | @@ -52,7 +53,7 @@ |
967 | # ? _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for |
968 | # compatibility issues memcached_stat_st |
969 | |
970 | -#serial 7 |
971 | +#serial 9 |
972 | |
973 | AC_DEFUN([_WARNINGS_AS_ERRORS], |
974 | [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors], |
975 | @@ -75,10 +76,11 @@ |
976 | # Everything above this does the heavy lifting, while what follows does the specifics. |
977 | |
978 | AC_DEFUN([_HARDEN_LINKER_FLAGS], |
979 | - [_APPEND_LINK_FLAGS_ERROR([-z relro -z now]) |
980 | - #_APPEND_LINK_FLAGS_ERROR([-pie]) |
981 | - AS_IF([test "x$ac_cv_warnings_as_errors" = xyes], |
982 | - [AX_APPEND_LINK_FLAGS([-Werror])]) |
983 | + [ |
984 | + AS_IF([test "$CC" != "clang"], |
985 | + [_APPEND_LINK_FLAGS_ERROR([-z relro -z now]) |
986 | + AS_IF([test "x$ac_cv_warnings_as_errors" = xyes], |
987 | + [AX_APPEND_LINK_FLAGS([-Werror])])]) |
988 | ]) |
989 | |
990 | AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS], |
991 | @@ -86,27 +88,37 @@ |
992 | |
993 | AS_IF([test "x$ax_enable_debug" = xyes], |
994 | [CFLAGS='' |
995 | + _APPEND_COMPILE_FLAGS_ERROR([-H]) |
996 | _APPEND_COMPILE_FLAGS_ERROR([-ggdb]) |
997 | _APPEND_COMPILE_FLAGS_ERROR([-g]) |
998 | - _APPEND_COMPILE_FLAGS_ERROR([-O0])], |
999 | - [_APPEND_COMPILE_FLAGS_ERROR([-g]) |
1000 | - _APPEND_COMPILE_FLAGS_ERROR([-O2])]) |
1001 | + _APPEND_COMPILE_FLAGS_ERROR([-O0]), |
1002 | + _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer]) |
1003 | + ],[ |
1004 | + _APPEND_COMPILE_FLAGS_ERROR([-g]) |
1005 | + _APPEND_COMPILE_FLAGS_ERROR([-O2]) |
1006 | + ]) |
1007 | |
1008 | AS_IF([test "x$ac_cv_vcs_checkout" = xyes], |
1009 | - [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])], |
1010 | - [_APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])]) |
1011 | + [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check]) |
1012 | + _APPEND_COMPILE_FLAGS_ERROR([-Wpragmas]) |
1013 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])], |
1014 | + [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas]) |
1015 | + _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])]) |
1016 | + |
1017 | + AS_IF([test "$CC" = "clang"], |
1018 | + [_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])]) |
1019 | |
1020 | _APPEND_COMPILE_FLAGS_ERROR([-Wall]) |
1021 | _APPEND_COMPILE_FLAGS_ERROR([-Wextra]) |
1022 | - _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas]) |
1023 | _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail]) |
1024 | _APPEND_COMPILE_FLAGS_ERROR([-std=c99]) |
1025 | # Anything below this comment please keep sorted. |
1026 | - AS_IF([test "x$CC_VERSION_VENDOR" != xclang], |
1027 | - [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], []) |
1028 | # _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute]) |
1029 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunsuffixed-float-constants]) |
1030 | + _APPEND_COMPILE_FLAGS_ERROR([-Wjump-misses-init]) |
1031 | _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes]) |
1032 | _APPEND_COMPILE_FLAGS_ERROR([-Waddress]) |
1033 | + _APPEND_COMPILE_FLAGS_ERROR([-Wvarargs]) |
1034 | _APPEND_COMPILE_FLAGS_ERROR([-Warray-bounds]) |
1035 | _APPEND_COMPILE_FLAGS_ERROR([-Wbad-function-cast]) |
1036 | # Not in use -Wc++-compat |
1037 | @@ -115,6 +127,7 @@ |
1038 | _APPEND_COMPILE_FLAGS_ERROR([-Wfloat-equal]) |
1039 | _APPEND_COMPILE_FLAGS_ERROR([-Wformat-security]) |
1040 | _APPEND_COMPILE_FLAGS_ERROR([-Wformat=2]) |
1041 | + _APPEND_COMPILE_FLAGS_ERROR([-Wformat-y2k]) |
1042 | _APPEND_COMPILE_FLAGS_ERROR([-Wlogical-op]) |
1043 | _APPEND_COMPILE_FLAGS_ERROR([-Wmaybe-uninitialized]) |
1044 | _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-field-initializers]) |
1045 | @@ -124,7 +137,6 @@ |
1046 | _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-prototypes]) |
1047 | _APPEND_COMPILE_FLAGS_ERROR([-Wnested-externs]) |
1048 | _APPEND_COMPILE_FLAGS_ERROR([-Wnormalized=id]) |
1049 | - _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-definition]) |
1050 | _APPEND_COMPILE_FLAGS_ERROR([-Woverride-init]) |
1051 | _APPEND_COMPILE_FLAGS_ERROR([-Wpointer-arith]) |
1052 | _APPEND_COMPILE_FLAGS_ERROR([-Wpointer-sign]) |
1053 | @@ -141,15 +153,48 @@ |
1054 | _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-overflow=1]) |
1055 | _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-prototypes]) |
1056 | _APPEND_COMPILE_FLAGS_ERROR([-Wswitch-enum]) |
1057 | + _APPEND_COMPILE_FLAGS_ERROR([-Wtrampolines]) |
1058 | _APPEND_COMPILE_FLAGS_ERROR([-Wundef]) |
1059 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations]) |
1060 | + _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations]) |
1061 | + AS_IF([test "x$ac_cv_vcs_checkout" = xyes && test "x$MINGW" != xyes],[ |
1062 | + _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer]) |
1063 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address]) |
1064 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer]) |
1065 | + AS_IF([test "x$enable_shared" = "xyes"],[ |
1066 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread]) |
1067 | + ]) |
1068 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory]) |
1069 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment]) |
1070 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool]) |
1071 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds]) |
1072 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum]) |
1073 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow]) |
1074 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero]) |
1075 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero]) |
1076 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null]) |
1077 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size]) |
1078 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return]) |
1079 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift]) |
1080 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow]) |
1081 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable]) |
1082 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow]) |
1083 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound]) |
1084 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr]) |
1085 | + ]) |
1086 | + _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered]) |
1087 | _APPEND_COMPILE_FLAGS_ERROR([-Wunused]) |
1088 | _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result]) |
1089 | _APPEND_COMPILE_FLAGS_ERROR([-Wunused-variable]) |
1090 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunused-parameter]) |
1091 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunused-local-typedefs]) |
1092 | _APPEND_COMPILE_FLAGS_ERROR([-Wwrite-strings]) |
1093 | _APPEND_COMPILE_FLAGS_ERROR([-floop-parallelize-all]) |
1094 | _APPEND_COMPILE_FLAGS_ERROR([-fwrapv]) |
1095 | _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt]) |
1096 | _APPEND_COMPILE_FLAGS_ERROR([-pipe]) |
1097 | + _APPEND_COMPILE_FLAGS_ERROR([-fPIE -pie]) |
1098 | + _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess]) |
1099 | |
1100 | AS_IF([test "x$ax_enable_debug" = xno], |
1101 | [AS_IF([test "x$ac_cv_vcs_checkout" = xyes], |
1102 | @@ -157,7 +202,7 @@ |
1103 | [AS_IF([test "x$ac_c_gcc_recent" = xyes], |
1104 | [_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2]) |
1105 | #_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector]) |
1106 | - #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector]) |
1107 | + #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector --param=ssp-buffer-size=4]) |
1108 | _APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all]) |
1109 | ])])])]) |
1110 | |
1111 | @@ -173,25 +218,33 @@ |
1112 | |
1113 | AS_IF([test "x$ax_enable_debug" = xyes], |
1114 | [CXXFLAGS='' |
1115 | + _APPEND_COMPILE_FLAGS_ERROR([-H]) |
1116 | _APPEND_COMPILE_FLAGS_ERROR([-ggdb]) |
1117 | _APPEND_COMPILE_FLAGS_ERROR([-g]) |
1118 | - _APPEND_COMPILE_FLAGS_ERROR([-O0])], |
1119 | - [_APPEND_COMPILE_FLAGS_ERROR([-g]) |
1120 | - _APPEND_COMPILE_FLAGS_ERROR([-O2])]) |
1121 | + _APPEND_COMPILE_FLAGS_ERROR([-O0]), |
1122 | + _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer]) |
1123 | + ],[ |
1124 | + _APPEND_COMPILE_FLAGS_ERROR([-g]) |
1125 | + _APPEND_COMPILE_FLAGS_ERROR([-O2]) |
1126 | + ]) |
1127 | |
1128 | AS_IF([test "x$ac_cv_vcs_checkout" = xyes], |
1129 | - [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])], |
1130 | - [_APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])]) |
1131 | + [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check]) |
1132 | + _APPEND_COMPILE_FLAGS_ERROR([-Wpragmas]) |
1133 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])], |
1134 | + [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas]) |
1135 | + _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])]) |
1136 | + |
1137 | + AS_IF([test "$CXX" = "clang++"], |
1138 | + [_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])]) |
1139 | |
1140 | _APPEND_COMPILE_FLAGS_ERROR([-Wall]) |
1141 | _APPEND_COMPILE_FLAGS_ERROR([-Wextra]) |
1142 | - _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas]) |
1143 | _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail]) |
1144 | # Anything below this comment please keep sorted. |
1145 | - AS_IF([test "x$CXX_VERSION_VENDOR" != xclang], |
1146 | - [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], []) |
1147 | # _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute]) |
1148 | _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes]) |
1149 | + _APPEND_COMPILE_FLAGS_ERROR([-Wvarargs]) |
1150 | _APPEND_COMPILE_FLAGS_ERROR([-Waddress]) |
1151 | _APPEND_COMPILE_FLAGS_ERROR([-Warray-bounds]) |
1152 | _APPEND_COMPILE_FLAGS_ERROR([-Wchar-subscripts]) |
1153 | @@ -199,6 +252,7 @@ |
1154 | _APPEND_COMPILE_FLAGS_ERROR([-Wctor-dtor-privacy]) |
1155 | _APPEND_COMPILE_FLAGS_ERROR([-Wfloat-equal]) |
1156 | _APPEND_COMPILE_FLAGS_ERROR([-Wformat=2]) |
1157 | + _APPEND_COMPILE_FLAGS_ERROR([-Wformat-y2k]) |
1158 | _APPEND_COMPILE_FLAGS_ERROR([-Wmaybe-uninitialized]) |
1159 | _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-field-initializers]) |
1160 | _APPEND_COMPILE_FLAGS_ERROR([-Wlogical-op]) |
1161 | @@ -219,17 +273,52 @@ |
1162 | _APPEND_COMPILE_FLAGS_ERROR([-Wsign-compare]) |
1163 | _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-overflow=1]) |
1164 | _APPEND_COMPILE_FLAGS_ERROR([-Wswitch-enum]) |
1165 | + _APPEND_COMPILE_FLAGS_ERROR([-Wtrampolines]) |
1166 | _APPEND_COMPILE_FLAGS_ERROR([-Wundef]) |
1167 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations]) |
1168 | + _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations]) |
1169 | _APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat]) |
1170 | +# _APPEND_COMPILE_FLAGS_ERROR([-Weffc++]) |
1171 | + AS_IF([test "x$ac_cv_vcs_checkout" = xyes && test "x$MINGW" != xyes],[ |
1172 | + _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer]) |
1173 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address]) |
1174 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer]) |
1175 | + AS_IF([test "x$enable_shared" = "xyes"],[ |
1176 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread]) |
1177 | + ]) |
1178 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory]) |
1179 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment]) |
1180 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool]) |
1181 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds]) |
1182 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum]) |
1183 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow]) |
1184 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero]) |
1185 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero]) |
1186 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null]) |
1187 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size]) |
1188 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return]) |
1189 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift]) |
1190 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow]) |
1191 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable]) |
1192 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow]) |
1193 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound]) |
1194 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr]) |
1195 | + ]) |
1196 | +# _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast]) |
1197 | + _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered]) |
1198 | _APPEND_COMPILE_FLAGS_ERROR([-Wunused]) |
1199 | _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result]) |
1200 | _APPEND_COMPILE_FLAGS_ERROR([-Wunused-variable]) |
1201 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunused-parameter]) |
1202 | + _APPEND_COMPILE_FLAGS_ERROR([-Wunused-local-typedefs]) |
1203 | _APPEND_COMPILE_FLAGS_ERROR([-Wwrite-strings]) |
1204 | _APPEND_COMPILE_FLAGS_ERROR([-Wformat-security]) |
1205 | _APPEND_COMPILE_FLAGS_ERROR([-floop-parallelize-all]) |
1206 | _APPEND_COMPILE_FLAGS_ERROR([-fwrapv]) |
1207 | _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt]) |
1208 | _APPEND_COMPILE_FLAGS_ERROR([-pipe]) |
1209 | + _APPEND_COMPILE_FLAGS_ERROR([-fPIE -pie]) |
1210 | + _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess]) |
1211 | |
1212 | AS_IF([test "x$ax_enable_debug" = xno], |
1213 | [AS_IF([test "x$ac_cv_vcs_checkout" = xyes], |
1214 | @@ -237,7 +326,7 @@ |
1215 | [AS_IF([test "x$ac_c_gcc_recent" = xyes], |
1216 | [_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2]) |
1217 | #_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector]) |
1218 | - #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector]) |
1219 | + #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector --param=ssp-buffer-size=4]) |
1220 | _APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all]) |
1221 | ])])])]) |
1222 | |
1223 | |
1224 | === modified file 'tests/unit/numbers.c' |
1225 | --- tests/unit/numbers.c 2013-04-26 18:53:22 +0000 |
1226 | +++ tests/unit/numbers.c 2013-04-28 22:03:24 +0000 |
1227 | @@ -91,7 +91,7 @@ |
1228 | set_up_connection(); |
1229 | set_up_schema("test_numbers"); |
1230 | |
1231 | - CHECKED_QUERY("create table test_numbers.t1 (a int primary key auto_increment, b tinyint, c smallint, d mediumint, e int, f bigint, g float, h double)"); |
1232 | + CHECKED_QUERY("create table test_numbers.t1 (a int primary key auto_increment, b tinyint, c smallint, d mediumint, e int, f bigint, g float, h double(16,13))"); |
1233 | |
1234 | /* Insert rows with pk 1 and 2 */ |
1235 | CHECKED_QUERY("insert into test_numbers.t1 (b,c,d,e,f,g,h) values (1,1,1,1,1,1,1), (127,32687,8388351,2147352575,9222246136947920895,443664,291.2711110711098);"); |
1236 | @@ -110,8 +110,8 @@ |
1237 | CHECK(drizzle_stmt_set_int(sth, 2, 8388351, 0)); |
1238 | CHECK(drizzle_stmt_set_int(sth, 3, 2147352575, 0)); |
1239 | CHECK(drizzle_stmt_set_bigint(sth, 4, 9222246136947920895, 0)); |
1240 | - CHECK(drizzle_stmt_set_float(sth, 5, 443664.0)); |
1241 | - CHECK(drizzle_stmt_set_double(sth, 6, 291.2711110711098)); |
1242 | + CHECK(drizzle_stmt_set_float(sth, 5, 443664.0f)); |
1243 | + CHECK(drizzle_stmt_set_double(sth, 6, 291.2711110711098l)); |
1244 | driz_ret = drizzle_stmt_execute(sth); |
1245 | ASSERT_EQ_(driz_ret, DRIZZLE_RETURN_OK, "Error (%s): %s, executing \"%s\"", drizzle_strerror(driz_ret), drizzle_error(con), query); |
1246 | driz_ret = drizzle_stmt_buffer(sth); |
1247 | @@ -257,21 +257,21 @@ |
1248 | ASSERT_STREQ(expect_strval, col_strval); |
1249 | } |
1250 | |
1251 | - float expect_floatval = 0.0; |
1252 | - double expect_dblval = 0.0; |
1253 | + float expect_floatval = 0.0f; |
1254 | + double expect_dblval = 0.0f; |
1255 | switch (columnA) { |
1256 | case 1: |
1257 | - expect_floatval = 1.0; |
1258 | - expect_dblval = 1.0; |
1259 | + expect_floatval = 1.0f; |
1260 | + expect_dblval = 1.0f; |
1261 | break; |
1262 | case 2: |
1263 | case 4: |
1264 | - expect_floatval = 443664.0; |
1265 | - expect_dblval = 291.2711110711098; |
1266 | + expect_floatval = 443664.0f; |
1267 | + expect_dblval = 291.2711110711098l; |
1268 | break; |
1269 | case 3: |
1270 | - expect_floatval = 443665.0; |
1271 | - expect_dblval = 292.2711110711098; |
1272 | + expect_floatval = 443665.0f; |
1273 | + expect_dblval = 292.2711110711098l; |
1274 | break; |
1275 | } |
1276 |
sha1 fix is probably "the wrong thing" but it was to kill this warning:
sha1.cc:138: warning: assuming that the loop counter does not overflow