]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
m4: Avoid _FORTIFY_SOURCE redefinition warnings
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 22 Dec 2017 07:36:48 +0000 (09:36 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 22 Dec 2017 10:40:01 +0000 (12:40 +0200)
Some source based distros like Gentoo already enable -D_FORTIFY_SOURCE=2
by default resulting in the following warnings during build:

<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition

Patch by Eray Aslan

m4/cc_fortify.m4

index 3137eece852bfba30734ce5f5350529b7c252186..070c75705f91dbdce134ff4bd2d12115ed8ed0cd 100644 (file)
@@ -8,7 +8,7 @@ AC_DEFUN([AC_CC_D_FORTIFY_SOURCE],[
       case "$host" in
         *)
           gl_COMPILER_OPTION_IF([-O2 -D_FORTIFY_SOURCE=2], [
-            CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
+            CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
             ],
             [],
             [AC_LANG_PROGRAM([[