OSDN Git Service

MacGui: Remove Target Size as a rate control option as it doesn't really work correct...
[handbrake-jp/handbrake-jp-git.git] / gtk / configure.ac
index 1aaea79..9f54347 100644 (file)
@@ -13,6 +13,16 @@ AC_PROG_CXX
 AM_PROG_CC_STDC
 AC_HEADER_STDC
 
+if test x"$CC_FOR_BUILD" = x; then
+       if test x"$cross_compiling" = x"yes"; then
+               AC_CHECK_PROGS(CC_FOR_BUILD, gcc, cc)
+       else
+               CC_FOR_BUILD="$CC"
+       fi
+fi
+
+AC_SUBST(CC_FOR_BUILD)
+
 # introduce the optional configure parameter for the path of libXXX.a
 AC_ARG_WITH(hb,
        AC_HELP_STRING(
@@ -45,9 +55,17 @@ else
        AC_SUBST(HB_DIR, '$(top_srcdir)/'"..")
 fi
 
+AC_ARG_ENABLE(dl,
+       AS_HELP_STRING([--enable-dl], [enable libdl]),
+       use_libdl=yes, use_libdl=no)
+
 AC_ARG_ENABLE(gst,
-       AS_HELP_STRING([--enable-gst], [enable gstreamer on Win32]),
-       w32_gst=yes, w32_gst=no)
+       AS_HELP_STRING([--disable-gst], [disable gstreamer (live preview)]),
+       gst_disable=yes, gst_disable=no)
+
+AC_ARG_ENABLE(update-checks,
+       AS_HELP_STRING([--disable-update-checks], [disable update checks]),
+       update_checks=no, update_checks=yes)
 
 # overwrite global variable (used for Makefile generation)
 AC_SUBST(GLOBALCXXFLAGS, $CXXFLAGS )
@@ -68,39 +86,68 @@ AM_PROG_LIBTOOL
 
 case $host in
   *-*-mingw*)
-    if test "x$w32_gst" = "xyes" ; then
-               GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage"
-       else
+    if test "x$gst_disable" = "xyes" ; then
         GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0"
+       else
+               GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0"
        fi
        mingw_flag=yes
     ;;
   *)
-       GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage libnotify"
+    if test "x$gst_disable" = "xyes" ; then
+           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0 libnotify gudev-1.0"
+    else
+           GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 libnotify gudev-1.0"
+    fi
        mingw_flag=no
     ;;
 esac
 
-if test "x$w32_gst" = "xyes" -o  "x$mingw_flag" != "xyes" ; then
+if test "x$gst_disable" = "xno" ; then
        CXXFLAGS="$CXXFLAGS -D_ENABLE_GST"
        CFLAGS="$CFLAGS -D_ENABLE_GST"
 fi
 
-PKG_CHECK_MODULES(OldWebKitGtk, WebKitGtk, old_webkit=yes, old_webkit=no)
-if test "x$old_webkit" = "xyes" ; then
-       if test "x$mingw_flag" = "xno" ; then
-               GHB_PACKAGES="$GHB_PACKAGES WebKitGtk"
-               CXXFLAGS="$CXXFLAGS -D_OLD_WEBKIT"
-               CFLAGS="$CFLAGS -D_OLD_WEBKIT"
+PKG_PROG_PKG_CONFIG
+if test "x$update_checks" = "xyes" ; then
+       PKG_CHECK_MODULES(OldWebKitGtk, WebKitGtk, old_webkit=yes, old_webkit=no)
+       if test "x$old_webkit" = "xyes" ; then
+               if test "x$mingw_flag" = "xno" ; then
+                       GHB_PACKAGES="$GHB_PACKAGES WebKitGtk"
+                       CXXFLAGS="$CXXFLAGS -D_OLD_WEBKIT"
+                       CFLAGS="$CFLAGS -D_OLD_WEBKIT"
+               fi
+       else
+               if test "x$mingw_flag" = "xno" ; then
+                       GHB_PACKAGES="$GHB_PACKAGES webkit-1.0"
+               fi
        fi
 else
-       GHB_PACKAGES="$GHB_PACKAGES webkit-1.0"
+       CFLAGS="$CFLAGS -D_NO_UPDATE_CHECK"
 fi
 
 AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])
 
 PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
 
+AC_PATH_PROG(BUILD_PKG_CONFIG, pkg-config, no)
+if test x"$BUILD_PKG_CONFIG" = x"no"; then
+       AC_MSG_ERROR([You need to install pkg-config])
+fi
+
+GHB_TOOLS_CFLAGS=`$BUILD_PKG_CONFIG --cflags glib-2.0 gdk-pixbuf-2.0`
+GHB_TOOLS_LIBS=`$BUILD_PKG_CONFIG --libs glib-2.0 gdk-pixbuf-2.0`
+
+case $host in
+  *-*-mingw*)
+    if test "x$use_libdl" = "xyes" ; then
+               GHB_LIBS="$GHB_LIBS -ldl"
+       fi
+    ;;
+esac
+
+AC_SUBST(GHB_TOOLS_CFLAGS)
+AC_SUBST(GHB_TOOLS_LIBS)
 AC_SUBST(GHB_CFLAGS)
 AC_SUBST(GHB_LIBS)