WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / gtk / configure.ac
blobfa77354b628dc9d834b51df0fe11c47a1b725c1f
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Created by Anjuta application wizard.
4 AC_INIT(ghb, 0.1)
6 AM_INIT_AUTOMAKE([1.7.9 foreign dist-bzip2 dist-zip])
7 AM_CONFIG_HEADER(config.h)
8 AM_MAINTAINER_MODE
10 AC_ISC_POSIX
11 AC_PROG_CC
12 AC_PROG_CXX
13 AM_PROG_CC_STDC
14 AC_HEADER_STDC
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
24 AC_SUBST(CC_FOR_BUILD)
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
36 if test  $hb_PATHSET = 1 ; then
37     case ${with_hb} in
38     /*)
39                 HBINC="-I$with_hb/libhb -I$with_hb/contrib/include"
40                 LDFLAGS="$LDFLAGS -L$with_hb/libhb -L$with_hb/contrib/lib"
41                 AC_SUBST(HB_DIR, "$with_hb")
42         ;;
43     *)
44                 HBINC='-I$(top_srcdir)/'"$with_hb/libhb "'-I$(top_srcdir)/'"$with_hb/contrib/include"
45                 LDFLAGS="$LDFLAGS "'-L$(top_srcdir)/'"$with_hb/libhb "'-L$(top_srcdir)/'"$with_hb/contrib/lib"
46                 AC_SUBST(HB_DIR, '$(top_srcdir)/'"$with_hb")
47         ;;
48     esac
49 else
50         HBINC='-I$(top_srcdir)/'"../libhb "'-I$(top_srcdir)/'"../contrib/include"
51         LDFLAGS="$LDFLAGS "'-L$(top_srcdir)/'"../libhb "'-L$(top_srcdir)/'"../contrib/lib"
52         AC_SUBST(HB_DIR, '$(top_srcdir)/'"..")
55 AC_ARG_ENABLE(dl,
56         AS_HELP_STRING([--enable-dl], [enable libdl]),
57         use_libdl=yes, use_libdl=no)
59 AC_ARG_ENABLE(pthread,
60         AS_HELP_STRING([--enable-pthread], [enable libpthread]),
61         use_libpthread=yes, use_libpthread=no)
63 AC_ARG_ENABLE(fdk-aac,
64         AS_HELP_STRING([--enable-fdk-aac], [enable fdk aac encoder]),
65         use_fdk_aac=yes, use_fdk_aac=no)
67 AC_ARG_ENABLE(x265,
68         AS_HELP_STRING([--enable-x265], [enable x265 encoder]),
69         use_x265=yes, use_x265=no)
71 AC_ARG_ENABLE(qsv,
72         AS_HELP_STRING([--enable-qsv], [enable QSV encoder]),
73         use_qsv=yes, use_qsv=no)
75 AC_ARG_ENABLE(gst,
76         AS_HELP_STRING([--disable-gst], [disable gstreamer (live preview)]),
77         gst_disable=yes, gst_disable=no)
79 AC_ARG_ENABLE(update-checks,
80         AS_HELP_STRING([--disable-update-checks], [disable update checks]),
81         update_checks=no, update_checks=yes)
83 # overwrite global variable (used for Makefile generation)
84 AC_SUBST(GLOBALCXXFLAGS, $CXXFLAGS )
85 AC_SUBST(GLOBALLDFLAGS, $LDFLAGS )
89 dnl ***************************************************************************
90 dnl Internatinalization
91 dnl ***************************************************************************
92 GETTEXT_PACKAGE=ghb
93 AC_SUBST(GETTEXT_PACKAGE)
94 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
95 AM_GLIB_GNU_GETTEXT
96 IT_PROG_INTLTOOL([0.35.0])
98 AM_PROG_LIBTOOL
100 AC_SYS_LARGEFILE
102 case $host in
103   *-*-mingw*)
104     GHB_PACKAGES="gthread-2.0 gio-2.0 gmodule-2.0"
105         mingw_flag=yes
106     ;;
107   *)
108     case "$host_os" in
109         linux*)
110           pkg_gudev="gudev-1.0"
111           ;;
112     esac
113     GHB_PACKAGES="gthread-2.0 gio-2.0 libnotify dbus-glib-1 gmodule-2.0 $pkg_gudev"
114         mingw_flag=no
115     ;;
116 esac
118 PKG_PROG_PKG_CONFIG
119 GHB_PACKAGES="gtk+-3.0 $GHB_PACKAGES"
121 GST1_MODULES="gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0"
123 if test "x$gst_disable" = "xno" ; then
124     PKG_CHECK_MODULES(GStreamer1, [$GST1_MODULES], use_gst1=yes, use_gst1=no)
125     if test "x$use_gst1" = "xyes" ; then
126         GHB_PACKAGES="$GHB_PACKAGES $GST1_MODULES"
127     else
128         gst_disable="yes"
129     fi
132 if test "x$gst_disable" = "xno" ; then
133         CXXFLAGS="$CXXFLAGS -D_ENABLE_GST"
134         CFLAGS="$CFLAGS -D_ENABLE_GST"
137 if test "x$update_checks" = "xyes" ; then
138     PKG_CHECK_MODULES(WebKitGtk3, webkitgtk-3.0, use_webkitgtk3=yes, use_webkitgtk3=no)
139     if test "x$use_webkitgtk3" = "xyes" ; then
140         GHB_PACKAGES="$GHB_PACKAGES webkitgtk-3.0"
141     else
142         update_checks="no"
143         CFLAGS="$CFLAGS -D_NO_UPDATE_CHECK"
144     fi
145 else
146         CFLAGS="$CFLAGS -D_NO_UPDATE_CHECK"
149 PKG_CHECK_MODULES([GHB_GTK_3_14], [gtk+-3.0 >= 3.14], [HAVE_GTK_314=1], [HAVE_GTK_314=0])
150 PKG_CHECK_MODULES([GHB_GTK_3_12], [gtk+-3.0 >= 3.12], [HAVE_GTK_312=1], [HAVE_GTK_312=0])
151 AM_CONDITIONAL([GHB_GTK_3_14], [test "$HAVE_GTK_314" -eq 1])
152 AM_CONDITIONAL([GHB_GTK_3_12], [test "$HAVE_GTK_312" -eq 1])
154 AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])
156 PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
158 GHB_CFLAGS="$HBINC $GHB_CFLAGS"
160 HB_LIBS="-lhandbrake -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson"
162 case $host in
163   *-*-mingw*)
164     if test "x$use_libdl" = "xyes" ; then
165                 HB_LIBS+=" -ldl"
166         fi
167     if test "x$use_libpthread" = "xyes" ; then
168                 HB_LIBS+=" -lpthread"
169     else
170         HB_LIBS+=" -lpthreadGC2"
171         fi
172     HB_LIBS+=" -lregex -luuid"
173     ;;
174   *)
175     HB_LIBS+=" -ldl -lpthread"
176     ;;
177 esac
179 if test "x$use_fdk_aac" = "xyes" ; then
180     HB_LIBS+=" -lfdk-aac"
183 if test "x$use_x265" = "xyes" ; then
184     HB_LIBS+=" -lx265"
187 if test "x$use_qsv" = "xyes" ; then
188     HB_LIBS+=" -lmfx"
191 AC_SUBST(HB_LIBS)
192 AC_SUBST(GHB_CFLAGS)
193 AC_SUBST(GHB_LIBS)
195 AC_OUTPUT([
196 Makefile
197 src/Makefile
198 po/Makefile.in