Index: pjproject/trunk/aconfigure.ac
===================================================================
--- pjproject/trunk/aconfigure.ac	(revision 908)
+++ pjproject/trunk/aconfigure.ac	(revision 909)
@@ -8,4 +8,6 @@
 AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h
 		  pjlib/include/pj/compat/m_auto.h
+		  pjmedia/include/pjmedia/config_auto.h
+		  pjmedia/include/pjmedia-codec/config_auto.h
 		  pjsip/include/pjsip/sip_autoconf.h
 		 ])
@@ -333,4 +335,5 @@
 	      [if test "$enable_g711_codec" = "no"; then
 		[ac_no_g711_codec=1]
+		AC_DEFINE(PJMEDIA_HAS_G711_CODEC,0)
 		AC_MSG_RESULT([Checking if G.711 codec is disabled...yes])
 	       fi],
@@ -345,4 +348,5 @@
 	      [if test "$enable_l16_codec" = "no"; then
 		[ac_no_l16_codec=1]
+		AC_DEFINE(PJMEDIA_HAS_L16_CODEC,0)
 		AC_MSG_RESULT([Checking if L16 codecs are disabled...yes])
 	       fi],
@@ -357,4 +361,5 @@
 	      [if test "$enable_gsm_codec" = "no"; then
 		[ac_no_gsm_codec=1]
+		AC_DEFINE(PJMEDIA_HAS_GSM_CODEC,0)
 		AC_MSG_RESULT([Checking if GSM codec is disabled...yes])
 	       fi],
@@ -368,4 +373,5 @@
 	      [if test "$enable_speex_codec" = "no"; then
 		[ac_no_speex_codec=1]
+		AC_DEFINE(PJMEDIA_HAS_SPEEX_CODEC,0)
 		AC_MSG_RESULT([Checking if Speex codec is disabled...yes])
 	       fi],
@@ -379,4 +385,5 @@
 	      [if test "$enable_ilbc_codec" = "no"; then
 		[ac_no_ilbc_codec=1]
+		AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0)
 		AC_MSG_RESULT([Checking if iLBC codec is disabled...yes])
 	       fi],
Index: pjproject/trunk/pjmedia/include/pjmedia-codec/config.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia-codec/config.h	(revision 908)
+++ pjproject/trunk/pjmedia/include/pjmedia-codec/config.h	(revision 909)
@@ -22,4 +22,10 @@
 #include <pjmedia/types.h>
 
+/*
+ * Include config_auto.h if autoconf is used (PJ_AUTOCONF is set)
+ */
+#if defined(PJ_AUTOCONF)
+#   include <pjmedia-codec/config_auto.h>
+#endif
 
 /**
@@ -57,2 +63,3 @@
 
 #endif	/* __PJMEDIA_CODEC_CONFIG_H__ */
+
Index: pjproject/trunk/pjmedia/include/pjmedia-codec/config_auto.h.in
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia-codec/config_auto.h.in	(revision 909)
+++ pjproject/trunk/pjmedia/include/pjmedia-codec/config_auto.h.in	(revision 909)
@@ -0,0 +1,59 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __PJMEDIA_CODEC_CONFIG_AUTO_H_
+#define __PJMEDIA_CODEC_CONFIG_AUTO_H_
+
+/**
+ * @file config_auto.h
+ * @brief PJMEDIA-CODEC configuration as set by autoconf script
+ */
+
+/*
+ * Note:
+ *	The configuration in config_site.h overrides any other settings,
+ *	including the setting as detected by autoconf. 
+ */
+ 
+/* L16 codec */
+#ifndef PJMEDIA_HAS_L16_CODEC
+#undef PJMEDIA_HAS_L16_CODEC
+#endif
+
+
+/* GSM codec */
+#ifndef PJMEDIA_HAS_GSM_CODEC
+#undef PJMEDIA_HAS_GSM_CODEC
+#endif
+
+
+/* Speex codec */
+#ifndef PJMEDIA_HAS_SPEEX_CODEC
+#undef PJMEDIA_HAS_SPEEX_CODEC
+#endif
+
+
+/* iLBC codec */
+#ifndef PJMEDIA_HAS_ILBC_CODEC
+#undef PJMEDIA_HAS_ILBC_CODEC
+#endif
+
+
+#endif	/* __PJMEDIA_CODEC_CONFIG_AUTO_H_ */
+
+
Index: pjproject/trunk/pjmedia/include/pjmedia/config.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 908)
+++ pjproject/trunk/pjmedia/include/pjmedia/config.h	(revision 909)
@@ -37,4 +37,11 @@
  * @{
  */
+
+/*
+ * Include config_auto.h if autoconf is used (PJ_AUTOCONF is set)
+ */
+#if defined(PJ_AUTOCONF)
+#   include <pjmedia/config_auto.h>
+#endif
 
 /*
@@ -92,7 +99,4 @@
 /**
  * Unless specified otherwise, G711 codec is included by default.
- * Note that there are parts of G711 codec (such as linear2ulaw) that are 
- * needed by other PJMEDIA components (e.g. silence detector, conference).
- * Thus disabling G711 is generally not a good idea.
  */
 #ifndef PJMEDIA_HAS_G711_CODEC
Index: pjproject/trunk/pjmedia/include/pjmedia/config_auto.h.in
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/config_auto.h.in	(revision 909)
+++ pjproject/trunk/pjmedia/include/pjmedia/config_auto.h.in	(revision 909)
@@ -0,0 +1,42 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __PJMEDIA_CONFIG_AUTO_H_
+#define __PJMEDIA_CONFIG_AUTO_H_
+
+/**
+ * @file config_auto.h
+ * @brief PJMEDIA configuration as set by autoconf script
+ */
+
+/*
+ * Note:
+ *	The configuration in config_site.h overrides any other settings,
+ *	including the setting as detected by autoconf. 
+ */
+ 
+/* G711 codec */
+#ifndef PJMEDIA_HAS_G711_CODEC
+#undef PJMEDIA_HAS_G711_CODEC
+#endif
+
+
+#endif	/* __PJMEDIA_CONFIG_AUTO_H_ */
+
+
+
