Commit Graph

5 Commits

Author SHA1 Message Date
David Sterba 18e12e95ab btrfs-progs: build: fix detection of std=gnu11 build
Commit 0d5767e664 ("btrfs-progs: build: use -std=gnu11") was supposed
to set C level to gnu11 to match kernel but it was done only in the C=1
(checker) branch. The std used was still gnu90 that can be verified by
running with V=1.

Set the std option to gnu11 unconditionally and delete the m4 macros
that were detecting support on older gcc (4.5). The reference build on
lowest supported distro (Centos 7) compiles fine.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-02-28 19:49:30 +01:00
David Sterba ad1ed616f1 btrfs-progs: build: add m4 macros for builtin detection
Use the autoconf archive macros for gcc builtin detection and add the
overflow from recently added from kernel.

New:
__builtin_add_overflow
__builtin_sub_overflow
__builtin_mul_overflow

Signed-off-by: David Sterba <dsterba@suse.com>
2022-08-16 15:18:12 +02:00
Adam Borowski c615287cc0 btrfs-progs: a bunch of typo fixes
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-01-13 22:33:10 +01:00
Jeff Mahoney eb7b42003a btrfs-progs: build: detect whether -std=gnu90 is supported
GCC releases prior to 4.5.0 don't support -std=gnu90 so btrfs-progs won't
build at all on older distros.  We can detect whether the compiler
supports -std=gnu90 and fall back to -std=gnu89 if it doesn't.

AX_CHECK_COMPILE_FLAG is the right way to do this, but it depends on
autoconf 2.64.  AX_GCC_VERSION has been deprecated, so we'll use that
only for earlier autoconf versions so we can drop it when we drop
support for older autoconf releases.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:35 +02:00
David Sterba af62507bed btrfs-progs: build: add m4 macros for AC_CHECK_DEFINE
Signed-off-by: David Sterba <dsterba@suse.com>
2016-06-24 14:05:44 +02:00