Le 26/08/2010 11:49, Dave Page a écrit :
> On Thu, Aug 26, 2010 at 10:48 AM, Guillaume Lelarge
> <[email protected]> wrote:
>> What I've come to is this patch. Actually, and quite surprisingly, it
>> doesn't work. I have no idea why. The configure script finds if we have
>> or not the PQconninfoParse function(), but the #ifdef in pgConn source
>> file doesn't seem to do what it has to. I always get a build without
>> PQconninfoParse, wether configure founds it or not.
>>
>> Any ideas on what I did wrong?
>
> EPATCHNOTFOUND
>
Oops, time to get some coffee, as you already said :)
--
Guillaume
http://www.postgresql.fr
http://dalibo.com
diff --git a/acinclude.m4 b/acinclude.m4
index dca5579..a0dc87d 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -482,15 +482,15 @@ AC_DEFUN([SETUP_POSTGRESQL],
if test "$(nm ${PG_LIB}/libpq.a | grep -c PQconninfoParse)" -gt 0
then
AC_MSG_RESULT(present)
- PG_LIBPQ="yes"
+ HAVE_CONNINFO_PARSE="yes"
else
AC_MSG_RESULT(not present)
- PG_LIBPQ="no"
+ HAVE_CONNINFO_PARSE="no"
fi
else
AC_LANG_SAVE
AC_LANG_C
- AC_CHECK_LIB(pq, PQconninfoParse, [PG_LIBPQ=yes], [PG_LIBPQ=no])
+ AC_CHECK_LIB(pq, PQconninfoParse, [HAVE_CONNINFO_PARSE=yes], [HAVE_CONNINFO_PARSE=no])
AC_LANG_RESTORE
fi
@@ -635,6 +635,7 @@ AC_DEFUN([SETUP_POSTGRESQL],
fi
])
AC_SUBST(PG_CONFIG)
+AC_SUBST(HAVE_CONNINFO_PARSE)
#######################################################
# Check for extended libpq functions in EnterpriseDB #
@@ -815,6 +816,13 @@ AC_DEFUN([SUMMARY],
echo "PostgreSQL directory: $PG_HOME"
echo "PostgreSQL pg_config binary: $PG_CONFIG"
echo "PostgreSQL version: $PG_VERSION"
+ if test "$HAVE_CONNINFO_PARSE" = yes
+ then
+ echo "PostgreSQL PQconninfoParse support: Present"
+ else
+ echo "PostgreSQL PQconninfoParse support: Missing"
+ fi
+ echo
if test "$PG_SSL" = yes
then
echo "PostgreSQL SSL support: Present"
diff --git a/pgadmin/db/pgConn.cpp b/pgadmin/db/pgConn.cpp
index 4b4c49d..698ab53 100644
--- a/pgadmin/db/pgConn.cpp
+++ b/pgadmin/db/pgConn.cpp
@@ -124,6 +124,7 @@ pgConn::pgConn(const wxString& server, const wxString& database, const wxString&
dbHost = server;
dbHostName = server;
+#ifdef HAVE_CONNINFO_PARSE
if (!applicationname.IsEmpty())
{
// Check connection string with application_name
@@ -138,6 +139,7 @@ pgConn::pgConn(const wxString& server, const wxString& database, const wxString&
connstr = connstr_with_applicationname;
}
}
+#endif
// Open the connection
wxString cleanConnStr = connstr;
diff --git a/pgadmin/debugger/dbgPgConn.cpp b/pgadmin/debugger/dbgPgConn.cpp
index b40ddb5..8d28ec8 100644
--- a/pgadmin/debugger/dbgPgConn.cpp
+++ b/pgadmin/debugger/dbgPgConn.cpp
@@ -208,6 +208,7 @@ void dbgPgConn::Init( const wxString &server, const wxString &database, const wx
connectParams.Trim(true);
connectParams.Trim(false);
+#ifdef HAVE_CONNINFO_PARSE
if (!applicationname.IsEmpty())
{
// Check connection string with application_name
@@ -224,6 +225,7 @@ void dbgPgConn::Init( const wxString &server, const wxString &database, const wx
connectParams = connectParams_with_applicationname;
}
}
+#endif
m_frame->getStatusBar()->SetStatusText( wxString::Format(_( "Connecting to %s" ), msg.c_str()), 1 );
wxCharBuffer cstrUTF=connectParams.mb_str(wxConvUTF8);
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers