-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.ac
857 lines (773 loc) · 26.3 KB
/
configure.ac
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
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
AC_INIT(cinelerra-cv, 2.3)
AC_CANONICAL_SYSTEM
# Test for minimal version of autoconf
AC_PREREQ(2.57)
AM_INIT_AUTOMAKE([foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
IT_PROG_INTLTOOL
GETTEXT_PACKAGE="AC_PACKAGE_NAME"
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The prefix for our gettext translation domains])
AM_ICONV
AM_PROG_AS
AC_LANG_CPLUSPLUS
AC_LANG_C
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX(11, ext, optional)
dnl
dnl GREP_CXXFLAGS(flag, cmd_if_missing, cmd_if_present)
dnl
AC_DEFUN([GREP_CXXFLAGS],
[case "$CXXFLAGS" in
"$1" | "$1 "* | *" $1" | *" $1 "* )
ifelse($#, 3, [$3], [:])
;;
*)
$2
;;
esac
])
dnl
dnl GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present)
dnl
AC_DEFUN([GREP_CFLAGS],
[case "$CFLAGS" in
"$1" | "$1 "* | *" $1" | *" $1 "* )
ifelse($#, 3, [$3], [:])
;;
*)
$2
;;
esac
])
if eval "test x$GCC = xyes"; then
for flag in \
-Wformat \
-Werror=format-security
do
GREP_CXXFLAGS($flag, [ CXXFLAGS="$CXXFLAGS $flag" ])
done
for flag in \
-Wformat \
-Werror=format-security
do
GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
done
AC_ARG_WITH([lots-of-warnings],
AC_HELP_STRING([--with-lots-of-warnings], [ask the compiler to enable lots of warning flags]),[
for flag in \
-Wall \
-Werror=format-security \
-Wextra \
-Wcast-qual \
-Wpointer-arith \
-Wreturn-type \
-Wunused \
-pedantic
do
GREP_CXXFLAGS($flag, [ CXXFLAGS="$CXXFLAGS $flag" ])
done
for flag in \
-Wall \
-Werror=format-security \
-Wextra \
-Wcast-qual \
-Wpointer-arith \
-Wreturn-type \
-Wunused \
-pedantic
do
GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
done
])
fi
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)
dnl Check for nasm
AC_CHECK_PROG(HAVE_NASM, nasm, yes)
if test x$HAVE_NASM != "xyes"; then
AC_MSG_ERROR(nasm is missing. Please install it.)
fi
if test "$am_cv_func_iconv" = "yes"; then
funiconv=yes
fi
# 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/videodev2.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/cinelerra-cv" ])
AC_SUBST(plugindir)
############## 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([Cinelerra requires X Windows.])
fi
AH_TEMPLATE(HAVE_LIBXXF86VM, [Define to 1 if libXxf86vm is available.])
AC_DEFINE(HAVE_LIBXXF86VM)
############## END XLIB
############## UTF8 support
AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
if test "$no_utf" = "yes"; then
AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
fi
############## UTF8 support
############## Freetype2 and fontconfig support
PKG_CHECK_MODULES(FREETYPE,freetype2,[freetype2=yes],:)
PKG_CHECK_MODULES(FONTCONFIG,fontconfig >= 2.4.2,[fontconfig=yes],:)
if test "x$freetype2" != "xyes" -o "x$fontconfig" != "xyes"; then
AC_MSG_ERROR([Cinelerra requires freetype2 and fontconfig ver 2.4.2 or later])
fi
############## End of freetype2 and fontconfig support
############# XFT
AH_TEMPLATE(HAVE_XFT, [Define to 1 if libXft is available.])
PKG_CHECK_MODULES(XFT, xft, [libxft=yes],:)
if test "$libxft" = "yes"; then
AC_DEFINE(HAVE_XFT)
AC_SUBST(XFT_CFLAGS)
AC_SUBST(XFT_LIBS)
AC_DEFINE([PNG_SETJMP_NOT_SUPPORTED], [1], [Workaround to fix compile with xft])
CXXFLAGS="$XFT_CFLAGS $CXXFLAGS"
fi
############## END XFT
############## 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 arguments 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],:)
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])
############## END OF MISC LIBRARIES
LARGEFILE_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_FORMAT_MACROS"
AC_SUBST(LARGEFILE_CFLAGS)
############## A52DEC
AC_CHECK_LIB(a52,a52_init,[liba52=yes])
AC_CHECK_HEADER(a52dec/a52.h,[liba52h=yes])
AH_TEMPLATE(A52_INIT_NEEDS_ARG, [Define to 1 if an argument must be passed to a52_init.])
if test "x$liba52$liba52h" = "xyesyes"; then
A52DEC_CFLAGS=
A52DEC_LIBS=-la52
AC_MSG_CHECKING(whether a52_init requires an argument)
AC_TRY_COMPILE([
#include <stdint.h>
#include <a52dec/a52.h>],
[a52_init(0)],
a52_init_needs_arg=yes,a52_init_needs_arg=no)
AC_MSG_RESULT([$a52_init_needs_arg])
test "$a52_init_needs_arg" = yes && AC_DEFINE(A52_INIT_NEEDS_ARG)
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
AH_TEMPLATE(HAVE_OPENEXR, [Define 1 if OpenEXR is used])
PKG_CHECK_MODULES(OPENEXR, OpenEXR,[libOpenEXR=yes],:)
if test "$libOpenEXR" = "yes"; then
AC_SUBST(OPENEXR_CFLAGS)
AC_SUBST(OPENEXR_LIBS)
AC_DEFINE(HAVE_OPENEXR)
fi
AM_CONDITIONAL(NEED_OPENEXR, test "x$libOpenEXR" = "xyes")
############## 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 cinelerra/versioninfo.h to force a re-build
rm -f cinelerra/versioninfo.h > /dev/null 2>&1
############# END BUILDINFO display, (for displaying version / date)
############ external libmpeg3
AC_ARG_WITH([external-libmpeg3], AC_HELP_STRING([--with-external-libmpeg3], [use external libmpeg3 library (experimental)]))
if test "x$with_external_libmpeg3" = "xyes"; then
PKG_CHECK_MODULES(LIBMPEG3, libmpeg3,[libmpeg3_system=yes],:)
AC_CHECK_HEADER(mpeg3/libmpeg3.h)
# the mpeg3io_eof macro in mpeg3protos.h is used by mplexlo,
# make sure it is available
old_LIBS="$LIBS"
LIBS="$LIBS -lmpeg3"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <mpeg3/libmpeg3.h>
#include <mpeg3/mpeg3protos.h>
void test() { mpeg3io_eof(0); }]])],
[libmpeg3_mpeg3io_eof=1], [libmpeg3_mpeg3io_eof=0])
LIBS="$old_LIBS"
unset old_LIBS
# Check if libmpeg3 1.7 or later is used. It is needed for
# several functions not present in earlier versions.
AC_CHECK_LIB(mpeg3, mpeg3_open)
AC_TRY_LINK([#include <mpeg3/libmpeg3.h>],
[char *s; int e; mpeg3_open(s, &e);],
libmpeg3_open_return_error=1, libmpeg3_open_return_error=0)
if test 1 = $libmpeg3_open_return_error ; then
echo "external libmpeg3 version with mpeg3_open(char*, int*) (present in 1.7 or later) found"
else
echo "error: external libmpeg3 without mpeg3_open(char*, int*) (before version 1.7) found"
echo "error: Upgrade libmpeg3 or drop the --with-external-libmpeg3 configure flag."
exit 1
fi
else
LIBMPEG3_CFLAGS="-I\$(top_srcdir)/libmpeg3"
LIBMPEG3_LIBS="\$(top_builddir)/libmpeg3/libmpeg3cv.la"
libmpeg3_mpeg3io_eof=1
AC_SUBST(LIBMPEG3_CFLAGS)
AC_SUBST(LIBMPEG3_LIBS)
fi
AM_CONDITIONAL(HAVE_MPEG3IO_EOF, [test "x$libmpeg3_mpeg3io_eof" = "x1"])
AM_CONDITIONAL(HAVE_LIBMPEG3_INTERNAL, [test "x$libmpeg3_system" != "xyes"])
############# END external libmpeg3
############# CSS SUPPORT IN INTERNAL 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 internal libmpeg3 (default=enabled)]),,
[ enable_css=$enableval ],
[ enable_css=yes ])
############## END OF CSS SUPPORT IN LIBMPEG3
############## libx264
LIBX264_LIBS=""
PKG_CHECK_MODULES([LIBX264], [x264], [libx264=yes], [libx264=no])
AC_CHECK_HEADER(x264.h, [libx264h=yes])
AC_SUBST(LIBX264_LIBS)
##############
############## MMX / 3DNOW 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(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_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
CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
if test "x$enable_mmx" = "xyes"; then
CPU_CFLAGS="-DHAVE_MMX -DUSE_MMX $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
AM_CONDITIONAL(USEMMX, test "x$enable_mmx" = "xyes")
AM_CONDITIONAL(USEMMX32, test "x$enable_mmx32" = "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 / 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 libswscale])
FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/libavcodec -I/usr/include/libswscale -DHAVE_SWSCALER"
else
PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc])
fi
FFMPEG_EXTERNALTEXT="External ffmpeg"
else
FFMPEG_FOLDER=ffmpeg
FFMPEG_CFLAGS="-I\$(top_srcdir)/quicktime/ffmpeg"
FFMPEG_LIBS="-L\$(top_builddir)/quicktime/ffmpeg/libavcodec -lavcodec-cv \
-L\$(top_builddir)/quicktime/ffmpeg/libavutil -lavutil-cv"
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
ff_conf_args="--disable-ffmpeg --disable-ffserver --disable-ffplay \
--disable-static --enable-shared --build-suffix=-cv"
if test "x$enable_mmx" = "xno"; then
ff_conf_args="$ff_conf_args --disable-mmx"
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/ &&
(
cd quicktime/ffmpeg/
# if --libdir was not set, then it expands to '$exec_prefix/lib'
# if --exec-prefix was not set, then it expands to NONE
# this makes sure $libdir is expanded to a useful value
if test "x$exec_prefix" = xNONE; then
exec_prefix=$acl_final_prefix
fi
cmd="quicktime/ffmpeg/configure \$ff_conf_args \
--prefix=\"\$acl_final_prefix\" \
--libdir=\"$libdir\" --shlibdir=\"$libdir\""
eval echo $cmd
eval \$srcdir_c/$cmd
)
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],:)
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=auto ])
if test "x$enable_opengl" = "xauto"; 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"
)
if test "x$libGL" = "xyes"; then
enable_opengl=ok
OPENGL_LIBS="-lGLU $OPENGL_LIBS"
AC_DEFINE(HAVE_GL)
fi
else
if test "x$enable_opengl" = "xyes"; then
enable_opengl=ok
libGL=skip
OPENGL_LIBS="-lGLU -lGL"
AC_DEFINE(HAVE_GL)
fi
fi
AC_SUBST(OPENGL_LIBS)
# END OpenGL
############## ask for extra debug output from X
AC_ARG_ENABLE(x-error-output,
AC_HELP_STRING([--enable-x-error-output], [enable output when X report errors (default=no)])
[],
[if test yes = "$enableval" ; then
AC_DEFINE(OUTPUT_X_ERROR, [1], [enable output when X report errors])
fi])
# END --enable-x-error-output
############## .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 cinelerra-cvs-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 \
cinelerra/Makefile \
cinelerra/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/C41/Makefile \
plugins/bandslide/Makefile \
plugins/bandwipe/Makefile
plugins/blur/Makefile \
plugins/bluebanana/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/color3way/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/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/greycstoration/Makefile \
plugins/holo/Makefile \
plugins/huesaturation/Makefile \
plugins/interpolateaudio/Makefile \
plugins/interpolatevideo/Makefile \
plugins/invertaudio/Makefile \
plugins/invertvideo/Makefile \
plugins/irissquare/Makefile \
plugins/ivtc/Makefile \
plugins/lens/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/bluedottheme/Makefile \
plugins/bluedottheme/data/Makefile \
plugins/defaulttheme/Makefile \
plugins/defaulttheme/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 \
image/Makefile)
succeeded=yes
AC_DEFUN([RPT],[if test "x$$1" = "xskip"; then status="not probed"
elif 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(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(libxft,libXft library)
RPT(funiconv,iconv function)
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)
)
RPT(libOpenEXR,OpenEXR)
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