Index: acinclude.m4
===================================================================
RCS file: /cvsroot/curl/curl/acinclude.m4,v
retrieving revision 1.114
diff -u -r1.114 acinclude.m4
--- acinclude.m4	22 Nov 2006 18:41:34 -0000	1.114
+++ acinclude.m4	11 Dec 2006 12:01:52 -0000
@@ -1949,3 +1949,55 @@
     dnl if this test fails, configure has already stopped
   fi
 ])
+
+dnl CURL_CONFIG_H
+dnl -------------------------------------------------
+dnl Create the $2 file based on what is defined in the $1 file. Make sure
+dnl the input file exists before you run this.
+dnl
+AC_DEFUN([CURL_CONFIG_H], [
+
+INPUT=$1
+OUTPUT=$2
+
+AC_MSG_NOTICE(creating $OUTPUT)
+
+cat >$OUTPUT <<EOF
+#ifndef __CURL_CONFIG_H
+#define __CURL_CONFIG_H
+/* curl/config.h - generated by curl's configure script
+ ***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+EOF
+
+#
+# We prefix all the variables in the curl/config.h file with CURLCONF because
+# 1) we make sure they are in our name space
+# 2) they get a distinct look so that we see from where they originate
+#
+grep "^#define" $INPUT | sed -e 's/^#define /#define CURLCONF_/' >> $OUTPUT
+
+cat >>$OUTPUT <<EOF
+#endif /* __CURL_CONFIG_H */
+EOF
+
+])
\ No newline at end of file
Index: configure.ac
===================================================================
RCS file: /cvsroot/curl/curl/configure.ac,v
retrieving revision 1.213
diff -u -r1.213 configure.ac
--- configure.ac	3 Dec 2006 09:19:23 -0000	1.213
+++ configure.ac	11 Dec 2006 12:01:53 -0000
@@ -2142,6 +2142,8 @@
 ])
 AC_OUTPUT
 
+CURL_CONFIG_H(lib/config.h, include/curl/config.h)
+
 AC_MSG_NOTICE([Configured to build curl/libcurl:
 
   curl version:    ${VERSION}
Index: include/curl/Makefile.am
===================================================================
RCS file: /cvsroot/curl/curl/include/curl/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- include/curl/Makefile.am	25 Mar 2004 11:34:35 -0000	1.4
+++ include/curl/Makefile.am	11 Dec 2006 12:01:53 -0000
@@ -1,5 +1,9 @@
 pkginclude_HEADERS = \
-	curl.h curlver.h easy.h mprintf.h stdcheaders.h types.h multi.h
+ curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h config.h
 pkgincludedir= $(includedir)/curl
 
-CLEANFILES = *dist
+# this file get renamed to config.h and included in distributions
+EXTRA_DIST = config.h.dist
+
+# this file gets created by configure or when creating a distribution archive
+DISTCLEANFILES = config.h
Index: include/curl/config.h.dist
===================================================================
RCS file: include/curl/config.h.dist
diff -N include/curl/config.h.dist
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ include/curl/config.h.dist	11 Dec 2006 12:01:53 -0000
@@ -0,0 +1,33 @@
+#ifndef __CURL_CONFIG_H
+#define __CURL_CONFIG_H
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/*
+ * ATTENTION! ATTENTION! ATTENTION!
+ *
+ * This particular file you see here is a file that is supposed to be replaced
+ * by a file generated by the configure script. All the stuff in this file is
+ * thus written to work for systems where this file is NOT replaced/updated.
+ *
+ */
+#endif /* __CURL_CONFIG_H */
