Re: how to compile postgresql with other version of openssl? - Mailing list pgsql-general

From Tom Lane
Subject Re: how to compile postgresql with other version of openssl?
Date
Msg-id 23645.1437968936@sss.pgh.pa.us
Whole thread Raw
In response to Re: how to compile postgresql with other version of openssl?  ("krzf83@gmail.com " <krzf83@gmail.com>)
List pgsql-general
"krzf83@gmail.com " <krzf83@gmail.com> writes:
> # grep -i ssl config.log
> configure:13056: gcc -o conftest -Wall -Wmissing-prototypes
> -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
> -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
> -fwrapv -O2  -D_GNU_SOURCE  -L/usr/openssl-0.9.8zg/lib  conftest.c
> -lssl -lcrypto -lz -lreadline -ltermcap -lrt -lcrypt -ldl -lm  >&5
> ./conftest: error while loading shared libraries: libssl.so.0.9.8:
> cannot open shared object file: No such file or directory

Please try to be a little bit more effective about examining config.log.
There is likely to be useful information in the log immediately around the
lines you have grepped for.

(Also, "tail config.log" is just about guaranteed to be useless, because
autoconf always ends that file with a dump of the script's state
variables, of which there are hundreds.  Typically what you need to look
at to debug a failure is the last few dozen lines before the line reading
"## Cache variables. ##".)

In this particular case, though, I can pretty much predict what your
problem is: Linux is not very friendly to shared libraries that are
installed outside the normal shared-library directories such as /usr/lib.
Adding a -L switch is *not* sufficient to overcome that: -L only fixes
program construction not program execution.  You can overcome it with an
"rpath" setting, which is what Postgres uses so that psql et al can find
libpq.so when we're asked to install into nonstandard locations.  But we
don't have a provision for adding anything except our own lib directory
to our rpath (and I don't think many other packages offer such a thing
either).  If you want to have your own private libssl installation in a
nonstandard location, the best bet is to teach the dynamic loader about
that library directory by adding it to /etc/ld.so.conf or similar
location.  ("man ldconfig" is worth reading first.)

            regards, tom lane

PS: you'll need the -L switch as well.  And the -I switch.  They each
solve distinct parts of the problem when dealing with a library in a
nonstandard location.


pgsql-general by date:

Previous
From: Sanjaya Vithanagama
Date:
Subject: Splitting a string containing a numeric value in to three parts
Next
From: Adrian Klaver
Date:
Subject: Re: I lost my password