dnl Copyright © 2011 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. AC_DEFUN([_DX_LIBMODPLUG_TEST_PROGRAM], [AC_LANG_PROGRAM([dnl #include ], [dnl unsigned char buf@<:@128@:>@ = {0}; ModPlugFile *f = ModPlug_Load(buf, sizeof buf); ModPlug_Unload(f); ])]) dnl DX_CHECK_LIBMODPLUG([action-if-ok], [action-if-fail]) AC_DEFUN([DX_CHECK_LIBMODPLUG], [DX_PKG_CONFIG([libmodplug], [libmodplug], [libmodplug]) DX_CHECK_LIB([libmodplug], [for libmodplug], [_DX_LIBMODPLUG_TEST_PROGRAM], [dnl [[$LIBMODPLUG_CFLAGS], [$LIBMODPLUG_LIBS]], [[$pkg_cv_libmodplug_cflags], [$pkg_cv_libmodplug_libs], [test ! x"$pkg_failed" = x"yes"]], [[], [-lmodplug]], ]) if test x"$dx_cv_libmodplug_found" = x"yes"; then ifelse([$1], [], [:], [$1]) else ifelse([$2], [], [AC_MSG_FAILURE([dnl libmodplug is required. The latest version can be obtained from http://modplug-xmms.sourceforge.net/. If libmodplug is installed but was not found by this configure script, consider adjusting LIBMODPLUG_CFLAGS and/or LIBMODPLUG_LIBS as necessary. If pkg-config is installed, it may help to adjust PKG_CONFIG_PATH if libmodplug is installed in a non-standard prefix. ])], [$2]) fi ])