plugin Makefile.ams, configure.acs (AM_CFLAGS): Add many -W options.
authorMatt Birkholz <matt@birchwood-abbey.net>
Thu, 17 Nov 2016 22:11:22 +0000 (15:11 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Thu, 17 Nov 2016 22:11:22 +0000 (15:11 -0700)
12 files changed:
src/blowfish/Makefile.am
src/blowfish/configure.ac
src/gdbm/Makefile.am
src/gdbm/configure.ac
src/mcrypt/Makefile.am
src/mcrypt/configure.ac
src/md5/Makefile.am
src/md5/configure.ac
src/mhash/Makefile.am
src/mhash/configure.ac
src/x11/Makefile.am
src/x11/configure.ac

index 067e13b2ba9b909c7ee5273fa89616d489e167be..f6b4ddec5e54d28d1b8720832513433e6864c8db 100644 (file)
@@ -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
index 92e20a5b6d7c7c1dc155510f3db9699572267ccc..2da328cb9b32186f879781cda6200b9c8dce3a1e 100644 (file)
@@ -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])
index 1b30bf81db4ab850dc13cd1bb8eb465ae74c7f5b..332e648603508b1eccbe8786f1e27bef34b9e9b5 100644 (file)
@@ -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
index 82c6a4e1feb085bdcac543ffaade0929a02f2bfd..181de8888c6e7e3c6f77eab70afed6ad60747f27 100644 (file)
@@ -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 <gdbm.h> 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])
index eebefb43f07afb4d8a8cb7d21d65817a91cd54f4..9bbc0225ac8c8b15c26ff678e38406be5da10a91 100644 (file)
@@ -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
index 1791995e51554a4327ba93385fdfa6a1b344440c..cb6003cf2bc0e9a95d5c8f8754f33791f6936bb4 100644 (file)
@@ -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 <mcrypt.h> 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])
index e261f0a98680042ec2f3fd48413bc3086e248f49..15d6c0493f74f0421aa2496732b891e1d0032455 100644 (file)
@@ -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
index 2e8019f85fd2a5cae742e5bd989f4dd5e01daadd..79176dafe45e0759fd7a3e0d7599149e446b7f53 100644 (file)
@@ -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])
index 0373bb5de2fe479d137aa71743699a72b7c94e85..9dd3dd3f369455d390e80f701e0065626f4c0f8a 100644 (file)
@@ -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
index 9b22fecdc5dd3cd25b7e96a2de41867a2b797bcd..fcf64adba06f854e9e3969bb22938771c5782c9d 100644 (file)
@@ -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 <mhash.h> 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])
index b2f394a0b6a80003c21fbffde3a806c8a024c71f..e4216c6f3604060a88bc4e9bf1988d725dcdcd3a 100644 (file)
@@ -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
index ed3aed8efcfdd7fc5bc6ca3e459399b45858c025..2eb5cc61fe69217e7c8ffa45a1cec4d861220f08 100644 (file)
@@ -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])