Commit 03c14d2a authored by Geoff Simmons's avatar Geoff Simmons

add the compiler option --enable-debugging

parent ea7344da
...@@ -82,6 +82,24 @@ if test "x$enable_stack_protector" != "xno"; then ...@@ -82,6 +82,24 @@ if test "x$enable_stack_protector" != "xno"; then
[], []) [], [])
fi fi
# --enable-debugging
AC_ARG_ENABLE(debugging,
AS_HELP_STRING([--enable-debugging],[enable debugging (default is NO)]),
[],
[enable_debugging=no])
# AC_PROG_CC sets CFLAGS to '-g -O2' unless it is already set, so
# there's no need to add -g. Disable or change by explicitly setting
# CFLAGS. If this option is enabled, then -Og or -O0 becomes the last
# optimization option, and hence takes precedence.
if test "x$enable_debugging" != "xno"; then
CFLAGS="${CFLAGS} -fno-inline"
AX_CHECK_COMPILE_FLAG([-Og],
[CFLAGS="${CFLAGS} -Og"],
[CFLAGS="${CFLAGS} -O0"],
[])
fi
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
src/Makefile src/Makefile
......
...@@ -290,6 +290,23 @@ Other files such as this man-page are installed in the locations ...@@ -290,6 +290,23 @@ Other files such as this man-page are installed in the locations
determined by ``configure``, which inherits its default ``--prefix`` determined by ``configure``, which inherits its default ``--prefix``
setting from Varnish. setting from Varnish.
For developers
--------------
The build specifies C99 conformance, all compiler warnings turned on,
and all warnings considered errors (compiler options ``-std=c99
-Werror -Wall``).
By default, ``CFLAGS`` is set to ``-g -O2``, so that symbols are
included in the shared library, and optimization is at level
``O2``. To change or disable these options, set ``CFLAGS`` explicitly
before calling ``make`` (it may be set to the empty string).
For development/debugging cycles, the ``configure`` option
``--enable-debugging`` is recommended (off by default). This will turn
off optimizations and function inlining, so that a debugger will step
through the code as expected.
LIMITATIONS LIMITATIONS
=========== ===========
...@@ -308,7 +325,7 @@ temporary BLOB. If this function causes stack overflow, you may need ...@@ -308,7 +325,7 @@ temporary BLOB. If this function causes stack overflow, you may need
to increase the stack size for the varnishd process, for example with to increase the stack size for the varnishd process, for example with
``ulimit -s``. By default, the VMOD is built with the stack protector ``ulimit -s``. By default, the VMOD is built with the stack protector
enabled (compile option ``-fstack-protector``), but it can be disabled enabled (compile option ``-fstack-protector``), but it can be disabled
with the ``./configure`` option ``--disable-stack-protector``. with the ``configure`` option ``--disable-stack-protector``.
AUTHORS AUTHORS
======= =======
......
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