Skip to content

Commit adf91e0

Browse files
committed
fixup freeimage detection for macOS
1 parent 86cb813 commit adf91e0

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

configure.ac

Lines changed: 14 additions & 6 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.1],[https://github.com/devkitPro/wut-tools/issues])
5+
AC_INIT([wut-tools],[1.3.2],[https://github.com/devkitPro/wut-tools/issues])
66
AC_CONFIG_SRCDIR([src/elf2rpl/main.cpp])
77
AC_CONFIG_MACRO_DIR([m4])
88

@@ -35,14 +35,22 @@ case "$host" in
3535
;;
3636
esac
3737

38-
#
39-
# check for libfreeimage
40-
#
38+
case "$host" in
39+
*-apple-darwin*)
40+
STDCPP_LIBS="-lc++"
41+
;;
42+
43+
*)
44+
STDCPP_LIBS="-lstdc++"
45+
;;
46+
47+
esac
48+
4149
AC_CHECK_HEADER([FreeImage.h])
4250

4351
AC_MSG_CHECKING([for libfreeimage])
4452
save_LIBS="$LIBS"
45-
LIBS="$LIBS -lfreeimage ${NET_LIBS} -lstdc++ -lm"
53+
LIBS="-lfreeimage ${LIBS} ${NET_LIBS} ${STDCPP_LIBS} -lm"
4654
AC_LINK_IFELSE(
4755
[AC_LANG_PROGRAM([[#include <FreeImage.h>]],
4856
[[FreeImage_DeInitialise()]])],
@@ -51,7 +59,7 @@ AC_LINK_IFELSE(
5159
AC_MSG_RESULT([$freeimage_result])
5260
LIBS="$save_LIBS"
5361
if test "x$freeimage_result" = "xyes"; then
54-
FREEIMAGE_LIBS="-lfreeimage ${NET_LIBS} -lm"
62+
FREEIMAGE_LIBS="-lfreeimage ${NET_LIBS} ${STDCPP_LIBS} -lm"
5563
else
5664
AC_MSG_ERROR(['libfreeimage' not found])
5765
fi

0 commit comments

Comments
 (0)