Thread: pga3: FreeBSD Port

pga3: FreeBSD Port

From
"Dave Page"
Date:
Hi All,

I just got KDE vaguely running on FreeBSD 5.1 and started working on a
port of pga3.

First problem, FreeBSD seems to evaluate:

if test "$pgsql_cv_libpq" == "yes" -a "$pgsql_cv_libpqfe_h" == "yes"

to false, even if both variables do actually equal yes. Please see
attached logfile.

As a test, I commented out the if statement:

#    if test "$pgsql_cv_libpq" == "yes" -a "$pgsql_cv_libpqfe_h" ==
"yes"
#    then
        AC_MSG_CHECKING(pgsql in ${LIBPQ_HOME})
        AC_MSG_RESULT(ok)
        if test "$pg_static_build" == "yes"
        then
            LIBS="$LIBS ${LIBPQ_HOME}/lib/libpq.a -lcrypt"
        else
            LIBS="$LIBS -lpq"
        fi
#    else
#        AC_MSG_CHECKING(pgsql in ${LIBPQ_HOME})
#        AC_MSG_RESULT(failed)
#        LDFLAGS="$PGSQL_OLD_LDFLAGS"
#        CPPFLAGS="$PGSQL_OLD_CPPFLAGS"
#        AC_MSG_ERROR([you must specify a valid pgsql installation with
--with-pgsql=DIR])
#    fi
fi
])


 and associated bits such that it just ran the static build test and
then carried on. This built successfully (yay!), however, (second
problem) although it statically linked the wx stuff as I wanted, it
dynamically linked libpq.

So, does this mean 'if test' is broken on FreeBSD?

Aside from those relatively minor build issues, in my 2 minute test,
pgAdmin 3 seems to run OK on FreeBSD 5.1!!

Regards, Dave

Attachment

Re: pga3: FreeBSD Port

From
"Dave Page"
Date:

> -----Original Message-----
> From: Adam H. Pendleton [mailto:fmonkey@fmonkey.net]
> Sent: 27 June 2003 17:32
> To: Dave Page
> Subject: Re: pga3: FreeBSD Port
>
>
> Dave Page wrote:
>
> >Hi All,
> >
> >First problem, FreeBSD seems to evaluate:
> >
> >if test "$pgsql_cv_libpq" == "yes" -a "$pgsql_cv_libpqfe_h" == "yes"
> >
> I didn't have this problem when I compiled pgadmin3.  What
> shell are you
> using?

/bin/csh is the default in /etc/passwd, but I ran from a Konsole window
(I assume that was a csh as well). Stupidly I'm at home now and didn't
create a non-root account before I left so I can't get in to check.

> > and associated bits such that it just ran the static build test and
> >then carried on. This built successfully (yay!), however, (second
> >problem) although it statically linked the wx stuff as I wanted, it
> >dynamically linked libpq.
> >
> By dynamically linked do you mean that it added "-lpq" to the linker,
> instead of "/usr/local/pgsql/libpq.a"?  It doesn't matter
> which way you
> write it, if /usr/local/pgsql/libpq.a is the only libpq.{ a | so } in
> your library path, then it will be linked against.  Since
> it's a static
> library, static linking is required.

When I compiled, it dynamically linked (-lpq) despite the fact that
libpq.so was *not* in the library path and I specified --enable-static.
Both the static and dynamic libpq's are in the standard pgsql location.
I think the second 'if' failed so it just did the 'else' bit. It
obviously worked fine for the wx stuff, but that uses case not if.

        if test "$pg_static_build" == "yes"
        then
            LIBS="$LIBS ${LIBPQ_HOME}/lib/libpq.a -lcrypt"
        else
            LIBS="$LIBS -lpq"
        fi

I don't suppose you need braces round the var names in this case?

> >So, does this mean 'if test' is broken on FreeBSD?
> >
> Doubtful.  It's more likely that my M4 is not totally portable.
>
> >Aside from those relatively minor build issues, in my 2 minute test,
> >pgAdmin 3 seems to run OK on FreeBSD 5.1!!
> >
> That's farther than I got.  I ran into wxWindows include file
> problems
> when I tried to compile.  Glad to hear it!

Yeah, no problems here. Fired it up, selected a language, connected to a
DB and had a brief browse around :-)

Regards, Dave.

Re: pga3: FreeBSD Port

From
"Dave Page"
Date:

> -----Original Message-----
> From: Dave Page
> Sent: 27 June 2003 19:34
> To: Adam H. Pendleton
> Cc: pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] pga3: FreeBSD Port
>
>
>
>
> > -----Original Message-----
> > From: Adam H. Pendleton [mailto:fmonkey@fmonkey.net]
> > Sent: 27 June 2003 17:32
> > To: Dave Page
> > Subject: Re: pga3: FreeBSD Port
> >
> >
> > Dave Page wrote:
> >
> > >Hi All,
> > >
> > >First problem, FreeBSD seems to evaluate:
> > >
> > >if test "$pgsql_cv_libpq" == "yes" -a
> "$pgsql_cv_libpqfe_h" == "yes"
> > >
> > I didn't have this problem when I compiled pgadmin3.  What
> > shell are you
> > using?
>
> /bin/csh is the default in /etc/passwd, but I ran from a
> Konsole window (I assume that was a csh as well). Stupidly
> I'm at home now and didn't create a non-root account before I
> left so I can't get in to check.

Hi Adam,

It fails with sh and csh.

Regards, Dave.