Merge lp:~brianaker/libdrizzle/bootstrap-update-april-2013 into lp:libdrizzle

Proposed by Brian Aker
Status: Merged
Approved by: Andrew Hutchings
Approved revision: 121
Merged at revision: 121
Proposed branch: lp:~brianaker/libdrizzle/bootstrap-update-april-2013
Merge into: lp:libdrizzle
Diff against target: 1208 lines (+475/-152)
3 files modified
bootstrap.sh (+358/-127)
configure.ac (+3/-0)
m4/ax_harden_compiler_flags.m4 (+114/-25)
To merge this branch: bzr merge lp:~brianaker/libdrizzle/bootstrap-update-april-2013
Reviewer Review Type Date Requested Status
Andrew Hutchings Approve
Review via email: mp+161265@code.launchpad.net

Description of the change

Update bootstrap and hardening files.

To post a comment you must log in.
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Lots of really good stuff in there, many thanks :)

Thanks for moving --param=ssp-buffer-size somewhere better. Clang 3.2 was barfing on that but autotools wasn't picking that up in the support check due to the message it generates.

review: Approve
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

so, we have 2 problems found by the RHEL builder:

1. it appears to be a lot stricter than before (and stricter than the other builders) and firing lots of warnings

2. the test suite is now executing on that builder and is having connect timeouts which isn't a SKIP event we test for. I'm hoping this isn't a bug :/

https://jenkins.drizzle.org/job/libdrizzle-build-matrix/label=amd64-RedHatEnterpriseServer-6.4/102/console

I'll look at #1 at some point today (going to download CentOS first to try this out)

Revision history for this message
Brian Aker (brianaker) wrote :

I can take a look as well. I've had to remove reachable for other
projects because of the glibc issue for the resolver.

Sent from my Ti85

On Apr 27, 2013, at 0:15, Andrew Hutchings <email address hidden> wrote:

> so, we have 2 problems found by the RHEL builder:
>
> 1. it appears to be a lot stricter than before (and stricter than the other builders) and firing lots of warnings
>
> 2. the test suite is now executing on that builder and is having connect timeouts which isn't a SKIP event we test for. I'm hoping this isn't a bug :/
>
> https://jenkins.drizzle.org/job/libdrizzle-build-matrix/label=amd64-RedHatEnterpriseServer-6.4/102/console
>
> I'll look at #1 at some point today (going to download CentOS first to try this out)
> --
> https://code.launchpad.net/~brianaker/libdrizzle/bootstrap-update-april-2013/+merge/161265
> You are the owner of lp:~brianaker/libdrizzle/bootstrap-update-april-2013.

122. By Brian Aker

Update bootstrap and disable two warning types that currently are not passable.

Revision history for this message
Brian Aker (brianaker) wrote :

I am commenting out style and effc for the moment.

effc is showing a few real bugs (init issues).

Cheers,
 -Brian

On Apr 26, 2013, at 11:59 PM, Andrew Hutchings <email address hidden> wrote:

> The proposal to merge lp:~brianaker/libdrizzle/bootstrap-update-april-2013 into lp:libdrizzle has been updated.
>
> Status: Needs review => Approved
>
> For more details, see:
> https://code.launchpad.net/~brianaker/libdrizzle/bootstrap-update-april-2013/+merge/161265
> --
> https://code.launchpad.net/~brianaker/libdrizzle/bootstrap-update-april-2013/+merge/161265
> You are the owner of lp:~brianaker/libdrizzle/bootstrap-update-april-2013.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bootstrap.sh'
--- bootstrap.sh 2013-01-10 12:04:23 +0000
+++ bootstrap.sh 2013-04-27 15:24:24 +0000
@@ -1,6 +1,6 @@
1#!/bin/bash1#!/bin/bash
2# 2#
3# Copyright (C) 2012 Brian Aker3# Copyright (C) 2012-2013 Brian Aker
4# All rights reserved.4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without6# Redistribution and use in source and binary forms, with or without
@@ -151,7 +151,8 @@
151 fi151 fi
152}152}
153153
154# Valid values are: darwin,fedora,rhel,ubuntu154# Validate the distribution name, or toss an erro
155# values: darwin,fedora,rhel,ubuntu,debian,opensuse
155function set_VENDOR_DISTRIBUTION ()156function set_VENDOR_DISTRIBUTION ()
156{157{
157 local dist=`echo "$1" | tr '[A-Z]' '[a-z]'`158 local dist=`echo "$1" | tr '[A-Z]' '[a-z]'`
@@ -165,9 +166,15 @@
165 rhel)166 rhel)
166 VENDOR_DISTRIBUTION='rhel'167 VENDOR_DISTRIBUTION='rhel'
167 ;;168 ;;
169 debian)
170 VENDOR_DISTRIBUTION='debian'
171 ;;
168 ubuntu)172 ubuntu)
169 VENDOR_DISTRIBUTION='ubuntu'173 VENDOR_DISTRIBUTION='ubuntu'
170 ;;174 ;;
175 suse)
176 VENDOR_DISTRIBUTION='opensuse'
177 ;;
171 opensuse)178 opensuse)
172 VENDOR_DISTRIBUTION='opensuse'179 VENDOR_DISTRIBUTION='opensuse'
173 ;;180 ;;
@@ -177,21 +184,57 @@
177 esac184 esac
178}185}
179186
187# Validate a Vendor's release name/number
180function set_VENDOR_RELEASE ()188function set_VENDOR_RELEASE ()
181{189{
182 local release=`echo "$1" | tr '[A-Z]' '[a-z]'`190 local release=`echo "$1" | tr '[A-Z]' '[a-z]'`
183 case "$VENDOR_DISTRIBUTION" in191
192 if $DEBUG; then
193 echo "VENDOR_DISTRIBUTION:$VENDOR_DISTRIBUTION"
194 echo "VENDOR_RELEASE:$release"
195 fi
196
197 case $VENDOR_DISTRIBUTION in
184 darwin)198 darwin)
185 VENDOR_RELEASE='mountain'199 case $release in
200 10.6*)
201 VENDOR_RELEASE='snow_leopard'
202 ;;
203 10.7*)
204 VENDOR_RELEASE='mountain'
205 ;;
206 mountain)
207 VENDOR_RELEASE='mountain'
208 ;;
209 10.8.*)
210 echo "mountain_lion"
211 VENDOR_RELEASE='mountain_lion'
212 ;;
213 *)
214 echo $VENDOR_RELEASE
215 VENDOR_RELEASE='unknown'
216 ;;
217 esac
186 ;;218 ;;
187 fedora)219 fedora)
188 VENDOR_RELEASE="$release"220 VENDOR_RELEASE="$release"
221 if [[ "x$VENDOR_RELEASE" == '18' ]]; then
222 VENDOR_RELEASE='sphericalcow'
223 fi
189 ;;224 ;;
190 rhel)225 rhel)
191 VENDOR_RELEASE="$release"226 VENDOR_RELEASE="$release"
192 ;;227 ;;
228 debian)
229 VENDOR_RELEASE="$release"
230 ;;
193 ubuntu)231 ubuntu)
194 VENDOR_RELEASE="$release"232 VENDOR_RELEASE="$release"
233 if [[ "x$VENDOR_RELEASE" == 'x12.04' ]]; then
234 VENDOR_RELEASE="precise"
235 elif [[ "x$VENDOR_RELEASE" == 'x12.10' ]]; then
236 VENDOR_RELEASE="quantal"
237 fi
195 ;;238 ;;
196 opensuse)239 opensuse)
197 VENDOR_RELEASE="$release"240 VENDOR_RELEASE="$release"
@@ -206,7 +249,7 @@
206}249}
207250
208251
209# Valid values are: apple, redhat, centos, canonical252# Valid values are: apple, redhat, centos, canonical, oracle, suse
210function set_VENDOR ()253function set_VENDOR ()
211{254{
212 local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'`255 local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'`
@@ -218,12 +261,30 @@
218 redhat)261 redhat)
219 VENDOR='redhat'262 VENDOR='redhat'
220 ;;263 ;;
264 fedora)
265 VENDOR='redhat'
266 ;;
267 redhat-release-server-*)
268 VENDOR='redhat'
269 ;;
270 enterprise-release-*)
271 VENDOR='oracle'
272 ;;
221 centos)273 centos)
222 VENDOR='centos'274 VENDOR='centos'
223 ;;275 ;;
224 canonical)276 canonical)
225 VENDOR='canonical'277 VENDOR='canonical'
226 ;;278 ;;
279 ubuntu)
280 VENDOR='canonical'
281 ;;
282 debian)
283 VENDOR='debian'
284 ;;
285 opensuse)
286 VENDOR='suse'
287 ;;
227 suse)288 suse)
228 VENDOR='suse'289 VENDOR='suse'
229 ;;290 ;;
@@ -234,6 +295,27 @@
234295
235 set_VENDOR_DISTRIBUTION $2296 set_VENDOR_DISTRIBUTION $2
236 set_VENDOR_RELEASE $3297 set_VENDOR_RELEASE $3
298
299 # Set which vendor/versions we trust for autoreconf
300 case $VENDOR_DISTRIBUTION in
301 fedora)
302 if [[ "x$VENDOR_RELEASE" == 'x18' ]]; then
303 AUTORECONF_REBUILD_HOST=true
304 elif [[ "x$VENDOR_RELEASE" == 'xsphericalcow' ]]; then
305 AUTORECONF_REBUILD_HOST=true
306 elif [[ "x$VENDOR_RELEASE" == 'x19' ]]; then
307 AUTORECONF_REBUILD_HOST=true
308 fi
309 ;;
310 canonical)
311 if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
312 AUTORECONF_REBUILD_HOST=true
313 elif [[ "x$VENDOR_RELEASE" == 'xquantal' ]]; then
314 AUTORECONF_REBUILD_HOST=true
315 fi
316 ;;
317 esac
318
237}319}
238320
239function determine_target_platform ()321function determine_target_platform ()
@@ -242,14 +324,14 @@
242 UNAME_KERNEL=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown324 UNAME_KERNEL=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
243 UNAME_KERNEL_RELEASE=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE=unknown325 UNAME_KERNEL_RELEASE=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE=unknown
244326
245 if [[ $(uname) == 'Darwin' ]]; then327 if [[ -x '/usr/bin/sw_vers' ]]; then
328 local _VERSION=`/usr/bin/sw_vers -productVersion`
329 set_VENDOR 'apple' 'darwin' $_VERSION
330 elif [[ $(uname) == 'Darwin' ]]; then
246 set_VENDOR 'apple' 'darwin' 'mountain'331 set_VENDOR 'apple' 'darwin' 'mountain'
247 elif [[ -f '/etc/fedora-release' ]]; then 332 elif [[ -f '/etc/fedora-release' ]]; then
248 local fedora_version=`cat /etc/fedora-release | awk ' { print $3 } '`333 local fedora_version=`cat /etc/fedora-release | awk ' { print $3 } '`
249 set_VENDOR 'redhat' 'fedora' $fedora_version334 set_VENDOR 'redhat' 'fedora' $fedora_version
250 if [[ "x$VENDOR_RELEASE" == 'x17' ]]; then
251 AUTORECONF_REBUILD_HOST=true
252 fi
253 elif [[ -f '/etc/centos-release' ]]; then335 elif [[ -f '/etc/centos-release' ]]; then
254 local centos_version=`cat /etc/centos-release | awk ' { print $7 } '`336 local centos_version=`cat /etc/centos-release | awk ' { print $7 } '`
255 set_VENDOR 'centos' 'rhel' $centos_version337 set_VENDOR 'centos' 'rhel' $centos_version
@@ -259,14 +341,18 @@
259 set_VENDOR 'suse' $suse_distribution $suse_version341 set_VENDOR 'suse' $suse_distribution $suse_version
260 elif [[ -f '/etc/redhat-release' ]]; then342 elif [[ -f '/etc/redhat-release' ]]; then
261 local rhel_version=`cat /etc/redhat-release | awk ' { print $7 } '`343 local rhel_version=`cat /etc/redhat-release | awk ' { print $7 } '`
262 set_VENDOR 'redhat' 'rhel' $rhel_version344 local _vendor=`rpm -qf /etc/redhat-release`
345 set_VENDOR $_vendor 'rhel' $rhel_version
346 elif [[ -f '/etc/os-release' ]]; then
347 source '/etc/os-release'
348 set_VENDOR $ID $ID $VERSION_ID
349 elif [[ -x '/usr/bin/lsb_release' ]]; then
350 local _ID=`/usr/bin/lsb_release -s -i`
351 local _VERSION=`/usr/bin/lsb_release -s -r`
352 set_VENDOR $_ID $_ID $_VERSION_ID
263 elif [[ -f '/etc/lsb-release' ]]; then 353 elif [[ -f '/etc/lsb-release' ]]; then
264 local debian_DISTRIB_ID=`cat /etc/lsb-release | grep DISTRIB_ID | awk -F= ' { print $2 } '`354 source '/etc/lsb-release'
265 local debian_version=`cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F= ' { print $2 } '`355 set_VENDOR 'canonical' $DISTRIB_ID $DISTRIB_CODENAME
266 set_VENDOR 'canonical' $debian_DISTRIB_ID $debian_version
267 if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
268 AUTORECONF_REBUILD_HOST=true
269 fi
270 fi356 fi
271357
272 rebuild_host_os358 rebuild_host_os
@@ -296,42 +382,48 @@
296 # Arguments for configure382 # Arguments for configure
297 local BUILD_CONFIGURE_ARG= 383 local BUILD_CONFIGURE_ARG=
298384
299 # Set ENV DEBUG in order to enable debugging385 # 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
300 if $DEBUG; then 386 # Set ENV ASSERT in order to enable assert.
301 BUILD_CONFIGURE_ARG='--enable-debug'387 # If we are doing a valgrind run, we always compile with assert disabled
302 fi388 if $valgrind_run; then
303389 BUILD_CONFIGURE_ARG+= " CXXFLAGS=-DNDEBUG "
304 # Set ENV ASSERT in order to enable assert390 BUILD_CONFIGURE_ARG+= " CFLAGS=-DNDEBUG "
305 if [[ -n "$ASSERT" ]]; then 391 else
306 local ASSERT_ARG=392 if $DEBUG; then
307 ASSERT_ARG='--enable-assert'393 BUILD_CONFIGURE_ARG+=' --enable-debug --enable-assert'
308 BUILD_CONFIGURE_ARG="$ASSERT_ARG $BUILD_CONFIGURE_ARG"394 elif [[ -n "$VCS_CHECKOUT" ]]; then
395 BUILD_CONFIGURE_ARG+=' --enable-assert'
396 fi
309 fi397 fi
310398
311 if [[ -n "$CONFIGURE_ARG" ]]; then 399 if [[ -n "$CONFIGURE_ARG" ]]; then
312 BUILD_CONFIGURE_ARG= "$BUILD_CONFIGURE_ARG $CONFIGURE_ARG"400 BUILD_CONFIGURE_ARG+=" $CONFIGURE_ARG"
401 fi
402
403 if [[ -n "$PREFIX_ARG" ]]; then
404 BUILD_CONFIGURE_ARG+=" $PREFIX_ARG"
313 fi405 fi
314406
315 ret=1;407 ret=1;
316 # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV408 # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
317 case $HOST_OS in409 case $HOST_OS in
318 *-darwin-*)410 *-darwin-*)
319 CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG $PREFIX_ARG"411 CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG"
320 ret=$?412 ret=$?
321 ;;413 ;;
322 rhel-5*)414 rhel-5*)
323 command_exists 'gcc44' || die "Could not locate gcc44"415 command_exists 'gcc44' || die "Could not locate gcc44"
324 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"416 CC=gcc44 CXX=gcc44 $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 configure $BUILD_CONFIGURE_ARG"
325 ret=$?417 ret=$?
326 ;;418 ;;
327 *)419 *)
328 $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG420 $CONFIGURE $BUILD_CONFIGURE_ARG
329 ret=$?421 ret=$?
330 ;;422 ;;
331 esac423 esac
332424
333 if [ $ret -ne 0 ]; then425 if [ $ret -ne 0 ]; then
334 die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG"426 die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG"
335 fi427 fi
336428
337 if [ ! -f 'Makefile' ]; then429 if [ ! -f 'Makefile' ]; then
@@ -353,7 +445,7 @@
353function setup_valgrind_command () {445function setup_valgrind_command () {
354 VALGRIND_PROGRAM=`type -p valgrind`446 VALGRIND_PROGRAM=`type -p valgrind`
355 if [[ -n "$VALGRIND_PROGRAM" ]]; then447 if [[ -n "$VALGRIND_PROGRAM" ]]; then
356 VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE"448 VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --malloc-fill=A5 --free-fill=DE --xml=yes --xml-file=\"valgrind-%p.xml\""
357 fi449 fi
358}450}
359451
@@ -367,6 +459,10 @@
367 die "OLD_CONFIGURE_ARG($OLD_CONFIGURE_ARG) was set on push, programmer error!"459 die "OLD_CONFIGURE_ARG($OLD_CONFIGURE_ARG) was set on push, programmer error!"
368 fi460 fi
369461
462 if [[ -n "$OLD_PREFIX" ]]; then
463 die "OLD_PREFIX($OLD_PREFIX) was set on push, programmer error!"
464 fi
465
370 if [[ -n "$OLD_MAKE" ]]; then466 if [[ -n "$OLD_MAKE" ]]; then
371 die "OLD_MAKE($OLD_MAKE) was set on push, programmer error!"467 die "OLD_MAKE($OLD_MAKE) was set on push, programmer error!"
372 fi468 fi
@@ -402,6 +498,10 @@
402 CONFIGURE_ARG=$OLD_CONFIGURE_ARG498 CONFIGURE_ARG=$OLD_CONFIGURE_ARG
403 fi499 fi
404500
501 if [[ -n "$OLD_PREFIX" ]]; then
502 PREFIX_ARG=$OLD_PREFIX
503 fi
504
405 if [[ -n "$OLD_MAKE" ]]; then505 if [[ -n "$OLD_MAKE" ]]; then
406 MAKE=$OLD_MAKE506 MAKE=$OLD_MAKE
407 fi507 fi
@@ -412,56 +512,11 @@
412512
413 OLD_CONFIGURE=513 OLD_CONFIGURE=
414 OLD_CONFIGURE_ARG=514 OLD_CONFIGURE_ARG=
515 OLD_PREFIX=
415 OLD_MAKE=516 OLD_MAKE=
416 OLD_TESTS_ENVIRONMENT=517 OLD_TESTS_ENVIRONMENT=
417 echo "reset happened"518
418}519 export -n CC CXX
419
420function push_PREFIX_ARG ()
421{
422 if [[ -n "$OLD_PREFIX_ARG" ]]; then
423 die "OLD_PREFIX_ARG was set on push, programmer error!"
424 fi
425
426 if [[ -n "$PREFIX_ARG" ]]; then
427 OLD_PREFIX_ARG=$PREFIX_ARG
428 PREFIX_ARG=
429 fi
430
431 if [[ -n "$1" ]]; then
432 PREFIX_ARG="--prefix=$1"
433 fi
434}
435
436function pop_PREFIX_ARG ()
437{
438 if [[ -n "$OLD_PREFIX_ARG" ]]; then
439 PREFIX_ARG=$OLD_PREFIX_ARG
440 OLD_PREFIX_ARG=
441 else
442 PREFIX_ARG=
443 fi
444}
445
446function push_TESTS_ENVIRONMENT ()
447{
448 if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
449 die "OLD_TESTS_ENVIRONMENT was set on push, programmer error!"
450 fi
451
452 if [[ -n "$TESTS_ENVIRONMENT" ]]; then
453 OLD_TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT
454 TESTS_ENVIRONMENT=
455 fi
456}
457
458function pop_TESTS_ENVIRONMENT ()
459{
460 TESTS_ENVIRONMENT=
461 if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
462 TESTS_ENVIRONMENT=$OLD_TESTS_ENVIRONMENT
463 OLD_TESTS_ENVIRONMENT=
464 fi
465}520}
466521
467function safe_pushd ()522function safe_pushd ()
@@ -490,11 +545,6 @@
490545
491function make_valgrind ()546function make_valgrind ()
492{547{
493 if [[ "$VENDOR_DISTRIBUTION" == 'darwin' ]]; then
494 make_darwin_malloc
495 return
496 fi
497
498 # If the env VALGRIND_COMMAND is set then we assume it is valid548 # If the env VALGRIND_COMMAND is set then we assume it is valid
499 local valgrind_was_set=false549 local valgrind_was_set=false
500 if [[ -z "$VALGRIND_COMMAND" ]]; then550 if [[ -z "$VALGRIND_COMMAND" ]]; then
@@ -512,10 +562,12 @@
512 return 1562 return 1
513 fi563 fi
514564
565 save_BUILD
566
567 valgrind_run=true
568
515 # If we are required to run configure, do so now569 # If we are required to run configure, do so now
516 run_configure_if_required570 run_configure
517
518 push_TESTS_ENVIRONMENT
519571
520 # If we don't have a configure, then most likely we will be missing libtool572 # If we don't have a configure, then most likely we will be missing libtool
521 assert_file 'configure'573 assert_file 'configure'
@@ -525,15 +577,29 @@
525 TESTS_ENVIRONMENT="$VALGRIND_COMMAND"577 TESTS_ENVIRONMENT="$VALGRIND_COMMAND"
526 fi578 fi
527579
528 make_target 'check' || return 1580 make_target 'check'
529581 ret=$?
530 pop_TESTS_ENVIRONMENT582
583 # If we aren't going to error, we will clean up our environment
584 if [ "$ret" -eq 0 ]; then
585 make 'distclean'
586 fi
587
588 valgrind_run=false
589
590 restore_BUILD
591
592 if [ "$ret" -ne 0 ]; then
593 return 1
594 fi
531}595}
532596
533function make_install_system ()597function make_install_system ()
534{598{
535 local INSTALL_LOCATION=$(mktemp -d /tmp/XXXXXXXXXX)599 local INSTALL_LOCATION=$(mktemp -d /tmp/XXXXXXXXXX)
536 push_PREFIX_ARG $INSTALL_LOCATION600
601 save_BUILD
602 PREFIX_ARG="--prefix=$INSTALL_LOCATION"
537603
538 if [ ! -d $INSTALL_LOCATION ] ; then604 if [ ! -d $INSTALL_LOCATION ] ; then
539 die "ASSERT temp directory not found '$INSTALL_LOCATION'"605 die "ASSERT temp directory not found '$INSTALL_LOCATION'"
@@ -541,17 +607,12 @@
541607
542 run_configure #install_buid_dir608 run_configure #install_buid_dir
543609
544 push_TESTS_ENVIRONMENT
545
546 make_target 'install'610 make_target 'install'
547611
548 make_target 'installcheck'612 make_target 'installcheck'
549613
550 make_target 'uninstall'614 make_target 'uninstall'
551615
552 pop_TESTS_ENVIRONMENT
553 pop_PREFIX_ARG
554
555 rm -r -f $INSTALL_LOCATION616 rm -r -f $INSTALL_LOCATION
556 make 'distclean'617 make 'distclean'
557618
@@ -559,6 +620,7 @@
559 die "ASSERT Makefile should not exist"620 die "ASSERT Makefile should not exist"
560 fi621 fi
561622
623 restore_BUILD
562 safe_popd624 safe_popd
563}625}
564626
@@ -625,7 +687,29 @@
625 return 0687 return 0
626}688}
627689
628function make_skeleton_mingw ()690function check_clang ()
691{
692 command_exists 'clang'
693 ret=$?
694 if [ "$ret" -ne 0 ]; then
695 return 1
696 fi
697
698 return 0
699}
700
701function check_clang_analyzer ()
702{
703 command_exists 'scan-build'
704 ret=$?
705 if [ "$ret" -ne 0 ]; then
706 return 1
707 fi
708
709 return 0
710}
711
712function make_skeleton ()
629{713{
630 run_configure714 run_configure
631 ret=$?715 ret=$?
@@ -642,8 +726,6 @@
642 if command_exists 'wine'; then726 if command_exists 'wine'; then
643 TESTS_ENVIRONMENT='wine'727 TESTS_ENVIRONMENT='wine'
644 fi728 fi
645 elif command_exists 'wineconsole'; then
646 TESTS_ENVIRONMENT='wineconsole --backend=curses'
647 fi729 fi
648730
649 if [[ -n "$TESTS_ENVIRONMENT" ]]; then731 if [[ -n "$TESTS_ENVIRONMENT" ]]; then
@@ -662,9 +744,8 @@
662744
663function make_for_mingw ()745function make_for_mingw ()
664{746{
665 check_mingw
666 if ! check_mingw; then747 if ! check_mingw; then
667 die 'mingw64 tools were not found'748 return 1
668 fi749 fi
669750
670 # Make sure it is clean751 # Make sure it is clean
@@ -678,10 +759,73 @@
678759
679 CONFIGURE='mingw64-configure'760 CONFIGURE='mingw64-configure'
680 MAKE='mingw64-make'761 MAKE='mingw64-make'
681 CONFIGURE_ARGS='--enable-static'762 CONFIGURE_ARGS='--enable-static --disable-shared'
682763
683 make_skeleton_mingw764 make_skeleton
684 ret=$?765 ret=$?
766
767 restore_BUILD
768
769 return $ret
770}
771
772function make_for_clang ()
773{
774 if ! check_clang; then
775 return 1
776 fi
777
778 # Make sure it is clean
779 if [ -f Makefile -o -f configure ]; then
780 make_maintainer_clean
781 fi
782
783 run_autoreconf
784
785 save_BUILD
786
787 CC=clang CXX=clang++
788 export CC CXX
789
790 make_skeleton
791 ret=$?
792
793 make_target 'check'
794
795 restore_BUILD
796
797 return $ret
798}
799
800function make_for_clang_analyzer ()
801{
802 if ! check_clang; then
803 return 1
804 fi
805
806 if ! check_clang_analyzer; then
807 die 'clang-analyzer was not found'
808 fi
809
810 # Make sure it is clean
811 if [ -f Makefile -o -f configure ]; then
812 make_maintainer_clean
813 fi
814
815 run_autoreconf
816
817 save_BUILD
818
819 CC=clang CXX=clang++
820 export CC CXX
821 CONFIGURE_ARGS='--enable-debug'
822
823 make_skeleton
824 ret=$?
825
826 make_target 'clean' 'warn'
827
828 scan-build -o clang-html make -j4 -k
685829
686 restore_BUILD830 restore_BUILD
687831
@@ -710,6 +854,8 @@
710 make_valgrind854 make_valgrind
711 make_gdb855 make_gdb
712 make_rpm856 make_rpm
857 make_for_clang
858 make_for_clang_analyzer
713859
714 if [ check_mingw -eq 0 ]; then860 if [ check_mingw -eq 0 ]; then
715 make_for_mingw861 make_for_mingw
@@ -815,11 +961,11 @@
815961
816function make_gdb ()962function make_gdb ()
817{963{
964 save_BUILD
965
818 if command_exists 'gdb'; then966 if command_exists 'gdb'; then
819 run_configure_if_required967 run_configure_if_required
820968
821 push_TESTS_ENVIRONMENT
822
823 # Set ENV GDB_COMMAND969 # Set ENV GDB_COMMAND
824 if [[ -z "$GDB_COMMAND" ]]; then970 if [[ -z "$GDB_COMMAND" ]]; then
825 setup_gdb_command971 setup_gdb_command
@@ -839,8 +985,6 @@
839 rm 'gdb.txt'985 rm 'gdb.txt'
840 fi986 fi
841987
842 pop_TESTS_ENVIRONMENT
843
844 if [ -f '.gdb_history' ]; then988 if [ -f '.gdb_history' ]; then
845 rm '.gdb_history'989 rm '.gdb_history'
846 fi990 fi
@@ -852,6 +996,8 @@
852 echo 'gdb was not present'996 echo 'gdb was not present'
853 return 1997 return 1
854 fi998 fi
999
1000 restore_BUILD
855}1001}
8561002
857# $1 target to compile1003# $1 target to compile
@@ -883,9 +1029,9 @@
8831029
884 if [ $ret -ne 0 ]; then1030 if [ $ret -ne 0 ]; then
885 if [ -n "$2" ]; then1031 if [ -n "$2" ]; then
886 warn "Cannot execute $MAKE $1: $ret"1032 warn "Failed to execute $MAKE $1: $ret"
887 else1033 else
888 die "Cannot execute $MAKE $1: $ret"1034 die "Failed to execute $MAKE $1: $ret"
889 fi1035 fi
890 fi1036 fi
8911037
@@ -951,6 +1097,13 @@
951 assert_file 'Makefile' 'configure did not produce a Makefile'1097 assert_file 'Makefile' 'configure did not produce a Makefile'
952}1098}
9531099
1100function run_make_maintainer_clean_if_possible ()
1101{
1102 if [ -f 'Makefile' ]; then
1103 make_maintainer_clean
1104 fi
1105}
1106
954function run_autoreconf_if_required () 1107function run_autoreconf_if_required ()
955{1108{
956 if [ ! -x 'configure' ]; then1109 if [ ! -x 'configure' ]; then
@@ -958,6 +1111,7 @@
958 fi1111 fi
9591112
960 assert_exec_file 'configure'1113 assert_exec_file 'configure'
1114 bash -n configure
961}1115}
9621116
963function run_autoreconf () 1117function run_autoreconf ()
@@ -971,7 +1125,7 @@
971 run $BOOTSTRAP_LIBTOOLIZE '--copy' '--install' '--force' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE"1125 run $BOOTSTRAP_LIBTOOLIZE '--copy' '--install' '--force' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE"
972 fi1126 fi
9731127
974 run $AUTORECONF || die "Cannot execute $AUTORECONF"1128 run $AUTORECONF $AUTORECONF_ARGS || die "Cannot execute $AUTORECONF"
9751129
976 eval 'bash -n configure' || die "autoreconf generated a malformed configure"1130 eval 'bash -n configure' || die "autoreconf generated a malformed configure"
977}1131}
@@ -1023,6 +1177,14 @@
1023 ;;1177 ;;
1024 h) # help1178 h) # help
1025 echo "bootstrap.sh [options] optional_target ..."1179 echo "bootstrap.sh [options] optional_target ..."
1180 echo " -a # Just run autoreconf";
1181 echo " -p # Print ENV";
1182 echo " -c # Just run configure";
1183 echo " -m # Just run maintainer-clean";
1184 echo " -t # Make target";
1185 echo " -d # Enable debug";
1186 echo " -h # Show help";
1187 echo " -v # Be more verbose in output";
1026 exit1188 exit
1027 ;;1189 ;;
1028 v) # verbose1190 v) # verbose
@@ -1057,6 +1219,8 @@
1057 VCS_CHECKOUT=svn1219 VCS_CHECKOUT=svn
1058 elif [[ -d '.hg' ]]; then1220 elif [[ -d '.hg' ]]; then
1059 VCS_CHECKOUT=hg1221 VCS_CHECKOUT=hg
1222 else
1223 VCS_CHECKOUT=
1060 fi1224 fi
10611225
1062 if [[ -n "$VCS_CHECKOUT" ]]; then1226 if [[ -n "$VCS_CHECKOUT" ]]; then
@@ -1122,6 +1286,7 @@
11221286
1123 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then1287 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
1124 echo "Couldn't find user supplied libtoolize, it is required"1288 echo "Couldn't find user supplied libtoolize, it is required"
1289 return 1
1125 fi1290 fi
1126 else1291 else
1127 # If we are using OSX, we first check to see glibtoolize is available1292 # If we are using OSX, we first check to see glibtoolize is available
@@ -1130,21 +1295,27 @@
11301295
1131 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then1296 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
1132 echo "Couldn't find glibtoolize, it is required on OSX"1297 echo "Couldn't find glibtoolize, it is required on OSX"
1298 return 1
1133 fi1299 fi
1134 else1300 else
1135 BOOTSTRAP_LIBTOOLIZE=`type -p libtoolize`1301 BOOTSTRAP_LIBTOOLIZE=`type -p libtoolize`
11361302
1137 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then1303 if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
1138 echo "Couldn't find libtoolize, it is required"1304 echo "Couldn't find libtoolize, it is required"
1305 return 1
1139 fi1306 fi
1140 fi1307 fi
1141 fi1308 fi
1309
1142 if $VERBOSE; then1310 if $VERBOSE; then
1143 LIBTOOLIZE_OPTIONS="--verbose $BOOTSTRAP_LIBTOOLIZE_OPTIONS"1311 LIBTOOLIZE_OPTIONS="--verbose $BOOTSTRAP_LIBTOOLIZE_OPTIONS"
1144 fi1312 fi
1313
1145 if $DEBUG; then1314 if $DEBUG; then
1146 LIBTOOLIZE_OPTIONS="--debug $BOOTSTRAP_LIBTOOLIZE_OPTIONS"1315 LIBTOOLIZE_OPTIONS="--debug $BOOTSTRAP_LIBTOOLIZE_OPTIONS"
1147 fi1316 fi
1317
1318 # Here we set LIBTOOLIZE to true since we are going to invoke it via BOOTSTRAP_LIBTOOLIZE
1148 LIBTOOLIZE=true1319 LIBTOOLIZE=true
1149 fi1320 fi
11501321
@@ -1182,7 +1353,7 @@
1182 fi1353 fi
11831354
1184 if [[ -n "$GNU_BUILD_FLAGS" ]]; then1355 if [[ -n "$GNU_BUILD_FLAGS" ]]; then
1185 AUTORECONF="$AUTORECONF $GNU_BUILD_FLAGS"1356 AUTORECONF_ARGS="$GNU_BUILD_FLAGS"
1186 fi1357 fi
1187 fi1358 fi
11881359
@@ -1200,6 +1371,9 @@
1200 echo 'BOOTSTRAP ENV' 1371 echo 'BOOTSTRAP ENV'
1201 echo "AUTORECONF=$AUTORECONF"1372 echo "AUTORECONF=$AUTORECONF"
1202 echo "HOST_OS=$HOST_OS"1373 echo "HOST_OS=$HOST_OS"
1374 echo "VENDOR=$VENDOR"
1375 echo "VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION"
1376 echo "VENDOR_RELEASE=$VENDOR_RELEASE"
12031377
1204 echo "getopt()"1378 echo "getopt()"
1205 if $AUTORECONF_OPTION; then1379 if $AUTORECONF_OPTION; then
@@ -1333,18 +1507,25 @@
1333 ;;1507 ;;
1334 'make_default')1508 'make_default')
1335 ;;1509 ;;
1336 'test-*')1510 'clang')
1337 ;;1511 ;;
1338 'valgrind-*')1512 'clang-analyzer')
1339 ;;1513 ;;
1340 'gdb-*')1514 test-*)
1515 ;;
1516 valgrind-*)
1517 ;;
1518 gdb-*)
1341 ;;1519 ;;
1342 'dist')1520 'dist')
1343 ;;1521 ;;
1344 *)1522 *)
1345 die "Unknown MAKE_TARGET option: $1"1523 echo "Matched default"
1524 return 1
1346 ;;1525 ;;
1347 esac1526 esac
1527
1528 return 0
1348}1529}
13491530
1350function bootstrap ()1531function bootstrap ()
@@ -1355,7 +1536,9 @@
13551536
1356 # Set up whatever we need to do to use autoreconf later1537 # Set up whatever we need to do to use autoreconf later
1357 require_libtoolise1538 require_libtoolise
1358 autoreconf_setup1539 if ! autoreconf_setup; then
1540 return 1
1541 fi
13591542
1360 if [ -z "$MAKE_TARGET" ]; then1543 if [ -z "$MAKE_TARGET" ]; then
1361 MAKE_TARGET="make_default"1544 MAKE_TARGET="make_default"
@@ -1377,7 +1560,7 @@
13771560
1378 # Set ENV PREFIX in order to set --prefix for ./configure1561 # Set ENV PREFIX in order to set --prefix for ./configure
1379 if [[ -n "$PREFIX" ]]; then 1562 if [[ -n "$PREFIX" ]]; then
1380 push_PREFIX_ARG $PREFIX1563 PREFIX_ARG="--prefix=$PREFIX"
1381 fi1564 fi
13821565
1383 # We should always have a target by this point1566 # We should always have a target by this point
@@ -1390,8 +1573,15 @@
1390 # If we are running inside of Jenkins, we want to only run some of the possible tests1573 # If we are running inside of Jenkins, we want to only run some of the possible tests
1391 if $jenkins_build_environment; then1574 if $jenkins_build_environment; then
1392 check_make_target $target1575 check_make_target $target
1576 ret=$?
1577 if [ $ret -ne 0 ]; then
1578 die "Unknown MAKE_TARGET option: $target"
1579 fi
1393 fi1580 fi
13941581
1582 local snapshot_run=false
1583 local valgrind_run=false
1584
1395 case $target in1585 case $target in
1396 'self')1586 'self')
1397 self_test1587 self_test
@@ -1417,26 +1607,48 @@
1417 'make_default')1607 'make_default')
1418 make_default1608 make_default
1419 ;;1609 ;;
1610 'clang')
1611 if ! check_clang; then
1612 die "clang was not found"
1613 fi
1614
1615 if ! make_for_clang; then
1616 die "Failed to build clang: $?"
1617 fi
1618 ;;
1619 'clang-analyzer')
1620 if ! check_clang_analyzer; then
1621 die "clang-analyzer was not found"
1622 fi
1623 if ! check_clang; then
1624 die "clang was not found"
1625 fi
1626
1627 if ! make_for_clang_analyzer; then
1628 die "Failed to build clang-analyzer: $?"
1629 fi
1630 ;;
1420 'mingw')1631 'mingw')
1421 check_mingw
1422 if ! check_mingw; then1632 if ! check_mingw; then
1423 die "mingw was not found"1633 die "mingw was not found"
1424 fi1634 fi
14251635
1426 make_for_mingw
1427 check_ret=$?
1428
1429 if ! make_for_mingw; then1636 if ! make_for_mingw; then
1430 die "Failed to build mingw: $?"1637 die "Failed to build mingw: $?"
1431 fi1638 fi
1432 ;;1639 ;;
1433 'snapshot')1640 'snapshot')
1434 make_for_snapshot1641 make_for_snapshot
1642 snapshot_run=true
1435 ;;1643 ;;
1436 'rpm')1644 'rpm')
1437 make_rpm1645 make_rpm
1438 ;;1646 ;;
1647 'darwin_malloc')
1648 make_darwin_malloc
1649 ;;
1439 'valgrind')1650 'valgrind')
1651 make_maintainer_clean
1440 make_valgrind1652 make_valgrind
1441 ;;1653 ;;
1442 'universe')1654 'universe')
@@ -1450,6 +1662,13 @@
1450 make_target "$target"1662 make_target "$target"
1451 ;;1663 ;;
1452 esac1664 esac
1665
1666 if $jenkins_build_environment; then
1667 if ! $snapshot_run; then
1668 run_make_maintainer_clean_if_possible
1669 fi
1670 fi
1671
1453 done1672 done
1454}1673}
14551674
@@ -1474,6 +1693,7 @@
14741693
1475 local OLD_CONFIGURE=1694 local OLD_CONFIGURE=
1476 local OLD_CONFIGURE_ARG=1695 local OLD_CONFIGURE_ARG=
1696 local OLD_PREFIX=
1477 local OLD_MAKE=1697 local OLD_MAKE=
1478 local OLD_TESTS_ENVIRONMENT=1698 local OLD_TESTS_ENVIRONMENT=
14791699
@@ -1517,7 +1737,16 @@
1517 # We don't want Jenkins overriding other variables, so we NULL them.1737 # We don't want Jenkins overriding other variables, so we NULL them.
1518 if [ -z "$MAKE_TARGET" ]; then1738 if [ -z "$MAKE_TARGET" ]; then
1519 if $jenkins_build_environment; then1739 if $jenkins_build_environment; then
1520 MAKE_TARGET='jenkins'1740 if [[ -n "$label" ]]; then
1741 check_make_target $label
1742 if [ $? -eq 0 ]; then
1743 MAKE_TARGET="$label"
1744 fi
1745 fi
1746
1747 if [ -z "$MAKE_TARGET" ]; then
1748 MAKE_TARGET='check'
1749 fi
1521 fi1750 fi
1522 fi1751 fi
15231752
@@ -1620,11 +1849,13 @@
1620export AUTOM4TE1849export AUTOM4TE
1621export AUTOMAKE1850export AUTOMAKE
1622export AUTORECONF1851export AUTORECONF
1852export CONFIGURE_ARG
1623export DEBUG1853export DEBUG
1624export GNU_BUILD_FLAGS1854export GNU_BUILD_FLAGS
1625export LIBTOOLIZE1855export LIBTOOLIZE
1626export LIBTOOLIZE_OPTIONS1856export LIBTOOLIZE_OPTIONS
1627export MAKE1857export MAKE
1858export PREFIX_ARG
1628export TESTS_ENVIRONMENT1859export TESTS_ENVIRONMENT
1629export VERBOSE1860export VERBOSE
1630export WARNINGS1861export WARNINGS
16311862
=== modified file 'configure.ac'
--- configure.ac 2013-04-25 10:26:18 +0000
+++ configure.ac 2013-04-27 15:24:24 +0000
@@ -44,6 +44,9 @@
44LT_INIT44LT_INIT
45LT_LANG([C++])45LT_LANG([C++])
4646
47AC_PROG_CC_C99
48AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])])
49
47AX_PLATFORM50AX_PLATFORM
48AX_ASSERT51AX_ASSERT
4952
5053
=== modified file 'm4/ax_harden_compiler_flags.m4'
--- m4/ax_harden_compiler_flags.m4 2013-04-26 19:50:55 +0000
+++ m4/ax_harden_compiler_flags.m4 2013-04-27 15:24:24 +0000
@@ -1,3 +1,4 @@
1# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
1# ===========================================================================2# ===========================================================================
2# https://github.com/BrianAker/ddm4/3# https://github.com/BrianAker/ddm4/
3# ===========================================================================4# ===========================================================================
@@ -14,7 +15,7 @@
14#15#
15# LICENSE16# LICENSE
16#17#
17# Copyright (C) 2012 Brian Aker18# Copyright (C) 2012-2013 Brian Aker
18# All rights reserved.19# All rights reserved.
19#20#
20# Redistribution and use in source and binary forms, with or without21# Redistribution and use in source and binary forms, with or without
@@ -52,7 +53,7 @@
52# ? _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for53# ? _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for
53# compatibility issues memcached_stat_st54# compatibility issues memcached_stat_st
5455
55#serial 756#serial 9
5657
57AC_DEFUN([_WARNINGS_AS_ERRORS],58AC_DEFUN([_WARNINGS_AS_ERRORS],
58 [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],59 [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],
@@ -75,10 +76,11 @@
75# Everything above this does the heavy lifting, while what follows does the specifics.76# Everything above this does the heavy lifting, while what follows does the specifics.
7677
77AC_DEFUN([_HARDEN_LINKER_FLAGS],78AC_DEFUN([_HARDEN_LINKER_FLAGS],
78 [_APPEND_LINK_FLAGS_ERROR([-z relro -z now])79 [
79 #_APPEND_LINK_FLAGS_ERROR([-pie])80 AS_IF([test "$CC" != "clang"],
80 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],81 [_APPEND_LINK_FLAGS_ERROR([-z relro -z now])
81 [AX_APPEND_LINK_FLAGS([-Werror])])82 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],
83 [AX_APPEND_LINK_FLAGS([-Werror])])])
82 ])84 ])
8385
84AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],86AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],
@@ -86,27 +88,37 @@
8688
87 AS_IF([test "x$ax_enable_debug" = xyes],89 AS_IF([test "x$ax_enable_debug" = xyes],
88 [CFLAGS=''90 [CFLAGS=''
91 _APPEND_COMPILE_FLAGS_ERROR([-H])
89 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])92 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
90 _APPEND_COMPILE_FLAGS_ERROR([-g])93 _APPEND_COMPILE_FLAGS_ERROR([-g])
91 _APPEND_COMPILE_FLAGS_ERROR([-O0])],94 _APPEND_COMPILE_FLAGS_ERROR([-O0]),
92 [_APPEND_COMPILE_FLAGS_ERROR([-g])95 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
93 _APPEND_COMPILE_FLAGS_ERROR([-O2])])96 ],[
97 _APPEND_COMPILE_FLAGS_ERROR([-g])
98 _APPEND_COMPILE_FLAGS_ERROR([-O2])
99 ])
94100
95 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],101 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
96 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])],102 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
97 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])103 _APPEND_COMPILE_FLAGS_ERROR([-Wpragmas])
104 _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])],
105 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
106 _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])
107
108 AS_IF([test "$CC" = "clang"],
109 [_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
98110
99 _APPEND_COMPILE_FLAGS_ERROR([-Wall])111 _APPEND_COMPILE_FLAGS_ERROR([-Wall])
100 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])112 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])
101 _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])
102 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])113 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
103 _APPEND_COMPILE_FLAGS_ERROR([-std=c99])114 _APPEND_COMPILE_FLAGS_ERROR([-std=c99])
104# Anything below this comment please keep sorted.115# Anything below this comment please keep sorted.
105 AS_IF([test "x$CC_VERSION_VENDOR" != xclang],
106 [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], [])
107# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])116# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
117 _APPEND_COMPILE_FLAGS_ERROR([-Wunsuffixed-float-constants])
118 _APPEND_COMPILE_FLAGS_ERROR([-Wjump-misses-init])
108 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])119 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])
109 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])120 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])
121 _APPEND_COMPILE_FLAGS_ERROR([-Wvarargs])
110 _APPEND_COMPILE_FLAGS_ERROR([-Warray-bounds])122 _APPEND_COMPILE_FLAGS_ERROR([-Warray-bounds])
111 _APPEND_COMPILE_FLAGS_ERROR([-Wbad-function-cast])123 _APPEND_COMPILE_FLAGS_ERROR([-Wbad-function-cast])
112# Not in use -Wc++-compat124# Not in use -Wc++-compat
@@ -115,6 +127,7 @@
115 _APPEND_COMPILE_FLAGS_ERROR([-Wfloat-equal])127 _APPEND_COMPILE_FLAGS_ERROR([-Wfloat-equal])
116 _APPEND_COMPILE_FLAGS_ERROR([-Wformat-security])128 _APPEND_COMPILE_FLAGS_ERROR([-Wformat-security])
117 _APPEND_COMPILE_FLAGS_ERROR([-Wformat=2])129 _APPEND_COMPILE_FLAGS_ERROR([-Wformat=2])
130 _APPEND_COMPILE_FLAGS_ERROR([-Wformat-y2k])
118 _APPEND_COMPILE_FLAGS_ERROR([-Wlogical-op])131 _APPEND_COMPILE_FLAGS_ERROR([-Wlogical-op])
119 _APPEND_COMPILE_FLAGS_ERROR([-Wmaybe-uninitialized])132 _APPEND_COMPILE_FLAGS_ERROR([-Wmaybe-uninitialized])
120 _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-field-initializers])133 _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-field-initializers])
@@ -124,7 +137,6 @@
124 _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-prototypes])137 _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-prototypes])
125 _APPEND_COMPILE_FLAGS_ERROR([-Wnested-externs])138 _APPEND_COMPILE_FLAGS_ERROR([-Wnested-externs])
126 _APPEND_COMPILE_FLAGS_ERROR([-Wnormalized=id])139 _APPEND_COMPILE_FLAGS_ERROR([-Wnormalized=id])
127 _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-definition])
128 _APPEND_COMPILE_FLAGS_ERROR([-Woverride-init])140 _APPEND_COMPILE_FLAGS_ERROR([-Woverride-init])
129 _APPEND_COMPILE_FLAGS_ERROR([-Wpointer-arith])141 _APPEND_COMPILE_FLAGS_ERROR([-Wpointer-arith])
130 _APPEND_COMPILE_FLAGS_ERROR([-Wpointer-sign])142 _APPEND_COMPILE_FLAGS_ERROR([-Wpointer-sign])
@@ -141,15 +153,48 @@
141 _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-overflow=1])153 _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-overflow=1])
142 _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-prototypes])154 _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-prototypes])
143 _APPEND_COMPILE_FLAGS_ERROR([-Wswitch-enum])155 _APPEND_COMPILE_FLAGS_ERROR([-Wswitch-enum])
156 _APPEND_COMPILE_FLAGS_ERROR([-Wtrampolines])
144 _APPEND_COMPILE_FLAGS_ERROR([-Wundef])157 _APPEND_COMPILE_FLAGS_ERROR([-Wundef])
158 _APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations])
159 _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
160 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
161 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
162 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
163 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
164 AS_IF([test "x$enable_shared" = "xyes"],[
165 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
166 ])
167 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
168 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
169 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
170 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
171 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
172 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
173 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
174 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
175 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
176 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
177 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
178 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
179 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
180 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
181 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
182 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
183 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
184 ])
185 _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
145 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])186 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])
146 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])187 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])
147 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-variable])188 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-variable])
189 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-parameter])
190 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-local-typedefs])
148 _APPEND_COMPILE_FLAGS_ERROR([-Wwrite-strings])191 _APPEND_COMPILE_FLAGS_ERROR([-Wwrite-strings])
149 _APPEND_COMPILE_FLAGS_ERROR([-floop-parallelize-all])192 _APPEND_COMPILE_FLAGS_ERROR([-floop-parallelize-all])
150 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])193 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
151 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])194 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
152 _APPEND_COMPILE_FLAGS_ERROR([-pipe])195 _APPEND_COMPILE_FLAGS_ERROR([-pipe])
196 _APPEND_COMPILE_FLAGS_ERROR([-fPIE -pie])
197 _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
153198
154 AS_IF([test "x$ax_enable_debug" = xno],199 AS_IF([test "x$ax_enable_debug" = xno],
155 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],200 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
@@ -157,7 +202,7 @@
157 [AS_IF([test "x$ac_c_gcc_recent" = xyes],202 [AS_IF([test "x$ac_c_gcc_recent" = xyes],
158 [_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2])203 [_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2])
159 #_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector])204 #_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector])
160 #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector])205 #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector --param=ssp-buffer-size=4])
161 _APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all])206 _APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all])
162 ])])])])207 ])])])])
163208
@@ -173,25 +218,33 @@
173218
174 AS_IF([test "x$ax_enable_debug" = xyes],219 AS_IF([test "x$ax_enable_debug" = xyes],
175 [CXXFLAGS=''220 [CXXFLAGS=''
221 _APPEND_COMPILE_FLAGS_ERROR([-H])
176 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])222 _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
177 _APPEND_COMPILE_FLAGS_ERROR([-g])223 _APPEND_COMPILE_FLAGS_ERROR([-g])
178 _APPEND_COMPILE_FLAGS_ERROR([-O0])],224 _APPEND_COMPILE_FLAGS_ERROR([-O0]),
179 [_APPEND_COMPILE_FLAGS_ERROR([-g])225 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
180 _APPEND_COMPILE_FLAGS_ERROR([-O2])])226 ],[
227 _APPEND_COMPILE_FLAGS_ERROR([-g])
228 _APPEND_COMPILE_FLAGS_ERROR([-O2])
229 ])
181230
182 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],231 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
183 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])],232 [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
184 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])233 _APPEND_COMPILE_FLAGS_ERROR([-Wpragmas])
234 _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])],
235 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
236 _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])
237
238 AS_IF([test "$CXX" = "clang++"],
239 [_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
185240
186 _APPEND_COMPILE_FLAGS_ERROR([-Wall])241 _APPEND_COMPILE_FLAGS_ERROR([-Wall])
187 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])242 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])
188 _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])
189 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])243 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
190# Anything below this comment please keep sorted.244# Anything below this comment please keep sorted.
191 AS_IF([test "x$CXX_VERSION_VENDOR" != xclang],
192 [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], [])
193# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])245# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
194 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])246 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])
247 _APPEND_COMPILE_FLAGS_ERROR([-Wvarargs])
195 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])248 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])
196 _APPEND_COMPILE_FLAGS_ERROR([-Warray-bounds])249 _APPEND_COMPILE_FLAGS_ERROR([-Warray-bounds])
197 _APPEND_COMPILE_FLAGS_ERROR([-Wchar-subscripts])250 _APPEND_COMPILE_FLAGS_ERROR([-Wchar-subscripts])
@@ -199,6 +252,7 @@
199 _APPEND_COMPILE_FLAGS_ERROR([-Wctor-dtor-privacy])252 _APPEND_COMPILE_FLAGS_ERROR([-Wctor-dtor-privacy])
200 _APPEND_COMPILE_FLAGS_ERROR([-Wfloat-equal])253 _APPEND_COMPILE_FLAGS_ERROR([-Wfloat-equal])
201 _APPEND_COMPILE_FLAGS_ERROR([-Wformat=2])254 _APPEND_COMPILE_FLAGS_ERROR([-Wformat=2])
255 _APPEND_COMPILE_FLAGS_ERROR([-Wformat-y2k])
202 _APPEND_COMPILE_FLAGS_ERROR([-Wmaybe-uninitialized])256 _APPEND_COMPILE_FLAGS_ERROR([-Wmaybe-uninitialized])
203 _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-field-initializers])257 _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-field-initializers])
204 _APPEND_COMPILE_FLAGS_ERROR([-Wlogical-op])258 _APPEND_COMPILE_FLAGS_ERROR([-Wlogical-op])
@@ -219,17 +273,52 @@
219 _APPEND_COMPILE_FLAGS_ERROR([-Wsign-compare])273 _APPEND_COMPILE_FLAGS_ERROR([-Wsign-compare])
220 _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-overflow=1])274 _APPEND_COMPILE_FLAGS_ERROR([-Wstrict-overflow=1])
221 _APPEND_COMPILE_FLAGS_ERROR([-Wswitch-enum])275 _APPEND_COMPILE_FLAGS_ERROR([-Wswitch-enum])
276 _APPEND_COMPILE_FLAGS_ERROR([-Wtrampolines])
222 _APPEND_COMPILE_FLAGS_ERROR([-Wundef])277 _APPEND_COMPILE_FLAGS_ERROR([-Wundef])
278 _APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations])
279 _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
223 _APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat])280 _APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat])
281# _APPEND_COMPILE_FLAGS_ERROR([-Weffc++])
282 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
283 _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
284 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
285 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
286 AS_IF([test "x$enable_shared" = "xyes"],[
287 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
288 ])
289 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
290 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
291 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
292 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
293 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
294 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
295 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
296 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
297 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
298 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
299 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
300 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
301 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
302 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
303 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
304 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
305 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
306 ])
307# _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast])
308 _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
224 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])309 _APPEND_COMPILE_FLAGS_ERROR([-Wunused])
225 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])310 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])
226 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-variable])311 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-variable])
312 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-parameter])
313 _APPEND_COMPILE_FLAGS_ERROR([-Wunused-local-typedefs])
227 _APPEND_COMPILE_FLAGS_ERROR([-Wwrite-strings])314 _APPEND_COMPILE_FLAGS_ERROR([-Wwrite-strings])
228 _APPEND_COMPILE_FLAGS_ERROR([-Wformat-security])315 _APPEND_COMPILE_FLAGS_ERROR([-Wformat-security])
229 _APPEND_COMPILE_FLAGS_ERROR([-floop-parallelize-all])316 _APPEND_COMPILE_FLAGS_ERROR([-floop-parallelize-all])
230 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])317 _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
231 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])318 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
232 _APPEND_COMPILE_FLAGS_ERROR([-pipe])319 _APPEND_COMPILE_FLAGS_ERROR([-pipe])
320 _APPEND_COMPILE_FLAGS_ERROR([-fPIE -pie])
321 _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
233322
234 AS_IF([test "x$ax_enable_debug" = xno],323 AS_IF([test "x$ax_enable_debug" = xno],
235 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],324 [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
@@ -237,7 +326,7 @@
237 [AS_IF([test "x$ac_c_gcc_recent" = xyes],326 [AS_IF([test "x$ac_c_gcc_recent" = xyes],
238 [_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2])327 [_APPEND_COMPILE_FLAGS_ERROR([-D_FORTIFY_SOURCE=2])
239 #_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector])328 #_APPEND_COMPILE_FLAGS_ERROR([-Wstack-protector])
240 #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector])329 #_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector --param=ssp-buffer-size=4])
241 _APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all])330 _APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all])
242 ])])])])331 ])])])])
243332

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: