Re: how to compile postgresql with other version of openssl?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "krzf83(at)gmail(dot)com " <krzf83(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to compile postgresql with other version of openssl?
Date: 2015-07-27 03:48:56
Message-ID: 23645.1437968936@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"krzf83(at)gmail(dot)com " <krzf83(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-07-27 04:12:35 Re: I lost my password
Previous Message Sanjaya Vithanagama 2015-07-27 03:48:20 Splitting a string containing a numeric value in to three parts