gcc/libphobos/testsuite/testsuite_flags.in
Iain Buclaw c0dbfbd763 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.
2020-04-09 00:46:39 +02:00

55 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
#
# This script computes the various flags needed to run D Phobos unittests.
#
# Print a message saying how this script is intended to be invoked
print_usage() {
cat <<EOF
Usage:
testsuite_flags --gdc
--gdcflags
--gdcpaths
--gdcldflags
EOF
}
# Establish configure-generated directory structure.
BUILD_DIR=@libphobos_builddir@
SRC_DIR=@libphobos_srcdir@
query=$1
case ${query} in
--gdc)
GDC="@GDC@"
echo ${GDC}
;;
--gdcflags)
GDCFLAGS_default="-fmessage-length=0 -fno-show-column"
GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGSX@ -fno-release -funittest"
echo ${GDCFLAGS_default} ${GDCFLAGS_config}
;;
--gdcpaths)
GDCPATHS_default="-nostdinc"
GDCPATHS_config="-B${BUILD_DIR}/src
-I${BUILD_DIR}/libdruntime
-I${SRC_DIR}/libdruntime
-I${SRC_DIR}/src"
echo ${GDCPATHS_default} ${GDCPATHS_config}
;;
--gdcldflags)
GDCLDFLAGS="-B${BUILD_DIR}/src
-B${BUILD_DIR}/libdruntime/gcc
-L${BUILD_DIR}/libdruntime/.libs
-L${BUILD_DIR}/src/.libs"
echo ${GDCLDFLAGS}
;;
*)
print_usage
;;
esac
exit 0