From 8a80c97000990ddf0a19aba15e55b33df7d22cd0 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 30 Apr 2015 21:51:20 -0400 Subject: [PATCH] Import libmodplug detection from upkg. Change include to , as required by newer versions (and should work the same on older ones...) --- m4/libmodplug.m4 | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 m4/libmodplug.m4 diff --git a/m4/libmodplug.m4 b/m4/libmodplug.m4 new file mode 100644 index 0000000..08de051 --- /dev/null +++ b/m4/libmodplug.m4 @@ -0,0 +1,41 @@ +dnl Copyright © 2011, 2015 Nick Bowler +dnl +dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2. +dnl This is free software: you are free to do what the fuck you want to. +dnl There is NO WARRANTY, to the extent permitted by law. + +dnl DX_LIB_LIBMODPLUG([action-if-ok], [action-if-failed]) +dnl +dnl Search for libmodplug. This library does not expose version information +dnl so min-version checks are not supported. +dnl +dnl If a working library is found, appropriate compiler and linker flags are +dnl stored in LIBMODPLUG_CFLAGS and LIBMODPLUG_LIBS, respectively, and the +dnl action-if-ok is performed (may be empty). If no such library is found, +dnl then action-if-failed is performed if non-empty; otherwise configure will +dnl stop with a fatal error. +AC_DEFUN([DX_LIB_LIBMODPLUG], +[DX_LIB_SETUP([libmodplug])dnl +DX_LIB_PKGCONFIG_FLAGS([libmodplug]) +AC_MSG_CHECKING([for libmodplug]) +DX_LIB_SEARCH_LINK([libmodplug], [_DX_LIB_LIBMODPLUG_TEST], + [ [[$LIBMODPLUG_CFLAGS], [$LIBMODPLUG_LIBS]], + [[$dx_cv_libmodplug_pkg_cflags], [$dx_cv_libmodplug_pkg_libs], + [test x"$dx_cv_libmodplug_pkg_found" = x"yes"]], + [[], [-lmodplug]] ]) +AS_IF([test x"$dx_cv_libmodplug_lib_found" = x"yes"], [$1], + [m4_default([$2], [AC_MSG_FAILURE([dnl +libmodplug is required. The latest version may be found at +. +m4_newline([DX_LIB_USERFLAG_BLURB([libmodplug])]) +m4_newline([DX_LIB_PKGCONFIG_BLURB([libmodplug])]) +])])])]) + +dnl Internal test program for libmodplug. +m4_define([_DX_LIB_LIBMODPLUG_TEST], [AC_LANG_PROGRAM([dnl +#include +], [dnl +unsigned char buf[[128]]; +ModPlugFile *f = ModPlug_Load(buf, sizeof buf); +ModPlug_Unload(f); +])]) -- 2.43.0