Skip to content

Commit 5a93d62

Browse files
committed
fix windows freeimage detection
1 parent 2134619 commit 5a93d62

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

configure.ac

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ(2.61)
5-
AC_INIT([wut-tools],[1.3.0],[https://github.com/devkitPro/wut-tools/issues])
5+
AC_INIT([wut-tools],[1.3.1],[https://github.com/devkitPro/wut-tools/issues])
66
AC_CONFIG_SRCDIR([src/elf2rpl/main.cpp])
77
AC_CONFIG_MACRO_DIR([m4])
88

@@ -26,33 +26,36 @@ PKG_CHECK_MODULES([ZLIB], zlib, [
2626
AC_DEFINE([HAVE_LIBZ], [1], [Define if using zlib.])
2727
])
2828

29+
NET_LIBS=""
30+
31+
case "$host" in
32+
*-*-mingw*)
33+
NET_LIBS="-lws2_32"
34+
CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO"
35+
;;
36+
esac
37+
38+
#
39+
# check for libfreeimage
40+
#
2941
AC_CHECK_HEADER([FreeImage.h])
3042

3143
AC_MSG_CHECKING([for libfreeimage])
3244
save_LIBS="$LIBS"
33-
LIBS="$LIBS -lfreeimage -lstdc++ -lm"
45+
LIBS="$LIBS -lfreeimage ${NET_LIBS} -lstdc++ -lm"
3446
AC_LINK_IFELSE(
35-
[AC_LANG_PROGRAM([[#include <FreeImage.h>]],
36-
[[FreeImage_DeInitialise()]])],
37-
[freeimage_result=yes],
38-
[freeimage_result=no])
47+
[AC_LANG_PROGRAM([[#include <FreeImage.h>]],
48+
[[FreeImage_DeInitialise()]])],
49+
[freeimage_result=yes],
50+
[freeimage_result=no])
3951
AC_MSG_RESULT([$freeimage_result])
4052
LIBS="$save_LIBS"
4153
if test "x$freeimage_result" = "xyes"; then
42-
FREEIMAGE_LIBS="-lfreeimage -lm"
54+
FREEIMAGE_LIBS="-lfreeimage ${NET_LIBS} -lm"
4355
else
44-
AC_MSG_ERROR(['libfreeimage' not found])
56+
AC_MSG_ERROR(['libfreeimage' not found])
4557
fi
4658

47-
NET_LIBS=""
48-
49-
case "$host" in
50-
*-*-mingw*)
51-
NET_LIBS="-lws2_32"
52-
CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO"
53-
;;
54-
esac
55-
5659
CFLAGS="$CFLAGS -std=gnu99"
5760

5861
AC_SUBST(ZLIB_CFLAGS)

0 commit comments

Comments
 (0)