RE: [gnome-db] alternative instructions to compile libgda on cygwin



Hi!

Thanks, Daniel and Gonzalo, for your answers.

I made some dirty modifications [*] to ./configure in order to have the
libgda compiled with the postgresql provider. No more errors at this point.
Postgresql server is running fine and I'm now trying gda-test.

After reading some code, I realised the first problem was an empty
~/.libgda/config file. I suppose this is normal and in Linux one could use
gnome-db-fe to edit it. In cygwin, I guess I could have used
gda-config-tool.exe but I found it simpler to copy libgda/data/config and
hand-edit the file. This is the file I have. Please let me know if you find
something wrong with it:


<?xml version="1.0"?>
<libgda-config>
	<section path="/apps/libgda/Datasources/postgres">
		<entry name="Provider" type="string" value="postgres"/>
		<entry name="Username" type="string" value="fmartins"/>
		<entry name="DSN" type="string"
value="DSN=DATABASE=test;HOST=127.0.0.1;PORT=5432"/>
		<entry name="Description" type="string" value="postgresql test database"/>
	</section>
</libgda-config>



The next error given by gda-test is:


> =========================================
> = Testing provider configuration API
> =========================================
> ** Message: ERROR: Error opening directory
'/usr/local/lib/libgda/providers':
> No such file or directory

followed in the end by:

> =========================================
> = Testing GDA client API
> =========================================
>  Data source = postgres, User = fmartins
> ** Message: ERROR: Error opening directory >
'/usr/local/lib/libgda/providers':
>  No such file or directory
> ** Message: ERROR: Provider postgres is not installed
> ** ERROR: could not open connection to postgres

These are the files I have in the providers directory (which exists, in
fact):

libgda-default.a
libgda-default.la
libgda-postgres.a
libgda-postgres.la

Any hints of what could be wrong?

Thanks,

Fernando


[*]
As for the postgresql configuration (from libgda's side) the ./configure is
not prepared to handle the postgresql installation in cygwin because it
assumes a common root directory (from --with-postgresql=<directory>) for
both include and lib directories, which is not the case. I have in my
default cygwin installation:

/bin/pq.dll   (note no lib/ here!)
/usr/include/libpq-fe.h

For the sake of completeness, here is the modified section in ./configure to
support postgresql in cygwin:

# Added for the cygwin case
	if test x$postgresdir = x
	then
		if test -f $dir/pq.dll
		then
			echo "$as_me:$LINENO: result: found cygwin Postgres in $dir" >&5
echo "${ECHO_T}found cygwin Postgres in $dir" >&6
			postgresdir=$dir
			break
		fi
	fi

	if test x$postgresdir = x
	then
		{ echo "$as_me:$LINENO: WARNING: Postgres backend not used" >&5
echo "$as_me: WARNING: Postgres backend not used" >&2;}
	else
		if test -f ${postgresdir}/include/libpq-fe.h
		then
			POSTGRES_CFLAGS=-I${postgresdir}/include
		elif test -f ${postgresdir}/include/pgsql/libpq-fe.h
		then
			POSTGRES_CFLAGS=-I${postgresdir}/include/pgsql
		elif test -f ${postgresdir}/include/postgresql/libpq-fe.h
		then
			POSTGRES_CFLAGS=-I${postgresdir}/include/postgresql
# Next case added for cygwin
		elif test -f /usr/include/libpq-fe.h
		then
			POSTGRES_CFLAGS=-I/usr/include
		else
			{ echo "$as_me:$LINENO: WARNING: Postgres include files not found" >&5
echo "$as_me: WARNING: Postgres include files not found" >&2;}
			postgresdir=""
		fi
# A test is made to check for the cygwin case
		if test -f /usr/include/libpq-fe.h
		then
			POSTGRES_LIBS="-L${postgresdir} -lpq"
		else
			POSTGRES_LIBS="-L${postgresdir}/lib -lpq"
		fi
		cat >>confdefs.h <<\_ACEOF
#define HAVE_POSTGRES 1
_ACEOF

	fi




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