From c0dbfbd763ad77d6beaa345ce94afc93e193236e Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Thu, 9 Apr 2020 00:41:14 +0200 Subject: libphobos: Add --enable-libphobos-checking configure option As GDCFLAGS is overriden by the top-level make file with '-O2 -g', libphobos ends up always being built with all contracts, invariants, and asserts compiled in. This adds a new configurable that defaults to omit compiling any run-time checks into the library using '-frelease'. Other choices either set the flags '-fno-release', enabling all run-time checks, or '-fassert', which only compiles in asserts. The omission of compiling in contracts results in a smaller library size, with faster build times. libphobos/ChangeLog: PR d/94305 * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Add --enable-libphobos-checking and substitute CHECKING_DFLAGS. Remove -frelease from GDCFLAGS. * libdruntime/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS. * libdruntime/Makefile.in: Regenerate. * src/Makefile.am: Add CHECKING_DFLAGS to AM_DFLAGS. * src/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * testsuite/testsuite_flags.in: Add -fno-release -funittest to --gdcflags. --- libphobos/libdruntime/Makefile.am | 2 +- libphobos/libdruntime/Makefile.in | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'libphobos/libdruntime') diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index 41ccfaa..c7b03a5 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -24,7 +24,7 @@ D_EXTRA_DFLAGS=-nostdinc -I $(srcdir) -I . # D flags for compilation AM_DFLAGS= \ $(phobos_compiler_pic_flag) \ - $(WARN_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) # Install all D and DI files ALL_DRUNTIME_INSTALL_DSOURCES = $(DRUNTIME_DSOURCES) \ diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 9277e0a..e0688e2 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -555,6 +555,7 @@ CCASFLAGS = @CCASFLAGS@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CHECKING_DFLAGS = @CHECKING_DFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -715,7 +716,7 @@ D_EXTRA_DFLAGS = -nostdinc -I $(srcdir) -I . # D flags for compilation AM_DFLAGS = \ $(phobos_compiler_pic_flag) \ - $(WARN_DFLAGS) + $(WARN_DFLAGS) $(CHECKING_DFLAGS) # Install all D and DI files -- cgit v1.1