aboutsummaryrefslogtreecommitdiff
path: root/m4/disable-compiler-warnings.m4
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2015-05-01 07:18:12 -0500
committerBrent Cook <busterb@gmail.com>2015-05-23 19:27:57 -0500
commitd3771a41cb106c945e0f538073d0a6e7b35d145b (patch)
tree0ec81fcb0eae37fc7f1f89e2a7d1de26e54d35d2 /m4/disable-compiler-warnings.m4
parent28353c1df15c3d0482a10ffe33fa34c053af2c2e (diff)
downloadportable-d3771a41cb106c945e0f538073d0a6e7b35d145b.tar.gz
portable-d3771a41cb106c945e0f538073d0a6e7b35d145b.tar.bz2
portable-d3771a41cb106c945e0f538073d0a6e7b35d145b.zip
refactor configure into separate m4 macros
this allows for some reusability with libtls
Diffstat (limited to '')
-rw-r--r--m4/disable-compiler-warnings.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/m4/disable-compiler-warnings.m4 b/m4/disable-compiler-warnings.m4
new file mode 100644
index 0000000..2792722
--- /dev/null
+++ b/m4/disable-compiler-warnings.m4
@@ -0,0 +1,29 @@
1AC_DEFUN([DISABLE_COMPILER_WARNINGS], [
2# Clang throws a lot of warnings when it does not understand a flag. Disable
3# this warning for now so other warnings are visible.
4AC_MSG_CHECKING([if compiling with clang])
5AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
6#ifndef __clang__
7 not clang
8#endif
9 ]])],
10 [CLANG=yes],
11 [CLANG=no]
12)
13AC_MSG_RESULT([$CLANG])
14AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Qunused-arguments])
15CFLAGS="$CFLAGS $CLANG_FLAGS"
16LDFLAGS="$LDFLAGS $CLANG_FLAGS"
17
18# Removing the dependency on -Wno-pointer-sign should be a goal. These are
19# largely unsigned char */char* mismatches in asn1 functions.
20save_cflags="$CFLAGS"
21CFLAGS=-Wno-pointer-sign
22AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
23AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
24 [AC_MSG_RESULT([yes])]
25 [AM_CFLAGS=-Wno-pointer-sign],
26 [AC_MSG_RESULT([no])]
27)
28CFLAGS="$save_cflags $AM_CFLAGS"
29])