[glom] Really never use config.h in libglom.



commit 8d73f2051fb624e145505b3587a12d89ed3c8326
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Aug 27 15:45:08 2009 +0200

    Really never use config.h in libglom.
    
    * glom/libglom/*.cc: Remove some remaining includes of config.h
    instead of libglom_config.h.
    * glom/libglom/libglom_config.h.in: Add GETTEXT_PACKAGE,
    PACKAGE_TARNAME, though I suspect that libglom requires different
    build stuff for translations.
    Added POSTGRES_UTILS_PATH and EXEEXT.

 glom/libglom/appstate.cc                           |    4 ++--
 glom/libglom/connectionpool.cc                     |    4 ++--
 glom/libglom/connectionpool.h                      |    3 +--
 glom/libglom/connectionpool_backends/backend.h     |    2 +-
 glom/libglom/connectionpool_backends/postgres.cc   |    7 +++----
 glom/libglom/connectionpool_backends/postgres.h    |    6 +++---
 .../connectionpool_backends/postgres_central.cc    |    3 +--
 .../connectionpool_backends/postgres_central.h     |    3 +--
 .../connectionpool_backends/postgres_self.cc       |    2 +-
 .../connectionpool_backends/postgres_self.h        |    3 +--
 glom/libglom/connectionpool_backends/sqlite.cc     |    3 +--
 glom/libglom/connectionpool_backends/sqlite.h      |    3 +--
 glom/libglom/data_structure/glomconversions.cc     |    2 +-
 glom/libglom/data_structure/iso_codes.cc           |    2 +-
 glom/libglom/document/bakery/document.cc           |    2 +-
 glom/libglom/document/document.h                   |    3 +--
 glom/libglom/libglom_config.h.in                   |   13 +++++++++++++
 glom/libglom/utils.cc                              |    3 +--
 18 files changed, 36 insertions(+), 32 deletions(-)
---
diff --git a/glom/libglom/appstate.cc b/glom/libglom/appstate.cc
index f0e4c0b..016615e 100644
--- a/glom/libglom/appstate.cc
+++ b/glom/libglom/appstate.cc
@@ -18,8 +18,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/libglom_config.h> // GLOM_ENABLE_CLIENT_ONLY
-#include "appstate.h"
+#include <libglom/appstate.h>
+#include <libglom/libglom_config.h>
 
 
 namespace Glom
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index b5bf139..64fa8b4 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -18,12 +18,12 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/libglom_config.h>
- 
+
 #include <libglom/connectionpool.h>
 #include <libglom/document/document.h>
 #include <libglom/utils.h>
 //#include <libgdamm/connectionevent.h>
+#include <libglom/libglom_config.h>
 #include <glibmm/i18n.h>
 
 #ifdef G_OS_WIN32
diff --git a/glom/libglom/connectionpool.h b/glom/libglom/connectionpool.h
index 4af3563..67d57c2 100644
--- a/glom/libglom/connectionpool.h
+++ b/glom/libglom/connectionpool.h
@@ -21,13 +21,12 @@
 #ifndef GLOM_CONNECTIONPOOL_H
 #define GLOM_CONNECTIONPOOL_H
 
-#include <libglom/libglom_config.h> // For GLOM_ENABLE_CLIENT_ONLY
-
 #include <libgdamm.h>
 #include <libglom/sharedptr.h>
 #include <libglom/data_structure/fieldtypes.h>
 #include <libglom/data_structure/field.h>
 #include <libglom/connectionpool_backends/backend.h>
+#include <libglom/libglom_config.h>
 
 #include <memory> // For std::auto_ptr
 
diff --git a/glom/libglom/connectionpool_backends/backend.h b/glom/libglom/connectionpool_backends/backend.h
index f731139..b1f4f22 100644
--- a/glom/libglom/connectionpool_backends/backend.h
+++ b/glom/libglom/connectionpool_backends/backend.h
@@ -21,10 +21,10 @@
 #ifndef GLOM_BACKEND_BACKEND_H
 #define GLOM_BACKEND_BACKEND_H
 
-#include <libglom/libglom_config.h> // For GLOM_ENABLE_CLIENT_ONLY
 
 #include <libglom/sharedptr.h>
 #include <libglom/data_structure/field.h>
+#include <libglom/libglom_config.h>
 
 #include <memory>
 
diff --git a/glom/libglom/connectionpool_backends/postgres.cc b/glom/libglom/connectionpool_backends/postgres.cc
index 90f9c73..d33f24f 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -18,10 +18,10 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/libglom_config.h>
 
 #include <libglom/connectionpool_backends/postgres.h>
 #include <libglom/utils.h>
+#include <libglom/libglom_config.h>
 #include <glibmm/i18n.h>
 
 // Uncomment to see debug messages
@@ -81,15 +81,14 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
   std::cout << "  DEBUG: auth_string=" << auth_string << std::endl;
 #endif
 
+//TODO: Allow the client-only build to specify a read-only connection, 
+//so we can use Gnome::Gda::CONNECTION_OPTIONS_READ_ONLY?
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
   {
     connection = Gnome::Gda::Connection::open_from_string("PostgreSQL", 
       cnc_string, auth_string, 
       Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE
-#ifndef GLOM_ENABLE_CLIENT_ONLY
-      | Gnome::Gda::CONNECTION_OPTIONS_READ_ONLY
-#endif
       );
     connection->statement_execute_non_select("SET DATESTYLE = 'ISO'");
     data_model = connection->statement_execute_select("SELECT version()");
diff --git a/glom/libglom/connectionpool_backends/postgres.h b/glom/libglom/connectionpool_backends/postgres.h
index 5165454..5660672 100644
--- a/glom/libglom/connectionpool_backends/postgres.h
+++ b/glom/libglom/connectionpool_backends/postgres.h
@@ -21,10 +21,10 @@
 #ifndef GLOM_BACKEND_POSTGRES_H
 #define GLOM_BACKEND_POSTGRES_H
 
-#include <libgdamm.h>
-#include <libglom/connectionpool_backends/backend.h>
 
-#include <libglom/libglom_config.h> // For GLOM_ENABLE_CLIENT_ONLY
+#include <libglom/libglom_config.h>
+#include <libglom/connectionpool_backends/backend.h>
+#include <libgdamm.h>
 
 namespace Glom
 {
diff --git a/glom/libglom/connectionpool_backends/postgres_central.cc b/glom/libglom/connectionpool_backends/postgres_central.cc
index 3d242f8..7d41c7e 100644
--- a/glom/libglom/connectionpool_backends/postgres_central.cc
+++ b/glom/libglom/connectionpool_backends/postgres_central.cc
@@ -18,9 +18,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/libglom_config.h>
-
 #include <libglom/connectionpool_backends/postgres_central.h>
+#include <libglom/libglom_config.h>
 #include <glibmm/i18n.h>
 
 // Uncomment to see debug messages
diff --git a/glom/libglom/connectionpool_backends/postgres_central.h b/glom/libglom/connectionpool_backends/postgres_central.h
index 7858786..16ec5f8 100644
--- a/glom/libglom/connectionpool_backends/postgres_central.h
+++ b/glom/libglom/connectionpool_backends/postgres_central.h
@@ -21,10 +21,9 @@
 #ifndef GLOM_BACKEND_POSTGRES_CENTRAL_H
 #define GLOM_BACKEND_POSTGRES_CENTRAL_H
 
+#include <libglom/libglom_config.h>
 #include <libglom/connectionpool_backends/postgres.h>
 
-#include <libglom/libglom_config.h> // For GLOM_ENABLE_CLIENT_ONLY
-
 namespace Glom
 {
 
diff --git a/glom/libglom/connectionpool_backends/postgres_self.cc b/glom/libglom/connectionpool_backends/postgres_self.cc
index 5640b1f..fe3a94a 100644
--- a/glom/libglom/connectionpool_backends/postgres_self.cc
+++ b/glom/libglom/connectionpool_backends/postgres_self.cc
@@ -18,7 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h> // For POSTGRES_UTILS_PATH
+#include <libglom/libglom_config.h> // For POSTGRES_UTILS_PATH
 
 #include <libglom/connectionpool_backends/postgres_self.h>
 #include <libglom/utils.h>
diff --git a/glom/libglom/connectionpool_backends/postgres_self.h b/glom/libglom/connectionpool_backends/postgres_self.h
index 027b1d8..3fbd5fe 100644
--- a/glom/libglom/connectionpool_backends/postgres_self.h
+++ b/glom/libglom/connectionpool_backends/postgres_self.h
@@ -21,9 +21,8 @@
 #ifndef GLOM_BACKEND_POSTGRES_SELF_H
 #define GLOM_BACKEND_POSTGRES_SELF_H
 
-#include <libglom/libglom_config.h> // For GLOM_ENABLE_CLIENT_ONLY
-
 #include <libglom/connectionpool_backends/postgres.h>
+#include <libglom/libglom_config.h>
 
 namespace Glom
 {
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index ba3739e..73169f8 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -18,11 +18,10 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/libglom_config.h>
 
 #include <libglom/connectionpool_backends/sqlite.h>
-
 #include <giomm/file.h>
+#include <libglom/libglom_config.h>
 
 namespace Glom
 {
diff --git a/glom/libglom/connectionpool_backends/sqlite.h b/glom/libglom/connectionpool_backends/sqlite.h
index 0b33931..1de6d42 100644
--- a/glom/libglom/connectionpool_backends/sqlite.h
+++ b/glom/libglom/connectionpool_backends/sqlite.h
@@ -23,8 +23,7 @@
 
 #include <libgdamm.h>
 #include <libglom/connectionpool_backends/backend.h>
-
-#include <libglom/libglom_config.h> // For GLOM_ENABLE_CLIENT_ONLY
+#include <libglom/libglom_config.h>
 
 namespace Glom
 {
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index ae70df7..8af507c 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -19,11 +19,11 @@
  */
 
 
-#include <libglom/libglom_config.h> // For HAVE_STRPTIME
 
 #include "glomconversions.h"
 #include <libglom/connectionpool.h>
 #include <libglom/utils.h>
+#include <libglom/libglom_config.h> // For HAVE_STRPTIME
 
 #include <glibmm/i18n.h>
 #include <sstream> //For stringstream
diff --git a/glom/libglom/data_structure/iso_codes.cc b/glom/libglom/data_structure/iso_codes.cc
index 5e649c2..336da38 100644
--- a/glom/libglom/data_structure/iso_codes.cc
+++ b/glom/libglom/data_structure/iso_codes.cc
@@ -18,12 +18,12 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/libglom_config.h> //For ISO_CODES_PREFIX.
 
 #include <libglom/data_structure/iso_codes.h>
 #include <libxml++/libxml++.h>
 #include <libglom/document/document.h>
 #include <libglom/utils.h>
+#include <libglom/libglom_config.h> //For ISO_CODES_PREFIX.
 #include <glibmm/i18n.h>
 
 namespace Glom
diff --git a/glom/libglom/document/bakery/document.cc b/glom/libglom/document/bakery/document.cc
index 9b80865..a40472e 100644
--- a/glom/libglom/document/bakery/document.cc
+++ b/glom/libglom/document/bakery/document.cc
@@ -16,8 +16,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <config.h>
 #include <libglom/document/bakery/document.h>
+#include <libglom/libglom_config.h>
 #include <giomm.h>
 //#include <fstream>
 #include <glibmm/i18n-lib.h>
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index d3169eb..fa06307 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -21,8 +21,6 @@
 #ifndef DOCUMENT_GLOM_H
 #define DOCUMENT_GLOM_H
 
-#include <libglom/libglom_config.h> // For GLOM_ENABLE_CLIENT_ONLY
-
 #include <libglom/document/bakery/document_xml.h>
 #include <libglom/data_structure/relationship.h>
 #include <libglom/data_structure/field.h>
@@ -38,6 +36,7 @@
 #include <libglom/data_structure/print_layout.h>
 #include <libglom/data_structure/foundset.h>
 #include <libglom/appstate.h>
+#include <libglom/libglom_config.h>
 #include <vector>
 #include <map>
 #include <limits> // for numeric_limits
diff --git a/glom/libglom/libglom_config.h.in b/glom/libglom/libglom_config.h.in
index 28be5dd..c6e0d71 100644
--- a/glom/libglom/libglom_config.h.in
+++ b/glom/libglom/libglom_config.h.in
@@ -5,9 +5,16 @@
 /* "definition of GLOM_DTD_INSTALL_DIR" */
 #undef GLOM_DTD_INSTALL_DIR
 
+//TODO: Should libglom have separate translations than Glom itself? How? murrayc.
 /* Define to 1 if you have the `dcgettext' function. */
 #undef HAVE_DCGETTEXT
 
+/* Define to the gettext package name. */
+#undef GETTEXT_PACKAGE
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
@@ -20,4 +27,10 @@
 /* Define to the installation prefix of the iso-codes module. */
 #undef ISO_CODES_PREFIX
 
+/* Define to the location of the PostgreSQL utilities. */
+#undef POSTGRES_UTILS_PATH
+
+/* Define to the file extension of executables on the target. */
+#undef EXEEXT
+
 #endif /* GLOM_LIBGLOM_CONFIG_H */
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 48a0b99..280eda4 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -18,12 +18,11 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/libglom_config.h>
-
 #include <libglom/utils.h>
 #include <libglom/connectionpool.h>
 #include <libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.h>
 #include <libglom/data_structure/glomconversions.h>
+#include <libglom/libglom_config.h>
 
 #include <glibmm/i18n.h>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]