summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sdl_image-test.c22
-rw-r--r--src/sdl_image.mk9
2 files changed, 31 insertions, 0 deletions
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 <SDL.h>
+#include <SDL_image.h>
+
+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