aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Barlow <jim@purplerock.ca>2014-12-23 04:38:43 -0800
committerJim Barlow <jim@purplerock.ca>2014-12-23 04:38:43 -0800
commit164f684eb8e4ebe31d0f9d0603dc25533fa43c5b (patch)
tree23ecdf6b064a139e9e14712a589f2a9b0c046f10
parent8c6c07c5ba7e4f862a4f70b2f1bf7c1fc7f968f2 (diff)
downloadportable-164f684eb8e4ebe31d0f9d0603dc25533fa43c5b.tar.gz
portable-164f684eb8e4ebe31d0f9d0603dc25533fa43c5b.tar.bz2
portable-164f684eb8e4ebe31d0f9d0603dc25533fa43c5b.zip
configure.ac: Modify clang check to save result to a variable
...and leave a note that -Qunused-arguments is being applied to CFLAGS not LDFLAGS, probably in error.
-rw-r--r--configure.ac24
1 files changed, 14 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index e56e39d..9174a64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,17 @@ AC_PROG_LIBTOOL
63AC_PROG_CC_STDC 63AC_PROG_CC_STDC
64AM_PROG_CC_C_O 64AM_PROG_CC_C_O
65 65
66AC_MSG_CHECKING([if compiling with clang])
67AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
68#ifndef __clang__
69 not clang
70#endif
71 ]])],
72 [CLANG=yes],
73 [CLANG=no]
74)
75AC_MSG_RESULT([CLANG])
76
66save_cflags="$CFLAGS" 77save_cflags="$CFLAGS"
67CFLAGS=-Wno-pointer-sign 78CFLAGS=-Wno-pointer-sign
68AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign]) 79AC_MSG_CHECKING([whether CC supports -Wno-pointer-sign])
@@ -73,16 +84,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
73) 84)
74CFLAGS="$save_cflags $AM_CFLAGS" 85CFLAGS="$save_cflags $AM_CFLAGS"
75 86
76AC_MSG_CHECKING([if compiling with clang]) 87# TODO: note CFLAGS=...CLANG_CFLAGS has no effect since the latter is undefined
77AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ 88# investigate its effect
78#ifndef __clang__ 89AS_IF([test "x$CLANG" == "xyes"], [CLANG_FLAGS=-Qunused-arguments])
79 not clang
80#endif
81 ]])],
82 [AC_MSG_RESULT([yes])]
83 [CLANG_FLAGS=-Qunused-arguments],
84 [AC_MSG_RESULT([no])]
85)
86CFLAGS="$CFLAGS $CLANG_CFLAGS" 90CFLAGS="$CFLAGS $CLANG_CFLAGS"
87LDFLAGS="$LDFLAGS $CLANG_FLAGS" 91LDFLAGS="$LDFLAGS $CLANG_FLAGS"
88 92