[lxc-devel] Static bulding of LXC tools (was: Re: Duplicate definitions of `lxc_log_define`)

Ciprian Dorin, Craciun ciprian.craciun at gmail.com
Tue Jan 12 11:12:06 UTC 2010


On Tue, Jan 12, 2010 at 12:06 PM, Daniel Lezcano <dlezcano at fr.ibm.com> wrote:
> Ciprian Dorin, Craciun wrote:
>
> [ ... ]
>
>> From 2bfc3d1be1715d582f7d319580d49723ff913d99 Mon Sep 17 00:00:00 2001
>> From: Ciprian Dorin, Craciun <ciprian at volution.ro>
>> Date: Sun, 10 Jan 2010 14:22:47 +0200
>> Subject: [PATCH 2/2] Added options for building (enabling / disabling:
>> static / shared libraries and linking).
>>
>> Added the following options for `./configure` script:
>>  * `--enable-shared` / `--disable-shared`, that instructs
>>  if the (dynamic) `liblxc.so` is getting built and installed;
>>  * `--enable-static` / `--disable-static`, that instructs
>>  if the (static) `liblxc.a` is getting built and installed;
>>  * `--enable-static-linking` that instructs if
>>  the resulting executables are statically linked against `liblxc.a`;
>>
>> There are also sensible defaults:
>>  * `static` is by default `no`;
>>  * `shared` is by default the negation of `static`;
>>  * `static-linking` is by default equal with `static`;
>>
>> As a consequence of the defaults there are the following scenarios:
>>  * none of these options are specified => the build behaves exectly
>> like before the patch;
>>  * `--enable-static` => static linking, shared libraries are not built;
>>  * `--enable-static --enable-shared` => we build both libraries, but
>> we statically link;
>>  * `--enable-static-linking` => static linking, but also the shared
>> library is installed;
>
> Hi Ciprian,
>
> Why do we need such combination options, with --enable-static we make
> everything static. If the user neeeds to have shared, then it should rerun
> the configure without this option, no ?


    Indeed the usual way in which configure+make+make_install style
applications work is like you've said: enable-static does both (lib +
exe) static, while enable-shared builds both shared. And the user
(actual the packager) if he wants both he shall re-run the entire
process twice (thus double the build time.)

    But then if it's not that difficult to support all four
combinations (all static, all shared, static exe+lib + shared lib,
shared exe+lib + static lib), and with sensible defaults it just works
as expected, I see no harm. (The build time decreases, but only the
configuration time is saved.)

    But I don't mind if you just drop the --enable-static-linking.
(You only have to remove the configure.ac option and initialize always
the variable as static_libraries.)

    Ciprian.




More information about the lxc-devel mailing list