[go: up one dir, main page]

File: configure.in

package info (click to toggle)
kino 1.3.4-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 29,692 kB
  • ctags: 27,935
  • sloc: ansic: 323,805; cpp: 35,797; sh: 14,924; asm: 3,727; makefile: 1,504; perl: 440; xml: 15
file content (374 lines) | stat: -rw-r--r-- 13,413 bytes parent folder | download | duplicates (4)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# configure.in file for kino

# ######################################################################
# Initialization
# ######################################################################
AC_PREREQ(2.52)
AC_INIT(kino, 1.3.4, http://sourceforge.net/tracker/?group_id=14103&atid=114103)
AC_CONFIG_SRCDIR(src/main.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

# ######################################################################
# Compiler characteristics.
# ######################################################################
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_STDC
AM_PROG_LIBTOOL
IT_PROG_INTLTOOL

AC_ISC_POSIX
AC_HEADER_STDC
AC_C_BIGENDIAN

test "$prefix" = NONE && prefix=${ac_default_prefix}

# ######################################################################
# Large file and multi-threading support.
# ######################################################################
AC_DEFINE(_GNU_SOURCE, 1, [Enable GNU extensions of glibc, notably large file support])
AC_SYS_LARGEFILE
AC_DEFINE(_REENTRANT, 1, [multi-threading.])

# ######################################################################
# checks for critical DV and IEEE 1394 packages
# ######################################################################

PKG_CHECK_MODULES(LIBDV, libdv >= 0.103, AC_DEFINE(HAVE_LIBDV, 1, [libdv present]))
AC_SUBST(LIBDV_CFLAGS)
AC_SUBST(LIBDV_LIBS)

PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.0.0, AC_DEFINE(HAVE_LIBRAW1394, 1, [libraw1394 present]))
AC_SUBST(LIBRAW1394_CFLAGS)
AC_SUBST(LIBRAW1394_LIBS)
LIBS="$LIBS $LIBRAW1394_LIBS -lm"
CFLAGS="$CFLAGS $LIBRAW1394_CFLAGS"

# LIBAVC1394 and LIBROM1394
AC_CHECK_HEADER([libavc1394/avc1394.h], ,
	[AC_MSG_ERROR([avc1394.h not found, install libavc1394-devel])
])
AC_CHECK_LIB(avc1394, avc1394_vcr_record, ,
	[AC_MSG_ERROR([Unable to link with libavc1394. Check that you have libavc1394 installed and that the version is 0.4.1 or newer])]
)
AC_CHECK_HEADER([libavc1394/rom1394.h], ,
	[AC_MSG_ERROR([rom1394.h not found, install libavc1394-devel])
])
AC_CHECK_LIB(rom1394, rom1394_get_node_type, ,
	[AC_MSG_ERROR([Unable to link with librom1394. Check that your have librom1394 installed (usually part of libavc1394) and that the version is 0.4.1 or newer])]
)

AC_CHECK_LIB(pthread, pthread_create, ,
	[AC_MSG_ERROR([You need the pthread library to compile kino])]
)
AC_CHECK_LIB(dl, dlopen, ,
	[AC_MSG_ERROR([You need libdl to compile kino])]
)

# LIBIEC61883
AC_ARG_WITH(dv1394, AC_HELP_STRING([--with-dv1394],[Use dv1394 instead of libiec61883 for DV I/O (only if you must).]))
PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.0.0,
[
	if test x$with_dv1394 = xyes; then
		AC_DEFINE(HAVE_DV1394, 1, [using dv1394 instead of libiec61883])
	else
		AC_SUBST(LIBIEC61883_CFLAGS)
		AC_SUBST(LIBIEC61883_LIBS)
		AC_DEFINE(HAVE_IEC61883, 1, [libiec61883 present])
	fi
],[
	if test x$with_dv1394 = xyes; then
		AC_DEFINE(HAVE_DV1394, 1, [using dv1394 instead of libiec61883])
	else
		AC_MSG_ERROR([libiec61883 is the new, preferred Linux 1394 streaming
		interface; others are deprecated. If you must only support dv1394,
		then you must explicitly specify it using --with-dv1394.])
	fi
])

# ######################################################################
# ALSA
# ######################################################################
PKG_CHECK_MODULES(ALSA, alsa >= 1.0.9,
[
	AC_SUBST(ALSA_CFLAGS)
	AC_SUBST(ALSA_LIBS)
	AC_DEFINE(HAVE_ALSA, 1, [ALSA present])
],[
	AC_WARN($ALSA_PKG_ERRORS)
])

# ######################################################################
# Quicktime
# ######################################################################
AC_ARG_ENABLE(quicktime, AC_HELP_STRING([--enable-quicktime],[Support Quicktime DV files using Quicktime4Linux or libquicktime.]))
if test x$enable_quicktime = xyes ; then
	PKG_CHECK_MODULES(LIBQUICKTIME, [libquicktime >= 0.9.5],
	[
		AC_DEFINE(HAVE_LIBQUICKTIME, 1, [libquicktime.sourceforge.net present])
		AC_SUBST(LIBQUICKTIME_CFLAGS)
		AC_SUBST(LIBQUICKTIME_LIBS)
	],[
		AC_CHECK_HEADERS(quicktime/quicktime.h,
		[
			LIBQUICKTIME_CFLAGS="-I$prefix/include/quicktime"
			AC_CHECK_LIB(quicktime, quicktime_open,
			[
				LIBQUICKTIME_LIBS="-lquicktime"
				AC_DEFINE(HAVE_LIBQUICKTIME, 1, [Heroine Virtual Quicktime4Linux present])
			],[
				AC_CHECK_LIB(quicktimehv, quicktime_open,
				[
					LIBQUICKTIME_LIBS="-lquicktimehv"
					AC_DEFINE(HAVE_LIBQUICKTIME, 1, [cvs.cinelerra.org Quicktime4Linux present])
				],[
					AC_WARN([libquicktime missing; install libquicktime or quicktime4linux to support Quicktime files.])
				])
			])
		],[
			AC_WARN($LIBQUICKTIME_PKG_ERRORS)
			AC_WARN([libquicktime missing; install libquicktime or quicktime4linux to support Quicktime files.])
		])
	])
	AC_SUBST(LIBQUICKTIME_CFLAGS)
	AC_SUBST(LIBQUICKTIME_LIBS)
fi

# ######################################################################
# FFMPEG
# ######################################################################
local_legacy_ffmpeg_test(){
	if test "x$avcodec_include" != x ; then
		with_avcodec_i="$avcodec_include"
	else
		with_avcodec_i="$prefix/include/ffmpeg"
	fi
	if test "x$avcodec_lib" != x ; then
		with_avcodec_l="$avcodec_lib"
	else
		with_avcodec_l="-lavcodec -lavformat"
	fi

	have_avcodec=no
	AC_MSG_CHECKING([libavcodec version (build >4644)])
	
	SAVE_CFLAGS=$CFLAGS
	CFLAGS="$CFLAGS $with_avcodec_i"
	SAVE_LIBS=$LIBS
	LIBS="$LIBS $with_avcodec_l"
	AC_TRY_RUN(
	[
		#include "avcodec.h"
		int main() {
		avcodec_init();
		return (LIBAVCODEC_BUILD < 4645);
		}
	],[
		AVCODEC_CFLAGS="-I$with_avcodec_i"
		AVCODEC_LIBS="$with_avcodec_l"
		AC_SUBST(AVCODEC_LIBS)
		AC_SUBST(AVCODEC_CFLAGS)
		AC_DEFINE(HAVE_LIBAVCODEC, 1, [Enable FFMPEG libavcodec])
		have_avcodec=yes
	],[
		have_avcodec=no
		AC_MSG_ERROR([FFMPEG is the new, preferred DV codec. If you must only
		support libdv, then you must explicitly specify it using --with-libdv-only.])
	])
	CFLAGS=$SAVE_CFLAGS
	LIBS=$SAVE_LIBS
	AC_MSG_RESULT($have_avcodec)
}
AC_CONFIG_COMMANDS_POST([
	if test x$enable_local_ffmpeg != xno; then
		if ! (test -d ffmpeg) ; then
			tar -xzf ffmpeg-svn-r12186.tar.gz
		fi
		if ! (test -f ffmpeg/config.mak) ; then
			pushd ffmpeg
			./configure --disable-ffserver --disable-ffplay --disable-network --disable-zlib \
			--disable-vhook --build-suffix=-kino --enable-gpl --enable-swscaler --enable-pthreads \
			--prefix="$prefix"
			popd
		fi
	fi
])
EXTRA_LIBS="$LIBS"
AC_ARG_WITH(libdv-only, AC_HELP_STRING([--with-libdv-only],[Use libdv instead of ffmpeg for DV coding (only if you must).]))
if test x$with_libdv_only != xyes ; then
	AC_ARG_ENABLE(local-ffmpeg, AC_HELP_STRING([--enable-local-ffmpeg], [Build against a locally distributed copy of ffmpeg.]))
	if test x$enable_local_ffmpeg != xno; then
		FFMPEG_SUBDIR="ffmpeg"
		FFMPEG_MAN="ffmpeg-kino.1"
		FFMPEG_KINO="ffmpeg-kino"
		AVCODEC_CFLAGS="-I\$(top_builddir)/ffmpeg -I\$(top_builddir)/ffmpeg/libavformat -I\$(top_builddir)/ffmpeg/libavcodec -I\$(top_builddir)/ffmpeg/libavutil -I\$(top_builddir)/ffmpeg/libswscale -DHAVE_SWSCALE"
		AVCODEC_LIBS="\$(top_builddir)/ffmpeg/libavformat/libavformat-kino.a \$(top_builddir)/ffmpeg/libavcodec/libavcodec-kino.a \$(top_builddir)/ffmpeg/libavutil/libavutil-kino.a \$(top_builddir)/ffmpeg/libswscale/libswscale-kino.a"
		AC_SUBST(top_builddir)
		AC_SUBST(FFMPEG_SUBDIR)
		AC_SUBST(FFMPEG_MAN)
		AC_SUBST(FFMPEG_KINO)
		AC_SUBST(AVCODEC_LIBS)
		AC_SUBST(AVCODEC_CFLAGS)
		AC_DEFINE(HAVE_LIBAVCODEC, 1, [Enable FFMPEG libavcodec])
		AC_DEFINE(HAVE_SWSCALE, 1, [Enable FFMPEG libswscale])
	else
		AC_ARG_WITH(ffmpeg-cflags, AC_HELP_STRING([--with-ffmpeg-cflags=ARG],[compiler flags for ffmpeg (optional)]),
			avcodec_include="$withval", avcodec_include="")
		AC_ARG_WITH(ffmpeg-libs, AC_HELP_STRING([--with-ffmpeg-libs=ARG],[linker flags for ffmpeg (optional)]),
			avcodec_lib="$withval", avcodec_lib="")
		if (test "x$avcodec_include" != x) || (test "x$avcodec_lib" != x) ; then
			local_legacy_ffmpeg_test
		else
			PKG_CHECK_MODULES(AVCODEC, libavformat libavcodec libavutil,
			[
				AC_DEFINE(HAVE_LIBAVCODEC, 1, [Enable FFMPEG libavcodec])
				AC_SUBST(AVCODEC_LIBS)
				AC_SUBST(AVCODEC_CFLAGS)
				PKG_CHECK_MODULES(SWSCALE, libswscale,[
					AC_DEFINE(HAVE_SWSCALE, 1, [Enable FFMPEG libswscale])
					AC_SUBST(SWSCALE_LIBS)
					AC_SUBST(SWSCALE_CFLAGS)
				], AC_MSG_RESULT([no]))
			],[
				AC_MSG_RESULT([no])
				local_legacy_ffmpeg_test
			])
		fi
	fi
fi

# ######################################################################
# checks for X11 and XVideo
# ######################################################################
# Hmm. The check for AC_PATH_X is probably not enough. I want to
# check for libxv though, so we need a little bit more
AC_PATH_X
AC_PATH_XTRA
# CFLAGS="$CFLAGS $X_CFLAGS"
LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS -lX11"

AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h],[],
	[AC_MSG_ERROR([Xlib.h or Xutil.h not found install xdevel])])

# OK, this is confusing. The old tests test for the existence of a number 
# of header files, and add -lXv to the linker flags if they are there.
# However, if they are _not_ there, only a warning is issued, but
# src/displayer.h includes these unconditionally.
# I conclude that -lXv _is_ required. If not, src/displayer.h should be edited, 
# I think.
# This test requires libXv and, therefore, libXext

AC_CHECK_HEADERS([sys/ipc.h sys/shm.h],,
	[AC_MSG_ERROR([Required header not found. Please check that it is installed])]
)
AC_CHECK_HEADERS([X11/extensions/Xvlib.h X11/extensions/XShm.h],,
	[AC_MSG_ERROR([Required xvideo (Xv) extension to X not found. Please check that it is installed.])],
        [#include <X11/Xlib.h>]
)

AC_CHECK_LIB(Xext, XInitExtension, ,
    [AC_MSG_ERROR([Could not link with libXext. Check that you have libXext installed])], -lX11
)
AC_CHECK_LIB(Xv, XvQueryAdaptors, ,
    [AC_MSG_ERROR([Could not link with libXv. Check that you have libXv installed])]
)

# ######################################################################
# Check for other dependent libs
# ######################################################################

# LIBXML2
PKG_CHECK_MODULES(LIBXML2, libxml-2.0)
AC_SUBST(LIBXML2_CFLAGS)
AC_SUBST(LIBXML2_LIBS)

# ######################################################################
# GTK stuff
# ######################################################################

PKG_CHECK_MODULES(GTK2, gthread-2.0 libglade-2.0 >= 2.5.0 gtk+-2.0 >= 2.6)
AC_SUBST(GTK2_CFLAGS)
AC_SUBST(GTK2_LIBS)
AC_DEFINE(HAVE_GTK24, 1, [Have version 2.4 or greater of GTK])

PKG_CHECK_MODULES(PANGOFT, pangoft2)
AC_SUBST(PANGOFT_CFLAGS)
AC_SUBST(PANGOFT_LIBS)

# ######################################################################
# udev stuff
# ######################################################################
AC_ARG_WITH(udev-rules-dir, AC_HELP_STRING([--with-udev-rules-dir=PATH],
	[Where to install udev rules (/etc/udev/rules.d)]),[
		udevrulesdir=$withval
	],[
		udevrulesdir="\${sysconfdir}/udev/rules.d"
])
AC_SUBST(udevrulesdir)

# ######################################################################
# Internationalization
# ######################################################################

# Add the languages which your application supports here.
ALL_LINGUAS="ca da sv fr es cs it no nb eu de hu ru fi uk be zh_TW sl"
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_SUBST(ALL_LINGUAS)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", "")
AM_GLIB_GNU_GETTEXT

HELP_LINGUAS="en fr"
AC_DEFINE_UNQUOTED(HELP_LINGUAS, "$HELP_LINGUAS", [language codes for online help translations])

# ######################################################################
# Check for some more headers and calls used
# ######################################################################
# This is a safety net - will fix if some users actually does not have
# these headers or calls..
AC_CHECK_HEADERS([limits.h stdlib.h sys/types.h dirent.h libgen.h string.h], 
		, AC_MSG_ERROR([You need this header to compile kino]))
AC_CHECK_FUNCS([dirname opendir strdup realpath], , 
               AC_MSG_ERROR([You need this function to compile kino]))

# ######################################################################
# Check if we have the execinfo header, use it if present
# This is a feature of the GNU libc that is documented at e.g.
# http://www.gnu.org/software/libc/manual/html_node/Backtraces.html
# ######################################################################
AC_CHECK_HEADER(execinfo.h, [AC_DEFINE(HAVE_EXECINFO_H, 1, Wheter or not execinfo.h is present)
	EXTRA_LIBS="$EXTRA_LIBS -rdynamic"])

# ######################################################################
# libsamplerate
# ######################################################################
PKG_CHECK_MODULES(SRC, samplerate, ,
	[AC_MSG_ERROR([samplerate.pc not found, install libsamplerate-devel (see http://www.mega-nerd.com/SRC/)])])
AC_SUBST(SRC_CFLAGS)
AC_SUBST(SRC_LIBS)

prefix_datadir="${datadir}"
DATADIR="$prefix_datadir"
AC_SUBST(DATADIR)

AC_CONFIG_FILES([
Makefile
po/Makefile.in
src/Makefile
src/cell-renderers/Makefile
src/dvtitler/Makefile
src/timfx/Makefile
src/timfx/lumas/Makefile
src/kinoplus/Makefile
help/Makefile
scripts/Makefile
scripts/dvdauthor/Makefile
scripts/exports/Makefile
scripts/import/Makefile
scripts/publish/Makefile
pixmaps/Makefile
])

AC_OUTPUT