Pango is a required component of GTK+ libraries. With Cygwin GCC compiler, I was compiling Pango during GTK+ compilation. But I ran into a problem when only static libraries of Pango were produced. So I had to produce shared libraries of Pango from static ones. Here I show how I did it using dllwrap
:
- First, create empty directories:
mkdir pango pangocairo pangoft2 pangowin32
- Extract object codes from the static libraries into separate directories:
cd pango
ar x /usr/lib/libpango-1.0.a
cd ../pangocairo/
ar x /usr/lib/libpangocairo-1.0.a
cd ../pangoft2/
ar x /usr/lib/libpangoft2-1.0.a
cd ../pangowin32/
ar x /usr/lib/libpangowin32-1.0.a - Create a shared library
cygpango-1.0-0.dll
and import librarylibpango-1.0.dll.a
from the static library/usr/lib/libpango-1.0.a
. The dependencies are gotten from/usr/lib/libpango-1.0.la
:cd ../pango/
dllwrap --verbose --export-all-symbols --add-stdcall-alias -o /usr/bin/cygpango-1.0-0.dll --dllname cygpango-1.0-0.dll --output-lib /usr/lib/libpango-1.0.dll.a *.o -L/usr/lib -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -luser32 -lkernel32 -lintl -liconv - Likewise, convert
/usr/lib/libpangowin32-1.0.a
to a shared library:cd ../pangowin32/
dllwrap --verbose --export-all-symbols --add-stdcall-alias -o /usr/bin/cygpangowin32-1.0-0.dll --dllname cygpangowin32-1.0-0.dll --output-lib /usr/lib/libpangowin32-1.0.dll.a *.o -L/usr/lib -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -luser32 -lkernel32 -lintl -liconv -lgdi32 - Likewise, convert
/usr/lib/libpangoft2-1.0.a
to a shared library:cd ../pangoft2/
dllwrap --verbose --export-all-symbols --add-stdcall-alias -o /usr/bin/cygpangoft2-1.0-0.dll --dllname cygpangoft2-1.0-0.dll --output-lib /usr/lib/libpangoft2-1.0.dll.a *.o -L/usr/lib -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -luser32 -lkernel32 -lintl -lfontconfig -lxml2 -liconv -lfreetype -lzIf fontconfig was compiled with expat, replace -lxml2 with -lexpat.
- Likewise, convert
/usr/lib/libpangocairo-1.0.a
to a shared library:cd ../pangocairo/
dllwrap --verbose --export-all-symbols --add-stdcall-alias -o /usr/bin/cygpangocairo-1.0-0.dll --dllname cygpangocairo-1.0-0.dll --output-lib /usr/lib/libpangocairo-1.0.dll.a *.o -L/usr/lib -lcairo -lmsimg32 -lpixman-1 -lpng12 -lpangowin32-1.0 -lgdi32 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -luser32 -lkernel32 -lintl -lfontconfig -lxml2 -liconv -lfreetype -lzIf fontconfig was compiled with expat, replace -lxml2 with -lexpat.
- Finally, modify
/usr/lib/libpango*.la
accordingly. For example, I made the following change to mylibpango-1.0.la
file:dlname='../bin/cygpango-1.0-0.dll'
library_names='libpango-1.0.dll.a'
This creates shared libraries cygpango-1.0-0.dll, cygpangowin32-1.0-0.dll, cygpangoft2-1.0-0.dll, cygpangocairo-1.0-0.dll
and import libraries libpango-1.0.dll.a, libpangowin32-1.0.dll.a, libpangoft2-1.0.dll.a, libpangocairo-1.0.dll.a
.
No comments:
Post a Comment