diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile index 5f93075db..0de02a78b 100644 --- a/contrib/depends/Makefile +++ b/contrib/depends/Makefile @@ -8,6 +8,9 @@ SOURCES_PATH ?= $(BASEDIR)/sources BASE_CACHE ?= $(BASEDIR)/built FALLBACK_DOWNLOAD_PATH ?= https://downloads.getmonero.org/depends-sources +C_STANDARD ?= c11 +CXX_STANDARD ?= c++17 + BUILD = $(shell ./config.guess) HOST ?= $(BUILD) PATCHES_PATH = $(BASEDIR)/patches diff --git a/contrib/depends/hosts/android.mk b/contrib/depends/hosts/android.mk index a7989100a..77dc3c3cc 100644 --- a/contrib/depends/hosts/android.mk +++ b/contrib/depends/hosts/android.mk @@ -16,8 +16,8 @@ android_CXX=$(clear_guix_env) $(build_prefix)/bin/$(host_toolchain)clang++ android_AR=llvm-ar android_RANLIB=llvm-ranlib -android_CFLAGS=-pipe -android_CXXFLAGS=$(android_CFLAGS) +android_CFLAGS=-pipe -std=$(C_STANDARD) +android_CXXFLAGS=-pipe -std=$(CXX_STANDARD) android_ARFLAGS=crsD android_release_CFLAGS=-O2 diff --git a/contrib/depends/hosts/darwin.mk b/contrib/depends/hosts/darwin.mk index 70601dc25..aa61d6031 100644 --- a/contrib/depends/hosts/darwin.mk +++ b/contrib/depends/hosts/darwin.mk @@ -53,8 +53,8 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ -iwithsysroot/usr/include/c++/v1 \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks -darwin_CFLAGS=-pipe -darwin_CXXFLAGS=$(darwin_CFLAGS) +darwin_CFLAGS=-pipe -std=$(C_STANDARD) +darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION) -Wl,-no_adhoc_codesign -fuse-ld=lld darwin_ARFLAGS=cr diff --git a/contrib/depends/hosts/freebsd.mk b/contrib/depends/hosts/freebsd.mk index aeaccbf27..549c57841 100644 --- a/contrib/depends/hosts/freebsd.mk +++ b/contrib/depends/hosts/freebsd.mk @@ -13,8 +13,8 @@ freebsd_AR=ar freebsd_RANLIB=ranlib freebsd_NM=nm -freebsd_CFLAGS=-pipe -freebsd_CXXFLAGS=$(freebsd_CFLAGS) +freebsd_CFLAGS=-pipe -std=$(C_STANDARD) +freebsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD) freebsd_ARFLAGS=cr freebsd_release_CFLAGS=-O2 diff --git a/contrib/depends/hosts/linux.mk b/contrib/depends/hosts/linux.mk index ba0c4c302..08fdcc1dc 100644 --- a/contrib/depends/hosts/linux.mk +++ b/contrib/depends/hosts/linux.mk @@ -1,5 +1,5 @@ -linux_CFLAGS=-pipe -linux_CXXFLAGS=$(linux_CFLAGS) +linux_CFLAGS=-pipe -std=$(C_STANDARD) +linux_CXXFLAGS=-pipe -std=$(CXX_STANDARD) linux_ARFLAGS=cr linux_release_CFLAGS=-O2 diff --git a/contrib/depends/hosts/mingw32.mk b/contrib/depends/hosts/mingw32.mk index 58a9a929d..e78318bcc 100644 --- a/contrib/depends/hosts/mingw32.mk +++ b/contrib/depends/hosts/mingw32.mk @@ -1,5 +1,5 @@ -mingw32_CFLAGS=-pipe -mingw32_CXXFLAGS=$(mingw32_CFLAGS) +mingw32_CFLAGS=-pipe -std=$(C_STANDARD) +mingw32_CXXFLAGS=-pipe -std=$(CXX_STANDARD) mingw32_ARFLAGS=cr mingw32_release_CFLAGS=-O2 diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk index d4200915e..bbada6ac2 100644 --- a/contrib/depends/packages/boost.mk +++ b/contrib/depends/packages/boost.mk @@ -20,7 +20,6 @@ $(package)_toolset_$(host_os)=gcc $(package)_archiver_$(host_os)=$($(package)_ar) $(package)_config_libraries_$(host_os)="chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization" $(package)_config_libraries_mingw32="chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale" -$(package)_cxxflags=-std=c++17 $(package)_cxxflags_linux+=-fPIC $(package)_cxxflags_freebsd+=-fPIC $(package)_cxxflags_darwin+=-ffile-prefix-map=$($(package)_extract_dir)=/usr diff --git a/contrib/depends/packages/native_protobuf.mk b/contrib/depends/packages/native_protobuf.mk index 8d7649b67..0ec544417 100644 --- a/contrib/depends/packages/native_protobuf.mk +++ b/contrib/depends/packages/native_protobuf.mk @@ -4,7 +4,6 @@ $(package)_version_protobuf_cpp=3.21.12 $(package)_download_path=https://github.com/protocolbuffers/protobuf/releases/download/v$($(package)_version)/ $(package)_file_name=protobuf-cpp-$($(package)_version_protobuf_cpp).tar.gz $(package)_sha256_hash=4eab9b524aa5913c6fffb20b2a8abf5ef7f95a80bc0701f3a6dbb4c607f73460 -$(package)_cxxflags=-std=c++11 define $(package)_set_vars $(package)_config_opts=--disable-shared --prefix=$(build_prefix) diff --git a/contrib/depends/packages/protobuf.mk b/contrib/depends/packages/protobuf.mk index 9702506d0..85257493a 100644 --- a/contrib/depends/packages/protobuf.mk +++ b/contrib/depends/packages/protobuf.mk @@ -5,7 +5,6 @@ $(package)_download_path=$(native_$(package)_download_path) $(package)_file_name=$(native_$(package)_file_name) $(package)_sha256_hash=$(native_$(package)_sha256_hash) $(package)_dependencies=native_$(package) -$(package)_cxxflags=-std=c++11 define $(package)_set_vars $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc diff --git a/contrib/depends/packages/zeromq.mk b/contrib/depends/packages/zeromq.mk index cdf598b6c..7255790d0 100644 --- a/contrib/depends/packages/zeromq.mk +++ b/contrib/depends/packages/zeromq.mk @@ -6,7 +6,6 @@ $(package)_sha256_hash=6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a91 define $(package)_set_vars $(package)_config_opts=--without-documentation --disable-shared --without-libsodium --disable-curve - $(package)_cxxflags=-std=c++11 endef define $(package)_preprocess_cmds