On Sat, May 12, 2012 at 12:56 AM, Alon Bar-Lev <alon.bar...@gmail.com> wrote:
> On Sat, May 12, 2012 at 12:52 AM, Arne Schwabe <schw...@uni-paderborn.de> 
> wrote:
>> Am 11.05.12 20:56, schrieb Gert Doering:
>>> Changing the build environment to build a shared library out of openvpn
>>> is something I do not fully understand yet, though - and don't view
>>> a particular useful goal right now.
>> The shared library is not used as real shared library. I build
>> libopenvpn as complete library and then build a miniature executable
>> that calls the main method of the shared library and therefore exactly
>> behaves like openvpn as executable.
>>
>> The reason for this is that libraries are managed by the android package
>> system. For executables I have to carry them as data files and write
>> them to a cache partition. By putting the main  code into the library I
>> can minimise the amount of data that is written twice to the /data
>> parition on Android.
>>
>> The building as library and using android build system should seen as
>> something that is useful for my particular Android application and not
>> as a general thing or requirement.
>>
>> Arne
>>
>
> I would like you to try to do so using libtool...
>
> Just replace:
> ---
> sbin_PROGRAMS = openvpn
> openvpn_SOURCES = ....
> ---
> with:
> ---
> lib_LTLIBRARIES = openvpn.la
> openvpn_la_SOURCES = ...
> openvpn_la_LDFLAGS = \
>    -module -shared -avoid-version -no-undefined
> ---
>
> And add -Dmain=openvpn_main to AM_CFLAGS.
>
> Alon.

You should also change:
---
openvpn_LDADD = ...
---
to:
---
openvpn_la_LDADD = ...
---

Reply via email to