Index: /trunk/psLib/configure.ac
===================================================================
--- /trunk/psLib/configure.ac	(revision 7463)
+++ /trunk/psLib/configure.ac	(revision 7464)
@@ -159,7 +159,9 @@
 
 dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
+TMP_CFLAGS=${CPPFLAGS}
 TMP_CFLAGS=${CFLAGS}
 TMP_LDFLAGS=${LDFLAGS}
 
+CPPFLAGS=${PSLIB_CFLAGS}
 CFLAGS=${PSLIB_CFLAGS}
 LDFLAGS=${PSLIB_LIBS}
@@ -180,4 +182,5 @@
 
 dnl restore the CFLAGS/LDFLAGS
+CPPFLAGS=${TMP_CPPFLAGS}
 CFLAGS=${TMP_CFLAGS}
 LDFLAGS=${TMP_LDFLAGS}
@@ -200,9 +203,11 @@
 PSLIB_LIBS="${PSLIB_LIBS=} $FFTW3_LDFLAGS -lfftw3f"
 
-dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
+dnl Store off CPPFLAGS/CFLAGS/LDFLAGS so that they can be restored after tests
+TMP_CPPFLAGS=${CPPFLAGS}
 TMP_CFLAGS=${CFLAGS}
 TMP_LDFLAGS=${LDFLAGS}
 
 CFLAGS="${TMP_CFLAGS} ${PSLIB_CFLAGS}"
+CPPFLAGS="$CFLAGS"
 LDFLAGS="${TMP_LDFLAGS} ${PSLIB_LIBS}"
 AC_CHECK_HEADERS([fftw3.h],[],
@@ -215,4 +220,5 @@
 
 dnl restore the CFLAGS/LDFLAGS
+CPPFLAGS=${TMP_CPPFLAGS}
 CFLAGS=${TMP_CFLAGS}
 LDFLAGS=${TMP_LDFLAGS}
@@ -254,9 +260,11 @@
 [JPEG_LDFLAGS="-L$withval"])
 
-dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
+dnl Store off CPPFLAGS/CFLAGS/LDFLAGS so that they can be restored after tests
+TMP_CPPFLAGS=${CPPFLAGS}
 TMP_CFLAGS=${CFLAGS}
 TMP_LDFLAGS=${LDFLAGS}
 
 CFLAGS="${TMP_CFLAGS} ${JPEG_CFLAGS}"
+CPPFLAGS="$CFLAGS"
 LDFLAGS="${TMP_LDFLAGS} ${JPEG_LDFLAGS}"
 
@@ -269,5 +277,6 @@
 )
 
-dnl restore the CFLAGS/LDFLAGS
+dnl restore the CFLAGS/LDFLAGS in case we decide to make missing libjpeg only a warning
+CPPFLAGS=${TMP_CPPFLAGS}
 CFLAGS=${TMP_CFLAGS}
 LDFLAGS=${TMP_LDFLAGS}
