Skip to Content.
Sympa Menu

freetds - Re: [freetds] Configure Build so OpenSSL is statically linked

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Configure Build so OpenSSL is statically linked
  • Date: Mon, 20 Sep 2021 19:27:58 +0100

Hi,

Il giorno lun 20 set 2021 alle ore 17:39 John Kendall <john AT capps.com> ha
scritto:

> Hi, Frediano.
>
> Yes, only OpenSSL static, the rest dynamic. I’m on MacOS. I’ve got the
> latest OpenSSL (3.0) compiled and installed.
> The static libs are in /usr/local/lib:
>
> $ ls /usr/local/lib/*.a
> /usr/local/lib/libcrypto.a /usr/local/lib/libssl.a
>
> It was no problem getting things built with dynamic libraries.
>
> ./configure --with-openssl=/usr/local ; make. ## works
>
> I suppose it works with dynamic libraries. Are the dynamic libraries in
the same directory?


> I’ve tried a few things to get them to statically link:
>
> adding --disable-rpath
>

It should not help


> setting LDFLAGS
>

I would work on OPENSSL_LIBS instead. Some linker prefers to have the full
path of the static libraries, like
export OPENSSL_LIBS='/usr/local/lib/libcrypto.a /usr/local/lib/libssl.a'


> setting OPENSSL_CFLAGS
>
>
This should be the same for static and not static (at least usually)

But I don’t know how to set them.
> I don’t know about PKG_CONFIG. Any ideas would be appreciated.
>
> I hope it is not necessary to change these. pkg-config is a program that
helps configure to find libraries and settings.
PKG_CONFIG variable tells configure where to find this program/script.
PKG_CONFIG_PATH tell pkg-config where
to look for *.pc files containing configuration for libraries. For instance
on my system (Linux):

$ pkg-config --cflags --libs openssl
-lssl -lcrypto

Given what you told me I would try

$ export OPENSSL_CFLAGS='-I/usr/local/include'
$ export OPENSSL_LIBS='/usr/local/lib/libcrypto.a /usr/local/lib/libssl.a'
$ ./configure --with-openssl <arguments>
$ make

Thanks,
> John
>
>
Frediano

>
> > On Sep 20, 2021, at 4:49 AM, Frediano Ziglio <freddy77 AT gmail.com> wrote:
> >
> > Hi,
> > I suppose you want only OpenSSL static, rest dynamic.
> > Usually you first compile/install the static library, then tell configure
> > where/how to find the static compiled library.
> > Usually ./configure --help can help. In this case there are
> --with-openssl
> > (flag) and OPENSSL_CFLAGS/OPENSSL_LIBS
> > (environment) to play with. To be complete I would add PKG_CONFIG_xxx
> > environments (as configure is using
> > pkg-config also) but usually it is not necessary to use these.
> > If you are using Unix an alternative could be the usage of LD_RUN_PATH.
> > This environment is used by the linker
> > automatically and tells the executable where to find libraries.
> > What's the environment? Linux, Windows, MacOS or any other?
> >
> > Regards,
> > Frediano
> >
> >
> > Il giorno lun 20 set 2021 alle ore 11:55 John Kendall <john AT capps.com>
> ha
> > scritto:
> >
> >> Hi, Folks.
> >> I’ve tried, but I can’t seem to find the ./configure options that will
> >> build a libct with openssl’s libssl and libcrypt statically linked to
> it.
> >> Has anyone done this?
> >> Thanks in advance for any direction.
> >> John
> >>
>




Archive powered by MHonArc 2.6.24.

Top of Page