1 dnl Copyright © 2011 Nick Bowler
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
7 AC_DEFUN([_DX_LIBMODPLUG_TEST_PROGRAM], [AC_LANG_PROGRAM([dnl
10 unsigned char buf@<:@128@:>@ = {0};
11 ModPlugFile *f = ModPlug_Load(buf, sizeof buf);
15 dnl DX_CHECK_LIBMODPLUG([action-if-ok], [action-if-fail])
16 AC_DEFUN([DX_CHECK_LIBMODPLUG],
17 [DX_PKG_CONFIG([libmodplug], [libmodplug], [libmodplug])
19 DX_CHECK_LIB([libmodplug],
20 [for libmodplug], [_DX_LIBMODPLUG_TEST_PROGRAM], [dnl
21 [[$LIBMODPLUG_CFLAGS], [$LIBMODPLUG_LIBS]],
22 [[$pkg_cv_libmodplug_cflags], [$pkg_cv_libmodplug_libs],
23 [test ! x"$pkg_failed" = x"yes"]],
27 if test x"$dx_cv_libmodplug_found" = x"yes"; then
28 ifelse([$1], [], [:], [$1])
30 ifelse([$2], [], [AC_MSG_FAILURE([dnl
31 libmodplug is required. The latest
32 version can be obtained from http://modplug-xmms.sourceforge.net/.
34 If libmodplug is installed but was not found by this configure script,
35 consider adjusting LIBMODPLUG_CFLAGS and/or LIBMODPLUG_LIBS as necessary.
37 If pkg-config is installed, it may help to adjust PKG_CONFIG_PATH if
38 libmodplug is installed in a non-standard prefix.