Thread: stand-alone psql

stand-alone psql

From
John DeSoi
Date:
I'm looking for a way to build psql on OS X so that it can be copied to
another computer without any external dependencies. In particular, if I
build the standard distribution and then copy psql to another computer,
I get an error that /mydir/.../lib/libpq.3.dylib cannot be found. This
is probably basic make stuff, but I'm not sure where to start.

I think I solved this on Windows (8.0 beta) just by keeping libpq.dll
and zlib.dll in the same directory with psql.exe. Please correct me if
there is more to it.

Thanks,

John DeSoi, Ph.D.


Re: stand-alone psql

From
Peter Eisentraut
Date:
John DeSoi wrote:
> I'm looking for a way to build psql on OS X so that it can be copied
> to another computer without any external dependencies. In particular,
> if I build the standard distribution and then copy psql to another
> computer, I get an error that /mydir/.../lib/libpq.3.dylib cannot be
> found. This is probably basic make stuff, but I'm not sure where to
> start.

You could link psql statically.  You would have to look up in your
compiler/linker manual how to do that though.  The relevant makefile is
in src/bin/psql.  Setting LDFLAGS globally to some option like -static
might work.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: stand-alone psql

From
John DeSoi
Date:
On Sep 1, 2004, at 11:51 AM, Peter Eisentraut wrote:

> You could link psql statically.  You would have to look up in your
> compiler/linker manual how to do that though.  The relevant makefile is
> in src/bin/psql.  Setting LDFLAGS globally to some option like -static
> might work.

Right, this was my thinking but I was hoping for a little more
direction from some one familiar with C. I have already spent hours
working on it and have not been able to get it to work. The task is
pretty daunting for some one without a strong background with
gcc/ld/make.

I thought I had it solved by putting the dynamic libraries in the psql
folder and using install_name_tool to change the paths. But when I
moved the folder from a 10.3 to a 10.2 Mac, I got an error about a
missing symbol in /usr/lib/libSystem.B.dylib (the library is there on
10.2, but I guess it is an older version). When I include the newer
libSystem.B.dylib with psql I get an error when I try to start it:

*** vm_page_shift incorrectly set to 12

Thanks for any further ideas or pointers.

John DeSoi, Ph.D.