22# Process this file with autoconf to produce a configure script.
33
44AC_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] )
66AC_CONFIG_SRCDIR ( [ src/elf2rpl/main.cpp] )
77AC_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+ #
2941AC_CHECK_HEADER ( [ FreeImage.h] )
3042
3143AC_MSG_CHECKING ( [ for libfreeimage] )
3244save_LIBS="$LIBS"
33- LIBS="$LIBS -lfreeimage -lstdc++ -lm"
45+ LIBS="$LIBS -lfreeimage ${NET_LIBS} -lstdc++ -lm"
3446AC_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] )
3951AC_MSG_RESULT ( [ $freeimage_result] )
4052LIBS="$save_LIBS"
4153if test "x$freeimage_result" = "xyes"; then
42- FREEIMAGE_LIBS="-lfreeimage -lm"
54+ FREEIMAGE_LIBS="-lfreeimage ${NET_LIBS} -lm"
4355else
44- AC_MSG_ERROR ( [ 'libfreeimage' not found] )
56+ AC_MSG_ERROR ( [ 'libfreeimage' not found] )
4557fi
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-
5659CFLAGS="$CFLAGS -std=gnu99"
5760
5861AC_SUBST ( ZLIB_CFLAGS )
0 commit comments