Diff

Differences From Artifact [d44ea11c0b]:

To Artifact [4da108b9e1]:


33
34
35
36
37
38
39











40
41
42
43
44
45
46
47
48
49
50
51










52
53
54
55
56
57
58
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79







+
+
+
+
+
+
+
+
+
+
+












+
+
+
+
+
+
+
+
+
+







dnl Enable support for a debugging build
tcl_nano_debug='false'
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [enable debugging parameters]), [
	if test "$enableval" = "yes"; then
		tcl_nano_debug='true'
	fi
])

dnl Enable support for a code coverage build
tcl_nano_coverage='false'
AC_ARG_ENABLE([coverage], AS_HELP_STRING([--enable-coverage], [enable code coverage build (requires debug)]), [
	if test "$enableval" = "yes"; then
		tcl_nano_coverage='true'
		tcl_nano_debug='true'
	fi
])

dnl If we are building a debug release, enable debugging flags
if test "$tcl_nano_debug" = 'true'; then
	AC_DEFINE(TCLEXT_TCL_NANO_DEBUG, [1], [Enable debugging build])
	AX_CHECK_COMPILE_FLAG([-mmpx -fcheck-pointer-bounds], [CFLAGS="$CFLAGS -mmpx -fcheck-pointer-bounds"])
	AX_CHECK_COMPILE_FLAG([-g3], [CFLAGS="$CFLAGS -g3"])
	AX_CHECK_COMPILE_FLAG([-ggdb3], [CFLAGS="$CFLAGS -ggdb3"])
else
	dnl If we are not doing debugging disable some of the more annoying warnings
	AX_CHECK_COMPILE_FLAG([-Wno-unused-value], [CFLAGS="$CFLAGS -Wno-unused-value"])
	AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter], [CFLAGS="$CFLAGS -Wno-unused-parameter"])
	AX_CHECK_COMPILE_FLAG([-Wno-deprecated-declarations], [CFLAGS="$CFLAGS -Wno-deprecated-declarations"])
fi
AX_CHECK_COMPILE_FLAG([-Wno-sign-compare], [CFLAGS="$CFLAGS -Wno-sign-compare"])

dnl If enabled, do code coverage
if test "$tcl_nano_coverage" = 'true'; then
	ENABLE_COVERAGE='true'
	AC_SUBST(ENABLE_COVERAGE)
	AX_CHECK_COMPILE_FLAG([-coverage], [
		CFLAGS="$CFLAGS -coverage"
		LDFLAGS="$LDFLAGS -coverage"
	])
fi

dnl Enable compiler warnings
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="-Wall $CFLAGS"])
AX_CHECK_COMPILE_FLAG([-W], [
	CFLAGS="-W $CFLAGS"
	AX_CHECK_COMPILE_FLAG([-Wno-self-assign], [CFLAGS="$CFLAGS -Wno-self-assign"])
	AX_CHECK_COMPILE_FLAG([-Wno-tautological-constant-out-of-range-compare], [CFLAGS="$CFLAGS -Wno-tautological-constant-out-of-range-compare"])