+
+
+
+ # Check whether --enable-precomp-headers or --disable-precomp-headers was given.
+if test "${enable_precomp_headers+set}" = set; then
+ enableval="$enable_precomp_headers"
+ bk_use_pch="$enableval"
+fi;
+
+ GCC_PCH=0
+
+ if test "x$bk_use_pch" = "x" -o "x$bk_use_pch" = "xyes" ; then
+ if test "x$GCC" = "xyes"; then
+ echo "$as_me:$LINENO: checking if the compiler supports precompiled headers" >&5
+echo $ECHO_N "checking if the compiler supports precompiled headers... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #if !defined(__GNUC__) || !defined(__GNUC_MINOR__) || \
+ (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
+ #error "no pch support"
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ CPPFLAGS="-fpch-deps $CPPFLAGS"
+ GCC_PCH=1
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ if test $GCC_PCH = 1 ; then
+ cat <<EOF >bk-make-pch
+#!/bin/sh
+
+# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
+# script. It is used to generated precompiled headers.
+#
+# Permission is given to use this file in any way.
+
+outfile="\${1}"
+header="\${2}"
+shift
+shift
+
+compiler=
+headerfile=
+while test \${#} -gt 0; do
+ case "\${1}" in
+ -I* )
+ incdir=\`echo \${1} | sed -e 's/-I\(.*\)/\1/g'\`
+ if test "x\${headerfile}" = "x" -a -f "\${incdir}/\${header}" ; then
+ headerfile="\${incdir}/\${header}"
+ fi
+ ;;
+ esac
+ compiler="\${compiler} \${1}"
+ shift
+done
+
+if test "x\${headerfile}" = "x" ; then
+ echo "error: can't find header \${header} in include paths" >2
+else
+ if test -f \${outfile} ; then
+ rm -f \${outfile}
+ else
+ mkdir -p \`dirname \${outfile}\`
+ fi
+ depsfile=".deps/\`basename \${outfile}\`.d"
+ mkdir -p .deps
+ # can do this because gcc is >= 3.4:
+ \${compiler} -o \${outfile} -MMD -MF "\${depsfile}" "\${headerfile}"
+ exit \${?}
+fi
+EOF
+ chmod +x bk-make-pch
+ fi
+ fi
+ fi
+
+
+
+
+