Ver código fonte

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 anos atrás
pai
commit
2c79783bee
4 arquivos alterados com 10 adições e 12 exclusões
  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 Ver arquivo

@@ -25,10 +25,6 @@ cd "${BUILDDIR}"
make pkglibdir=/lib pkgdatadir=/data bindir=/bin
# Install into our private directory
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
cd "${SRCDIR}"
rm -Rf "${BUILDDIR}"
@@ -44,6 +40,13 @@ find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';'
mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/"
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"
for f in COPYING NOTES; do
sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"


+ 1
- 1
pipi/Makefile.am Ver arquivo

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

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



+ 2
- 7
pipi/codec/gdiplus.cpp Ver arquivo

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

extern "C" pipi_image_t *pipi_load_gdiplus(const char *name)
{
#if 0
size_t len;
len = mbstowcs(NULL, name, 0);
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;
return NULL;
@@ -78,13 +77,10 @@ extern "C" pipi_image_t *pipi_load_gdiplus(const char *name)
img->u8 = 1;

return img;
#endif
return NULL;
}

extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name)
{
#if 0
wchar_t const *fmt;
if(strstr(name, ".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;
len = mbstowcs(NULL, name, 0);
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;
return -1;
@@ -154,7 +150,6 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name)
delete[] wname;
delete b;

#endif
return 0;
}



BIN
win32/gdiplus/lib/libgdiplus.a Ver arquivo


Carregando…
Cancelar
Salvar