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
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Created by Anjuta application wizard.
3
4 AC_INIT(ghb, 0.1)
5
6 AM_INIT_AUTOMAKE([1.7.9 foreign dist-bzip2 dist-zip])
7 AM_CONFIG_HEADER(config.h)
8 AM_MAINTAINER_MODE
9
10 AC_ISC_POSIX
11 AC_PROG_CC
12 AC_PROG_CXX
13 AM_PROG_CC_STDC
14 AC_HEADER_STDC
15
16 if test x"$CC_FOR_BUILD" = x; then
17         if test x"$cross_compiling" = x"yes"; then
18                 AC_CHECK_PROGS(CC_FOR_BUILD, gcc, cc)
19         else
20                 CC_FOR_BUILD="$CC"
21         fi
22 fi
23
24 AC_SUBST(CC_FOR_BUILD)
25
26 # introduce the optional configure parameter for the path of libXXX.a
27 AC_ARG_WITH(hb,
28         AC_HELP_STRING(
29             [--with-hb=prefix],
30             [try this for the hb-library prefix install directory]
31           ),
32           hb_PATHSET=1,
33           hb_PATHSET=0
34 )
35
36 if test  $hb_PATHSET = 1 ; then
37     case ${with_hb} in
38     /*)
39                 CXXFLAGS="$CXXFLAGS -I$with_hb/libhb"
40                 CFLAGS="$CFLAGS -I$with_hb/libhb"
41                 LDFLAGS="$LDFLAGS -L$with_hb/libhb -L$with_hb/contrib/lib"
42                 AC_SUBST(HB_DIR, "$with_hb")
43         ;;
44     *)
45                 CXXFLAGS="$CXXFLAGS "'-I$(top_srcdir)/'"$with_hb/libhb"
46                 CFLAGS="$CFLAGS "'-I$(top_srcdir)/'"$with_hb/libhb"
47                 LDFLAGS="$LDFLAGS "'-L$(top_srcdir)/'"$with_hb/libhb "'-L$(top_srcdir)/'"$with_hb/contrib/lib"
48                 AC_SUBST(HB_DIR, '$(top_srcdir)/'"$with_hb")
49         ;;
50     esac
51 else
52         CXXFLAGS="$CXXFLAGS "'-I$(top_srcdir)/'"../libhb"
53         CFLAGS="$CFLAGS "'-I$(top_srcdir)/'"../libhb"
54         LDFLAGS="$LDFLAGS "'-L$(top_srcdir)/'"../libhb "'-L$(top_srcdir)/'"../contrib/lib"
55         AC_SUBST(HB_DIR, '$(top_srcdir)/'"..")
56 fi
57
58 AC_ARG_ENABLE(dl,
59         AS_HELP_STRING([--enable-dl], [enable libdl]),
60         use_libdl=yes, use_libdl=no)
61
62 AC_ARG_ENABLE(gst,
63         AS_HELP_STRING([--disable-gst], [disable gstreamer (live preview)]),
64         gst_disable=yes, gst_disable=no)
65
66 AC_ARG_ENABLE(update-checks,
67         AS_HELP_STRING([--disable-update-checks], [disable update checks]),
68         update_checks=no, update_checks=yes)
69
70 # overwrite global variable (used for Makefile generation)
71 AC_SUBST(GLOBALCXXFLAGS, $CXXFLAGS )
72 AC_SUBST(GLOBALLDFLAGS, $LDFLAGS )
73
74
75
76 dnl ***************************************************************************
77 dnl Internatinalization
78 dnl ***************************************************************************
79 GETTEXT_PACKAGE=ghb
80 AC_SUBST(GETTEXT_PACKAGE)
81 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
82 AM_GLIB_GNU_GETTEXT
83 IT_PROG_INTLTOOL([0.35.0])
84
85 AM_PROG_LIBTOOL
86
87 case $host in
88   *-*-mingw*)
89     if test "x$gst_disable" = "xyes" ; then
90         GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0"
91         else
92                 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"
93         fi
94         mingw_flag=yes
95     ;;
96   *)
97     if test "x$gst_disable" = "xyes" ; then
98             GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0 libnotify gudev-1.0"
99     else
100             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"
101     fi
102         mingw_flag=no
103     ;;
104 esac
105
106 if test "x$gst_disable" = "xno" ; then
107         CXXFLAGS="$CXXFLAGS -D_ENABLE_GST"
108         CFLAGS="$CFLAGS -D_ENABLE_GST"
109 fi
110
111 PKG_PROG_PKG_CONFIG
112 if test "x$update_checks" = "xyes" ; then
113         PKG_CHECK_MODULES(OldWebKitGtk, WebKitGtk, old_webkit=yes, old_webkit=no)
114         if test "x$old_webkit" = "xyes" ; then
115                 if test "x$mingw_flag" = "xno" ; then
116                         GHB_PACKAGES="$GHB_PACKAGES WebKitGtk"
117                         CXXFLAGS="$CXXFLAGS -D_OLD_WEBKIT"
118                         CFLAGS="$CFLAGS -D_OLD_WEBKIT"
119                 fi
120         else
121                 if test "x$mingw_flag" = "xno" ; then
122                         GHB_PACKAGES="$GHB_PACKAGES webkit-1.0"
123                 fi
124         fi
125 else
126         CFLAGS="$CFLAGS -D_NO_UPDATE_CHECK"
127 fi
128
129 AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])
130
131 PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
132
133 AC_PATH_PROG(BUILD_PKG_CONFIG, pkg-config, no)
134 if test x"$BUILD_PKG_CONFIG" = x"no"; then
135         AC_MSG_ERROR([You need to install pkg-config])
136 fi
137
138 GHB_TOOLS_CFLAGS=`$BUILD_PKG_CONFIG --cflags glib-2.0 gdk-pixbuf-2.0`
139 GHB_TOOLS_LIBS=`$BUILD_PKG_CONFIG --libs glib-2.0 gdk-pixbuf-2.0`
140
141 case $host in
142   *-*-mingw*)
143     if test "x$use_libdl" = "xyes" ; then
144                 GHB_LIBS="$GHB_LIBS -ldl"
145         fi
146     ;;
147 esac
148
149 AC_SUBST(GHB_TOOLS_CFLAGS)
150 AC_SUBST(GHB_TOOLS_LIBS)
151 AC_SUBST(GHB_CFLAGS)
152 AC_SUBST(GHB_LIBS)
153
154 AC_OUTPUT([
155 Makefile
156 src/Makefile
157 po/Makefile.in
158 ])