You are not logged in.

#1 2017-10-03 09:23:49

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 190
Website

[SOLVED] Can't build static libraries for mariadb

Hi all,

I'm trying to build a static version of my executable to run in an environment where the library versions are not easily controllable (AWS Lambda).

In order to create a static executable, I need static libraries.  Since my code needs to connect to a MySQL database, I need a static version of libmysqlclient.

I cannot however work out how to compile this.  I downloaded the PKGBUILD for mariadb and added this line near the top:

options=('staticlibs')

However when I compile it with makepkg, it always shows the step where it deletes static libraries, so although the libmysqlclient.a file gets built, it never makes it into libmariadbclient*.xz so when I go to compile my own code, it complains that it can't find the (static) MySQL library.

What am I doing wrong?  Why does "options=('staticlibs')" not do what it says and preserve the static libraries?

EDIT: Forgot to say I already removed these lines but they didn't help:

  # remove static libraries
  rm "$pkgdir"/usr/lib/*.a

Last edited by Malvineous (2017-10-06 02:34:57)

Offline

#2 2017-10-06 02:34:45

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 190
Website

Re: [SOLVED] Can't build static libraries for mariadb

Figured out the problem.  Turns out there's a line for some of the packages that overrides the options=() variable, so my global "staticlibs" option set at the start of the PKGBUILD was getting removed.

Removing that (along with the command that deleted *.a) fixed the problem.

Last edited by Malvineous (2017-10-06 02:35:23)

Offline

Board footer

Powered by FluxBB