* configure.ac, Makefile.am: Test if GCC accepts -Wno-pointer-sign

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@878 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
mludvig 2009-11-04 23:42:16 +00:00
parent fd1c9b4910
commit 63eb9668fd
3 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2009-11-04 Michal Ludvig <mludvig@logix.net.nz>
* configure.ac, Makefile.am: Test if GCC accepts -Wno-pointer-sign
2009-11-04 Michal Ludvig <mludvig@logix.net.nz>
* buspirate.c: Implemented 'BinMode' support for

View File

@ -51,7 +51,7 @@ libavrdude_a_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\"
avrdude_CFLAGS = @ENABLE_WARNINGS@
libavrdude_a_CFLAGS = @ENABLE_WARNINGS@ -Wno-sign-compare -Wno-sign-conversion -Wno-pointer-sign
libavrdude_a_CFLAGS = @ENABLE_WARNINGS@
avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB@ @LIBHID@ -lm

View File

@ -254,6 +254,25 @@ AC_SUBST(WINDOWS_DIRS,$WINDOWS_DIRS)
# If we are compiling with gcc, enable all warning and make warnings errors.
if test "$GCC" = yes; then
ENABLE_WARNINGS="-Wall"
# does this compiler support -Wno-pointer-sign ?
AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ])
safe_CFLAGS=$CFLAGS
CFLAGS="$ENABLE_WARNINGS -Wno-pointer-sign"
AC_TRY_COMPILE(, [ int main () { return 0 ; } ], [
no_pointer_sign=yes
AC_MSG_RESULT([yes])
], [
no_pointer_sign=no
AC_MSG_RESULT([no])
])
CFLAGS=$safe_CFLAGS
if test x$no_pointer_sign = xyes; then
ENABLE_WARNINGS="$ENABLE_WARNINGS -Wno-pointer-sign"
fi
fi
AC_SUBST(ENABLE_WARNINGS,$ENABLE_WARNINGS)