]> git.sesse.net Git - vlc/blobdiff - configure.ac
- added 'vlc.video.crop' property for ActiveX/Mozilla
[vlc] / configure.ac
index e9d9036dcc62236b7ec9ea0a55035053143d7855..9edec03ecba1b79f209ca131d50f4d1a1f9dc116 100644 (file)
@@ -6,7 +6,7 @@ VERSION_MINOR="9"
 VERSION_REVISION="0"
 VERSION_EXTRA="svn"
 
-CONFIGURE_LINE="$0 $ac_configure_args"
+CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
 CODENAME="Grishenko"
 
 AC_PREREQ(2.59)
@@ -570,7 +570,7 @@ AC_CHECK_LIB(m,pow,[
   VLC_ADD_LDFLAGS([ffmpeg ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer param_eq libvlc vorbis freetype mod mpc dmo quicktime realaudio galaktos opengl],[-lm])
 ])
 AC_CHECK_LIB(m,sqrt,[
-  VLC_ADD_LDFLAGS([headphone_channel_mixer normvol speex mono colorthres],[-lm])
+  VLC_ADD_LDFLAGS([headphone_channel_mixer normvol speex mono colorthres extract],[-lm])
 ])
 AC_CHECK_LIB(m,ceil,[
   VLC_ADD_LDFLAGS([mosaic],[-lm])
@@ -844,7 +844,7 @@ dnl Check for dbus
 AC_ARG_ENABLE(dbus,
   [  --enable-dbus           Linux D-BUS message bus system (default enabled)])
  
-if test "${enable_dbus}" != "no"
+if test "${enable_dbus}" != "no" -a "$SYS" = "Linux"
 then
   dnl api stable dbus
   PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0.0,
@@ -1396,7 +1396,7 @@ AS_IF([test "${CFLAGS_TUNING}"],
 dnl
 dnl  x86 accelerations
 dnl
-if test "${host_cpu}" = "i686" -o "${host_cpu}" = "i586" -o "${host_cpu}" = "x86" -o "${host_cpu}" = "i386" -o "${host_cpu}" = "x86_64"
+if test "${host_cpu}" = "i686" -o "${host_cpu}" = "i586" -o "${host_cpu}" = "x86" -o "${host_cpu}" = "i386" -o "${host_cpu}"="i486" -o "${host_cpu}" = "x86_64"
 then
     ARCH="${ARCH} mmx"
     VLC_ADD_BUILTINS([${ACCEL_MODULES}])
@@ -5265,18 +5265,24 @@ then
        WIDL=no
     fi
     AC_LANG_PUSH(C++)
-    AC_CHECK_HEADERS(ole2.h olectl.h,
-      [ VLC_ADD_CPPFLAGS([activex],[-D_MIDL_USE_GUIDDEF_])
-        VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
-        VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi]) 
-        AC_CHECK_HEADERS(objsafe.h,
-          VLC_ADD_CXXFLAGS([activex],[-DHAVE_OBJSAFE_HEADER]),,
-          [#if HAVE_OLE2_H
-           #   include <ole2.h>
-           #endif]
-        )
-        activex=:
-      ],
+    AC_CHECK_HEADERS(ole2.h, 
+      [AC_CHECK_HEADERS(olectl.h,
+        [ VLC_ADD_CPPFLAGS([activex],[-D_MIDL_USE_GUIDDEF_])
+          VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
+          VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi]) 
+          AC_CHECK_HEADERS(objsafe.h,
+            VLC_ADD_CXXFLAGS([activex],[-DHAVE_OBJSAFE_HEADER]),,
+            [
+            #if HAVE_OLE2_H
+             #   include <ole2.h>
+             #endif
+            ]
+          )
+          activex=:
+         PLUGINS_BINDINGS="${PLUGINS_BINDINGS} activex"
+        ],
+        [ AC_MSG_ERROR([required OLE headers are missing from your system]) ]
+      )],
       [ AC_MSG_ERROR([required OLE headers are missing from your system]) ]
     )
     AC_LANG_POP(C++)
@@ -5293,7 +5299,7 @@ dnl  Mozilla plugin
 dnl
 mozilla=false
 AC_ARG_ENABLE(mozilla,
-  [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
+  [  --enable-mozilla        build a vlc-based Firefox/Mozilla plugin (default disabled)])
 AC_ARG_WITH(mozilla-sdk-path,
   [    --with-mozilla-sdk-path=PATH path to mozilla sdk])
 AC_LANG_PUSH(C++)
@@ -5301,41 +5307,82 @@ if test "${enable_mozilla}" = "yes"
 then
   dnl currently vlc plugin only needs headers, no xpcom support apis are actually used
   need_xpcom_libs=false
+
   if test "${with_mozilla_sdk_path}" = "" -o "${with_mozilla_sdk_path}" = "no"
   then
-    AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
-    if test "${MOZILLA_CONFIG}" = "no"
-    then
-      AC_PATH_PROG(SEAMONKEY_CONFIG, seamonkey-config, no)
-      if test "${SEAMONKEY_CONFIG}" = "no"
-      then
-        AC_PATH_PROG(XULRUNNER_CONFIG, xulrunner-config, no)
-        if test "${XULRUNNER_CONFIG}" = "no"
+    dnl New firefox-1.5 SDK api
+    PKG_CHECK_MODULES([firefox], [firefox-plugin],
+      [
+        firefox_libs=`pkg-config --libs firefox-plugin`
+        firefox_cflags=`pkg-config --cflags firefox-plugin`
+        PKG_CHECK_MODULES([nspr], [nspr], [ nspr= ],
+          [
+            AC_MSG_ERROR([Please install the nspr development tools.])
+          ]
+        )
+        CPPFLAGS="${CPPFLAGS_save} ${firefox_cflags} ${MOZILLA_CPPFLAGS}"
+        MOZILLA_REQUIRED_HEADERS=1
+        AC_CHECK_HEADERS(mozilla-config.h,,MOZILLA_REQUIRED_HEADERS=0)
+        AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
+        AC_CHECK_HEADERS(npruntime.h,,MOZILLA_REQUIRED_HEADERS=0,
+          [#if HAVE_NPAPI_H
+           # include <npapi.h>
+           #endif
+          ])
+        CPPFLAGS="${CPPFLAGS_save}"
+        if test "${MOZILLA_CONFIG_HEADERS}" = "0"; then
+            AC_MSG_ERROR([Please install the Firefox development tools; mozilla-config.h, plugin/npapi.h and plugin/npruntime.h were not found.])
+        fi
+        MOZILLA_REQUIRED_HEADERS=
+        mozilla=:
+        firefox_include=`pkg-config --variable=includedir firefox-plugin`
+        MOZILLA_CONFIG_H="${firefox_include}/mozilla-config.h"
+        if grep '^#define MOZ_X11 1' ${MOZILLA_CONFIG_H} 2>&1 > /dev/null ; then
+            VLC_ADD_LDFLAGS([mozilla], [-lX11 -lXt ${X_LIBS} ${X_PRE_LIBS}])
+        fi
+        VLC_ADD_CPPFLAGS([mozilla],[${firefox_cflags} ${MOZILLA_CPPFLAGS}])
+        VLC_ADD_LDFLAGS([mozilla],[${firefox_libs} ${MOZILLA_LDFLAGS}])
+        VLC_ADD_PLUGINS([mozilla])
+        MOZILLA_CONFIG=
+      ],
+      [
+        AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
+        if test "${MOZILLA_CONFIG}" = "no"
         then
-          AC_MSG_ERROR([Please install the Mozilla development tools, mozilla-config was not found.])
-        else
-          have_xul=true
-          MOZILLA_CONFIG="${XULRUNNER_CONFIG}"
+          AC_PATH_PROG(SEAMONKEY_CONFIG, seamonkey-config, no)
+          if test "${SEAMONKEY_CONFIG}" = "no"
+          then
+            AC_PATH_PROG(XULRUNNER_CONFIG, xulrunner-config, no)
+            if test "${XULRUNNER_CONFIG}" = "no"
+            then
+              AC_MSG_ERROR([Please install the Mozilla development tools, mozilla-config was not found.])
+            else
+              have_xul=true
+              MOZILLA_CONFIG="${XULRUNNER_CONFIG}"
+            fi
+          else
+            MOZILLA_CONFIG="${SEAMONKEY_CONFIG}"
+          fi
         fi
-      else
-        MOZILLA_CONFIG="${SEAMONKEY_CONFIG}"
+      ]
+    )
+    if test ! -z "${MOZILLA_CONFIG}"
+    then
+      if ${MOZILLA_CONFIG} --defines | grep -q 'MOZ_X11=1'; then
+        LDFLAGS="${LDFLAGS_save} ${X_LIBS} ${X_PRE_LIBS}"
+        AC_CHECK_LIB(Xt,XtStrings,
+         [
+           VLC_ADD_CPPFLAGS([mozilla],[${X_CFLAGS}])
+           VLC_ADD_LDFLAGS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE])
+         ],
+         [],
+         [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE]
+        ])
+        LDFLAGS="${LDFLAGS_save}"
       fi
-    fi
-
-    if ${MOZILLA_CONFIG} --defines | grep -q 'MOZ_X11=1'; then
-      LDFLAGS="${LDFLAGS_save} ${X_LIBS} ${X_PRE_LIBS}"
-      AC_CHECK_LIB(Xt,XtStrings,
-       [
-         VLC_ADD_CPPFLAGS([mozilla],[${X_CFLAGS}])
-         VLC_ADD_LDFLAGS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE])
-       ],
-       [],
-       [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE]
-      ])
-      LDFLAGS="${LDFLAGS_save}"
-    fi
 
       mozilla=:
+      PLUGINS_BINDINGS="${PLUGINS_BINDINGS} mozilla"
       dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
       VLC_ADD_CPPFLAGS([mozilla],[[`${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`]])
       if ${need_xpcom_libs}; then
@@ -5359,6 +5406,7 @@ then
       MOZILLA_REQUIRED_HEADERS=
       CPPFLAGS="${CPPFLAGS_save}"
       MOZILLA_SDK_PATH="`${MOZILLA_CONFIG} --prefix`"
+    fi
     dnl End of moz_sdk = ""
   else
     dnl special case for mingw32
@@ -5387,19 +5435,20 @@ then
     fi
     MOZILLA_REQUIRED_HEADERS=
     mozilla=:
+    PLUGINS_BINDINGS="${PLUGINS_BINDINGS} mozilla"
     VLC_ADD_CPPFLAGS([mozilla],[-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX -I${real_mozilla_sdk} -I${real_mozilla_sdk}/include -I${real_mozilla_sdk}/embedstring/include -I${real_mozilla_sdk}/xpcom/include -I${real_mozilla_sdk}/nspr/include -I${real_mozilla_sdk}/string/include -I${real_mozilla_sdk}/plugin/include -I${real_mozilla_sdk}/java/include])
     if ${need_xpcom_libs}; then
        VLC_ADD_LDFLAGS([mozilla],[-L${real_mozilla_sdk}/embedstring/bin -L${real_mozilla_sdk}/xpcom/bin -L${real_mozilla_sdk}/nspr/bin -L${real_mozilla_sdk}/string/bin -L${real_mozilla_sdk}/lib -lnspr4 -lplds4 -lplc4 -lxpcomglue])
       if test "${SYS}" = "mingw32"; then
-           dnl latest gecko sdk does not have embedstring
-           if test -d "${real_mozilla_sdk}/embedstring/bin"
-           then
-             VLC_ADD_LDFLAGS([mozilla],[-lembedstring -Wl,--kill-at])
-           fi
-         fi
+        dnl latest gecko sdk does not have embedstring
+        if test -d "${real_mozilla_sdk}/embedstring/bin"
+        then
+          VLC_ADD_LDFLAGS([mozilla],[-lembedstring -Wl,--kill-at])
+        fi
+      fi
     fi
     MOZILLA_SDK_PATH="${real_mozilla_sdk}"
-  
+
     if test -n "${CYGPATH}"; then
       real_mozilla_sdk="`${CYGPATH} -w ${real_mozilla_sdk}`"
     fi
@@ -5415,6 +5464,10 @@ dnl
 AC_ARG_ENABLE(python-bindings,
   [  --enable-python-bindings    Enable Python bindings (default disabled)])
 dnl TODO: look for python dev headers
+AS_IF([test "${enable_python_bindings}" = "yes"],
+      PLUGINS_BINDINGS="${PLUGINS_BINDINGS} python"
+     ) 
+
 AM_CONDITIONAL(BUILD_PYTHON, [test "${enable_python_bindings}" = "yes"])
 
 dnl
@@ -5428,6 +5481,7 @@ then
        [AC_MSG_ERROR([Please set the JAVA_HOME variable to your JDK environment])])
   AC_PROG_JAVAC
   AC_PROG_JAVA
+  PLUGINS_BINDINGS="${PLUGINS_BINDINGS} java"
 fi
 AM_CONDITIONAL(BUILD_JAVA, [test "${enable_java_bindings}" = "yes"])
 
@@ -5749,6 +5803,7 @@ test "${enable_optimizations}" = "yes" && printf "optim "
 test "${enable_release}" = "yes" && printf "release " || printf "devel "
 echo "
 vlc aliases           :${ALIASES}
+plugins/bindings      :${PLUGINS_BINDINGS}
 
 You can tune the compiler flags in vlc-config.
 To build vlc and its plugins, type \`./compile' or \`make'.