+dnl =================================================================
+dnl config.h Header/footer
+dnl =================================================================
+
+AH_TOP(
+[#ifndef CONFIG_H_INCLUDED
+#define CONFIG_H_INCLUDED
+
+/*********************************************************************
+ *
+ * File : config.h
+ *
+ * Purpose : This file should be the first thing included in every
+ * .c file. (Before even system headers). It contains
+ * #define statements for various features. It was
+ * introduced because the compile command line started
+ * getting ludicrously long with feature defines.
+ *
+ * Copyright : Written by and Copyright (C) 2001 the SourceForge
+ * Privoxy team. http://www.privoxy.org/
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will
+ * be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * The GNU General Public License should be included with
+ * this file. If not, you can view it at
+ * http://www.gnu.org/copyleft/gpl.html
+ * or write to the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *********************************************************************/
+\f
+
+/*
+ * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h
+ * under VC++, and it usually gives many wierd error messages. Let's make
+ * the error messages understandable, by bailing out now.
+ */
+#ifdef _MSC_VER
+#error For MS VC++, please use vc_config_winthreads.h or vc_config_pthreads.h. You can usually do this by selecting the "Build", "Clean" menu option.
+#endif /* def _MSC_VER */
+
+])
+
+AH_BOTTOM(
+[
+
+/*
+ * Defined always.
+ * FIXME: Don't know what it does or why we need it.
+ * (presumably something to do with ANSI Standard C?)
+ */
+#ifndef __STDC__
+#define __STDC__ 1
+#endif /* ndef __STDC__ */
+
+/*
+ * Need to set up this define only for the Pthreads library for
+ * Win32, available from http://sources.redhat.com/pthreads-win32/
+ */
+#if defined(FEATURE_PTHREAD) && defined(_WIN32)
+#define __CLEANUP_C
+#endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */
+
+/*
+ * BEOS does not currently support POSIX threads.
+ * This *should* be detected by ./configure, but let's be sure.
+ */
+#if defined(FEATURE_PTHREAD) && defined(__BEOS__)
+#error BEOS does not support pthread - please run ./configure again with "--disable-pthread"
+
+#endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */
+
+
+#endif /* CONFIG_H_INCLUDED */
+])
+
+dnl =================================================================
+dnl DocBook stuff
+dnl =================================================================
+
+AC_ARG_WITH(docbook, dnl
+ --with-docbook=<directory>
+ Set the location of the dsssl stylesheet
+ (default = search),[dnl
+DKPREFIX=$withval
+])
+
+dnl Check for jade, so we can build the documentation
+dnl Openjade is preferred according to docs, but jade
+dnl is *much* faster.
+AC_CHECK_PROGS(JADEBIN,jade openjade,false)
+AC_SUBST(JADEBIN)
+
+dnl Checking for the docbook.dsl stylesheet file
+dnl It is still not portable (directory slash)
+dnl ^ Why not? All systems use / don't they?
+dnl Windows certainly can. Is this a Mac or
+dnl Amiga issue? -- Jon
+DKPREFIXCOPY=$DKPREFIX
+DKPREFIX=false
+for i in $DKPREFIXCOPY /usr/share/sgml/docbook/stylesheet/dsssl/modular \
+ /usr/share/sgml/docbook/dsssl-stylesheets /usr/share/sgml/docbkdsl \
+ /usr/share/sgml/docbook-dsssl; do
+ echo -n "checking for $i/html/docbook.dsl..."
+ if test -f $i/html/docbook.dsl; then
+ echo "yes"
+ DKPREFIX=$i
+ break
+ else
+ echo "no"
+ fi
+done
+AC_SUBST(DKPREFIX)
+
+JADECAT=""
+dnl where are the catalogs?
+for i in /usr/share/sgml/CATALOG.docbk30 \
+ /usr/share/sgml/CATALOG.docbk31; do
+ echo -n "checking for $i..."
+ if test -f $i; then
+ echo "yes"
+ JADECAT="$JADECAT -c $i"
+ else
+ echo "no"
+ fi
+done
+AC_SUBST(JADECAT)
+
+dnl NOT USED?
+dnl DB2HTML=false
+dnl AC_ARG_WITH(db2html, dnl
+dnl --with-db2html=<path/executable>
+dnl Set the location of the docbook to html converter
+dnl (default = search),[dnl
+dnl DB2HTML=$withval
+dnl ])
+dnl if ! test -x $DB2HTML; then
+dnl DB2HTML=""
+dnl fi
+dnl
+dnl Check for a docbook -> HTML converter
+dnl AC_CHECK_PROGS(DB2HTML,db2html docbook2html,false)
+dnl AC_SUBST(DB2HTML)
+
+dnl Check for a text browser that supports -dump
+AC_CHECK_PROGS(WDUMP,w3m lynx links,false)
+AC_SUBST(WDUMP)
+
+dnl Check for man2html for docs.
+AC_CHECK_PROGS(MAN2HTML,man2html,false)
+AC_SUBST(MAN2HTML)
+
+dnl Set doc status, used for conditional content inclusions
+DOC_STATUS=""
+if test $CODE_STATUS = alpha; then
+ DOC_STATUS="-ip-alpha -ip-not-stable"
+fi
+if test $CODE_STATUS = beta; then
+ DOC_STATUS="-ip-beta -ip-not-stable"
+fi
+if test $CODE_STATUS = stable; then
+ DOC_STATUS="-ip-stable"
+fi
+echo "checking for doc status flags... $DOC_STATUS"
+AC_SUBST(DOC_STATUS)
+
+dnl =================================================================
+dnl RPM stuff
+dnl =================================================================
+
+dnl If we use rpm, we need to check where %_topdir is
+AC_CHECK_PROGS(RPMBIN,rpm,false)
+if test $RPMBIN != false; then
+ RPM_BASE=`rpm --eval "%{_topdir}"`
+ if test "$RPM_BASE" = ""; then
+ RPM_BASE=/usr/src/redhat
+ fi
+fi
+AC_SUBST(RPM_BASE)
+
+