From ece8ad5079c63fe119096ddfc6436b610a8a6927 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 17 Nov 2016 15:11:22 -0700 Subject: [PATCH] plugin Makefile.ams, configure.acs (AM_CFLAGS): Add many -W options. --- src/blowfish/Makefile.am | 1 + src/blowfish/configure.ac | 32 ++++++++++++++++++++++++++++++++ src/gdbm/Makefile.am | 1 + src/gdbm/configure.ac | 32 ++++++++++++++++++++++++++++++++ src/mcrypt/Makefile.am | 1 + src/mcrypt/configure.ac | 32 ++++++++++++++++++++++++++++++++ src/md5/Makefile.am | 1 + src/md5/configure.ac | 32 ++++++++++++++++++++++++++++++++ src/mhash/Makefile.am | 1 + src/mhash/configure.ac | 32 ++++++++++++++++++++++++++++++++ src/x11/Makefile.am | 3 ++- src/x11/configure.ac | 32 ++++++++++++++++++++++++++++++++ 12 files changed, 199 insertions(+), 1 deletion(-) diff --git a/src/blowfish/Makefile.am b/src/blowfish/Makefile.am index 067e13b2b..f6b4ddec5 100644 --- a/src/blowfish/Makefile.am +++ b/src/blowfish/Makefile.am @@ -50,6 +50,7 @@ dvidir = $(libdir)/mit-scheme/doc pdfdir = $(libdir)/mit-scheme/doc AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ +AM_CFLAGS = @MIT_CFLAGS@ blowfish_shim_la_LIBADD = blowfish-adapter.lo blowfish_shim_la_LDFLAGS = -module -avoid-version -shared diff --git a/src/blowfish/configure.ac b/src/blowfish/configure.ac index 92e20a5b6..2da328cb9 100644 --- a/src/blowfish/configure.ac +++ b/src/blowfish/configure.ac @@ -68,6 +68,37 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +if test ${GCC} = yes; then + + MIT_CFLAGS="-Wall -Wundef -Wpointer-arith -Winline" + MIT_CFLAGS="${MIT_CFLAGS} -Wstrict-prototypes -Wnested-externs" + MIT_CFLAGS="${MIT_CFLAGS} -Wredundant-decls" + + AC_MSG_CHECKING([for GCC>=4]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #if __GNUC__ >= 4 + ; + #else + #error "gcc too old" + #endif + ]], + [[]] + )], + [ + AC_MSG_RESULT([yes]) + MIT_CFLAGS="${MIT_CFLAGS} -Wextra -Wno-sign-compare" + MIT_CFLAGS="${MIT_CFLAGS} -Wno-unused-parameter" + MIT_CFLAGS="${MIT_CFLAGS} -Wold-style-definition" + # The generated shim code violates this big-time. + # MIT_CFLAGS="${MIT_CFLAGS} -Wmissing-prototypes" + MIT_CFLAGS="${MIT_CFLAGS} -Wunreachable-code" + MIT_CFLAGS="${MIT_CFLAGS} -Wwrite-strings" + ], + [AC_MSG_RESULT([no])]) +fi + AC_ARG_WITH([openssl], AS_HELP_STRING([--with-openssl], [Use OpenSSL crypto library if available [[yes]]])) @@ -128,6 +159,7 @@ MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" AC_SUBST([MIT_SCHEME_EXE]) +AC_SUBST([MIT_CFLAGS]) AC_SUBST([MIT_SCHEME_LIBDIR]) AC_SUBST([MIT_SCHEME_INCLUDEDIR]) AC_SUBST([MIT_SCHEME_PKD]) diff --git a/src/gdbm/Makefile.am b/src/gdbm/Makefile.am index 1b30bf81d..332e64860 100644 --- a/src/gdbm/Makefile.am +++ b/src/gdbm/Makefile.am @@ -50,6 +50,7 @@ dvidir = $(libdir)/mit-scheme/doc pdfdir = $(libdir)/mit-scheme/doc AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ +AM_CFLAGS = @MIT_CFLAGS@ gdbm_shim_la_LIBADD = gdbm-adapter.lo gdbm_shim_la_LDFLAGS = -module -avoid-version -shared diff --git a/src/gdbm/configure.ac b/src/gdbm/configure.ac index 82c6a4e1f..181de8888 100644 --- a/src/gdbm/configure.ac +++ b/src/gdbm/configure.ac @@ -41,6 +41,37 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +if test ${GCC} = yes; then + + MIT_CFLAGS="-Wall -Wundef -Wpointer-arith -Winline" + MIT_CFLAGS="${MIT_CFLAGS} -Wstrict-prototypes -Wnested-externs" + MIT_CFLAGS="${MIT_CFLAGS} -Wredundant-decls" + + AC_MSG_CHECKING([for GCC>=4]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #if __GNUC__ >= 4 + ; + #else + #error "gcc too old" + #endif + ]], + [[]] + )], + [ + AC_MSG_RESULT([yes]) + MIT_CFLAGS="${MIT_CFLAGS} -Wextra -Wno-sign-compare" + MIT_CFLAGS="${MIT_CFLAGS} -Wno-unused-parameter" + MIT_CFLAGS="${MIT_CFLAGS} -Wold-style-definition" + # The generated shim code violates this big-time. + # MIT_CFLAGS="${MIT_CFLAGS} -Wmissing-prototypes" + MIT_CFLAGS="${MIT_CFLAGS} -Wunreachable-code" + MIT_CFLAGS="${MIT_CFLAGS} -Wwrite-strings" + ], + [AC_MSG_RESULT([no])]) +fi + AC_CHECK_HEADER([gdbm.h],[],[ AC_MSG_ERROR([Header file not found.])]) @@ -82,6 +113,7 @@ done MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" +AC_SUBST([MIT_CFLAGS]) AC_SUBST([MIT_SCHEME_EXE]) AC_SUBST([MIT_SCHEME_LIBDIR]) AC_SUBST([MIT_SCHEME_INCLUDEDIR]) diff --git a/src/mcrypt/Makefile.am b/src/mcrypt/Makefile.am index eebefb43f..9bbc0225a 100644 --- a/src/mcrypt/Makefile.am +++ b/src/mcrypt/Makefile.am @@ -50,6 +50,7 @@ dvidir = $(libdir)/mit-scheme/doc pdfdir = $(libdir)/mit-scheme/doc AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ +AM_CFLAGS = @MIT_CFLAGS@ mcrypt_shim_la_LIBADD = mcrypt-adapter.lo mcrypt_shim_la_LDFLAGS = -module -avoid-version -shared diff --git a/src/mcrypt/configure.ac b/src/mcrypt/configure.ac index 1791995e5..cb6003cf2 100644 --- a/src/mcrypt/configure.ac +++ b/src/mcrypt/configure.ac @@ -68,6 +68,37 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +if test ${GCC} = yes; then + + MIT_CFLAGS="-Wall -Wundef -Wpointer-arith -Winline" + MIT_CFLAGS="${MIT_CFLAGS} -Wstrict-prototypes -Wnested-externs" + MIT_CFLAGS="${MIT_CFLAGS} -Wredundant-decls" + + AC_MSG_CHECKING([for GCC>=4]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #if __GNUC__ >= 4 + ; + #else + #error "gcc too old" + #endif + ]], + [[]] + )], + [ + AC_MSG_RESULT([yes]) + MIT_CFLAGS="${MIT_CFLAGS} -Wextra -Wno-sign-compare" + MIT_CFLAGS="${MIT_CFLAGS} -Wno-unused-parameter" + MIT_CFLAGS="${MIT_CFLAGS} -Wold-style-definition" + # The generated shim code violates this big-time. + # MIT_CFLAGS="${MIT_CFLAGS} -Wmissing-prototypes" + MIT_CFLAGS="${MIT_CFLAGS} -Wunreachable-code" + MIT_CFLAGS="${MIT_CFLAGS} -Wwrite-strings" + ], + [AC_MSG_RESULT([no])]) +fi + AC_CHECK_HEADER([mcrypt.h],[],[ AC_MSG_ERROR([Header file not found.])]) @@ -112,6 +143,7 @@ done MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" +AC_SUBST([MIT_CFLAGS]) AC_SUBST([MIT_SCHEME_EXE]) AC_SUBST([MIT_SCHEME_LIBDIR]) AC_SUBST([MIT_SCHEME_INCLUDEDIR]) diff --git a/src/md5/Makefile.am b/src/md5/Makefile.am index e261f0a98..15d6c0493 100644 --- a/src/md5/Makefile.am +++ b/src/md5/Makefile.am @@ -50,6 +50,7 @@ dvidir = $(libdir)/mit-scheme/doc pdfdir = $(libdir)/mit-scheme/doc AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ +AM_CFLAGS = @MIT_CFLAGS@ md5_shim_la_LIBADD = md5-adapter.lo md5_shim_la_LDFLAGS = -module -avoid-version -shared diff --git a/src/md5/configure.ac b/src/md5/configure.ac index 2e8019f85..79176dafe 100644 --- a/src/md5/configure.ac +++ b/src/md5/configure.ac @@ -68,6 +68,37 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +if test ${GCC} = yes; then + + MIT_CFLAGS="-Wall -Wundef -Wpointer-arith -Winline" + MIT_CFLAGS="${MIT_CFLAGS} -Wstrict-prototypes -Wnested-externs" + MIT_CFLAGS="${MIT_CFLAGS} -Wredundant-decls" + + AC_MSG_CHECKING([for GCC>=4]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #if __GNUC__ >= 4 + ; + #else + #error "gcc too old" + #endif + ]], + [[]] + )], + [ + AC_MSG_RESULT([yes]) + MIT_CFLAGS="${MIT_CFLAGS} -Wextra -Wno-sign-compare" + MIT_CFLAGS="${MIT_CFLAGS} -Wno-unused-parameter" + MIT_CFLAGS="${MIT_CFLAGS} -Wold-style-definition" + # The generated shim code violates this big-time. + # MIT_CFLAGS="${MIT_CFLAGS} -Wmissing-prototypes" + MIT_CFLAGS="${MIT_CFLAGS} -Wunreachable-code" + MIT_CFLAGS="${MIT_CFLAGS} -Wwrite-strings" + ], + [AC_MSG_RESULT([no])]) +fi + AC_ARG_WITH([openssl], AS_HELP_STRING([--with-openssl], [Use OpenSSL crypto library if available [[yes]]])) @@ -127,6 +158,7 @@ done MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" +AC_SUBST([MIT_CFLAGS]) AC_SUBST([MIT_SCHEME_EXE]) AC_SUBST([MIT_SCHEME_LIBDIR]) AC_SUBST([MIT_SCHEME_INCLUDEDIR]) diff --git a/src/mhash/Makefile.am b/src/mhash/Makefile.am index 0373bb5de..9dd3dd3f3 100644 --- a/src/mhash/Makefile.am +++ b/src/mhash/Makefile.am @@ -50,6 +50,7 @@ dvidir = $(libdir)/mit-scheme/doc pdfdir = $(libdir)/mit-scheme/doc AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ +AM_CFLAGS = @MIT_CFLAGS@ mhash_shim_la_LIBADD = mhash-adapter.lo mhash_shim_la_LDFLAGS = -module -avoid-version -shared diff --git a/src/mhash/configure.ac b/src/mhash/configure.ac index 9b22fecdc..fcf64adba 100644 --- a/src/mhash/configure.ac +++ b/src/mhash/configure.ac @@ -68,6 +68,37 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +if test ${GCC} = yes; then + + MIT_CFLAGS="-Wall -Wundef -Wpointer-arith -Winline" + MIT_CFLAGS="${MIT_CFLAGS} -Wstrict-prototypes -Wnested-externs" + MIT_CFLAGS="${MIT_CFLAGS} -Wredundant-decls" + + AC_MSG_CHECKING([for GCC>=4]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #if __GNUC__ >= 4 + ; + #else + #error "gcc too old" + #endif + ]], + [[]] + )], + [ + AC_MSG_RESULT([yes]) + MIT_CFLAGS="${MIT_CFLAGS} -Wextra -Wno-sign-compare" + MIT_CFLAGS="${MIT_CFLAGS} -Wno-unused-parameter" + MIT_CFLAGS="${MIT_CFLAGS} -Wold-style-definition" + # The generated shim code violates this big-time. + # MIT_CFLAGS="${MIT_CFLAGS} -Wmissing-prototypes" + MIT_CFLAGS="${MIT_CFLAGS} -Wunreachable-code" + MIT_CFLAGS="${MIT_CFLAGS} -Wwrite-strings" + ], + [AC_MSG_RESULT([no])]) +fi + AC_CHECK_HEADER([mhash.h],[],[ AC_MSG_ERROR([Header file not found.])]) @@ -109,6 +140,7 @@ done MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" +AC_SUBST([MIT_CFLAGS]) AC_SUBST([MIT_SCHEME_EXE]) AC_SUBST([MIT_SCHEME_LIBDIR]) AC_SUBST([MIT_SCHEME_INCLUDEDIR]) diff --git a/src/x11/Makefile.am b/src/x11/Makefile.am index b2f394a0b..e4216c6f3 100644 --- a/src/x11/Makefile.am +++ b/src/x11/Makefile.am @@ -50,7 +50,8 @@ dvidir = $(libdir)/mit-scheme/doc pdfdir = $(libdir)/mit-scheme/doc AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ -AM_CFLAGS = `pkg-config --cflags x11` +AM_CFLAGS = @MIT_CFLAGS@ +AM_CFLAGS += `pkg-config --cflags x11` LIBS = `pkg-config --libs x11` x11_shim_la_LIBADD = x11base.lo x11color.lo x11graph.lo x11term.lo diff --git a/src/x11/configure.ac b/src/x11/configure.ac index ed3aed8ef..2eb5cc61f 100644 --- a/src/x11/configure.ac +++ b/src/x11/configure.ac @@ -40,6 +40,37 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +if test ${GCC} = yes; then + + MIT_CFLAGS="-Wall -Wundef -Wpointer-arith -Winline" + MIT_CFLAGS="${MIT_CFLAGS} -Wstrict-prototypes -Wnested-externs" + MIT_CFLAGS="${MIT_CFLAGS} -Wredundant-decls" + + AC_MSG_CHECKING([for GCC>=4]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #if __GNUC__ >= 4 + ; + #else + #error "gcc too old" + #endif + ]], + [[]] + )], + [ + AC_MSG_RESULT([yes]) + MIT_CFLAGS="${MIT_CFLAGS} -Wextra -Wno-sign-compare" + MIT_CFLAGS="${MIT_CFLAGS} -Wno-unused-parameter" + MIT_CFLAGS="${MIT_CFLAGS} -Wold-style-definition" + # The generated shim code violates this big-time. + # MIT_CFLAGS="${MIT_CFLAGS} -Wmissing-prototypes" + MIT_CFLAGS="${MIT_CFLAGS} -Wunreachable-code" + MIT_CFLAGS="${MIT_CFLAGS} -Wwrite-strings" + ], + [AC_MSG_RESULT([no])]) +fi + AC_CHECK_PROG([PKG_CONFIG], [pkg-config], [yes]) if ! pkg-config --exists x11 2>/dev/null; then @@ -82,6 +113,7 @@ done MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" +AC_SUBST([MIT_CFLAGS]) AC_SUBST([MIT_SCHEME_EXE]) AC_SUBST([MIT_SCHEME_LIBDIR]) AC_SUBST([MIT_SCHEME_INCLUDEDIR]) -- 2.25.1