gtk plugins: Add MIT_CFLAGS for maximal warnage.
authorMatt Birkholz <matt@birchwood-abbey.net>
Fri, 19 May 2017 20:18:57 +0000 (13:18 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sat, 20 May 2017 17:57:36 +0000 (10:57 -0700)
src/cairo/Makefile.am
src/cairo/configure.ac
src/gl/Makefile.am
src/gl/configure.ac
src/glib/Makefile.am
src/glib/configure.ac
src/gtk/Makefile.am
src/gtk/configure.ac
src/pango/Makefile.am
src/pango/configure.ac
src/x11/Makefile.am

index 858457a07b04453c03d87797cffe03137725cfb9..b257d28e1db3aac5e306c30bbedd8b58c2e890f3 100644 (file)
@@ -49,6 +49,7 @@ AM_UPDATE_INFO_DIR = no
 
 AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@
 AM_CFLAGS = `pkg-config --cflags pangocairo`
+AM_CFLAGS += @MIT_CFLAGS@
 LIBS = `pkg-config --libs pangocairo`
 
 cairo_shim_la_LDFLAGS = -module -avoid-version -shared
index 747cb1d151e394ed3688e020cd5683be0ab43eb4..5cf8d7a96e3c350086c0b29e2497605bcb21116d 100644 (file)
@@ -67,6 +67,37 @@ if ! pkg-config --exists cairo 2>/dev/null; then
     AC_MSG_ERROR([Cairo not found.])
 fi
 
+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
+
 MIT_SCHEME_PROJECT=mit-scheme-pucked
 : ${MIT_SCHEME_EXE=mit-scheme}
 MIT_SCHEME_LIBDIR=`( echo "(display (->namestring" ;\
@@ -86,6 +117,7 @@ pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf'
 
 AC_SUBST([MIT_SCHEME_PROJECT])
 AC_SUBST([MIT_SCHEME_EXE])
+AC_SUBST([MIT_CFLAGS])
 AC_SUBST([MIT_SCHEME_LIBDIR])
 AC_SUBST([MIT_SCHEME_INCLUDEDIR])
 AC_SUBST([MIT_SCHEME_OS_SUFFIX])
index cbac409d76e948a27a1ef8b7bf4989e3677abdcf..d894c286c4aecd2dea631b70d327e67df8c465ec 100644 (file)
@@ -50,6 +50,7 @@ scmlib_sub_DATA += make.scm gl-@MIT_SCHEME_OS_SUFFIX@.pkd
 
 AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@
 AM_CFLAGS = `pkg-config --cflags gl glu gtk+-3.0`
+AM_CFLAGS += @MIT_CFLAGS@
 LIBS = `pkg-config --libs gl glu gtk+-3.0`
 
 gl_shim_la_LIBADD = gl-adapter.lo
index 394600b6b92a698e9ba21de695adcb7e2731d3c5..945b1ddceea28f2a118bc9421ec64be3da85ac85 100644 (file)
@@ -67,6 +67,37 @@ if ! pkg-config --exists gl glu gtk+-3.0 2>/dev/null; then
     AC_MSG_ERROR([libGL not found.])
 fi
 
+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
+
 MIT_SCHEME_PROJECT=mit-scheme-pucked
 : ${MIT_SCHEME_EXE=mit-scheme}
 MIT_SCHEME_LIBDIR=`( echo "(display (->namestring" ;\
@@ -86,6 +117,7 @@ pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf'
 
 AC_SUBST([MIT_SCHEME_PROJECT])
 AC_SUBST([MIT_SCHEME_EXE])
+AC_SUBST([MIT_CFLAGS])
 AC_SUBST([MIT_SCHEME_LIBDIR])
 AC_SUBST([MIT_SCHEME_INCLUDEDIR])
 AC_SUBST([MIT_SCHEME_OS_SUFFIX])
index ec03457b55e627c8a48f736eabd12985b2d43cd2..eabe887d9d47fe03cf94ac36a48aabbe93d2902b 100644 (file)
@@ -52,6 +52,7 @@ AM_UPDATE_INFO_DIR = no
 
 AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@
 AM_CFLAGS = `pkg-config --cflags gio-2.0`
+AM_CFLAGS += @MIT_CFLAGS@
 LIBS = `pkg-config --libs glib-2.0 gthread-2.0 gio-2.0`
 
 glib_shim_la_LIBADD = glibio.lo
index 210ce70372741bda74bc868a00881f331f81a343..4a08ab238fda989a940a1e2be56e9379dac6b60a 100644 (file)
@@ -67,6 +67,37 @@ if ! pkg-config --exists glib-2.0 2>/dev/null; then
     AC_MSG_ERROR([GLib 2.0 not found.])
 fi
 
+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
+
 MIT_SCHEME_PROJECT=mit-scheme-pucked
 : ${MIT_SCHEME_EXE=mit-scheme}
 MIT_SCHEME_LIBDIR=`( echo "(display (->namestring" ;\
@@ -86,6 +117,7 @@ pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf'
 
 AC_SUBST([MIT_SCHEME_PROJECT])
 AC_SUBST([MIT_SCHEME_EXE])
+AC_SUBST([MIT_CFLAGS])
 AC_SUBST([MIT_SCHEME_LIBDIR])
 AC_SUBST([MIT_SCHEME_INCLUDEDIR])
 AC_SUBST([MIT_SCHEME_OS_SUFFIX])
index 17dcda32d0083355cb0202c6ed9bdffb072bc4ff..e60ca84751e578f2a064ae0c850130dd918ff466 100644 (file)
@@ -62,6 +62,7 @@ AM_UPDATE_INFO_DIR = no
 
 AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@
 AM_CFLAGS = `pkg-config --cflags gtk+-3.0`
+AM_CFLAGS += @MIT_CFLAGS@
 LIBS = `pkg-config --libs gtk+-3.0 gthread-2.0`
 
 gtk_shim_la_LIBADD = gtkio.lo scmwidget.lo gtkpanedview.lo gtkscrolledview.lo
index adb5882a0331d6bdeaa40264df0918d5d941dd14..0541b90d17988420fa710ed793ae4e2990697298 100644 (file)
@@ -93,6 +93,37 @@ fi
 ln -sf gtkscrolledview-$GTK_VERSION.c gtkscrolledview.c
 ln -sf gtkpanedview-$GTK_VERSION.c gtkpanedview.c
 
+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
+
 MIT_SCHEME_PROJECT=mit-scheme-pucked
 : ${MIT_SCHEME_EXE=mit-scheme}
 MIT_SCHEME_LIBDIR=`( echo "(display (->namestring" ;\
@@ -112,6 +143,7 @@ pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf'
 
 AC_SUBST([MIT_SCHEME_PROJECT])
 AC_SUBST([MIT_SCHEME_EXE])
+AC_SUBST([MIT_CFLAGS])
 AC_SUBST([MIT_SCHEME_LIBDIR])
 AC_SUBST([MIT_SCHEME_INCLUDEDIR])
 AC_SUBST([MIT_SCHEME_OS_SUFFIX])
index 4197e1a38aa0aa49374445623e02fb57247f5895..a1df145549b02f850888606df5c7a49391012b18 100644 (file)
@@ -48,6 +48,7 @@ AM_UPDATE_INFO_DIR = no
 
 AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@
 AM_CFLAGS = `pkg-config --cflags pango`
+AM_CFLAGS += @MIT_CFLAGS@
 LIBS = `pkg-config --libs pango`
 
 pango_shim_la_LDFLAGS = -module -avoid-version -shared
index 6a99aaab176cf095baacd68db89c8ef888a9e2bd..ffcac50ffce1d9c33c3a6a5e419acfe382a8edfb 100644 (file)
@@ -67,6 +67,37 @@ if ! pkg-config --exists pango 2>/dev/null; then
     AC_MSG_ERROR([Pango not found.])
 fi
 
+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
+
 MIT_SCHEME_PROJECT=mit-scheme-pucked
 : ${MIT_SCHEME_EXE=mit-scheme}
 MIT_SCHEME_LIBDIR=`( echo "(display (->namestring" ;\
@@ -86,6 +117,7 @@ pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf'
 
 AC_SUBST([MIT_SCHEME_PROJECT])
 AC_SUBST([MIT_SCHEME_EXE])
+AC_SUBST([MIT_CFLAGS])
 AC_SUBST([MIT_SCHEME_LIBDIR])
 AC_SUBST([MIT_SCHEME_INCLUDEDIR])
 AC_SUBST([MIT_SCHEME_OS_SUFFIX])
index 29ab3245ce596ce2008cb21a3201c48ea6a4b311..51de7846974a4d40099958fd8a9469d6524044d8 100644 (file)
@@ -46,8 +46,8 @@ scmlib_sub_DATA += make.scm @MIT_SCHEME_PKD@
 #AM_MAKEINFOHTMLFLAGS = --no-split
 
 AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@
-AM_CFLAGS = @MIT_CFLAGS@
-AM_CFLAGS += `pkg-config --cflags x11`
+AM_CFLAGS = `pkg-config --cflags x11`
+AM_CFLAGS += @MIT_CFLAGS@
 LIBS = `pkg-config --libs x11`
 
 x11_shim_la_LIBADD = x11base.lo x11color.lo x11graph.lo x11term.lo