add -Werror=declaration-after-statement only to stdlib extension modules (closes #21121)

Patch from Stefan Krah.
diff --git a/configure b/configure
index 87e6f3e..7379203 100755
--- a/configure
+++ b/configure
@@ -662,6 +662,7 @@
 LIBTOOL_CRUFT
 OTHER_LIBTOOL_OPT
 UNIVERSAL_ARCH_FLAGS
+CFLAGS_NODIST
 BASECFLAGS
 OPT
 ABIFLAGS
@@ -6292,6 +6293,7 @@
 
 
 
+
 # The -arch flags for universal builds on OSX
 UNIVERSAL_ARCH_FLAGS=
 
@@ -6452,7 +6454,7 @@
 
     if test $ac_cv_declaration_after_statement_warning = yes
     then
-      BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement"
+      CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
     fi
 
     # if using gcc on alpha, use -mieee to get (near) full IEEE 754