Check if were using CLANG which shows up as GCC compatible, and pass -Qunused-arguments
[freeradius.git] / configure
index 4433dd4..51a4688 100755 (executable)
--- a/configure
+++ b/configure
@@ -4200,10 +4200,43 @@ else
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiling with clang" >&5
+$as_echo_n "checking if compiling with clang... " >&6; }
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#ifndef __clang__
+       not clang
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  CLANG=yes
+else
+  CLANG=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG" >&5
+$as_echo "$CLANG" >&6; }
+
 if test "x$GCC" = "xyes"; then
     CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
 fi
 
+if test "x$CLANG" = "xyes"; then
+    CFLAGS="$CFLAGS -Qunused-arguments"
+    LDFLAGS="$LDFLAGS -Qunused-arguments"
+fi
+
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then :
   enableval=$enable_largefile;
@@ -7558,7 +7591,7 @@ int a = 1;
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
-                    smart_include="-I$try"
+                    smart_include="-I$try -isystem $try"
                     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
                     break
@@ -7653,7 +7686,7 @@ int a = 1;
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
-                    smart_include="-I$try"
+                    smart_include="-I$try -isystem $try"
                     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
                     break