From e83815cdb431ba2d24698e913bf4dad947f6bc8d Mon Sep 17 00:00:00 2001 From: Volker Grabsch Date: Sun, 14 Feb 2010 19:33:14 +0100 Subject: bugfix and test program for package sdl_image --- src/sdl_image-test.c | 22 ++++++++++++++++++++++ src/sdl_image.mk | 9 +++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/sdl_image-test.c diff --git a/src/sdl_image-test.c b/src/sdl_image-test.c new file mode 100644 index 0000000..ca76985 --- /dev/null +++ b/src/sdl_image-test.c @@ -0,0 +1,22 @@ +/* This file is part of mingw-cross-env. */ +/* See doc/index.html for further information. */ + +#include +#include + +int main(int argc, char* argv[]) +{ + SDL_Surface *image; + SDL_Surface *screen; + + (void)argc; + (void)argv; + + if (SDL_Init(SDL_INIT_EVERYTHING) < 0) return 1; + + image = IMG_Load("test.png"); + screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE); + + SDL_Quit(); + return 0; +} diff --git a/src/sdl_image.mk b/src/sdl_image.mk index 3a0ebe6..9038905 100644 --- a/src/sdl_image.mk +++ b/src/sdl_image.mk @@ -20,6 +20,8 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD + $(SED) 's,^\(Requires:.*\),\1 libpng,' -i '$(1)/SDL_image.pc.in' + echo 'Libs.private: -ltiff -ljpeg -lz' >> '$(1)/SDL_image.pc.in' cd '$(1)' && ./configure \ --host='$(TARGET)' \ --disable-shared \ @@ -31,4 +33,11 @@ define $(PKG)_BUILD --disable-tif-shared \ LIBS='-lz' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + `'$(TARGET)-pkg-config' SDL_image --cflags` \ + '$(2).c' \ + `'$(TARGET)-pkg-config' SDL_image --libs` \ + -o '$(PREFIX)/$(TARGET)/bin/test-sdl_image.exe' endef -- cgit v0.12