You are not logged in.

#1 2017-04-28 18:57:18

rando
Member
Registered: 2016-09-24
Posts: 3

[solved] Compiling things against openssl-1.0

Arch provides separate packages for openssl (currently 1.1.0.e) and openssl-1.0 (1.0.2.k). OpenSSL 1.1 has some major breaking changes, and some older software doesn't support it. Specifically, I've gotten stuck now on Ruby 2.3.4 and PostgreSQL 9.4.11. Both of these are still supported by upstream, and can be easily downloaded and compiled. Both, however, do not work on openssl-1.1, only 1.0.

What is the proper way to make use of the includes and libs provided by the openssl-1.0 package when running something like `./configure`? For example, the postgresql-9.4 package on AUR is currently broken, and fails with:

...
checking for CRYPTO_new_ex_data in -lcrypto... yes
checking for SSL_library_init in -lssl... no
configure: error: library 'ssl' is required for OpenSSL
==> ERROR: A failure occurred in build().
    Aborting...

I'm not very familiar with the autoconf etc toolchain, or compiling C in general, but it seems to me that something like this should work:

$ ./configure --with-openssl PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig

But with this, I get the same error. I got similar errors when trying to compile ruby 2.3.4 via `ruby-install`, and finally had to resort to compiling my own openssl into `/opt/openssl`, and pointing ruby at it with `./configure --with-openssl-dir=/opt/openssl`. This feels horribly hacky though, and I don't want to keep doing it.

What is the proper incantation to get `./configure` to find the libs and headers provided by the `openssl-1.0` package? Does anyone know of an existing PKGBUILD in the ABS repository I could look at for an example?

Last edited by rando (2017-04-28 20:33:52)

Offline

#2 2017-04-28 19:07:58

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: [solved] Compiling things against openssl-1.0

See https://www.archlinux.org/todo/openssl-110-rebuild/ for the most popular toolkits. Some package require special handling. You can look at the PKGBUILDs of the official packages that depend on openssl-1.0 for examples.

Offline

#3 2017-04-28 19:38:17

rando
Member
Registered: 2016-09-24
Posts: 3

Re: [solved] Compiling things against openssl-1.0

Yeah, as I mentioned, I tried setting the PKG_CONFIG_PATH like the TODO page says.

$ export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig
$ ./configure --with-openssl
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking which template to use... linux
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
...
checking for library containing readline... -lreadline
checking for inflate in -lz... yes
checking for CRYPTO_new_ex_data in -lcrypto... yes
checking for SSL_library_init in -lssl... no
configure: error: library 'ssl' is required for OpenSSL

$

I've tried several other things I found in the various PKGBUILDs that depend on it, but nothing seemed to work. Is postgresql just special somehow, and I need to dig deeper in to that?

  PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig 
  CFLAGS+=" -I/usr/include/openssl-1.0" 
  LDFLAGS+="-I/usr/lib/openssl-1.0" 

Offline

#4 2017-04-28 20:33:36

rando
Member
Registered: 2016-09-24
Posts: 3

Re: [solved] Compiling things against openssl-1.0

For any future googlers, here's how I solved this for postgresql in particular:

  PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig \
  CFLAGS+=" -I/usr/include/openssl-1.0" \
  LDFLAGS+=" -L/usr/lib/openssl-1.0 -lssl" \
  ./configure --with-openssl ...

Offline

#5 2017-05-05 09:22:10

milouse
Member
From: Nantes, France
Registered: 2011-08-14
Posts: 15
Website

Re: [solved] Compiling things against openssl-1.0

Wow, kudos to you @rando, you just save my life!

Offline

#6 2017-10-18 17:48:23

geca
Member
Registered: 2017-10-18
Posts: 1

Re: [solved] Compiling things against openssl-1.0

Thanks guys, I was trying to build PHP against OpenSSL 1.0.

After

export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig

I was ready for

--with-openssl

Offline

#7 2017-10-18 18:04:17

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [solved] Compiling things against openssl-1.0

Glad it works.  Using this opportunity to close this solved thread.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB