summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 8427611de6c06c1a410f1880c4deeb3153efdfa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT([cheese],
        [3.3.2],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=cheese],
        [cheese],
        [http://projects.gnome.org/cheese/])

AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([cheese-config.h])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability dist-xz no-define no-dist-gzip nostdinc subdir-objects])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])

# Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_VALAC([0.13.2])

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])

PKG_PROG_PKG_CONFIG([0.24])

AC_SUBST([CHEESE_WFLAGS], ["-Wall -DGSEAL_ENABLE"])

GNOME_MAINTAINER_MODE_DEFINES
GNOME_COMPILE_WARNINGS([maximum])

#*******************************************************************************
# Libraries
#*******************************************************************************
# Before making a release, the CHEESE_LT_VERSION string should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
#   been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
#   change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A
AC_SUBST([LIBCHEESE_LT_VERSION], [3:0:0])
AC_SUBST([LIBCHEESE_GTK_LT_VERSION], [21:0:0])

#*******************************************************************************
# Internationalization
#*******************************************************************************
AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])

IT_PROG_INTLTOOL([0.40.0])

#*******************************************************************************
# Check required libraries
#*******************************************************************************


GLIB_REQUIRED="glib-2.0 >= 2.28.0"
GOBJECT_REQUIRED="gobject-2.0 >= 2.28.0"
GIO_REQUIRED="gio-2.0 >= 2.28.0"
GTK_REQUIRED="gtk+-3.0 >= 2.99.4"
GDK_REQUIRED="gdk-3.0 >= 2.99.4"
GDK_PIXBUF_REQUIRED="gdk-pixbuf-2.0"
LIBGNOMEDESKTOP_REQUIRED="gnome-desktop-3.0 >= 2.91.6"
GSTREAMER_VERSION=0.10.32
GSTREAMER_REQUIRED="gstreamer-plugins-base-0.10 >= $GSTREAMER_VERSION gstreamer-0.10 >= $GSTREAMER_VERSION"
CAIRO_REQUIRED="cairo >= 1.10.0"
PANGOCAIRO_REQUIRED="pangocairo >= 1.28.0"
LIBRSVG_REQUIRED="librsvg-2.0 >= 2.32.0"
CLUTTER_REQUIRED="clutter-1.0 >= 1.6.1"
CLUTTERGTK_REQUIRED="clutter-gtk-1.0 >= 0.91.8"
CLUTTERGST_REQUIRED="clutter-gst-1.0 >= 1.0.0"
GEE_REQUIRED="gee-1.0 >= 0.6.0"
LIBCANBERRA_REQUIRED="libcanberra-gtk3 >= 0.26"
MX_REQUIRED="mx-1.0"
X11_REQUIRED="x11"
GNOME_VIDEO_EFFECTS_REQUIRED="gnome-video-effects"

# Libtool requires this, but it is only expanded once anyway.
AC_CANONICAL_HOST

AC_MSG_CHECKING([host operating system])
AS_CASE([$host_os],
  [*linux-*], [AC_MSG_RESULT([Linux])
    UDEV_REQUIRED="gudev-1.0"],
  [AC_MSG_RESULT([unsupported operating system])])

AC_MSG_CHECKING([for gudev-1.0])
AS_IF([test -n $UDEV_REQUIRED],
  [PKG_CHECK_EXISTS([$UDEV_REQUIRED],
    [AC_MSG_RESULT([found])
     AC_DEFINE([HAVE_UDEV], [], [Enable gudev support])],
    [AC_MSG_ERROR([$UDEV_REQUIRED not found])])],
  [AC_MSG_RESULT([not needed])])

AC_CHECK_HEADERS([sys/videoio.h])

AC_CHECK_HEADER([X11/extensions/XTest.h],
  [AC_CHECK_LIB([Xtst], [XTestFakeKeyEvent],
    [AC_DEFINE([HAVE_XTEST], [1], [Defined if the XTEST X extension is present])
     AC_SUBST([XTEST_LIBS], ["-lX11 -lXtst"])])
  ])
AM_CONDITIONAL([HAVE_XTEST], test "x$HAVE_TEST" = "xyes")

PKG_CHECK_MODULES([CHEESE],
  [$GLIB_REQUIRED
  $GIO_REQUIRED
  $X11_REQUIRED
  $GOBJECT_REQUIRED
  $GDK_PIXBUF_REQUIRED
  $GSTREAMER_REQUIRED
  $CAIRO_REQUIRED
  $PANGOCAIRO_REQUIRED
  $CLUTTER_REQUIRED
  $CLUTTERGST_REQUIRED
  $MX_REQUIRED
  $UDEV_REQUIRED])
CHEESE_LIBS="$CHEESE_LIBS -lgstinterfaces-0.10"

PKG_CHECK_MODULES([CHEESE_GTK],
  [$GIO_REQUIRED
   $GTK_REQUIRED
   $GDK_REQUIRED
   $LIBGNOMEDESKTOP_REQUIRED
   $LIBRSVG_REQUIRED
   $CLUTTERGTK_REQUIRED
   $GEE_REQUIRED
   $LIBCANBERRA_REQUIRED
   $UDEV_REQUIRED
   $GNOME_VIDEO_EFFECTS_REQUIRED])

# Recommend some runtime GStreamer plugins.
AC_PATH_PROGS([GST_INSPECT], [gst-inspect-0.10 gst-inspect], [notfound])
AS_IF([test "x$GST_INSPECT" = "xnotfound"],
  [AC_MSG_WARN([unable to check for runtime GStreamer plugin dependencies])],
  [GST_RUNTIME_PLUGINS="camerabin theoraenc"
   for gst_runtime_plugin in $GST_RUNTIME_PLUGINS
   do
     AC_MSG_CHECKING([for $gst_runtime_plugin GStreamer plugin])
     AS_IF([$GST_INSPECT $gst_runtime_plugin >/dev/null],
       [AC_MSG_RESULT([found])],
       [AC_MSG_RESULT([not found])
        AC_MSG_WARN([$gst_runtime_plugin was not found. It needs to be installed before Cheese is run])])
   done])

# Check for GLib testing utilities.
AC_PATH_PROG([GTESTER], [gtester], [notfound])
AC_PATH_PROG([GTESTER_REPORT], [gtester-report], [notfound])
AS_IF([test "x$GTESTER" = "xnotfound" -o "$GTESTER_REPORT" = "xnotfound"],
  [AC_MSG_WARN([testing disabled as the required utilities were not found])],
  [CHEESE_ENABLE_TESTS=true
   AC_SUBST([GTESTER])
   AC_SUBST([GTESTER_REPORT])])
AM_CONDITIONAL([CHEESE_ENABLE_TESTS], [test "x$CHEESE_ENABLE_TESTS" = "xtrue"])

AC_MSG_CHECKING([for glib-mkenums script])
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AS_IF([test "x$GLIB_MKENUMS" = "x"],
  [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
  [AC_SUBST([GLIB_MKENUMS])
   AC_MSG_RESULT([$GLIB_MKENUMS])])

GOBJECT_INTROSPECTION_CHECK([0.6.7])

# API documentation
GTK_DOC_CHECK([1.14], [--flavour no-tmpl])

# Manpage, generated with gtk-doc and xsltproc from DocBook XML.
AC_ARG_ENABLE([man],
  [AS_HELP_STRING([--disable-man], [Disable building the man page])])

AS_IF([test "x$enable_man" != "xno"],
  [AC_CHECK_PROG([have_xsltproc], [xsltproc], [yes], [no])],
  [have_xsltproc=no])

AM_CONDITIONAL([ENABLE_MAN], [test "x$have_xsltproc" = "xyes"])

# Mallard help
YELP_HELP_INIT

GLIB_GSETTINGS
#*******************************************************************************

AC_CONFIG_FILES([
Makefile
docs/reference/Makefile
docs/reference/version.xml
data/cheese.pc
data/cheese-gtk.pc
data/cheese.desktop.in
help/Makefile
po/Makefile.in
])
AC_OUTPUT

#**************************************************************************