]> git.draconx.ca Git - upkg.git/commitdiff
Fix build with more recent libmodplug.
authorNick Bowler <nbowler@draconx.ca>
Wed, 27 Feb 2019 18:35:39 +0000 (13:35 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 27 Jan 2020 04:06:58 +0000 (23:06 -0500)
Modern versions of libmodplug no longer put -I${includedir}/libmodplug
in the pkg-config file, which breaks our files that #include <modplug.h>.

Seems the expectation is for packges to #include <libmodplug/modplug.h>
instead, which should work totally fine with old versions too.  The new
libmodplug helper macro in dxcommon uses that, so just update the the
rest of the code accordingly.

Makefile.am
common
configure.ac
m4/dxutils.m4 [deleted file]
m4/libmodplug.m4 [deleted file]
src/engine/music-modplug.c

index 60474a576a1d5694635a5ff78c02538306de4a81..01ab6f860b90133bfe4651832cc99fd1c52ff153 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2009-2012, 2015 Nick Bowler
+# Copyright © 2009-2012, 2015, 2019 Nick Bowler
 #
 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
 # This is free software: you are free to do what the fuck you want to.
diff --git a/common b/common
index 8ff6f88c85fd93411fc013dc8eb2b54d2cf80a0d..92a89700c65e52fac8c2cace51a7112d60b3f42f 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 8ff6f88c85fd93411fc013dc8eb2b54d2cf80a0d
+Subproject commit 92a89700c65e52fac8c2cace51a7112d60b3f42f
index 030e9fa9171675765f771da23ccff116126df3e9..752343f62616ae84dffb1c1b50c776cdbc143ee5 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright © 2009-2012, 2015 Nick Bowler
+dnl Copyright © 2009-2012, 2015, 2019 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.
@@ -34,26 +34,13 @@ AC_ARG_WITH([modlib],
        [with_modlib=$withval],
        [with_modlib=auto])
 
-case $with_modlib in
-no|none)
-       use_modlib=none
-;;
-modplug)
-       DX_CHECK_LIBMODPLUG([use_modlib=modplug], [])
-;;
-auto)
-       DX_CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
+use_modlib=none
+AS_CASE([$with_modlib],
+  [no|none], [:],
+  [modplug], [DX_LIB_LIBMODPLUG([use_modlib=modplug])],
+  [auto], [DX_LIB_LIBMODPLUG([use_modlib=modplug], [:])],
+  [AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])])
 
-       if test x$have_libmodplug = xyes; then
-               use_modlib=modplug
-       else
-               use_modlib=none
-       fi
-;;
-*)
-       AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])
-;;
-esac
 AC_MSG_CHECKING([which module library to use])
 AC_MSG_RESULT([$use_modlib])
 
diff --git a/m4/dxutils.m4 b/m4/dxutils.m4
deleted file mode 100644 (file)
index 6df2438..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-dnl Copyright (C) 2010 Nick Bowler
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.  This file is offered as-is,
-dnl without any warranty.
-
-m4_pattern_forbid([^_?DX_])
-
-dnl DX_PKG_CONFIG(env-base, [pkg-id], [pkg-help])
-AC_DEFUN([DX_PKG_CONFIG], [dnl
-AC_ARG_VAR(m4_toupper([$1])[_CFLAGS], [C compiler flags for ]ifelse(
-       [$3], [], [$1], [$3]))dnl
-AC_ARG_VAR(m4_toupper([$1])[_LIBS],   [linker flags for ]ifelse(
-       [$3], [], [$1], [$3]))dnl
-
-ifelse([$2], [], [], [dnl
-AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test x"$PKG_CONFIG" != x; then
-       AC_MSG_CHECKING([pkg-config database for $2])
-       pkg_failed=no
-       _PKG_CONFIG(m4_tolower([$1])[_cflags], [cflags], [$2])
-       _PKG_CONFIG(m4_tolower([$1])[_libs],   [libs],   [$2])
-       if test x$pkg_failed = xyes; then
-               errors=`$PKG_CONFIG --errors-to-stdout --print-errors $2`
-               echo "$errors" >&AS_MESSAGE_LOG_FD
-               AC_MSG_RESULT([no])
-       else
-               AC_MSG_RESULT([yes])
-       fi
-fi])])
-
-dnl _DX_CHECK_LIB(env-base, check-func, [cflags], [libs], [test])
-AC_DEFUN([_DX_CHECK_LIB], [dnl
-if test x"$dx_cv_[]m4_tolower([$1])_found" = x"no"; then
-if ifelse([$5], [], [:], [$5]); then
-       CFLAGS="$3 $dx_old_cflags"
-       LIBS="$4 $dx_old_libs"
-
-       $2([dnl
-               dx_cv_[]m4_tolower([$1])_found="yes"
-               dx_cv_[]m4_tolower([$1])_cflags="$3"
-               dx_cv_[]m4_tolower([$1])_libs="$4"
-       ])
-fi
-fi
-])
-
-dnl DX_CHECK_LIB_EXT(env-base, message, check-func,
-dnl              [[[cflags1],[libs1],[test1]],[[cflags2],[libs2],[test2]],...])
-AC_DEFUN([DX_CHECK_LIB_EXT], [dnl
-AC_LANG_PUSH([C])
-dx_old_cflags=$CFLAGS
-dx_old_libs=$LIBS
-
-AC_CACHE_CHECK([$2], [dx_cv_]m4_tolower([$1])[_found], [dnl
-AC_CACHE_VAL([dx_cv_]m4_tolower([$1])[_libs],   [dnl
-AC_CACHE_VAL([dx_cv_]m4_tolower([$1])[_cflags], [dnl
-       dx_cv_[]m4_tolower([$1])_found=no
-       m4_foreach([dx_tuple], [$4], [_DX_CHECK_LIB([$1], [$3], dx_tuple)])
-])])])
-
-if test x"$dx_cv_[]m4_tolower([$1])_found" = x"yes"; then
-       m4_toupper([$1])_CFLAGS=$dx_cv_[]m4_tolower([$1])_cflags
-       m4_toupper([$1])_LIBS=$dx_cv_[]m4_tolower([$1])_libs
-       AC_SUBST(m4_toupper([$1])[_CFLAGS])
-       AC_SUBST(m4_toupper([$1])[_LIBS])
-fi
-
-CFLAGS=$dx_old_cflags
-LIBS=$dx_old_libs
-AC_LANG_POP([C])
-])
-
-dnl DX_CHECK_LIB(env-base, message, test-program,
-dnl              [[[cflags1],[libs1],[test1]],[[cflags2],[libs2],[test2]],...])
-AC_DEFUN([DX_CHECK_LIB], [dnl
-       DX_CHECK_LIB_EXT([$1], [$2], [m4_curry([AC_LINK_IFELSE], [$3])], [$4])
-])
diff --git a/m4/libmodplug.m4 b/m4/libmodplug.m4
deleted file mode 100644 (file)
index d19bcd0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-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 <modplug.h>
-], [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
-])
index 867caffa81618f57310f35d05ada8ba252b871cb..449a48027d8186a90645bdf549fa4ecbde60763c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  upkg: tool for manipulating Unreal Tournament packages.
- *  Copyright © 2009-2011 Nick Bowler
+ *  Copyright © 2009-2011, 2019 Nick Bowler
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <modplug.h>
+#include <libmodplug/modplug.h>
 #include "modplug-types.h"
 
 #include "music-module.h"