This repository has been archived by the owner on Dec 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
724 lines (647 loc) · 24.4 KB
/
configure.in
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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
AC_INIT(Cinecutie, 1.0)
AC_CANONICAL_SYSTEM
# Test for minimal version of autoconf
AC_PREREQ(2.57)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER(config.h)
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.12.1)
AM_PROG_AS
AC_CONFIG_MACRO_DIR([m4])
AC_LANG_CPLUSPLUS
AC_LANG_C
AC_PROG_CXX
AC_ENABLE_SHARED
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
# hack for libtool 1.5 -- this is ugly and probably wrong, but works
LTC_FLAGS="--tag=CC"
LTCXX_FLAGS="--tag=CXX"
AC_SUBST(LTC_FLAGS)
AC_SUBST(LTCXX_FLAGS)
# hack for using nasm for .S files
CCAS="\$(top_srcdir)/admin/nasm"
AC_SUBST(CCAS)
AC_SUBST(CCASFLAGS)
dnl Check for Video4Linux2
AH_TEMPLATE(HAVE_VIDEO4LINUX2, [Define to 1 if Video4Linux2 is available.])
AC_CHECK_HEADER([linux/videodev2.h],
[AC_CHECK_MEMBER(struct v4l2_buffer.index, [AC_DEFINE(HAVE_VIDEO4LINUX2)], [],
[#include <linux/time.h>
#include <linux/videodev2.h>])],
[],[#include <linux/time.h>] )
############## SPECIAL DIRECTORIES
AC_ARG_WITH(plugindir,
AC_HELP_STRING([--with-plugindir], [sets the directory where the plugins should be installed]),
[ plugindir=$withval ],
[ plugindir="\${exec_prefix}/lib/cinecutie" ])
AC_SUBST(plugindir)
AC_ARG_WITH(fontsdir,
AC_HELP_STRING([--with-fontsdir], [sets the directory where the fonts should be installed]),
[ fontsdir=$withval ],
[ fontsdir="\${plugindir}/fonts" ])
AC_SUBST(fontsdir)
############## END OF SPECIAL DIRECTORIES
############## XLIB
AC_PATH_XTRA
if test "$no_x" = yes; then
if test "x$have_x" = "xdisabled"; then
AC_MSG_WARN([Do not use --without-x or --with-x=no.])
else
AC_MSG_WARN([X Windows development tools were not found.])
AC_MSG_WARN([Please install xlib-dev or xorg-x11-devel.])
fi
AC_MSG_ERROR([Cinecutie requires X Windows.])
fi
AH_TEMPLATE(HAVE_LIBXXF86VM, [Define to 1 if libXxf86vm is available.])
AC_DEFINE(HAVE_LIBXXF86VM)
AC_MSG_CHECKING([whether to use xft])
AC_ARG_ENABLE(xft,
AC_HELP_STRING([--enable-xft],
[use freetype/fontconfig/xft (default: on)]),
[enable_xft=$enableval], [enable_xft="default"])
XFT_CFLAGS=""
XFT_LIBS=""
if test "$enable_xft" = "no" ; then
AC_MSG_RESULT([$enable_xft])
else
found_xft="yes"
dnl make sure package configurator (xft-config or pkg-config
dnl says that xft is present.
XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no"
XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no"
if test "$found_xft" = "no" ; then
found_xft=yes
XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no"
XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no"
fi
AC_MSG_RESULT([$found_xft])
dnl print a warning if xft is unusable and was specifically requested
if test "$found_xft" = "no" ; then
if test "$enable_xft" = "yes" ; then
AC_MSG_WARN([Can't find xft configuration, or xft is unusable])
fi
enable_xft=no
XFT_CFLAGS=""
XFT_LIBS=""
else
enable_xft=yes
## To force to all project - uncomment
##X_EXTRA_LIBS="$XFT_LIBS $X_EXTRA_LIBS"
CXXFLAGS="$XFT_CFLAGS $CXXFLAGS"
AH_TEMPLATE(HAVE_XFT, [Define to 1 if libXft is available.])
AC_DEFINE(HAVE_XFT)
## need some fix to compile with XFT
AC_DEFINE(
[PNG_SETJMP_NOT_SUPPORTED],
[1],
[Workaround to fix compile with xft]
)
fi
fi
AC_SUBST(XFT_CFLAGS)
AC_SUBST(XFT_LIBS)
############## END XLIB
############## SOUND
# the sound options are propagated by SOUND_CFLAGS and SOUND_LDFLAGS
AC_ARG_ENABLE(oss,
AC_HELP_STRING([--disable-oss], [disable support for oss (default=enabled)]))
AC_ARG_ENABLE(alsa,
AC_HELP_STRING([--disable-alsa],[disable support for ALSA (default=autodetect)]),
[enable_alsa=$enableval],[enable_alsa=yes])
AC_ARG_ENABLE(esd,
AC_HELP_STRING([--disable-esd], [disable support for ESD (default=autodetect)]),
[enable_esd=$enableval],[enable_esd=yes])
if test "x$enable_oss" = "xyes" || test "x$enable_oss" = "x"; then
SOUND_CFLAGS="-DHAVE_OSS $SOUND_CFLAGS"
fi
if test "x$enable_alsa" = "xyes"; then
AM_PATH_ALSA(1.0.2,[alsa=yes])
if test "x$alsa" = "xyes"; then
SOUND_CFLAGS="$ALSA_CFLAGS -DHAVE_ALSA $SOUND_CFLAGS"
SOUND_LDFLAGS="$ALSA_LIBS $SOUND_LDFLAGS"
enable_alsa=ok
fi
dnl This added -lasound to LIBS. LIBS is used in every link command.
dnl But we do not want to link all shared libraries against -lasound.
dnl So we remove it again.
LIBS=`echo "$LIBS" | sed -e s/-lasound//g`
fi
if test "x$enable_esd" = "xyes"; then
AM_PATH_ESD(,[esound=yes])
if test "x$esound" = xyes; then
SOUND_CFLAGS="$ESD_CFLAGS -DHAVE_ESOUND $SOUND_CFLAGS"
SOUND_LDFLAGS="$ESD_LIBS $SOUND_LDFLAGS"
enable_esd=ok
fi
fi
AC_SUBST(SOUND_CFLAGS)
AC_SUBST(SOUND_LDFLAGS)
############### END OF SOUND
############## MJPEGTOOLS (for YUV4MPEG)
PKG_CHECK_MODULES(MJPEG, mjpegtools,[mjpegtools=yes],:)
AC_SUBST(MJPEG_CFLAGS)
AC_SUBST(MJPEG_LIBS)
AC_MSG_CHECKING([for number of arguments to y4m_write_frame_header])
# check if mjpegtools has 3 arguements for y4m_write_frame_header
# Note: this test came from transcode...
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $MJPEG_CFLAGS"
LIBS="$LIBS $MJPEG_LIBS"
AC_TRY_LINK(
[
#include <mjpegtools/yuv4mpeg.h>
#include <mjpegtools/mpegconsts.h>
],
[y4m_write_frame_header(1,NULL,NULL)],
[
AC_DEFINE(
[MJPEGTOOLS_Y4M_WRITE_FRAME_HEADER__3ARGS],
[1],
[using y4m_write_frame_header with 3 arguments]
)
mjpeg_version_info="3 arguments (new versions)"
],[mjpeg_version_info="assuming 2 arguments (older versions)"])
AC_MSG_RESULT($mjpeg_version_info)
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
############## END MJPEGTOOLS
############## MISC LIBRARIES
AC_CHECK_HEADER(uuid/uuid.h,[libuuidh=yes])
AC_CHECK_LIB(uuid, uuid_clear,[libuuid=yes])
AC_CHECK_HEADER(fftw3.h,[libfftw3h=yes])
AC_CHECK_LIB(fftw3, fftw_free,[libfftw3=yes])
PKG_CHECK_MODULES(LIBDV,libdv >= 0.103,[libdv=yes],:)
AC_SUBST(LIBDV_CFLAGS)
AC_SUBST(LIBDV_LIBS)
PKG_CHECK_MODULES(PNG,libpng,[libpng=yes],:)
PKG_CHECK_MODULES(PNG14,libpng14 >= 1.4.0,[libnewpng=yes],:)
if test "x$libnewpng" = "xyes"; then
AC_DEFINE([HAVE_NEW_PNG], [1], [Needed to compile with libpng 1.4])
fi
AC_CHECK_HEADER(jpeglib.h,[libjpegh=yes])
AC_CHECK_LIB(jpeg,jpeg_start_decompress,[libjpeg=yes])
AC_CHECK_HEADER(tiffio.h,[libtiffh=yes])
AC_CHECK_LIB(tiff,TIFFOpen,[libtiff=yes])
AC_ARG_ENABLE(freetype2,
AC_HELP_STRING([--enable-freetype2],[enables freetype2 usage (default is use pkg-config detection)]),
[
[freetype2=yes] ],
[ PKG_CHECK_MODULES(FREETYPE,freetype2,[freetype2=yes],:) ])
############## END OF MISC LIBRARIES
LARGEFILE_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
AC_SUBST(LARGEFILE_CFLAGS)
############## A52DEC
AC_CHECK_LIB(a52,a52_init,[liba52=yes])
AC_CHECK_HEADER(a52dec/a52.h,[liba52h=yes])
if test "x$liba52$liba52h" = "xyesyes"; then
A52DEC_CFLAGS=
A52DEC_LIBS=-la52
fi
AC_SUBST(A52DEC_CFLAGS)
AC_SUBST(A52DEC_LDFLAGS)
############## END OF A52DEC
############## LIBSNDFILE
AC_CHECK_LIB(sndfile, sf_open,[libsndfile=yes])
AC_CHECK_HEADERS(sndfile.h,[libsndfileh=yes])
############## END OF LIBSNDFILE
############## OpenEXR
PKG_CHECK_MODULES(OPENEXR, OpenEXR,[libOpenEXR=yes],:)
AC_SUBST(OPENEXR_CFLAGS)
AC_SUBST(OPENEXR_LIBS)
############## END OF OpenEXR
############## LIBFAAD, LIBFAAC
AC_CHECK_LIB(faac, faacEncOpen,[libfaac=yes])
AC_CHECK_HEADER(faac.h,[libfaach=yes])
AC_CHECK_LIB(faad, faacDecInit,[libfaad=yes],
AC_CHECK_LIB(faad, NeAACDecInit,[libfaad=yes]))
AC_CHECK_HEADER(faad.h,[libfaadh=yes])
if test "x$libfaad$libfaadh" = xyesyes; then
FAAD_CFLAGS=
FAAD_LIBS="-lfaad"
fi
AC_SUBST(FAAD_CFLAGS)
AC_SUBST(FAAD_LIBS)
############## END OF LIBFAAD, LIBFAAC
############## FIREWIRE
# firewire settings are propagated through FIREWIRE_CFLAGS and FIREWIRE_LDFLAGS
AC_ARG_ENABLE(firewire,
AC_HELP_STRING([--disable-firewire], [disable support for firewire (default=enabled)]),
[ enable_firewire=$enableval ],
[ enable_firewire=yes ])
if test "x$enable_firewire" = "xyes"; then
PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.0,[libraw1394=yes],:)
PKG_CHECK_MODULES(LIBIEC61883, libiec61883,[libiec61883=yes],:)
AC_CHECK_LIB(avc1394, avc1394_send_command,[libavc1394=yes],:,$LIBRAW1394_LIBS)
AC_CHECK_HEADER([libavc1394/avc1394.h],[libavc1394h=yes])
AC_CHECK_LIB(rom1394, rom1394_get_bus_id,[librom1394=yes],:,$LIBRAW1394_LIBS)
AC_CHECK_HEADER([libavc1394/rom1394.h],[librom1394h=yes])
fi
if test "x$enable_firewire$libraw1394$libiec61883$libavc1394$libavc1394h$librom1394$librom1394h" = "xyesyesyesyesyesyesyes"; then
FIREWIRE_CFLAGS="-DHAVE_FIREWIRE $LIBIEC61883_CFLAGS $LIBRAW1394_CFLAGS"
FIREWIRE_LDFLAGS="-lavc1394 -lrom1394 $LIBIEC61883_LIBS $LIBRAW1394_LIBS"
enable_firewire=ok
fi
AC_SUBST(FIREWIRE_CFLAGS)
AC_SUBST(FIREWIRE_LDFLAGS)
AM_CONDITIONAL(HAVE_FIREWIRE,test "x$enable_firewire" = "xok")
############## END OF FIREWIRE
############# BUILDINFO display, (for displaying version / date)
AC_ARG_WITH(buildinfo,
AC_HELP_STRING(
[--with-buildinfo],
[includes revision information in the 'About' box; allowed values: svn, git; add /recompile to force rebuild on each make invocation, or cust/"Custom string" for packagers]),
[ buildinfo=$withval],
[ buildinfo="none" ])
AC_SUBST(buildinfo)
BUILDINFO_repository=$(echo $buildinfo | sed 's=/recompile==')
BUILDINFO_recompile=$(echo $buildinfo | sed 's=.*/recompile=yes=')
BUILDINFO_custom=$(echo $buildinfo | sed 's=cust.*=yes=')
BUILDINFO_CUSTOM_TAG=$(echo $buildinfo | sed 's=cust/==')
AC_SUBST(BUILDINFO_CUSTOM_TAG)
AM_CONDITIONAL(BUILDINFO_GIT, test "x$BUILDINFO_repository" = "xgit")
AM_CONDITIONAL(BUILDINFO_SVN, test "x$BUILDINFO_repository" = "xsvn")
AM_CONDITIONAL(BUILDINFO_RECOMPILE, test "x$BUILDINFO_recompile" = "xyes")
AM_CONDITIONAL(BUILDINFO_CUST, test "x$BUILDINFO_custom" = "xyes")
echo removing cinecutie/versioninfo.h to force a re-build
rm -f cinecutie/versioninfo.h > /dev/null 2>&1
############# END BUILDINFO display, (for displaying version / date)
############# CSS SUPPORT IN LIBMPEG3
if test "x$enable_css" = "xyes"; then
CSS_CFLAGS="-DHAVE_CSS"
fi
AC_SUBST(CSS_CFLAGS)
AC_ARG_ENABLE(css,
AC_HELP_STRING([--disable-css], [disable support for css in libmpeg3 (default=enabled)]),
[ enable_css=$enableval ],
[ enable_css=yes ])
############## END OF CSS SUPPORT IN LIBMPEG3
############## libx264
LIBX264_LIBS=""
AC_CHECK_LIB(x264, x264_encoder_close,
[libx264=yes LIBX264_LIBS=-lx264],,-lpthread -lm)
if test "x$with_pic" = "xyes"; then
AC_CHECK_LIB(x264_pic, x264_encoder_open,
[libx264=yes LIBX264_LIBS=-lx264_pic],,-lpthread -lm)
fi
AC_CHECK_HEADER(x264.h, [libx264h=yes])
AC_SUBST(LIBX264_LIBS)
##############
############## MMX / 3DNOW / SSE / POWERPC / ALTIVEC
AC_ARG_ENABLE(mmx,
AC_HELP_STRING([--enable-mmx], [enables support for mmx (default is autodetect)]),
[ enable_mmx=$enableval ],[ enable_mmx=auto ])
AC_ARG_ENABLE(sse,
AC_HELP_STRING([--enable-sse], [enables support for sse (default is autodetect)]),
[ enable_sse=$enableval ],[ enable_sse=auto ])
AC_ARG_ENABLE(3dnow,
AC_HELP_STRING([--enable-3dnow], [enables support for 3dnow (default is disabled)]),
[ enable_3dnow=$enableval ], [ enable_3dnow=no ])
AC_ARG_ENABLE(altivec,
AC_HELP_STRING([--enable-altivec], [enables altivec support (default is disabled)]),
[ enable_altivec=$enableval ],
[ enable_altivec=no ])
case "$target_cpu" in
i586 | i686)
test "x$enable_mmx" = "xauto" && enable_mmx=yes
CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
ffmpeg_32bit=yes
if test "x$enable_mmx" = "xyes"; then
CPU_CFLAGS="-DHAVE_MMX -DUSE_MMX $CPU_CFLAGS" # -D_MMX_ doesn't work
enable_mmx32=yes
fi
if test "x$enable_sse" = "xyes"; then
CPU_CFLAGS="-DHAVE_SSE -DUSE_SSE $CPU_CFLAGS"
fi
if test "x$enable_3dnow" = "xyes"; then
CPU_CFLAGS="-DHAVE_3Dnow $CPU_CFLAGS" # -DUSE_3DNOW --> don't use, not compilin
fi
;;
x86_64)
test "x$enable_mmx" = "xauto" && enable_mmx=yes
test "x$enable_sse" = "xauto" && enable_sse=yes
CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
if test "x$enable_mmx" = "xyes"; then
CPU_CFLAGS="-DHAVE_MMX -DUSE_MMX $CPU_CFLAGS"
fi
if test "x$enable_sse" = "xyes"; then
CPU_CFLAGS="-DHAVE_SSE -DUSE_SSE $CPU_CFLAGS"
fi
;;
powerpc)
CPU_CFLAGS="-mcpu=powerpc $CPU_CFLAGS"
if test "x$enable_altivec" = "xyes"; then
CPU_CFLAGS="-maltivec -mabi=altivec $CPU_CFLAGS"
fi
;;
esac
test "x$enable_mmx" = "xauto" && enable_mmx=no
test "x$enable_sse" = "xauto" && enable_sse=no
AM_CONDITIONAL(USEMMX, test "x$enable_mmx" = "xyes")
AM_CONDITIONAL(USEMMX32, test "x$enable_mmx32" = "xyes")
AM_CONDITIONAL(USESSE, test "x$enable_sse" = "xyes")
AM_CONDITIONAL(TARGET_BUILTIN_VECTOR,test "x$enable_mmx" = "xyes")
AM_CONDITIONAL(USE3DNOW, test "x$enable_3dnow" = "xyes")
AM_CONDITIONAL(TARGET_ARCH_POWERPC, test "x$target_cpu" = "xpowerpc")
AM_CONDITIONAL(TARGET_ALTIVEC, test "x$enable_altivec" = "xyes")
AM_CONDITIONAL(FFMPEG_ARCH_32BIT, test "x$ffmpeg_32bit" = "xyes")
AC_SUBST(LIBDECORE_LIBADD)
AC_SUBST(CPU_CFLAGS)
############## END OF MMX / SSE / 3DNOW
############ external ffmpeg
AC_ARG_WITH([external-ffmpeg], AC_HELP_STRING([--with-external-ffmpeg], [use external ffmpeg library]))
if test "x$with_external_ffmpeg" = "xyes"; then
PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc])
FFMPEG_FOLDER=""
FFMPEG_EXTERNALTEXT="External ffmpeg"
dnl --------------------------------------------------------------
dnl check if libavcodec contains img_convert
dnl if not, that means that libswscale is compiled in
AC_MSG_CHECKING(for ffmpeg swscale support)
saved_LIBS="$LIBS"
LIBS="$saved_LIBS $FFMPEG_TEMP_LIBS"
AC_TRY_LINK([#include <libavcodec/avcodec.h>],
[img_convert(0, 0, 0,0,0,0)],
enable_ffmpeg_swscale=no,enable_ffmpeg_swscale=yes)
LIBS="$saved_LIBS"
AC_MSG_RESULT($enable_ffmpeg_swscale)
if test x"$enable_ffmpeg_swscale" = xyes; then
dnl AC_DEFINE(HAVE_SWSCALER)
PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libavformat libavdevice libswscale])
FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/libavcodec -I/usr/include/libavformat -I/usr/include/libavdevice -I/usr/include/libswscale -DHAVE_SWSCALER"
else
PKG_CHECK_MODULES([FFMPEG], [libavcodec libavformat libavdevice libpostproc])
fi
FFMPEG_EXTERNALTEXT="External ffmpeg"
else
FFMPEG_FOLDER=ffmpeg
FFMPEG_CFLAGS="-I\$(top_srcdir)/quicktime/ffmpeg -DHAVE_SWSCALER"
FFMPEG_LIBS="-L\$(top_builddir)/quicktime/ffmpeg/libavcodec -lavcodec-cinecutie \
-L\$(top_builddir)/quicktime/ffmpeg/libavformat -lavformat-cinecutie \
-L\$(top_builddir)/quicktime/ffmpeg/libavdevice -lavdevice-cinecutie \
-L\$(top_builddir)/quicktime/ffmpeg/libswscale -lswscale-cinecutie \
-L\$(top_builddir)/quicktime/ffmpeg/libavutil -lavutil-cinecutie"
FFMPEG_EXTERNALTEXT="Internal ffmpeg"
fi
AC_SUBST(FFMPEG_FOLDER)
AC_SUBST(FFMPEG_CFLAGS)
AC_SUBST(FFMPEG_LIBS)
AC_SUBST(FFMPEG_EXTERNALTEXT)
############# END external ffmpeg
############# run ffmpeg configure to generates avconfig.h
echo --- FFMPEG CONFIGURATION SECTION --------------
if test "x$with_external_ffmpeg" = "xyes"; then
echo Using external ffmpeg - no configuration needed
else
if test "$prefix" = "NONE"; then
prefix=/usr/local
fi
if test -z $prefix ; then
prefix=/usr/local
fi
ff_conf_args="--disable-ffmpeg --prefix=$prefix --incdir=/opt/cinecutie/conflicts/include \
--mandir=/opt/cinecutie/conflicts/share/man --disable-ffserver --disable-ffplay \
--disable-static --enable-shared --enable-libtheora --enable-libspeex --enable-libopenjpeg \
--enable-swscale --enable-libfaad --disable-vhook --enable-gpl --build-suffix=-cinecutie"
if test "x$enable_mmx" = "xno"; then
ff_conf_args="$ff_conf_args --disable-mmx"
fi
#if test "x$enable_sse" = "xno"; then
# ff_conf_args="$ff_conf_args --disable-sse"
#fi
#if test "x$enable_3dnow" = "xno"; then
# ff_conf_args="$ff_conf_args --disable-amd3dnow --disable-amd3dnowext"
#fi
# Where altivec is not present
if test "x$enable_altivec" = "xno"; then
ff_conf_args="$ff_conf_args --disable-altivec"
fi
srcdir_c=$(readlink -f $srcdir)
mkdir -p quicktime/ffmpeg/ > /dev/null 2>&1
cd quicktime/ffmpeg/
echo quicktime/ffmpeg/configure $ff_conf_args
$srcdir_c/quicktime/ffmpeg/configure $ff_conf_args
cd ../../
fi
echo --------------------------------------------------
############# END run ffmpeg configure to generates avconfig.h
############## XIPH
PKG_CHECK_MODULES(libogg,ogg >= 1.1,[libogg=yes],:)
PKG_CHECK_MODULES(libvorbis,vorbis,[libvorbis=yes],:)
PKG_CHECK_MODULES(libvorbisenc,vorbisenc,[libvorbisenc=yes],:)
PKG_CHECK_MODULES(libvorbisfile,vorbisfile,[libvorbisfile=yes],:)
PKG_CHECK_MODULES(libtheora,theora,[libtheora=yes],:)
PKG_CHECK_MODULES(libspeex,speex,[libspeex=yes],:)
AC_CHECK_HEADER(openjpeg.h, [libopenjpeg=yes])
XIPH_CFLAGS="$libogg_CFLAGS $libvorbis_CFLAGS $libvorbisenc_CFLAGS $libvorbisfile_CFLAGS $libtheora_CFLAGS"
XIPH_LIBS="$libogg_LIBS $libvorbis_LIBS $libvorbisenc_LIBS $libvorbisfile_LIBS $libtheora_LIBS"
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
############## END OF XIPH
############## LAME
# Just test to see if we have lame installed.
AC_CHECK_HEADER(lame/lame.h,[libmp3lameh=yes])
AC_CHECK_LIB(mp3lame,lame_init,[libmp3lame=yes],,[$XIPH_LIBS])
# END LAME
############## OpenGL
AH_TEMPLATE(HAVE_GL, [Define to 1 if OpenGL 2.0 is available.])
AC_ARG_ENABLE(opengl,
AC_HELP_STRING([--disable-opengl],
[disables hardware accelerated rendering (default=autodetect, requires OpenGL 2.0)]),
[ enable_opengl=$enableval ],
[ enable_opengl=yes ])
if test "x$enableval" = "xyes"; then
AC_CHECK_LIB([GL], [glUseProgram],
[OPENGL_LIBS="-lGL"; libGL=yes],
# On SUSE/OpenSUSE, NVidia places the OpenGL 2.0 capable library in /usr/X11R6/lib
# but it doesn't place a libGL.so there, so the linker won't pick it up
# we have to use the explicit libGL.so.1 path.
save_LIBS="$LIBS"
for l in /usr/X11R6/lib /usr/X11R6/lib64; do
LIBS="$l/libGL.so.1"
AC_MSG_CHECKING(for glUseProgram in $l/libGL.so.1)
AC_TRY_LINK([],[extern int glUseProgram(); glUseProgram();],
[OPENGL_LIBS="$l/libGL.so.1"; libGL=yes],[libGL=no])
AC_MSG_RESULT([$libGL])
test $libGL = yes && break
done
LIBS="$save_LIBS"
)
fi
if test "x$libGL" = "xyes"; then
enable_opengl=ok
OPENGL_LIBS="-lGLU $OPENGL_LIBS"
AC_DEFINE(HAVE_GL)
fi
AC_SUBST(OPENGL_LIBS)
# END OpenGL
############## .png TO .o CONVERSION
AC_CHECK_TOOL(OBJCOPY, objcopy)
if test "x$OBJCOPY" = "x"; then
AC_MSG_ERROR("objcopy from GNU binutils >= 2.11.90 not found")
fi
AC_CHECK_TOOL(OBJDUMP, objdump)
dnl extract target and architecture if objdump was found
if test "x$OBJDUMP" = "x"; then :; else
AC_MSG_CHECKING(for object target)
octarget=`$OBJDUMP --info | sed -ne '2p'` # extract first target
AC_MSG_RESULT($octarget)
AC_MSG_CHECKING(for object architecture)
ocarch=`$OBJDUMP --info | sed -ne '4p'` # extract corresponding arch
AC_MSG_RESULT($ocarch)
fi
AC_SUBST(OBJCOPYTARGET, $octarget)
AC_SUBST(OBJCOPYARCH, $ocarch)
############## END of .png TO .o CONVERSION
AC_OUTPUT(Makefile cinecutie-current.spec po/Makefile.in \
m4/Makefile \
libmpeg3/Makefile libmpeg3/video/Makefile libmpeg3/audio/Makefile \
quicktime/Makefile \
quicktime/encore50/Makefile \
mpeg2enc/Makefile toolame-02l/Makefile \
guicast/Makefile cinecutie/Makefile \
cinecutie/data/Makefile \
mplexlo/Makefile \
plugins/colors/Makefile \
plugins/libfourier/Makefile \
plugins/libeffecttv/Makefile \
plugins/Makefile
plugins/1080to540/Makefile \
plugins/histogram/Makefile \
plugins/720to480/Makefile \
plugins/bandslide/Makefile \
plugins/bandwipe/Makefile
plugins/blur/Makefile
plugins/brightness/Makefile \
plugins/burn/Makefile plugins/parametric/Makefile plugins/aging/Makefile \
plugins/cdripper/Makefile \
plugins/chromakey/Makefile \
plugins/chromakeyhsv/Makefile \
plugins/colorbalance/Makefile \
plugins/compressor/Makefile \
plugins/crossfade/Makefile \
plugins/decimate/Makefile \
plugins/deinterlace/Makefile plugins/delayaudio/Makefile plugins/delayvideo/Makefile \
plugins/denoise/Makefile plugins/denoisefft/Makefile plugins/denoisevideo/Makefile \
plugins/denoisemjpeg/Makefile \
plugins/despike/Makefile plugins/dissolve/Makefile plugins/dot/Makefile \
plugins/fieldframe/Makefile plugins/flip/Makefile plugins/framefield/Makefile \
plugins/freeverb/Makefile plugins/freezeframe/Makefile plugins/gain/Makefile \
plugins/gamma/Makefile \
plugins/holo/Makefile plugins/huesaturation/Makefile \
plugins/interpolate/Makefile \
plugins/interpolateaudio/Makefile \
plugins/interpolatevideo/Makefile \
plugins/invertaudio/Makefile plugins/invertvideo/Makefile plugins/irissquare/Makefile \
plugins/ivtc/Makefile \
plugins/liveaudio/Makefile \
plugins/livevideo/Makefile \
plugins/loopaudio/Makefile \
plugins/loopvideo/Makefile \
plugins/motion/Makefile \
plugins/motionblur/Makefile \
plugins/normalize/Makefile \
plugins/oilpainting/Makefile \
plugins/overlay/Makefile \
plugins/overlayaudio/Makefile \
plugins/pitch/Makefile \
plugins/polar/Makefile \
plugins/reroute/Makefile
plugins/reframert/Makefile
plugins/reframe/Makefile plugins/resample/Makefile plugins/reverb/Makefile \
plugins/reverseaudio/Makefile plugins/reversevideo/Makefile plugins/rgb601/Makefile \
plugins/rotate/Makefile \
plugins/scale/Makefile \
plugins/denoiseseltempavg/Makefile \
plugins/shapewipe/Makefile \
plugins/sharpen/Makefile \
plugins/shiftinterlace/Makefile plugins/slide/Makefile plugins/spectrogram/Makefile \
plugins/suv/Makefile \
plugins/suv/data/Makefile \
plugins/themepink/Makefile \
plugins/themepink/data/Makefile \
plugins/swapchannels/Makefile \
plugins/synthesizer/Makefile \
plugins/threshold/Makefile \
plugins/timeavg/Makefile \
plugins/timestretch/Makefile plugins/titler/Makefile plugins/translate/Makefile \
plugins/unsharp/Makefile \
plugins/videoscope/Makefile plugins/wave/Makefile plugins/whirl/Makefile \
plugins/wipe/Makefile \
plugins/yuv/Makefile \
plugins/downsample/Makefile plugins/flash/Makefile plugins/gradient/Makefile \
plugins/level/Makefile plugins/linearblur/Makefile \
plugins/perspective/Makefile plugins/radialblur/Makefile plugins/zoomblur/Makefile \
plugins/timefront/Makefile \
plugins/svg/Makefile \
plugins/diffkey/Makefile \
plugins/fonts/Makefile \
image/Makefile)
succeeded=yes
AC_DEFUN([RPT],[if test "x$$1" = "xyes"; then status=found; else status=missing; succeeded=no; fi
echo "AC_HELP_STRING($2,$status)"])
echo
echo "Summary of mandatory components:"
RPT(libogg,libogg)
RPT(libvorbis,libvorbis)
RPT(libvorbisenc,libvorbisenc)
RPT(libvorbisfile,libvorbisfile)
RPT(libtheora,libtheora)
RPT(libspeex,libspeex)
RPT(libopenjpeg,OpenJpeg)
RPT(libOpenEXR,OpenEXR)
RPT(libdv,libdv)
RPT(libpng,libpng)
RPT(libjpeg,libjpeg libraries)
RPT(libjpegh,libjpeg headers)
RPT(libtiff,libtiff libraries)
RPT(libtiffh,libtiff headers)
RPT(freetype2,FreeType 2)
RPT(libx264,libx264 libraries)
RPT(libx264h,libx264 headers)
RPT(libuuid,libuuid libraries)
RPT(libuuidh,libuuid headers)
RPT(mjpegtools,mjpegtools)
RPT(libfftw3,libfftw3 libraries)
RPT(libfftw3h,libfftw3 headers)
RPT(liba52,liba52 libraries)
RPT(liba52h,liba52 headers)
RPT(libmp3lame,libmp3lame libraries)
RPT(libmp3lameh,libmp3lame headers)
RPT(libsndfile,libsndfile libraries)
RPT(libsndfileh,libsndfile headers)
RPT(libfaac,libfaac libraries)
RPT(libfaach,libfaac headers)
RPT(libfaad,libfaad libraries)
RPT(libfaadh,libfaad headers)
mandatory="$succeeded"
echo
echo "Summary of optional components:"
AC_DEFUN([ORPT],[if test "x$$1" = "xno"; then
echo "$2 was opted out with $3"
else
if test "x$$1" = "xok"; then component=enabled; else component=disabled; fi
$4
echo "$2 is $component"
fi])
ORPT(enable_esd,ESD (Enlightenment Sound Daemon),--disable-esd,RPT(esound,ESD subsystem))
ORPT(enable_alsa,ALSA,--disable-alsa,RPT(alsa,ALSA subsystem))
ORPT(enable_firewire,Firewire,--disable-firewire,
RPT(libraw1394,libraw1394)
RPT(libiec61883,libiec61883)
RPT(libavc1394,libavc1394 libraries)
RPT(libavc1394h,libavc1394 headers)
RPT(librom1394,librom1394 libraries)
RPT(librom1394h,librom1394 headers)
)
ORPT(enable_opengl,Hardware acceleration using OpenGL 2.0,--disable-opengl,
RPT(libGL,OpenGL 2.0 libraries)
)
if test "x$mandatory" = "xno"; then
echo
echo "WARNING: Mandatory components are missing; compilation may fail!"
else
echo
echo "Now type"; echo " make"; echo; echo "to start compilation."
fi