Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depends: explicitely set C/CXX standard for all packages #9673

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions contrib/depends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ SOURCES_PATH ?= $(BASEDIR)/sources
BASE_CACHE ?= $(BASEDIR)/built
FALLBACK_DOWNLOAD_PATH ?= https://downloads.getmonero.org/depends-sources

C_STANDARD ?= gnu11
CXX_STANDARD ?= c++17

BUILD = $(shell ./config.guess)
HOST ?= $(BUILD)
PATCHES_PATH = $(BASEDIR)/patches
Expand Down
4 changes: 2 additions & 2 deletions contrib/depends/hosts/android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android_CC=$(host_toolchain)clang
android_CXX=$(host_toolchain)clang++
android_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
Expand Down
4 changes: 2 additions & 2 deletions contrib/depends/hosts/darwin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,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_ARFLAGS=cr

darwin_release_CFLAGS=-O2
Expand Down
4 changes: 2 additions & 2 deletions contrib/depends/hosts/freebsd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions contrib/depends/hosts/linux.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions contrib/depends/hosts/mingw32.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion contrib/depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ $(package)_toolset_darwin=darwin
$(package)_archiver_darwin=$($(package)_libtool)
$(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++11
$(package)_cxxflags_linux+=-fPIC
$(package)_cxxflags_freebsd+=-fPIC
$(package)_cxxflags_darwin+=-ffile-prefix-map=$($(package)_extract_dir)=/usr
Expand Down
1 change: 0 additions & 1 deletion contrib/depends/packages/native_protobuf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 12 additions & 13 deletions contrib/depends/packages/openssl.mk
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package=openssl
$(package)_version=3.0.13
$(package)_download_path=https://www.openssl.org/source
$(package)_version=3.4.0
$(package)_download_path=https://github.com/openssl/openssl/releases/download/openssl-$($(package)_version)
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=88525753f79d3bec27d2fa7c66aa0b92b3aa9498dafd93d7cfa4b3780cdae313

# The bundled ranlib in Android NDK 18b inserts timestamps by default.
# To prevent reproducibility issues, we must enable [D]eterministic mode.
$(package)_sha256_hash=e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf

define $(package)_set_vars
$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
$(package)_config_env_android=ANDROID_NDK_ROOT="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB="ranlib -D"
$(package)_config_env=AR="$($(package)_ar)" ARFLAGS=$($(package)_arflags) RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
$(package)_config_env_android=ANDROID_NDK_ROOT="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB=ranlib
$(package)_build_env_android=ANDROID_NDK_ROOT="$(host_prefix)/native"
$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl --libdir=$(host_prefix)/lib
$(package)_config_opts+=no-apps
$(package)_config_opts+=no-capieng
$(package)_config_opts+=no-dso
$(package)_config_opts+=no-dtls1
Expand All @@ -28,9 +26,10 @@ $(package)_config_opts+=no-ssl3
$(package)_config_opts+=no-tests
$(package)_config_opts+=no-unit-test
$(package)_config_opts+=no-weak-ssl-ciphers
$(package)_config_opts+=no-winstore
$(package)_config_opts+=no-zlib
$(package)_config_opts+=no-zlib-dynamic
$(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags)
$(package)_config_opts+=-pipe
$(package)_config_opts_linux=-fPIC -Wa,--noexecstack
$(package)_config_opts_freebsd=-fPIC -Wa,--noexecstack
$(package)_config_opts_x86_64_linux=linux-x86_64
Expand All @@ -40,8 +39,7 @@ $(package)_config_opts_aarch64_linux=linux-generic64
$(package)_config_opts_arm_android=--static android-arm
$(package)_config_opts_aarch64_android=--static android-arm64
$(package)_config_opts_aarch64_darwin=darwin64-arm64-cc
$(package)_config_opts_riscv64_linux=linux-generic64
$(package)_config_opts_loongarch64_linux=linux-generic64
$(package)_config_opts_riscv64_linux=linux64-riscv64
$(package)_config_opts_mipsel_linux=linux-generic32
$(package)_config_opts_mips_linux=linux-generic32
$(package)_config_opts_powerpc_linux=linux-generic32
Expand All @@ -52,11 +50,12 @@ $(package)_config_opts_x86_64_freebsd=BSD-x86_64
endef

define $(package)_preprocess_cmds
sed -i.old 's|crypto ssl apps util tools fuzz providers doc|crypto ssl util tools providers|' build.info
sed -i.old 's|crypto ssl apps util tools fuzz providers doc|crypto ssl util tools providers|' build.info &&\
rm -rf doc demos apps test
endef

define $(package)_config_cmds
./Configure $($(package)_config_opts) ARFLAGS=$($(package)_arflags)
./Configure $($(package)_config_opts)
endef

define $(package)_build_cmds
Expand Down
1 change: 0 additions & 1 deletion contrib/depends/packages/protobuf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion contrib/depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ define $(package)_set_vars
$(package)_config_opts=--without-documentation --disable-shared --without-libsodium --disable-curve
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_freebsd=--with-pic
$(package)_cxxflags=-std=c++11
endef

define $(package)_config_cmds
Expand Down
Loading