]> git.sesse.net Git - vlc/commitdiff
Configure: try to fix modplug detection
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 18 Jul 2010 17:27:24 +0000 (19:27 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 18 Jul 2010 17:27:24 +0000 (19:27 +0200)
If 0.8.8 is detected and --enable-mod is passed, it will error,
if --disable-mod is passed, nothing will happen
else it will autodetect. This is mostly like all other PKG_ENABLE_MODULES_VLC
detections

configure.ac

index ad074dbe8be8a62f690b1ab54a90c8f07f3743db..da7746b8693c761f43769d22ee1f053f2713b6ea 100644 (file)
@@ -2460,42 +2460,17 @@ dnl
 dnl  modplug demux plugin
 dnl
 AC_ARG_ENABLE(mod,
-  [  --enable-mod            Mod demux support (default enabled)])
-if test "${enable_mod}" != "no"
-then
-  AC_ARG_WITH(mod-tree,
-  [  --with-mod-tree=PATH    mod tree for static linking])
-  if test -n "${with_mod_tree}"
-  then
-    AC_MSG_CHECKING(for libmodplug.a in ${with_mod_tree})
-    real_mod_tree="`cd ${with_mod_tree} 2>/dev/null && pwd`"
-    if test -z "${real_mod_tree}"
-    then
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot cd to ${with_mod_tree}])
-    fi
-    if test -f "${real_mod_tree}/src/.libs/libmodplug.a"
-    then
-      dnl  Use a custom mod
-      AC_MSG_RESULT(${real_mod_tree}/src/.libs/libmodplug.a)
-      VLC_ADD_PLUGIN([mod])
-      VLC_ADD_LIBS([mod],[${real_mod_tree}/src/.libs/libmodplug.a -lstdc++])
-      VLC_ADD_CXXFLAGS([mod],[-I${real_mod_tree}/include])
-    else
-      dnl  The given mod wasn't built
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${real_mod_tree}/src/.libs/libmodplug.a, make sure you compiled mod in ${with_mod_tree}])
-    fi
-  else
-    PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8 libmodplug != 0.8.8], [
+  [  --enable-mod            Mod demux support (default auto)])
+if test "${enable_mod}" != "no" ; then
+    PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
           VLC_ADD_PLUGIN([mod])
           VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
           VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
-    ], [
-      AC_MSG_WARN([libmodplug not found or a broken version (0.8.8.0) was found!])
+    ],[
+       AS_IF([test x"${enable_mod}" = "xyes"],
+         [AC_MSG_ERROR(libmodplug not found or a broken version (0.8.8.0) was found!)],
+         [AC_MSG_WARN(libmodplug not found or a broken version (0.8.8.0) was found!)])
     ])
-  fi
 fi
 
 dnl