]> git.sesse.net Git - vlc/commitdiff
Fix check for libsidplay2 in ./configure
authorAlexey Sokolov <alexey@alexeysokolov.co.cc>
Sat, 19 Mar 2011 20:31:30 +0000 (02:31 +0600)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 20 Mar 2011 19:52:23 +0000 (20:52 +0100)
Some distros separate libsidplay2 into few packages.
In that case libresid-builder can be absent even if libsidplay2 was found.
Now, if libsidplay2 was found, we check for libresid-builder explicitly.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
configure.ac

index 07f859d091aa3162cfd77698a658072e02750d24..c77d88ac421ce1bae13d39ae5fb0cea8fe61bcdd 100644 (file)
@@ -2222,7 +2222,27 @@ AS_IF([test "${enable_gme}" != "no"], [
 dnl
 dnl  SIDPlay plugin
 dnl
-PKG_ENABLE_MODULES_VLC([SID], [], [libsidplay2], [C64 sid demux support], [auto], [], [-lresid-builder])
+PKG_WITH_MODULES([SID], [libsidplay2],
+               AC_LANG_PUSH(C++)
+               oldCPPFLAGS="$CPPFLAGS"
+               CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
+               AC_CHECK_HEADER([sidplay/builders/resid.h], [
+                       VLC_ADD_PLUGIN([sid])
+                       VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
+                       VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
+               ], [
+                       AS_IF([test "x${enable_sid}" = "xyes"],
+                               [AC_MSG_ERROR(Library libresid-builder needed for sid was not found)],
+                               [AC_MSG_WARN(Library libresid-builder needed for sid was not found)]
+                               )
+               ])
+               CPPFLAGS="$oldCPPFLAGS"
+               AC_LANG_POP(C++),
+               AS_IF([test "x${enable_sid}" = "xyes"],
+                       [AC_MSG_ERROR(Library libsidplay2 needed for sid was not found)],
+                       [AC_MSG_WARN(Library libsidplay2 needed for sid was not found)]
+                       ),
+               [C64 sid demux support], [auto])
 
 
 dnl