Commit f098b6e1 authored by Rodrigo Moya's avatar Rodrigo Moya Committed by Rodrigo Moya

added support for conditional compilation of the GDA (GNOME-DB) plugin

2000-11-16  Rodrigo Moya <rodrigo@linuxave.net>

	* configure.in: added support for conditional compilation of
	the GDA (GNOME-DB) plugin
	* plugins/gda/*: updated to current GDA code. Does not compile
	yet though
parent f1482522
2000-11-16 Rodrigo Moya <rodrigo@linuxave.net>
* configure.in: added support for conditional compilation of
the GDA (GNOME-DB) plugin
* plugins/gda/*: updated to current GDA code. Does not compile
yet though
2000-11-16 Zbigniew Chyla <cyba@gnome.pl>
* src/selection.c, src/dialogs/dialog-cell-sort.c: Marked strings
......
2000-11-16 Rodrigo Moya <rodrigo@linuxave.net>
* configure.in: added support for conditional compilation of
the GDA (GNOME-DB) plugin
* plugins/gda/*: updated to current GDA code. Does not compile
yet though
2000-11-16 Zbigniew Chyla <cyba@gnome.pl>
* src/selection.c, src/dialogs/dialog-cell-sort.c: Marked strings
......
2000-11-16 Rodrigo Moya <rodrigo@linuxave.net>
* configure.in: added support for conditional compilation of
the GDA (GNOME-DB) plugin
* plugins/gda/*: updated to current GDA code. Does not compile
yet though
2000-11-16 Zbigniew Chyla <cyba@gnome.pl>
* src/selection.c, src/dialogs/dialog-cell-sort.c: Marked strings
......
2000-11-16 Rodrigo Moya <rodrigo@linuxave.net>
* configure.in: added support for conditional compilation of
the GDA (GNOME-DB) plugin
* plugins/gda/*: updated to current GDA code. Does not compile
yet though
2000-11-16 Zbigniew Chyla <cyba@gnome.pl>
* src/selection.c, src/dialogs/dialog-cell-sort.c: Marked strings
......
2000-11-16 Rodrigo Moya <rodrigo@linuxave.net>
* configure.in: added support for conditional compilation of
the GDA (GNOME-DB) plugin
* plugins/gda/*: updated to current GDA code. Does not compile
yet though
2000-11-16 Zbigniew Chyla <cyba@gnome.pl>
* src/selection.c, src/dialogs/dialog-cell-sort.c: Marked strings
......
......@@ -447,6 +447,23 @@ if $have_bonobo; then
fi
AC_SUBST(IDL_FLAGS)
dnl ****************************
dnl Check for libgda
dnl ****************************
AC_MSG_CHECKING(for libgda)
if gda-config --libs client > /dev/null 2>&1; then
AC_MSG_RESULT(found)
GDA_CFLAGS=`gda-config --cflags client`
GDA_LIBS=`gda-config --libs client`
have_gda=true
else
AC_MSG_WARN(not found. GDA plugin not built)
fi
AC_SUBST(GDA_CFLAGS)
AC_SUBST(GDA_LIBS)
AM_CONDITIONAL(WITH_GDA, $have_gda)
EXTRA_GNOME_LIBS=`gnome-config --libs gnomeui print libglade $bonobo libole2 gal`
EXTRA_GNOME_CFLAGS=`gnome-config --cflags gnomeui print libglade $bonobo libole2 gal`
AC_SUBST(EXTRA_GNOME_LIBS)
......@@ -454,7 +471,6 @@ AC_SUBST(EXTRA_GNOME_CFLAGS)
AM_CONDITIONAL(LIBOLE2_PUBLIC_LIBRARY, false)
AM_CONDITIONAL(WITH_GDA, false)
AM_CONDITIONAL(WITH_PLAN_PERFECT, false)
AC_OUTPUT([
......
......@@ -24,10 +24,16 @@ else
GB_DIR =
endif
if WITH_GDA
GDA_DIR=gda
else
GDA_DIR=
endif
SUBDIRS_FILE_FORMATS = excel lotus-123 oleo sc sylk xbase html dif plan-perfect \
xml2 applix
SUBDIRS_FUNCTIONS = $(PYTHON_DIR) $(PERL_DIR) $(GUILE_DIR) $(GB_DIR) \
numtheory gda
numtheory $(GDA_DIR)
SUBDIRS = $(SUBDIRS_FILE_FORMATS) $(SUBDIRS_FUNCTIONS)
# Do not build by default until we are ready.
if WITH_GDA
GDA_TARGET = gnum_gdaif.la
else
GDA_TARGET =
endif
hack=$(shell gnome-config --includedir)
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) -I$(top_srcdir)/src \
$(GNOME_INCLUDEDIR) \
-I$(hack)/gda
$(GDA_CFLAGS)
#
# Do not build the plugin until there is a maintainer
#
gnumeric_plugin_LTLIBRARIES = $(GDA_TARGET)
gnum_gdaif_la_LDFLAGS = -module -avoid-version
gnum_gdaif_la_SOURCES = plugin-gda.c
gnum_gdaif_la_LIBADD = -L$(hack)/lib -lgda-client $(GNORBA_LIBS)
gnum_gdaif_la_LIBADD = $(GDA_LIBS)
/* Interface Gnumeric to Databases
* Copyright (C) 1998,1999 Michael Lausch
* Copyright (C) 2000 Rodrigo Moya
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -18,15 +19,7 @@
#include <config.h>
#include <gnome.h>
#include <glib.h>
#include <gda-command.h>
#include <gda-recordset.h>
#include <gda-error.h>
#include <gda-connection.h>
#include <libgnorba/gnorba.h>
#include <gda-client.h>
#include "src/gnumeric.h"
#include "src/func.h"
......@@ -91,9 +84,10 @@ execSQL (void* sheet, GList* expr_node_list, int eval_col, int eval_row, char **
gchar* user;
gchar* password;
GString* stmt;
gint rc;
gchar bfr[128];
gchar* provider;
gint rc;
gchar bfr[128];
gchar* provider;
Gda_Dsn* gda_dsn;
if (g_list_length(expr_node_list) < 4) {
......@@ -172,14 +166,12 @@ execSQL (void* sheet, GList* expr_node_list, int eval_col, int eval_row, char **
expr_node_list = g_list_next(expr_node_list);
}
g_snprintf(bfr, sizeof(bfr), "/gdalib/%s/Provider", &db_name[1]);
provider = gnome_config_get_string(bfr);
cnc = gda_connection_new(gnome_CORBA_ORB());
gda_connection_set_provider(cnc, provider);
g_snprintf(bfr, sizeof(bfr), "/gdalib/%s/DSN", &db_name[1]);
dsn = gnome_config_get_string(bfr);
gda_dsn = gda_dsn_find_by_name(&db_name[1]);
cnc = gda_connection_new(gda_corba_get_orb());
gda_connection_set_provider(cnc, GDA_DSN_PROVIDER(gda_dsn));
rc = gda_connection_open(cnc, dsn, &user[1], &password[1]);
rc = gda_connection_open(cnc, GDA_DSN_DSN(gda_dsn), &user[1], &password[1]);
gda_dsn_free(gda_dsn);
if (rc != 0) {
Gda_Error* e;
GList* errors;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment