Browse code

fix make distcheck on gcc < 4.3 (bb #1259)

git-svn: trunk@4303

Török Edvin authored on 2008/10/30 04:06:20
Showing 5 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Oct 29 21:22:15 EET 2008 (edwin)
2
+------------------------------------
3
+ * Makefile.am, Makefile.in, configure, configure.in: fix make
4
+ distcheck on gcc < 4.3  (bb #1259)
5
+
1 6
 Wed Oct 29 20:52:07 EET 2008 (edwin)
2 7
 ------------------------------------
3 8
  * configure, configure.in: add testcase for gcc bug 37573, affecting
... ...
@@ -28,7 +28,11 @@ pkgconfig_DATA = libclamav.pc
28 28
 # don't complain that configuration files and databases are not removed, this is intended
29 29
 distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
30 30
 DISTCLEANFILES = target.h
31
+if DISTCHECK_ENABLE_FLAGS 
31 32
 DISTCHECK_CONFIGURE_FLAGS=--enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded"
33
+else
34
+DISTCHECK_CONFIGURE_FLAGS=--enable-milter
35
+endif
32 36
 lcov:
33 37
 	($(MAKE); cd unit_tests; $(MAKE) lcov)
34 38
 quick-check:
... ...
@@ -275,25 +275,49 @@ pkgconfig_DATA = libclamav.pc
275 275
 # don't complain that configuration files and databases are not removed, this is intended
276 276
 distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
277 277
 DISTCLEANFILES = target.h
278
-DISTCHECK_CONFIGURE_FLAGS = --enable-milter CFLAGS="-Wno-pointer-sign \
279
-	-Wno-error=attributes -Werror-implicit-function-declaration \
280
-	-Werror -Wextra -Wall -Wbad-function-cast -Wcast-align \
281
-	-Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations \
282
-	-Wmissing-prototypes -Wno-error=missing-prototypes \
283
-	-Wnested-externs -Wno-error=nested-externs -Wpointer-arith \
284
-	-Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch \
285
-	-Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 \
286
-	-Winit-self -Wmissing-include-dirs -Wstrict-aliasing \
287
-	-Wdeclaration-after-statement -Waggregate-return \
288
-	-Wmissing-format-attribute -Wno-error=missing-format-attribute \
289
-	-Wpadded -Wno-error=type-limits -Wno-error=unused-value \
290
-	-Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual \
291
-	-Wno-error=sign-compare -Wshadow -Wno-error=shadow \
292
-	-Wno-error=uninitialized -fdiagnostics-show-option \
293
-	-Wno-unused-parameter -Wpacked -Wno-error=packed \
294
-	-Wno-error=unreachable-code -Winvalid-pch \
295
-	-Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 \
296
-	-fstack-protector-all -Wstack-protector -Wno-error=padded"
278
+@DISTCHECK_ENABLE_FLAGS_FALSE@DISTCHECK_CONFIGURE_FLAGS = --enable-milter
279
+@DISTCHECK_ENABLE_FLAGS_TRUE@DISTCHECK_CONFIGURE_FLAGS =  \
280
+@DISTCHECK_ENABLE_FLAGS_TRUE@	--enable-milter \
281
+@DISTCHECK_ENABLE_FLAGS_TRUE@	CFLAGS="-Wno-pointer-sign \
282
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=attributes \
283
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Werror-implicit-function-declaration \
284
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Werror -Wextra -Wall \
285
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wbad-function-cast -Wcast-align \
286
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wendif-labels -Wfloat-equal \
287
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wformat=2 -Wmissing-declarations \
288
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wmissing-prototypes \
289
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=missing-prototypes \
290
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wnested-externs \
291
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=nested-externs \
292
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wpointer-arith \
293
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wstrict-prototypes \
294
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=strict-prototypes \
295
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-switch -Wno-switch-enum \
296
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wundef -Wwrite-strings \
297
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wstrict-overflow=1 -Winit-self \
298
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wmissing-include-dirs \
299
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wstrict-aliasing \
300
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wdeclaration-after-statement \
301
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Waggregate-return \
302
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wmissing-format-attribute \
303
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=missing-format-attribute \
304
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wpadded -Wno-error=type-limits \
305
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=unused-value \
306
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=unused-variable \
307
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wcast-qual -Wno-error=cast-qual \
308
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=sign-compare -Wshadow \
309
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=shadow \
310
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=uninitialized \
311
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-fdiagnostics-show-option \
312
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-unused-parameter -Wpacked \
313
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=packed \
314
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=unreachable-code \
315
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Winvalid-pch \
316
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=invalid-pch -O2 \
317
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-D_FORTIFY_SOURCE=2 \
318
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-fstack-protector-all \
319
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wstack-protector \
320
+@DISTCHECK_ENABLE_FLAGS_TRUE@	-Wno-error=padded"
297 321
 all: clamav-config.h
298 322
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
299 323
 
... ...
@@ -872,6 +872,8 @@ LIPO
872 872
 OTOOL
873 873
 OTOOL64
874 874
 CPP
875
+DISTCHECK_ENABLE_FLAGS_TRUE
876
+DISTCHECK_ENABLE_FLAGS_FALSE
875 877
 VERSIONSCRIPTFLAG
876 878
 VERSIONSCRIPT_TRUE
877 879
 VERSIONSCRIPT_FALSE
... ...
@@ -4753,13 +4755,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
4753 4753
 else
4754 4754
   lt_cv_nm_interface="BSD nm"
4755 4755
   echo "int some_variable = 0;" > conftest.$ac_ext
4756
-  (eval echo "\"\$as_me:4756: $ac_compile\"" >&5)
4756
+  (eval echo "\"\$as_me:4758: $ac_compile\"" >&5)
4757 4757
   (eval "$ac_compile" 2>conftest.err)
4758 4758
   cat conftest.err >&5
4759
-  (eval echo "\"\$as_me:4759: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4759
+  (eval echo "\"\$as_me:4761: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4760 4760
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4761 4761
   cat conftest.err >&5
4762
-  (eval echo "\"\$as_me:4762: output\"" >&5)
4762
+  (eval echo "\"\$as_me:4764: output\"" >&5)
4763 4763
   cat conftest.out >&5
4764 4764
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4765 4765
     lt_cv_nm_interface="MS dumpbin"
... ...
@@ -5970,7 +5972,7 @@ ia64-*-hpux*)
5970 5970
   ;;
5971 5971
 *-*-irix6*)
5972 5972
   # Find out which ABI we are using.
5973
-  echo '#line 5973 "configure"' > conftest.$ac_ext
5973
+  echo '#line 5975 "configure"' > conftest.$ac_ext
5974 5974
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5975 5975
   (eval $ac_compile) 2>&5
5976 5976
   ac_status=$?
... ...
@@ -7821,11 +7823,11 @@ else
7821 7821
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7822 7822
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7823 7823
    -e 's:$: $lt_compiler_flag:'`
7824
-   (eval echo "\"\$as_me:7824: $lt_compile\"" >&5)
7824
+   (eval echo "\"\$as_me:7826: $lt_compile\"" >&5)
7825 7825
    (eval "$lt_compile" 2>conftest.err)
7826 7826
    ac_status=$?
7827 7827
    cat conftest.err >&5
7828
-   echo "$as_me:7828: \$? = $ac_status" >&5
7828
+   echo "$as_me:7830: \$? = $ac_status" >&5
7829 7829
    if (exit $ac_status) && test -s "$ac_outfile"; then
7830 7830
      # The compiler can only warn and ignore the option if not recognized
7831 7831
      # So say no if there are warnings other than the usual output.
... ...
@@ -8160,11 +8162,11 @@ else
8160 8160
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8161 8161
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8162 8162
    -e 's:$: $lt_compiler_flag:'`
8163
-   (eval echo "\"\$as_me:8163: $lt_compile\"" >&5)
8163
+   (eval echo "\"\$as_me:8165: $lt_compile\"" >&5)
8164 8164
    (eval "$lt_compile" 2>conftest.err)
8165 8165
    ac_status=$?
8166 8166
    cat conftest.err >&5
8167
-   echo "$as_me:8167: \$? = $ac_status" >&5
8167
+   echo "$as_me:8169: \$? = $ac_status" >&5
8168 8168
    if (exit $ac_status) && test -s "$ac_outfile"; then
8169 8169
      # The compiler can only warn and ignore the option if not recognized
8170 8170
      # So say no if there are warnings other than the usual output.
... ...
@@ -8265,11 +8267,11 @@ else
8265 8265
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8266 8266
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8267 8267
    -e 's:$: $lt_compiler_flag:'`
8268
-   (eval echo "\"\$as_me:8268: $lt_compile\"" >&5)
8268
+   (eval echo "\"\$as_me:8270: $lt_compile\"" >&5)
8269 8269
    (eval "$lt_compile" 2>out/conftest.err)
8270 8270
    ac_status=$?
8271 8271
    cat out/conftest.err >&5
8272
-   echo "$as_me:8272: \$? = $ac_status" >&5
8272
+   echo "$as_me:8274: \$? = $ac_status" >&5
8273 8273
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
8274 8274
    then
8275 8275
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -8320,11 +8322,11 @@ else
8320 8320
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8321 8321
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8322 8322
    -e 's:$: $lt_compiler_flag:'`
8323
-   (eval echo "\"\$as_me:8323: $lt_compile\"" >&5)
8323
+   (eval echo "\"\$as_me:8325: $lt_compile\"" >&5)
8324 8324
    (eval "$lt_compile" 2>out/conftest.err)
8325 8325
    ac_status=$?
8326 8326
    cat out/conftest.err >&5
8327
-   echo "$as_me:8327: \$? = $ac_status" >&5
8327
+   echo "$as_me:8329: \$? = $ac_status" >&5
8328 8328
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
8329 8329
    then
8330 8330
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -11076,7 +11078,7 @@ else
11076 11076
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11077 11077
   lt_status=$lt_dlunknown
11078 11078
   cat > conftest.$ac_ext <<_LT_EOF
11079
-#line 11079 "configure"
11079
+#line 11081 "configure"
11080 11080
 #include "confdefs.h"
11081 11081
 
11082 11082
 #if HAVE_DLFCN_H
... ...
@@ -11172,7 +11174,7 @@ else
11172 11172
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11173 11173
   lt_status=$lt_dlunknown
11174 11174
   cat > conftest.$ac_ext <<_LT_EOF
11175
-#line 11175 "configure"
11175
+#line 11177 "configure"
11176 11176
 #include "confdefs.h"
11177 11177
 
11178 11178
 #if HAVE_DLFCN_H
... ...
@@ -12238,6 +12240,27 @@ else
12238 12238
 	VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler"
12239 12239
 fi
12240 12240
 
12241
+# add distcheck warning flags
12242
+distcheck_enable_flags=0
12243
+if test "x$ac_compiler_gnu" = "xyes"; then
12244
+	gcc_version=`${CC} -dumpversion`
12245
+	case "${gcc_version}" in
12246
+		4.[3456789].*)
12247
+			distcheck_enable_flags=1
12248
+			;;
12249
+		[56789].*)
12250
+			distcheck_enable_flags=1
12251
+			;;
12252
+	esac
12253
+fi
12254
+ if test "x$distcheck_enable_flags" = "x1"; then
12255
+  DISTCHECK_ENABLE_FLAGS_TRUE=
12256
+  DISTCHECK_ENABLE_FLAGS_FALSE='#'
12257
+else
12258
+  DISTCHECK_ENABLE_FLAGS_TRUE='#'
12259
+  DISTCHECK_ENABLE_FLAGS_FALSE=
12260
+fi
12261
+
12241 12262
 
12242 12263
 
12243 12264
 { echo "$as_me:$LINENO: checking for gcc bug PR27603" >&5
... ...
@@ -21252,6 +21275,13 @@ echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
21252 21252
 Usually this means the macro was only invoked conditionally." >&2;}
21253 21253
    { (exit 1); exit 1; }; }
21254 21254
 fi
21255
+if test -z "${DISTCHECK_ENABLE_FLAGS_TRUE}" && test -z "${DISTCHECK_ENABLE_FLAGS_FALSE}"; then
21256
+  { { echo "$as_me:$LINENO: error: conditional \"DISTCHECK_ENABLE_FLAGS\" was never defined.
21257
+Usually this means the macro was only invoked conditionally." >&5
21258
+echo "$as_me: error: conditional \"DISTCHECK_ENABLE_FLAGS\" was never defined.
21259
+Usually this means the macro was only invoked conditionally." >&2;}
21260
+   { (exit 1); exit 1; }; }
21261
+fi
21255 21262
 if test -z "${VERSIONSCRIPT_TRUE}" && test -z "${VERSIONSCRIPT_FALSE}"; then
21256 21263
   { { echo "$as_me:$LINENO: error: conditional \"VERSIONSCRIPT\" was never defined.
21257 21264
 Usually this means the macro was only invoked conditionally." >&5
... ...
@@ -22265,6 +22295,8 @@ LIPO!$LIPO$ac_delim
22265 22265
 OTOOL!$OTOOL$ac_delim
22266 22266
 OTOOL64!$OTOOL64$ac_delim
22267 22267
 CPP!$CPP$ac_delim
22268
+DISTCHECK_ENABLE_FLAGS_TRUE!$DISTCHECK_ENABLE_FLAGS_TRUE$ac_delim
22269
+DISTCHECK_ENABLE_FLAGS_FALSE!$DISTCHECK_ENABLE_FLAGS_FALSE$ac_delim
22268 22270
 VERSIONSCRIPTFLAG!$VERSIONSCRIPTFLAG$ac_delim
22269 22271
 VERSIONSCRIPT_TRUE!$VERSIONSCRIPT_TRUE$ac_delim
22270 22272
 VERSIONSCRIPT_FALSE!$VERSIONSCRIPT_FALSE$ac_delim
... ...
@@ -22311,7 +22343,7 @@ LIBOBJS!$LIBOBJS$ac_delim
22311 22311
 LTLIBOBJS!$LTLIBOBJS$ac_delim
22312 22312
 _ACEOF
22313 22313
 
22314
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then
22314
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 57; then
22315 22315
     break
22316 22316
   elif $ac_last_try; then
22317 22317
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
... ...
@@ -99,6 +99,20 @@ else
99 99
 	VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler"
100 100
 fi
101 101
 
102
+# add distcheck warning flags
103
+distcheck_enable_flags=0
104
+if test "x$ac_compiler_gnu" = "xyes"; then
105
+	gcc_version=`${CC} -dumpversion`
106
+	case "${gcc_version}" in
107
+		4.[[3456789]].*)
108
+			distcheck_enable_flags=1
109
+			;;
110
+		[[56789]].*)
111
+			distcheck_enable_flags=1
112
+			;;
113
+	esac
114
+fi
115
+AM_CONDITIONAL([DISTCHECK_ENABLE_FLAGS], test "x$distcheck_enable_flags" = "x1")
102 116
 
103 117
 dnl Checks if compiler produces valid code, regardless of compiler
104 118
 dnl we do these checks here to avoid receiving endless bugreports about