]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make the option-checker code work with osx clang
authorNick Mathewson <nickm@torproject.org>
Fri, 11 May 2012 19:52:36 +0000 (15:52 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 11 May 2012 19:52:36 +0000 (15:52 -0400)
This is a matter of making gcc and friends squirm more loudly when
they get an option they don't like (-pedantic) and making clang shut
up with it gets an option it tolerates but doesnt know
(-Qunknown-argument).

Is there no better way?

acinclude.m4
configure.in

index c482e37546da67b9a6e0fe9eff5029cd38994272..c5037fa35d29be62ff9dbe95c5b659a5275ce3fd 100644 (file)
@@ -46,7 +46,7 @@ AC_DEFUN([TOR_CHECK_CFLAGS], [
   AS_VAR_PUSHDEF([VAR],[tor_cv_cflags_$1])
   AC_CACHE_CHECK([whether the compiler accepts $1], VAR, [
     tor_saved_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $1"
+    CFLAGS="$CFLAGS -pedantic $1"
     AC_TRY_COMPILE([], [return 0;],
                    [AS_VAR_SET(VAR,yes)],
                    [AS_VAR_SET(VAR,no)])
@@ -63,7 +63,7 @@ AC_DEFUN([TOR_CHECK_LDFLAGS], [
   AS_VAR_PUSHDEF([VAR],[tor_cv_ldflags_$1])
   AC_CACHE_CHECK([whether the linker accepts $1], VAR, [
     tor_saved_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $1"
+    LDFLAGS="$LDFLAGS -pedantic $1"
     AC_TRY_LINK([], [return 0;],
                    [AS_VAR_SET(VAR,yes)],
                    [AS_VAR_SET(VAR,no)])
index d894c73df8fd7fdaf23737423624d0436f36e33e..3e645753ee6e3f6c0f6702e8229d2103834d8b7d 100644 (file)
@@ -173,6 +173,7 @@ AM_PROG_CC_C_O
 
 if test x$enable_gcc_hardening != xno; then
     CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
+    TOR_CHECK_CFLAGS(-Qunused-arguments)
     TOR_CHECK_CFLAGS(-fstack-protector-all)
     TOR_CHECK_CFLAGS(-Wstack-protector)
     TOR_CHECK_CFLAGS(-fwrapv)