Index: /branches/eam_branches/ipp-20120601/psLib/m4/ipp_stdopts.m4
===================================================================
--- /branches/eam_branches/ipp-20120601/psLib/m4/ipp_stdopts.m4	(revision 34002)
+++ /branches/eam_branches/ipp-20120601/psLib/m4/ipp_stdopts.m4	(revision 34003)
@@ -1,8 +1,8 @@
 
-    dnl this is currently written to override an user-defined CFLAGS, is that OK?
     dnl this is currently written to override an user-defined LDFLAGS, is that OK?
 
 AC_DEFUN([IPP_STDCFLAGS],
 [
+    dnl this section currently overrides a user-defined CFLAGS
     AC_ARG_ENABLE(optimize,
       [AS_HELP_STRING(--enable-optimize,enable compiler optimization)],
@@ -12,4 +12,21 @@
         if test x"${CFLAGS}" == x; then
           CFLAGS="-pipe -O0 -g"
+        fi
+      ]
+    )
+    AC_ARG_ENABLE(debug-build,
+      [AS_HELP_STRING(--enable-debug-build,enable debug build: ie disable Werror)],
+      [AC_MSG_RESULT(debug build enabled)
+        if test x"${CFLAGS}" == x; then
+          CFLAGS="-Wall"
+	else
+          CFLAGS="${CFLAGS=} -Wall"
+        fi
+      ],
+      [AC_MSG_RESULT([compile optimization disabled])
+        if test x"${CFLAGS}" == x; then
+          CFLAGS="-Wall -Werror"
+	else
+          CFLAGS="${CFLAGS=} -Wall -Werror"
         fi
       ]
Index: /branches/eam_branches/ipp-20120601/psconfig/psbuild
===================================================================
--- /branches/eam_branches/ipp-20120601/psconfig/psbuild	(revision 34002)
+++ /branches/eam_branches/ipp-20120601/psconfig/psbuild	(revision 34003)
@@ -9,4 +9,6 @@
 $optimize = 0;
 $profile = 0;
+$no_as_needed = 0;
+$debug_build = 0;
 $developer = 0;
 $magic = 0;
@@ -72,4 +74,12 @@
     if ($ARGV[0] eq "-profile") {
         $profile = 1;
+        shift; next;
+    }
+    if ($ARGV[0] eq "-no-as-needed") {
+        $no_as_needed = 1;
+        shift; next;
+    }
+    if ($ARGV[0] eq "-debug-build") {
+        $debug_build = 1;
         shift; next;
     }
@@ -262,4 +272,6 @@
     if ($optimize) { $psopts = "$psopts --enable-optimize"; }
     if ($profile)  { $psopts = "$psopts --enable-profile --disable-shared --enable-static"; }
+    if ($debug_build)  { $psopts = "$psopts --enable-debug_build"; }
+    if ($no_as_needed)  { $psopts = "$psopts --enable-no-as-needed"; }
     $psopts .= " --disable-version" if $offline;
 
@@ -479,4 +491,6 @@
     print STDERR "     : -optimize          : set flags for optimized code\n";
     print STDERR "     : -profile           : set flags for profiling\n";
+    print STDERR "     : -debug-build       : set flags for debug build (Wall, but not Werror; use to find and fix warnings from Wall)\n";
+    print STDERR "     : -no-as-needed      : add --no-as-needed flag to gcc (to disable default --as-needed flags from Ubuntu, etc)\n";
     print STDERR "     : -only (module)     : only build the specified module\n";
     print STDERR "     : -start (module)    : begin build at specified module\n";
