Updated Adding Shared Support to Packages (markdown)

Timothy Gu 2014-08-07 15:08:30 -07:00
parent 085007b53c
commit 809658ca56
1 changed files with 34 additions and 3 deletions

@ -2,9 +2,9 @@ MXE is trying to support as many shared packages as possible. For well-packaged
Always try to build and see if the results are indeed shared.
## Autotools package with libtool
## Autotools package
In most cases, you can simply change this (or something close to this):
In most cases (for packages using libtool), you can simply change this (or something close to this):
```
--host='$(TARGET)' \
@ -20,7 +20,38 @@ to
$(MXE_CONFIGURE_OPTS)
```
and you'll be fine.
and you should be fine.
### Troubleshoot
#### Static-only library
Sometimes, even when a package uses libtool only static is built. You will have to look at the log to see the problem. One common problem occurs when a library tries to link to a static-only library, such as libSDLmain, libSDL2main, and libmingw32. The log shows something like this (occurred when I was trying to add shared support to sdl2_gfx):
```
*** Warning: This system can not link to static lib archive /home/timothy_gu/mxe/usr/i686-w64-mingw32.shared/lib/libSDL2main.la.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** Warning: linker path does not have real file for library -lmingw32.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libmingw32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: /home/timothy_gu/mxe/usr/i686-w64-mingw32.shared/lib/libmingw32.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.
*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
```
You will need to patch the package not to link to the offending libraries to fix this bug. If that is not possible, you will have to give up the attempt to convert the package to shared. For this particular package, see my fix here: 0656ed047ae78e9d7a190a423d52c104990727b3 (it uses a `sed` command to explicitly filter out the bad libraries).
## Pre-commit checklist