summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block/config/lf_warnings.m4
diff options
context:
space:
mode:
authorJohnathan Corgan2009-11-03 08:29:52 -0800
committerJohnathan Corgan2009-11-03 08:29:52 -0800
commit099dad679e232cb0f2b3ed61e085837310e69c92 (patch)
treea0c3ffeea5c8878651f48434ab14ac44898ca6f2 /gr-howto-write-a-block/config/lf_warnings.m4
parent7841f422c35ba4c67ce47587d82b0ced8692444f (diff)
downloadgnuradio-099dad679e232cb0f2b3ed61e085837310e69c92.tar.gz
gnuradio-099dad679e232cb0f2b3ed61e085837310e69c92.tar.bz2
gnuradio-099dad679e232cb0f2b3ed61e085837310e69c92.zip
howto: update m4 files to match latest master
Diffstat (limited to 'gr-howto-write-a-block/config/lf_warnings.m4')
-rw-r--r--gr-howto-write-a-block/config/lf_warnings.m447
1 files changed, 20 insertions, 27 deletions
diff --git a/gr-howto-write-a-block/config/lf_warnings.m4 b/gr-howto-write-a-block/config/lf_warnings.m4
index 4e2ca9111..d40c77f14 100644
--- a/gr-howto-write-a-block/config/lf_warnings.m4
+++ b/gr-howto-write-a-block/config/lf_warnings.m4
@@ -1,4 +1,5 @@
dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl Copyright (C) 2009 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -21,7 +22,7 @@ dnl distribution terms that you use for the rest of that program.
# --------------------------------------------------------------------------
# Check whether the C++ compiler accepts a certain flag
-# If it does it adds the flag to CXXFLAGS
+# If it does it adds the flag to lf_CXXFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_CXX_FLAG(-flag1 -flag2 -flag3 ...)
@@ -34,18 +35,19 @@ AC_DEFUN([LF_CHECK_CXX_FLAG],[
AC_MSG_CHECKING([whether $CXX accepts $i])
if test -z "`${CXX} $i -c conftest.cc 2>&1`"
then
- CXXFLAGS="${CXXFLAGS} $i"
+ lf_CXXFLAGS="${lf_CXXFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.cc conftest.o
+ AC_SUBST(lf_CXXFLAGS)
])
# --------------------------------------------------------------------------
# Check whether the C compiler accepts a certain flag
-# If it does it adds the flag to CFLAGS
+# If it does it adds the flag to lf_CFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_CC_FLAG(-flag1 -flag2 -flag3 ...)
@@ -58,18 +60,19 @@ AC_DEFUN([LF_CHECK_CC_FLAG],[
AC_MSG_CHECKING([whether $CC accepts $i])
if test -z "`${CC} $i -c conftest.c 2>&1`"
then
- CFLAGS="${CFLAGS} $i"
+ lf_CFLAGS="${lf_CFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.c conftest.o
+ AC_SUBST(lf_CFLAGS)
])
# --------------------------------------------------------------------------
# Check whether the Fortran compiler accepts a certain flag
-# If it does it adds the flag to FFLAGS
+# If it does it adds the flag to lf_FFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_F77_FLAG(-flag1 -flag2 -flag3 ...)
@@ -87,42 +90,32 @@ EOF
AC_MSG_CHECKING([whether $F77 accepts $i])
if test -z "`${F77} $i -c conftest.f 2>&1`"
then
- FFLAGS="${FFLAGS} $i"
+ lf_FFLAGS="${lf_FFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.f conftest.o
+ AC_SUBST(lf_FFLAGS)
])
# ----------------------------------------------------------------------
-# Provide the configure script with an --with-warnings option that
-# turns on warnings. Call this command AFTER you have configured ALL your
-# compilers.
+# Enable compiler warnings.
+# Call this command AFTER you have configured ALL your compilers.
# ----------------------------------------------------------------------
AC_DEFUN([LF_SET_WARNINGS],[
- dnl Check for --with-warnings
- AC_MSG_CHECKING([whether user wants warnings])
- AC_ARG_WITH(warnings,
- [ --with-warnings Turn on warnings],
- [ lf_warnings=yes ], [ lf_warnings=no ])
- lf_warnings=yes # hard code for now -eb
- AC_MSG_RESULT($lf_warnings)
-
dnl Warnings for the two main compilers
- cc_warning_flags="-Wall"
+ dnl add -Wextra when you're got time to fix a bunch of them ;-)
+ cc_warning_flags="-Wall -Werror-implicit-function-declaration"
cxx_warning_flags="-Wall -Woverloaded-virtual"
- if test $lf_warnings = yes
+ if test -n "${CC}"
then
- if test -n "${CC}"
- then
- LF_CHECK_CC_FLAG($cc_warning_flags)
- fi
- if test -n "${CXX}"
- then
- LF_CHECK_CXX_FLAG($cxx_warning_flags)
- fi
+ LF_CHECK_CC_FLAG($cc_warning_flags)
+ fi
+ if test -n "${CXX}"
+ then
+ LF_CHECK_CXX_FLAG($cxx_warning_flags)
fi
])