Commit 14f54750 authored by Guillaume Roguez's avatar Guillaume Roguez

build in non-debug mode by default

* declare NDEBUG for library and contrib
* activate pjsip extra checks as all PJ_ASSERT's are deactivated

Side effect: pjsip does not call abort() due to disabled assertions.

If debug is required:
* contrib: call bootstrap with --enable-debug
* libring: call configure with --enable-debug

Change-Id: I47b104c0f32352f0503457a9d419c4ed5db4e126
parent 3cca3d17
......@@ -668,7 +668,8 @@ dnl debug mode is default-disabled
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Build in debug mode, adds stricter warnings, disables optimization]))
AS_IF([test "x$enable_debug" = "xyes"],
[CXXFLAGS="${CXXFLAGS} -g -fno-omit-frame-pointer -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas -Wformat=2 -O0"])
[CXXFLAGS="${CXXFLAGS} -g -fno-omit-frame-pointer -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas -Wformat=2 -O0"],
[CXXFLAGS="${CXXFLAGS} -DNDEGUG=1"])
dnl What Makefiles to generate
......
......@@ -26,6 +26,7 @@ usage()
echo " --prefix=PREFIX install files in PREFIX"
echo " --no-checksums don't verify checksums (allows to replace tarballs)"
echo " --disable-downloads don't download packages from the internet"
echo " --enable-debug build with debug symbol and extra checks (disabled by default)"
echo " --disable-FOO configure to not build package FOO"
echo " --enable-FOO configure to build package FOO"
}
......@@ -58,6 +59,9 @@ do
--disable-downloads)
DISABLE_CONTRIB_DOWNLOADS="TRUE"
;;
--enable-debug)
ENABLE_DEBUG=1
;;
--host=*)
HOST="${1#--host=}"
;;
......@@ -118,6 +122,7 @@ PKGS_DISABLE := $PKGS_DISABLE
PKGS_ENABLE := $PKGS_ENABLE
DISABLE_CONTRIB_DOWNLOADS := $DISABLE_CONTRIB_DOWNLOADS
DISABLE_CONTRIB_CHECKSUMS := $DISABLE_CONTRIB_CHECKSUMS
ENABLE_DEBUG := $ENABLE_DEBUG
EOF
add_make()
......
......@@ -195,6 +195,12 @@ endif
EXTRA_CXXFLAGS += -std=c++14
ifdef ENABLE_DEBUG
EXTRA_CFLAGS += -g -fno-omit-frame-pointer
else
EXTRA_CFLAGS += -DNDEBUG=1
endif
cppcheck = $(shell $(CC) $(CFLAGS) -E -dM - < /dev/null | grep -E $(1))
EXTRA_CPPFLAGS += -I$(PREFIX)/include
......
......@@ -34,8 +34,8 @@ ifdef HAVE_IOS
PJPROJECT_OPTIONS += --with-ssl=$(PREFIX)
endif
PJPROJECT_EXTRA_CFLAGS = -g -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=150 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32
PJPROJECT_EXTRA_CXXFLAGS = -g -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=150 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32 -std=gnu++11
PJPROJECT_EXTRA_CFLAGS = -g -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=150 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32
PJPROJECT_EXTRA_CXXFLAGS = -g -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256 -DPJ_ICE_MAX_CHECKS=150 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3 -DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32 -std=gnu++11
ifdef HAVE_WIN64
PJPROJECT_EXTRA_CFLAGS += -DPJ_WIN64=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment