Skip to content

Commit 7e7b3e4

Browse files
committed
build: add and use C_STANDARD in depends
1 parent 8035b5c commit 7e7b3e4

File tree

10 files changed

+24
-16
lines changed

10 files changed

+24
-16
lines changed

depends/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ MULTIPROCESS ?=
4545
LTO ?=
4646
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
4747

48+
C_STANDARD ?= c11
49+
4850
BUILD = $(shell ./config.guess)
4951
HOST ?= $(BUILD)
5052
PATCHES_PATH = $(BASEDIR)/patches

depends/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ The following can be set when running make: `make FOO=bar`
9696
- `BASE_CACHE`: Built packages will be placed here
9797
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
9898
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
99+
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
99100
- `NO_QT`: Don't download/build/cache Qt and its dependencies
100101
- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode
101102
- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ

depends/hosts/android.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang++
66
android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang
77
endif
88

9+
android_CFLAGS=-std=$(C_STANDARD)
10+
911
ifneq ($(LTO),)
1012
android_CFLAGS += -flto
1113
android_LDFLAGS += -flto

depends/hosts/darwin.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
109109
-Xclang -internal-externc-isystem$(clang_resource_dir)/include \
110110
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
111111

112-
darwin_CFLAGS=-pipe
112+
darwin_CFLAGS=-pipe -std=$(C_STANDARD)
113+
darwin_CXXFLAGS=-pipe
113114

114115
ifneq ($(LTO),)
115116
darwin_CFLAGS += -flto
117+
darwin_CXXFLAGS += -flto
116118
darwin_LDFLAGS += -flto
117119
endif
118120

119-
darwin_CXXFLAGS=$(darwin_CFLAGS)
120-
121121
darwin_release_CFLAGS=-O2
122122
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
123123

depends/hosts/freebsd.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
freebsd_CFLAGS=-pipe
1+
freebsd_CFLAGS=-pipe -std=$(C_STANDARD)
2+
freebsd_CXXFLAGS=-pipe
23

34
ifneq ($(LTO),)
45
freebsd_CFLAGS += -flto
6+
freebsd_CXXFLAGS += -flto
57
freebsd_LDFLAGS += -flto
68
endif
79

8-
freebsd_CXXFLAGS=$(freebsd_CFLAGS)
9-
1010
freebsd_release_CFLAGS=-O2
1111
freebsd_release_CXXFLAGS=$(freebsd_release_CFLAGS)
1212

depends/hosts/linux.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
linux_CFLAGS=-pipe
1+
linux_CFLAGS=-pipe -std=$(C_STANDARD)
2+
linux_CXXFLAGS=-pipe
23

34
ifneq ($(LTO),)
45
linux_CFLAGS += -flto
6+
linux_CXXFLAGS += -flto
57
linux_LDFLAGS += -flto
68
endif
79

8-
linux_CXXFLAGS=$(linux_CFLAGS)
9-
1010
linux_release_CFLAGS=-O2
1111
linux_release_CXXFLAGS=$(linux_release_CFLAGS)
1212

depends/hosts/mingw32.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),)
22
mingw32_CXX := $(host)-g++-posix
33
endif
44

5-
mingw32_CFLAGS=-pipe
5+
mingw32_CFLAGS=-pipe -std=$(C_STANDARD)
6+
mingw32_CXXFLAGS=-pipe
67

78
ifneq ($(LTO),)
89
mingw32_CFLAGS += -flto
10+
mingw32_CXXFLAGS += -flto
911
mingw32_LDFLAGS += -flto
1012
endif
1113

12-
mingw32_CXXFLAGS=$(mingw32_CFLAGS)
13-
1414
mingw32_release_CFLAGS=-O2
1515
mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)
1616

depends/hosts/netbsd.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
netbsd_CFLAGS=-pipe
1+
netbsd_CFLAGS=-pipe -std=$(C_STANDARD)
2+
netbsd_CXXFLAGS=-pipe
23

34
ifneq ($(LTO),)
45
netbsd_CFLAGS += -flto
6+
netbsd_CXXFLAGS += -flto
57
netbsd_LDFLAGS += -flto
68
endif
79

depends/hosts/openbsd.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
openbsd_CFLAGS=-pipe
2-
openbsd_CXXFLAGS=$(openbsd_CFLAGS)
1+
openbsd_CFLAGS=-pipe -std=$(C_STANDARD)
2+
openbsd_CXXFLAGS=-pipe
33

44
ifneq ($(LTO),)
55
openbsd_CFLAGS += -flto
6+
openbsd_CXXFLAGS += -flto
67
openbsd_LDFLAGS += -flto
78
endif
89

depends/patches/qt/mac-qmake.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION}
1515
QMAKE_MAC_SDK.macosx.PlatformPath = /phony
1616
!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET}
1717
!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS
18-
!host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS
18+
!host_build: QMAKE_CXXFLAGS += -target $${MAC_TARGET}
1919
!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET}
2020
QMAKE_AR = $${CROSS_COMPILE}ar cq
2121
QMAKE_RANLIB=$${CROSS_COMPILE}ranlib

0 commit comments

Comments
 (0)