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
[], [])
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([
Makefile
src/Makefile
......
......@@ -290,6 +290,23 @@ Other files such as this man-page are installed in the locations
determined by ``configure``, which inherits its default ``--prefix``
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
===========
......@@ -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
``ulimit -s``. By default, the VMOD is built with the stack protector
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
=======
......
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