qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

shared library not created in mingw+msys (patch included) #113

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Original report with patch:
 http://code.google.com/p/webm/issues/detail?id=412

Summary:
I need shared library in mingw+msys environment but only static was created. 
After some investigation I found out that:
* libtool is not initialized (you need to add LT_INIT to configure.ac)
* '-no-undefined' need to be used [1]

Patch to solve this issues is included.

[1] 
http://stackoverflow.com/questions/2083533/automake-and-standard-shared-librarie
s
[2] http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
[3] http://sources.redhat.com/autobook/autobook/autobook_88.html

Original issue reported on code.google.com by jz...@google.com on 31 Mar 2012 at 2:19

GoogleCodeExporter commented 8 years ago
> diff --git a/configure.ac b/configure.ac
> index 8ae4574..7c14d47 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -5,6 +5,7 @@ AC_CANONICAL_TARGET
>  AM_INIT_AUTOMAKE([-Wall foreign silent-rules subdir-objects])
>  AC_PROG_LIBTOOL
>  AM_PROG_CC_C_O
> +LT_INIT
>  

Shouldn't be necessary unless we're sending libtool options, AC_PROG_LIBTOOL 
should call LT_INIT.

>  AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
>   [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 59e2c85..58b0a1a 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -8,7 +8,7 @@ libwebp_la_LIBADD = dec/libwebpdecode.la \
>                      enc/libwebpencode.la \
>                      utils/libwebputils.la \
>                      dsp/libwebpdsp.la
> -libwebp_la_LDFLAGS = -version-info 2:0:0
> +libwebp_la_LDFLAGS = -no-undefined -version-info 2:0:0

Not sure this is portable to platforms other than windows. I'll see if I can 
reproduce and then will investigate a solution.

>  libwebpinclude_HEADERS = webp/types.h webp/decode.h webp/decode_vp8.h \
>                           webp/encode.h
>  libwebpincludedir = $(includedir)/webp

Original comment by jz...@google.com on 31 Mar 2012 at 2:22

GoogleCodeExporter commented 8 years ago
Does appear to work on mingw, still need to test other platforms.

Original comment by jz...@google.com on 31 Mar 2012 at 2:50

GoogleCodeExporter commented 8 years ago
This works for libwebp at the moment, but libwebpmux will need some changes as 
it depends on a few functions from libwebp.

Original comment by jz...@google.com on 17 Jul 2012 at 6:09

GoogleCodeExporter commented 8 years ago
Patch for 0.2.0 attached.

Original comment by yselkow...@gmail.com on 22 Aug 2012 at 3:01

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, this didn't make it into 0.2.0 as there might be an issue with the 
current structure of libwebpmux and its dependency on libwebp. For the time 
being I'll split this and add it for libwebp at the HEAD, then get back to 
libwebpmux after it's split into a mux and demux lib.

Original comment by jz...@google.com on 23 Aug 2012 at 12:29

GoogleCodeExporter commented 8 years ago
https://gerrit.chromium.org/gerrit/#/c/34987/

Original comment by jz...@google.com on 9 Oct 2012 at 8:21

GoogleCodeExporter commented 8 years ago
The fix for libwebp has been merged (v0.2.0-40-g1765cb1). I'll leave this open 
to track libwebpmux.

1765cb1 Merge "autoconf/libwebp: enable dll builds for mingw"
a13562e autoconf/libwebp: enable dll builds for mingw

Original comment by jz...@google.com on 9 Oct 2012 at 8:26

GoogleCodeExporter commented 8 years ago
The above was cherry-picked into the 0.2.1 release.

Original comment by jz...@google.com on 13 Nov 2012 at 1:30

GoogleCodeExporter commented 8 years ago
The following change should address this for the mux/demux libs, which will be 
available in the 0.3.0 release

https://gerrit.chromium.org/gerrit/#/c/45301/
627f5ca automake: add reference to libwebp for mux/demux

Original comment by jz...@google.com on 13 Mar 2013 at 8:20