Browse Source

libpipi: improve GDI+ codec cross-compilation.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3076 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 years ago
parent
commit
2c79783bee
4 changed files with 10 additions and 12 deletions
  1. +7
    -4
      build-win32
  2. +1
    -1
      pipi/Makefile.am
  3. +2
    -7
      pipi/codec/gdiplus.cpp
  4. BIN
      win32/gdiplus/lib/libgdiplus.a

+ 7
- 4
build-win32 View File

@@ -25,10 +25,6 @@ cd "${BUILDDIR}"
make pkglibdir=/lib pkgdatadir=/data bindir=/bin make pkglibdir=/lib pkgdatadir=/data bindir=/bin
# Install into our private directory # Install into our private directory
make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/ make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
# Create a launcher
echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe"
# Clean up # Clean up
cd "${SRCDIR}" cd "${SRCDIR}"
rm -Rf "${BUILDDIR}" rm -Rf "${BUILDDIR}"
@@ -44,6 +40,13 @@ find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';'
mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/" mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/"
rm -Rf "${INSTALLDIR}/lib/mono" rm -Rf "${INSTALLDIR}/lib/mono"


# Install The Pimp
mv "${INSTALLDIR}/lib/ThePimp.exe" "${INSTALLDIR}/bin/"
echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe"

# Install documentation
mkdir "${INSTALLDIR}/doc" mkdir "${INSTALLDIR}/doc"
for f in COPYING NOTES; do for f in COPYING NOTES; do
sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt" sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"


+ 1
- 1
pipi/Makefile.am View File

@@ -113,7 +113,7 @@ codec_sources += codec/gdi.c
endif endif


if USE_GDIPLUS if USE_GDIPLUS
codec_libs += -lgdiplus
codec_libs += -Wl,--exclude-symbols,$$(printf '\x7f')gdiplus_NULL_THUNK_DATA -lgdiplus
codec_sources += codec/gdiplus.cpp codec_sources += codec/gdiplus.cpp
endif endif




+ 2
- 7
pipi/codec/gdiplus.cpp View File

@@ -33,11 +33,10 @@ extern "C" {


extern "C" pipi_image_t *pipi_load_gdiplus(const char *name) extern "C" pipi_image_t *pipi_load_gdiplus(const char *name)
{ {
#if 0
size_t len; size_t len;
len = mbstowcs(NULL, name, 0); len = mbstowcs(NULL, name, 0);
wchar_t *wname = new wchar_t[len + 1]; wchar_t *wname = new wchar_t[len + 1];
if(mbstowcs(wname, name, len + 1) != (size_t)-1)
if(mbstowcs(wname, name, len + 1) == (size_t)-1)
{ {
delete[] wname; delete[] wname;
return NULL; return NULL;
@@ -78,13 +77,10 @@ extern "C" pipi_image_t *pipi_load_gdiplus(const char *name)
img->u8 = 1; img->u8 = 1;


return img; return img;
#endif
return NULL;
} }


extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name)
{ {
#if 0
wchar_t const *fmt; wchar_t const *fmt;
if(strstr(name, ".gif")) if(strstr(name, ".gif"))
fmt = L"image/gif"; fmt = L"image/gif";
@@ -117,7 +113,7 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name)
size_t len; size_t len;
len = mbstowcs(NULL, name, 0); len = mbstowcs(NULL, name, 0);
wchar_t *wname = new wchar_t[len + 1]; wchar_t *wname = new wchar_t[len + 1];
if(mbstowcs(wname, name, len + 1) != (size_t)-1)
if(mbstowcs(wname, name, len + 1) == (size_t)-1)
{ {
delete[] wname; delete[] wname;
return -1; return -1;
@@ -154,7 +150,6 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name)
delete[] wname; delete[] wname;
delete b; delete b;


#endif
return 0; return 0;
} }




BIN
win32/gdiplus/lib/libgdiplus.a View File


Loading…
Cancel
Save