Index: /branches/eam_branches/ipp-20120601/dvoTools/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/dvoTools/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/dvoTools/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: /branches/eam_branches/ipp-20120601/glueforge/templates/psdb/configure_ac.tt
===================================================================
--- /branches/eam_branches/ipp-20120601/glueforge/templates/psdb/configure_ac.tt	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/glueforge/templates/psdb/configure_ac.tt	(revision 34076)
@@ -13,4 +13,6 @@
 AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE
+
+IPP_STDLDFLAGS
 
 AC_CONFIG_TESTDIR([tests])
@@ -54,6 +56,7 @@
 dnl is this the best was to setup recursive CFLAGS?
 IPP_STDOPTS
-dnl -Werror causes problems on OSX as inttypes.h uses some non standard C types
-[% pkg_name %]_CFLAGS="-Wall -pedantic -fno-strict-aliasing"
+IPP_STDCFLAGS
+
+[% pkg_name %]_CFLAGS="-pedantic -fno-strict-aliasing"
 AC_SUBST([[% pkg_name %]_CFLAGS])
 
Index: /branches/eam_branches/ipp-20120601/ippToPsps/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ippToPsps/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ippToPsps/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -31,4 +31,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
+IPP_STDCFLAGS
 dnl CFLAGS="${CFLAGS=} -Wall -Werror"
 echo "IPPTOPSPS_CFLAGS: $IPPTOPSPS_CFLAGS"
Index: /branches/eam_branches/ipp-20120601/ippTools/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ippTools/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ippTools/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -57,5 +57,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPPDB_VERSION=`$PKG_CONFIG --modversion ippdb`
Index: /branches/eam_branches/ipp-20120601/pedestal/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/pedestal/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/pedestal/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -20,5 +20,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: /branches/eam_branches/ipp-20120601/ppArith/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppArith/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppArith/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -24,5 +24,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppBackground/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppBackground/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppBackground/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -30,5 +30,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppConfigDump/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppConfigDump/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppConfigDump/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: /branches/eam_branches/ipp-20120601/ppImage/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppImage/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppImage/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -24,5 +24,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppMerge/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppMerge/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppMerge/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -24,5 +24,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: /branches/eam_branches/ipp-20120601/ppNoiseMap/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppNoiseMap/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppNoiseMap/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppNorm/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppNorm/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppNorm/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: /branches/eam_branches/ipp-20120601/ppSim/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSim/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppSim/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -25,5 +25,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: /branches/eam_branches/ipp-20120601/ppSkycell/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSkycell/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppSkycell/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -23,5 +23,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppSmooth/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSmooth/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppSmooth/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppStack/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppStack/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppStack/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -28,5 +28,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppStats/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppStats/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppStats/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,6 +21,6 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror -std=c99"
-dnl the above should no longer be needed (provided by stdopts)
+IPP_STDCFLAGS
+
 dnl not clear why the below is needed
 CFLAGS="${CFLAGS=} -std=c99"
Index: /branches/eam_branches/ipp-20120601/ppSub/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSub/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppSub/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -30,5 +30,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppTranslate/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppTranslate/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppTranslate/configure.ac	(revision 34076)
@@ -10,5 +10,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -30,5 +30,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppViz/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppViz/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppViz/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -23,5 +23,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/ppbgrestore/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/ppbgrestore/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/ppbgrestore/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -32,10 +32,7 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
-
-# echo "PPSTAMP_CFLAGS: $PPSTAMP_CFLAGS"
-# echo "PPSTAMP_LIBS: $PPSTAMP_LIBS"
 
 AC_SUBST([PPSTAMP_CFLAGS])
Index: /branches/eam_branches/ipp-20120601/psLib/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/psLib/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/psLib/configure.ac	(revision 34076)
@@ -27,5 +27,5 @@
 AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
 
-dnl move ? IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 dnl ------------------- PERL options ---------------------
@@ -473,9 +473,5 @@
 dnl ------- enable -Werror after all of the probes have run ---------
 IPP_STDOPTS
-
 IPP_STDCFLAGS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
-dnl CFLAGS="${CFLAGS} -Wall"
-dnl enable POSIX/XSI and C99 compliance
 CFLAGS="${CFLAGS=} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"
 
Index: /branches/eam_branches/ipp-20120601/psLib/m4/ipp_stdopts.m4
===================================================================
--- /branches/eam_branches/ipp-20120601/psLib/m4/ipp_stdopts.m4	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/psLib/m4/ipp_stdopts.m4	(revision 34076)
@@ -1,5 +1,4 @@
 
-    dnl this is currently written to override an user-defined LDFLAGS, is that OK?
-
+dnl IPP_STDCFLAGS must go *after* external probes (to avoid Werror confusing things)
 AC_DEFUN([IPP_STDCFLAGS],
 [
@@ -15,4 +14,5 @@
       ]
     )
+    dnl this section accepts a user-defined CFLAGS, and sets CFLAGS to the empty string if not present
     AC_ARG_ENABLE(debug-build,
       [AS_HELP_STRING(--enable-debug-build,enable debug build: ie disable Werror)],
@@ -32,10 +32,22 @@
       ]
     )
-    AC_ARG_ENABLE(no-as-needed, [AS_HELP_STRING(--enable-no-as-needed, prevent as-needed option sometimes supplied to gcc such as Ubuntu after 11.11)],
-      [AC_MSG_RESULT(compile optimization enabled) 
+])
+
+dnl IPP_STDLDFLAGS must go *before* external probes (so linking is done with --no-as-needed if needed)
+AC_DEFUN([IPP_STDLDFLAGS],
+[
+    dnl this section accepts a user-defined LDFLAGS, and sets LDFLAGS to the empty string if not present
+    AC_ARG_ENABLE(no-as-needed, 
+      [AS_HELP_STRING(--enable-no-as-needed, prevent as-needed option sometimes supplied to gcc such as Ubuntu after 11.11)],
+      [AC_MSG_RESULT(no-as-needed passed to linker) 
       	if test x"${LDFLAGS}" == x; then
+          LDFLAGS="-Wl,--no-as-needed"
+	else
           LDFLAGS="${LDFLAGS=} -Wl,--no-as-needed"
-	else
-          LDFLAGS="-Wl,--no-as-needed"
+	fi
+      ],
+      [AC_MSG_RESULT(as-needed linker flags accepted) 
+      	if test x"${LDFLAGS}" == x; then
+          LDFLAGS=""
 	fi
       ]
Index: /branches/eam_branches/ipp-20120601/psModules/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/psModules/configure.ac	(revision 34076)
@@ -14,5 +14,5 @@
 AC_SUBST(PSMODULES_LT_VERSION,$PSMODULES_LT_VERSION)
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -312,6 +312,6 @@
 dnl ------- enable -Werror after all of the probes have run ---------
 IPP_STDOPTS
-
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
+
 dnl enable POSIX/XSI and C99 compliance
 CFLAGS="${CFLAGS=} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"
Index: /branches/eam_branches/ipp-20120601/psastro/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/psastro/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/psastro/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -189,5 +189,6 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
+
 echo "PSASTRO_CFLAGS: $PSASTRO_CFLAGS"
 echo "PSASTRO_LIBS: $PSASTRO_LIBS"
Index: /branches/eam_branches/ipp-20120601/psphot/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/psphot/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/psphot/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -199,6 +199,6 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
+
 echo "PSPHOT_CFLAGS: $PSPHOT_CFLAGS"
 echo "PSPHOT_LIBS: $PSPHOT_LIBS"
@@ -207,5 +207,5 @@
 
 dnl note: the PSPHOT_ entries below do not include PSLIB_ and PSMODULE_ entires
-dnl those are passed down to lower Makefils
+dnl those are passed down to lower Makefiles by the PKG_CHECK_MODULES call above
 AC_SUBST([PSPHOT_CFLAGS])
 AC_SUBST([PSPHOT_LIBS])
Index: /branches/eam_branches/ipp-20120601/pstamp/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/pstamp/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/pstamp/configure.ac	(revision 34076)
@@ -10,5 +10,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -46,5 +46,6 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
+
 PPSTAMP_CFLAGS="${PSLIB_CFLAGS=} ${PSMODULE_CFLAGS=} ${OHANA_CFLAGS}"
 PPSTAMP_LIBS="${PSLIB_LIBS=} ${PSMODULE_LIBS=} ${OHANA_LIBS}"
Index: /branches/eam_branches/ipp-20120601/psvideophot/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/psvideophot/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/psvideophot/configure.ac	(revision 34076)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -24,5 +24,5 @@
 
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: /branches/eam_branches/ipp-20120601/pswarp/configure.ac
===================================================================
--- /branches/eam_branches/ipp-20120601/pswarp/configure.ac	(revision 34075)
+++ /branches/eam_branches/ipp-20120601/pswarp/configure.ac	(revision 34076)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -33,5 +33,6 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-dnl CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
+
 echo "PSWARP_CFLAGS: $PSWARP_CFLAGS"
 echo "PSWARP_LIBS: $PSWARP_LIBS"
