-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
1435 lines (1286 loc) · 38.7 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
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
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Process this file with autoconf to produce a configure script.
AC_INIT(transcode,1.1.7)
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_SRCDIR(src/transcode.c)
dnl Detect the canonical host and target build environment
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(transcode,1.1.7)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_LANG([C])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_AS
AM_CONDITIONAL(HAVE_GCC, test x"$GCC" = x"yes")
dnl Check for gcc2, which doesn't seem to handle asm templates
dnl And check for gcc4, which also has problems with filter_tomsmocomp
dnl
gcc2=no
gcc4=no
if test x"$GCC" = x"yes" ; then
gcc_ver="`LANG=C $CC -dumpversion`"
if test x"$gcc_ver" != x"" ; then
if echo $gcc_ver | grep -q ^2 ; then
gcc2=yes
fi
if echo $gcc_ver | grep -q ^4 ; then
gcc4=yes
fi
fi
fi
AM_CONDITIONAL(HAVE_GCC2, test x"$gcc2" = x"yes")
AM_CONDITIONAL(HAVE_GCC4, test x"$gcc4" = x"yes")
dnl we got $AWK already, but not its full path
AC_PATH_PROG(PATH_TO_AWK, $AWK)
dnl Check the OS. This has to be done here, after checks for proograms and
dnl before checks for libraries.
deflib="/lib"
is_linux=no
is_bsd=no
is_osx=no
case "${target_os}" in
*linux*)
is_linux=yes
AC_DEFINE([OS_LINUX], 1, [Define if your system is Linux])
;;
freebsd*|openbsd*|netbsd*|bsdi*|darwin*|rhapsody*)
is_bsd=yes
AC_DEFINE([OS_BSD], 1, [Define if your system is modern BSD])
# darwin is a subcase of BSD
case "${target_os}" in
darwin*)
is_osx=yes
CFLAGS="${CFLAGS} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"
#LDFLAGS="${LDFLAGS} -all_load"
AC_DEFINE([OS_DARWIN], 1, [Define if this is a Darwin / MacOS X system.])
AC_DEFINE([BROKEN_PTHREADS], 1, [Define if you have weird pthreads.])
# Include Fink in compile and link if present
if test -d /sw; then
CPPFLAGS="${CPPFLAGS} -I/sw/include"
LDFLAGS="${LDFLAGS} -L/sw/lib"
fi
;;
esac
;;
esac
AM_CONDITIONAL([OS_LINUX], test x"$is_linux" = x"yes")
AM_CONDITIONAL([OS_BSD], test x"$is_bsd" = x"yes")
AM_CONDITIONAL([OS_DARWIN], test x"$is_osx" = x"yes")
dnl Checks for libraries.
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_FUNCS([dlopen])
if test x"$is_osx" = x"true" ; then
AC_CHECK_FUNCS(dlsym_prepend_underscore,
[CFLAGS="${CFLAGS} -Ddlsym=dlsym_prepend_underscore"],
AC_MSG_WARN([Function 'dlsym_prepend_underscore' not found.])
AC_MSG_WARN([Using function 'dlsym' directly instead.])
AC_MSG_WARN([This can be a problem if the installed dlsym])
AC_MSG_WARN([does not automatically prepend an underscore])
AC_MSG_WARN([to symbols.]))
fi
USE_DLDARWIN=no
if test x"$ac_cv_lib_dl_dlopen" = x"no" ; then
case x${target_os} in
xdarwin*)
USE_DLDARWIN=yes
DLDARWIN_CFLAGS="-I\$(top_srcdir)/libdldarwin/"
DLDARWIN_LIBS="\$(top_builddir)/libdldarwin/libdldarwin.a"
;;
esac
fi
AC_SUBST(USE_DLDARWIN)
AC_SUBST(DLDARWIN_CFLAGS)
AC_SUBST(DLDARWIN_LIBS)
AM_CONDITIONAL(USE_DLDARWIN, test x"$USE_DLDARWIN" = x"yes")
dnl libtool setup
AC_PROVIDE([AC_PROG_CXX]) dnl we don't want it!
AC_PROVIDE([AC_PROG_F77]) dnl likewise
AC_DISABLE_STATIC
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
dnl Checks for header files.
TC_CHECK_STD_HEADERS
AC_CHECK_HEADERS([endian.h malloc.h sys/mman.h sys/select.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN([words_bigendian=true
AC_DEFINE([WORDS_BIGENDIAN], 1, [Define if your CPU is big-endian.])],
words_bigendian=false)
AM_CONDITIONAL(WORDS_BIGENDIAN, test x"$words_bigendian" = x"true")
TC_C_GCC_ATTRIBUTES
TC_C_ATTRIBUTE_ALIGNED
dnl Checks for library functions.
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([getopt_long_only getpagesize gettimeofday mmap strlcat strlcpy strtof vsscanf])
AM_CONDITIONAL(HAVE_GETOPT_LONG_ONLY, test x"$ac_cv_func_getopt_long_only" = x"yes")
AM_CONDITIONAL(HAVE_MMAP, test x"$ac_cv_func_mmap" = x"yes")
AM_CONDITIONAL(HAVE_GETTIMEOFDAY, test x"$ac_cv_func_gettimeofday" = x"yes")
dnl Special check for sysconf() to ensure _SC_PAGESIZE is also available.
AC_CACHE_CHECK([for sysconf(_SC_PAGESIZE)], ac_cv_sysconf_with_sc_pagesize,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],[[sysconf(_SC_PAGESIZE);]])],
[ac_cv_sysconf_with_sc_pagesize=yes],
[ac_cv_sysconf_with_sc_pagesize=no])])
if test x"$ac_cv_sysconf_with_sc_pagesize" = x"yes"; then
AC_DEFINE([HAVE_SYSCONF_WITH_SC_PAGESIZE], 1,
[Define to 1 if you have sysconf(_SC_PAGESIZE).])
fi
dnl Large file support.
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
dnl Thread support (pthreads).
case "$host" in
*-*-freebsd*)
pthread_cflags="-pthread -D_REENTRANT -D_THREAD_SAFE"
pthread_libs="-pthread"
;;
*-*-openbsd*)
pthread_cflags="-D_REENTRANT"
pthread_libs="-pthread"
;;
*-*-bsdi*)
pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
pthread_libs=""
;;
*)
pthread_cflags="-D_REENTRANT"
pthread_libs="-lpthread"
;;
esac
# let user override
if test -n "$PTHREAD_LIBS" ; then
pthread_libs="$PTHREAD_LIBS"
fi
if test -n "$PTHREAD_CFLAGS" ; then
pthread_cflags="$PTHREAD_CFLAGS"
fi
save_LIBS="$LIBS"
LIBS="$LIBS $pthread_libs"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pthread_cflags"
AC_MSG_CHECKING(for pthreads in $pthread_libs)
AC_TRY_LINK([
#include <pthread.h>
],[
pthread_attr_t type;
pthread_attr_init(&type);
],
[use_pthreads="yes"],
[use_pthreads="no"]
);
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($use_pthreads)
if test x"$use_pthreads" = x"yes" ; then
PTHREAD_LIBS="$pthread_libs"
PTHREAD_CFLAGS="$pthread_cflags"
else
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
dnl
dnl Architecture specific instructions
dnl
AC_MSG_CHECKING([for build architecture])
have_x86cpu=false
have_x86_64cpu=false
have_ppccpu=false
case x"$host_cpu" in
xi?86*|xk6*)
have_x86cpu=true
AC_MSG_RESULT([Intel Pentium architecture (IA32)])
AC_DEFINE([ARCH_X86], 1, [Define if your machine is x86 based])
;;
xx86_64*|xamd64*)
have_x86_64cpu=true
AC_MSG_RESULT([AMD64 architecture (AMD64)])
AC_DEFINE([ARCH_X86_64], 1, [Define if your machine is AMD64 based])
;;
xpowerpc*)
have_ppccpu=true
AC_MSG_RESULT([Mac PPC architecture (PPC)])
AC_DEFINE([ARCH_PPC], 1, [Define if your machine is PPC based])
;;
*)
;;
esac
AM_CONDITIONAL(ARCH_X86, test x"$have_x86cpu" = x"true")
AM_CONDITIONAL(ARCH_X86_64, test x"$have_x86_64cpu" = x"true")
AM_CONDITIONAL(ARCH_PPC, test x"$have_ppccpu" = x"true")
dnl x86 & x86_64 architectures
dnl MMX support
dnl
explicit_mmx=no
AC_ARG_ENABLE(mmx,
AC_HELP_STRING([--enable-mmx],
[enable MMX code portions (yes)]),
[case "${enableval}" in
yes) use_mmx=yes ;;
no) use_mmx=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mmx) ;;
esac
explicit_mmx=yes],
[if test x"$have_x86cpu" = x"true" -o x"$have_x86_64cpu" = x"true" ; then
use_mmx=yes
else
use_mmx=no
fi])
have_asm_mmx="no"
if test x"$use_mmx" = x"yes" ; then
AC_MSG_CHECKING([if \$CC groks MMX inline assembly])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));])],
[have_asm_mmx="yes"])
if test x"$have_asm_mmx" = x"yes" ; then
AC_DEFINE([HAVE_ASM_MMX], 1,
[Define if your compiler understands MMX assembly instructions])
fi
AC_MSG_RESULT($have_asm_mmx)
if test x"$have_asm_mmx" = x"no" -a x"$explicit_mmx" = x"yes" ; then
AC_MSG_WARN(*** Ignoring --enable-mmx due to no compiler support ***)
fi
fi
AM_CONDITIONAL(HAVE_ASM_MMX, test x"$have_asm_mmx" = x"yes")
if test x"$have_asm_mmx" = x"no" ; then
AC_MSG_WARN(*** All MMX dependent parts will be disabled ***)
fi
dnl 3DNow support
dnl
explicit_3dnow=no
AC_ARG_ENABLE(3dnow,
AC_HELP_STRING([--enable-3dnow],
[enable 3DNow code portions (yes)]),
[case "${enableval}" in
yes) if test x"$have_asm_mmx" = x"no"; then
AC_MSG_ERROR(--enable-3dnow requires --enable-mmx)
else
use_3dnow=yes
fi ;;
no) use_3dnow=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-3dnow) ;;
esac
explicit_3dnow=yes],
[if test x"$have_asm_mmx" = x"yes" -a \( x"$have_x86cpu" = x"true" -o x"$have_x86_64cpu" = x"true" \) ; then
use_3dnow=yes
else
use_3dnow=no
fi])
have_asm_3dnow="no"
if test x"$use_3dnow" = x"yes" ; then
AC_MSG_CHECKING([if \$CC groks 3DNow inline assembly])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [void *p;asm volatile("pfmul %%mm3,%%mm4"::"r"(p));])],
[have_asm_3dnow="yes"])
if test x"$have_asm_3dnow" = x"yes" ; then
AC_DEFINE([HAVE_ASM_3DNOW], 1,
[Define if your compiler understands 3DNow assembly instructions])
fi
AC_MSG_RESULT($have_asm_3dnow)
if test x"$have_asm_3dnow" = x"no" -a x"$explicit_3dnow" = x"yes" ; then
AC_MSG_WARN(*** Ignoring --enable-3dnow due to no compiler support ***)
fi
fi
AM_CONDITIONAL(HAVE_ASM_3DNOW, test x"$have_asm_3dnow" = x"yes")
if test x"$have_asm_3dnow" = x"no" ; then
AC_MSG_WARN(*** All 3DNow dependent parts will be disabled ***)
fi
dnl SSE support
dnl
explicit_sse=no
AC_ARG_ENABLE(sse,
AC_HELP_STRING([--enable-sse],
[enable SSE code portions (yes)]),
[case "${enableval}" in
yes) if test x"$have_asm_mmx" = x"no"; then
AC_MSG_ERROR(--enable-sse requires --enable-mmx)
else
use_sse=yes
fi ;;
no) use_sse=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-sse) ;;
esac
explicit_sse=yes],
[if test x"$have_asm_mmx" = x"yes" -a \( x"$have_x86cpu" = x"true" -o x"$have_x86_64cpu" = x"true" \) ; then
use_sse=yes
else
use_sse=no
fi])
have_asm_sse="no"
if test x"$use_sse" = x"yes" ; then
AC_MSG_CHECKING([if \$CC groks SSE inline assembly])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [void *p; asm volatile("movntps %%xmm0, 0"::"r"(p));])],
[have_asm_sse=yes])
if test x"$have_asm_sse" = x"yes" ; then
AC_DEFINE([HAVE_ASM_SSE], 1,
[Define if your compiler understands SSE assembly instructions])
fi
AC_MSG_RESULT($have_asm_sse)
if test x"$have_asm_sse" = x"no" -a x"$explicit_sse" = x"yes" ; then
AC_MSG_WARN(*** Ignoring --enable-sse due to no compiler support ***)
fi
fi
AM_CONDITIONAL(HAVE_ASM_SSE, test x"$have_asm_sse" = x"yes")
if test x"$have_asm_sse" = x"no" ; then
AC_MSG_WARN(*** All SSE dependent parts will be disabled ***)
fi
dnl SSE2 support
dnl
explicit_sse2=no
AC_ARG_ENABLE(sse2,
AC_HELP_STRING([--enable-sse2],
[enable SSE2 code portions (yes)]),
[case "${enableval}" in
yes) if test x"$have_asm_sse" = x"no"; then
AC_MSG_ERROR(--enable-sse2 requires --enable-sse)
else
use_sse2=yes
fi ;;
no) use_sse2=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-sse2) ;;
esac
explicit_sse2=yes],
[if test x"$have_asm_sse" = x"yes" -a \( x"$have_x86cpu" = x"true" -o x"$have_x86_64cpu" = x"true" \) ; then
use_sse2=yes
else
use_sse2=no
fi])
have_asm_sse2="no"
if test x"$use_sse2" = x"yes" ; then
AC_MSG_CHECKING([if \$CC can handle SSE2 inline asm])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [void *p; asm volatile("movdqa %%xmm2, %%xmm3"::"r"(p));])],
[have_asm_sse2=yes])
if test x"$have_asm_sse2" = x"yes" ; then
AC_DEFINE([HAVE_ASM_SSE2], 1,
[Define if your compiler understands SSE2 assembly instructions])
fi
AC_MSG_RESULT($have_asm_sse2)
if test x"$have_asm_sse2" = x"no" -a x"$explicit_sse2" = x"yes" ; then
AC_MSG_WARN(*** Ignoring --enable-sse2 due to no compiler support ***)
fi
fi
AM_CONDITIONAL(HAVE_ASM_SSE2, test x"$have_asm_sse2" = x"yes")
if test x"$have_asm_sse2" = x"no" ; then
AC_MSG_RESULT(*** All SSE2 dependent parts will be disabled ***)
fi
dnl ppc architectures
dnl
dnl Altivec support
dnl
AC_ARG_ENABLE(altivec,
AC_HELP_STRING([--enable-altivec],
[enable Altivec code portions (yes)]),
[case "${enableval}" in
yes) use_altivec=yes ;;
no) use_altivec=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-altivec) ;;
esac],
[if test x"$have_ppccpu" = x"true" ; then
use_altivec=yes
else
use_altivec=no
fi])
dnl if test x"$use_altivec" = x"no" ; then
dnl AC_MSG_WARN(*** All Altivec dependent parts will be disabled ***)
dnl fi
AC_MSG_CHECKING([if \$CC groks AltiVec inline assembly])
have_asm_altivec=no
if test x"$use_altivec" = x"yes" ; then
AC_COMPILE_IFELSE([AC_LANG_SOURCE([], [asm volatile("vperm 0,1,2,3");])],
[have_asm_altivec=yes],
[save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wa,-m7400"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([], [asm volatile("vperm 0,1,2,3");])],
[have_asm_altivec=yes])
CFLAGS="$save_CFLAGS"])
fi
AC_MSG_RESULT($have_asm_altivec)
if test x"$have_asm_altivec" = x"yes" ; then
AC_DEFINE([HAVE_ASM_ALTIVEC], 1,
[Define if your compiler understands AltiVec inline assembly])
fi
AC_MSG_CHECKING([if \$CC groks AltiVec C extensions])
have_c_altivec=no
if test x"$use_altivec" = x"yes" ; then
# Darwin test
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -faltivec"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [vec_mtvscr((vector unsigned int)(0));])],
[have_c_altivec=yes
ALTIVEC_CFLAGS="-faltivec"],
[# Linux/PPC test
CFLAGS="${save_CFLAGS} -fvec"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [vec_mtvscr((vector unsigned int)(0));])],
[have_c_altivec=yes
ALTIVEC_CFLAGS="-fvec"])
])
CFLAGS="$save_CFLAGS"
fi
AC_MSG_RESULT($have_c_altivec)
AM_CONDITIONAL(CAN_COMPILE_C_ALTIVEC, test x"$have_c_altivec" = x"yes")
if test x"$have_c_altivec" = x"yes" ; then
AC_DEFINE([CAN_COMPILE_C_ALTIVEC], 1,
[Define if your compiler groks C AltiVec extensions.])
AC_SUBST(ALTIVEC_CFLAGS)
fi
AC_MSG_CHECKING([if linker needs -framework vecLib])
if test x"$use_altivec" = x"yes" ; then
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -framework vecLib"
ld_altivec=no
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [ld_altivec=yes])
LDFLAGS="$save_LDFLAGS"
fi
AC_MSG_RESULT($ld_altivec)
if test x"$ld_altivec" = x"yes" ; then
LDFLAGS="$LDFLAGS -framework vecLib"
fi
dnl ---------------------------------------------------------------------
dnl
dnl pkgconfig
dnl
PKG_PROG_PKG_CONFIG([0.20])
if test -z "$PKG_CONFIG" ; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
dnl ---------------------------------------------------------------------
dnl X11 checks
AC_PATH_XTRA
if test x"${no_x}" = x"yes" ; then
AC_MSG_WARN(can not find X11)
USE_X11=no
else
AC_DEFINE([HAVE_X11], 1, [Have X11 support])
USE_X11=yes
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(X_PRE_LIBS)
AC_SUBST(X_EXTRA_LIBS)
AC_SUBST(X_LIBS)
AC_SUBST(x_includes)
AC_SUBST(x_libraries)
dnl fi
AM_CONDITIONAL(HAVE_X11, test x"${USE_X11}" = x"yes")
if test x"${USE_X11}" = x"yes" ; then
AC_CHECK_LIB(Xv, XvQueryExtension,
[have_xv=yes
AC_DEFINE([HAVE_LIBXV], 1,
[Have libxv support])],
[have_xv=no],
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
AC_CHECK_LIB(X11, XShmQueryExtension,
[have_xshm=yes
AC_DEFINE([HAVE_X11_SHM], 1,
[Have Xshm support])],
[have_xshm=no],
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
AC_CHECK_HEADERS([X11/Xaw/Simple.h],
[have_xaw_simple=yes
AC_DEFINE([HAVE_XAW_SIMPLE], 1,
[Have the Xaw Simple.h file support])],
[have_xaw_simple=no])
AC_CHECK_LIB(Xpm, XpmFreeAttributes,
[have_xpm=yes
AC_DEFINE([HAVE_LIBXPM], 1,
[Have libXpm support])],
[have_xpm=no],
[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
else
have_xv="no"
have_xshm="no"
have_xaw_simple="no"
have_xpm="no"
fi
AM_CONDITIONAL(HAVE_LIBXV, test x"$have_xv" = x"yes")
AM_CONDITIONAL(HAVE_X11_SHM, test x"$have_xshm" = x"yes")
AM_CONDITIONAL(HAVE_XAW_SIMPLE, test x"$have_xaw_simple" = x"yes" )
AM_CONDITIONAL(HAVE_LIBXPM, test x"$have_xpm" = x"yes")
dnl end X11 checks
dnl ---------------------------------------------------------------------
AC_CHECK_LIB(z, gzopen,
[],
[AC_MSG_ERROR([transcode depends on libz, but cannot links against libz])],
[])
AC_CHECK_LIB(m, sin,
[],
[AC_MSG_ERROR([transcode depends on libm (>= 2.0), but cannot link against libm])],
[-lc])
TC_PKG_INIT
have_libavcodec=no
have_libavformat=no
AC_MSG_CHECKING([for ffmpeg support])
AC_ARG_ENABLE(ffmpeg,
AC_HELP_STRING([--enable-ffmpeg],
[enable support for FFmpeg libraries - RECOMMENDED (yes)]),
[case "${enableval}" in
yes) ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ffmpeg) ;;
esac],
[enable_ffmpeg=yes])
if test x"$enable_ffmpeg" = x"no" ; then
AC_MSG_RESULT(disabled)
else
AC_MSG_RESULT(requested, checking for libraries)
dnl
dnl libavcodec
dnl
TC_PKG_CONFIG_CHECK(libavcodec, "$enable_ffmpeg", LIBAVCODEC, libavcodec, [http://www.ffmpeg.org/])
dnl
dnl libavformat
dnl
TC_PKG_CONFIG_CHECK(libavformat, "$enable_ffmpeg", LIBAVFORMAT, libavformat, [http://www.ffmpeg.org/])
AC_DEFINE([HAVE_FFMPEG], 1, [Have FFmpeg libraries support])
fi
TC_PKG_HAVE(libavcodec, LIBAVCODEC)
TC_PKG_HAVE(libavformat, LIBAVFORMAT)
AM_CONDITIONAL(HAVE_FFMPEG, test x"$enable_ffmpeg" = x"yes")
dnl
dnl setup layout define once
dnl
dnl
dnl libv4l toolkit
dnl
TC_PKG_CONFIG_CHECK(libv4l2, no, LIBV4L2, libv4l2,
[http://hansdegoede.livejournal.com/3636.html])
TC_PKG_CONFIG_CHECK(libv4lconvert, no, LIBV4LCONVERT,
libv4lconvert,
[http://hansdegoede.livejournal.com/3636.html])
TC_PKG_HAVE(libv4l2, LIBV4L2)
TC_PKG_HAVE(libv4lconvert, LIBV4LCONVERT)
dnl
dnl libmpeg2
dnl
TC_PKG_CONFIG_CHECK(libmpeg2, no, LIBMPEG2, libmpeg2,
[http://libmpeg2.sf.net/])
TC_PKG_CONFIG_CHECK(libmpeg2convert, no, LIBMPEG2CONVERT,
libmpeg2convert, [http://libmpeg2.sf.net/])
TC_PKG_HAVE(libmpeg2, LIBMPEG2)
TC_PKG_HAVE(libmpeg2convert, LIBMPEG2CONVERT)
dnl
dnl build options
dnl
dnl
dnl support for new/experimental features (1.1.0: NMS)
dnl
AC_MSG_CHECKING([enable new or experimental components])
AC_ARG_ENABLE(experimental,
AC_HELP_STRING([--enable-experimental],
[enable new, experimental or even incomplete transcode components (no)]),
[case "${enableval}" in
yes) ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-experimental) ;;
esac],
[enable_experimental=no])
AC_MSG_RESULT($enable_experimental)
if test x"$enable_experimental" = x"yes" ; then
AC_DEFINE([ENABLE_EXPERIMENTAL], 1, [Enable experimental components])
fi
AM_CONDITIONAL(ENABLE_EXPERIMENTAL, test x"$enable_experimental" = x"yes")
dnl
dnl support for deprecated features (1.1.0: tcrequant)
dnl
AC_MSG_CHECKING([enable deprecated components])
AC_ARG_ENABLE(deprecated,
AC_HELP_STRING([--enable-deprecated],
[enable deprecated or even broken transcode components (no)]),
[case "${enableval}" in
yes) ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-deprecated) ;;
esac],
[enable_deprecated=no])
AC_MSG_RESULT($enable_deprecated)
if test x"$enable_deprecated" = x"yes" ; then
AC_DEFINE([ENABLE_DEPRECATED], 1, [Enable deprecated components])
fi
AM_CONDITIONAL(ENABLE_DEPRECATED, test x"$enable_deprecated" = x"yes")
dnl
dnl static import frame buffer
dnl
AC_MSG_CHECKING([for internal static framebuffer support])
AC_ARG_ENABLE(statbuffer,
AC_HELP_STRING([--enable-statbuffer],
[enable internal static framebuffer support; recommended (yes)]),
[case "${enableval}" in
yes) ;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-statbuffer) ;;
esac],
[enable_statbuffer=yes])
AC_MSG_RESULT($enable_statbuffer)
if test x"$enable_statbuffer" = x"yes" ; then
AC_DEFINE([STATBUFFER], 1, [Use the static buffers])
fi
dnl
dnl hardware/OS dependent modules
dnl
dnl
dnl v4l
dnl
TC_CHECK_V4L(AC_DEFINE([HAVE_V4L], 1, [Have video4linux(2)]))
AM_CONDITIONAL(HAVE_V4L, test x"$have_v4l" = x"yes")
AM_CONDITIONAL(HAVE_V4L2, test x"$have_v4l2" = x"yes")
dnl
dnl bktr
dnl
TC_CHECK_BKTR(AC_DEFINE([HAVE_BKTR], 1, [Have bktr(4)]))
AM_CONDITIONAL(HAVE_BKTR, test x"$have_bktr" = x"yes")
dnl
dnl sunau
dnl
TC_CHECK_SUNAU(AC_DEFINE([HAVE_SUNAU], 1, [Have Sun style audio(4)]))
AM_CONDITIONAL(HAVE_SUNAU, test x"$have_sunau" = x"yes")
dnl
dnl OSS
dnl
TC_CHECK_OSS(AC_DEFINE([HAVE_OSS], 1, [Have OSS audio]))
AM_CONDITIONAL(HAVE_OSS, test x"$have_oss" = x"yes")
dnl
dnl ALSA
dnl
TC_CHECK_ALSA(AC_DEFINE([HAVE_ALSA], 1, [Have ALSA audio]))
AM_CONDITIONAL(HAVE_ALSA, test x"$have_alsa" = x"yes")
dnl
dnl optional 3rd party package support
dnl
dnl
dnl Divx4linux
dnl
AC_CHECK_HEADERS([encore2.h])
dnl
dnl libpostproc
dnl
TC_PKG_CONFIG_CHECK(libpostproc, no, LIBPOSTPROC, libpostproc, [http://ffmpeg.mplayerhq.hu/])
TC_PKG_HAVE(libpostproc, LIBPOSTPROC)
dnl
dnl freetype2
dnl
TC_PKG_CONFIG_CHECK(freetype2, no, FREETYPE2, freetype2, [http://www.freetype.org/])
TC_PKG_HAVE(freetype2, FREETYPE2)
dnl
dnl lame
dnl
TC_PKG_CHECK(lame, yes, LAME, no, none, mp3lame, lame_init, lame,
[http://www.mp3dev.org/])
if test x"$have_lame" = x"yes" ; then
lame_inc="no"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $lame_ii"
AC_CHECK_HEADER([lame/lame.h],
[AC_DEFINE([HAVE_LAME_INC], [1],
[Have Lame includes in separate path]) lame_inc=yes])
if test x"$lame_inc" = x"no" ; then
AC_CHECK_HEADER([lame.h], lame_inc="yes")
fi
if test x"$lame_inc" = x"no" ; then
have_lame="no"
TC_PKG_ERROR(lame, lame.h, yes, lame, [http://www.mp3dev.org/],
[cannot compile lame.h])
else
LAME_CFLAGS="$lame_ii"
fi
CPPFLAGS="$save_CPPFLAGS"
AC_MSG_CHECKING([lame version])
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LAME_CFLAGS"
LIBS="$LIBS $LAME_LIBS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#ifdef HAVE_LAME_INC
#include <lame/lame.h>
#else
#include <lame.h>
#endif
int main () {
lame_version_t lv;
get_lame_version_numerical(&lv);
if(lv.alpha || lv.beta) lv.minor--;
printf("%d%d\n", lv.major, lv.minor);
return 0;
}
]])],
[lame_version="`./conftest$ac_exeext`"],
[AC_MSG_RESULT([failed])
TC_PKG_ERROR(lame, lame.h, yes, lame, [http://www.mp3dev.org/],
[cannot compile and run a test program])],,
[AC_MSG_RESULT([cross compiling; assumed OK...])])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test 393 -ge "$lame_version" ; then
have_lame="no"
TC_PKG_ERROR(lame, lame.h, yes, lame, [http://www.mp3dev.org/],
[lame version < 3.93])
fi
fi
TC_PKG_HAVE(lame, LAME)
dnl
dnl xvid
dnl
TC_PKG_CHECK(xvid, no, xvid, no, xvid.h, xvidcore, xvid_global, xvid,
[http://www.xvid.org/])
if test x"$have_xvid" = x"yes" ; then
AC_MSG_CHECKING([xvid version >= 1.0])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <xvid.h>
int main() {
printf("%s\n", (XVID_API >= XVID_MAKE_API(4, 0)) ?"yes" :"no");
return 0;
}
]])],
[xvid_version_ok="`./conftest$ac_exeext`"],
[AC_MSG_RESULT([failed])
TC_PKG_ERROR(xvid, xvid.h, yes, xvid, [http://www.xvid.org/],
[cannot compile and run a test program])],,
[AC_MSG_RESULT([cross compiling; assumed OK...])])
if test x"$xvid_version_ok" = x"yes"; then
XVID_LIBS="-lxvidcore"
else
have_xvid="no"
TC_PKG_ERROR(xvid, xvid.h, yes, xvid, [http://www.xvid.org/],
[XviD version < 1.0])
fi
fi
TC_PKG_HAVE(xvid, XVID)
dnl
dnl x264
dnl
TC_PKG_CONFIG_CHECK(x264, no, X264, x264, [http://developers.videolan.org/x264.html])
if test x"$have_x264" = x"yes" ; then
AC_MSG_CHECKING([x264 version])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdint.h> /* required by x264.h */
#include <x264.h>
int main() {
printf("%d\n", X264_BUILD);
return 0;
}
]])],
[x264_version="`./conftest$ac_exeext`"],
[AC_MSG_RESULT([failed])
TC_PKG_ERROR(x264, x264.h, yes, x264,
[http://developers.videolan.org/x264.html],
[cannot compile and run a test program])],
[AC_MSG_RESULT([cross compiling; assumed OK...])
x264_version=54])
if test 54 -gt "$x264_version"; then
have_x264="no"
TC_PKG_ERROR(x264, x264.h, yes, x264,
[http://developers.videolan.org/x264.html],
[x264 version too old (must be at least 54)])
fi
fi
TC_PKG_HAVE(x264, X264)
dnl
dnl ogg
dnl
TC_PKG_CONFIG_CHECK(ogg, no, OGG, ogg, [http://www.xiph.org/ogg/])
TC_PKG_HAVE(ogg, OGG)
dnl
dnl vorbis
dnl
TC_PKG_CONFIG_CHECK(vorbis, no, VORBIS, vorbis, [http://www.xiph.org/ogg/vorbis/])
TC_PKG_HAVE(vorbis, VORBIS)
dnl
dnl theora
dnl
TC_PKG_CONFIG_CHECK(theora, no, THEORA, theora, [http://www.theora.org/])
TC_PKG_HAVE(theora, THEORA)
dnl
dnl libdvdread
dnl
LIBDVDREAD_EXTRA_LIBS="$LIBDVDREAD_EXTRA_LIBS -lm"
TC_PKG_CHECK(libdvdread, yes, LIBDVDREAD, no, none, dvdread, DVDOpen,
libdvdread, [http://www.dtek.chalmers.se/groups/dvd/downloads.shtml])
if test x"$have_libdvdread" = x"yes" ; then
libdvdread_inc="no"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $libdvdread_ii"
AC_CHECK_HEADER([dvdread/dvd_reader.h],
[AC_DEFINE([HAVE_LIBDVDREAD_INC], [1],
[have libdvdread includes in separate path])
libdvdread_inc="yes"])
if test x"$libdvdread_inc" = x"no" ; then
AC_CHECK_HEADER([dvd_reader.h],
[libdvdread_inc="yes"])
fi
CPPFLAGS="$save_CPPFLAGS"
if test x"$libdvdread_inc" = x"no" ; then
have_libdvdread="no"
TC_PKG_ERROR(libdvdread, dvd_reader.h, yes, libdvdread,
[http://www.dtek.chalmers.se/groups/dvd/downloads.shtml],
[cannot compile dvd_reader.h])
else
LIBDVDREAD_CFLAGS="$libdvdread_ii"
fi
fi
TC_PKG_HAVE(libdvdread, LIBDVDREAD)
dnl
dnl PVM3
dnl
PVM3_EXTRA_LIBS="$PVM3_EXTRA_LIBS -lgpvm3"
TC_PKG_CHECK(pvm3, no, PVM3, no, pvm3.h, pvm3, pvm_initsend,
pvm3, [])
if test x"$have_pvm3" = x"yes" ; then
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PVM3_CFLAGS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <pvm3.h>
int main ()
{
if ((PVM_MAJOR_VERSION == 3) && (PVM_MINOR_VERSION < 4))
{
printf("You need to upgrade pvm3 to version > 3.4\n");
return(1);
}
if (PVM_MAJOR_VERSION < 3)
{
printf("You need to upgrade pvm3 to version > 3.4\n");
return(1);
}
return 0;
}
]])],
[have_pvm3="yes"],
[have_pvm3="no"],
[AC_MSG_RESULT([cross compiling; assumed OK...])
have_pvm3="yes"])
CPPFLAGS="$save_CPPFLAGS"
# also include the in-tree pvm3 headers
PVM3_CFLAGS="$PVM3_CFLAGS -I\$(top_srcdir)/pvm3"
PVM3_PVMGS="$w_pvm3_l/pvmgs"
fi
AC_SUBST(PVM3_PVMGS)
TC_PKG_HAVE(pvm3, PVM3)
dnl
dnl libdv
dnl
TC_PKG_CONFIG_CHECK(libdv, no, LIBDV, libdv, [http://libdv.sourceforge.net/])
TC_PKG_HAVE(libdv, LIBDV)
dnl
dnl libquicktime
dnl
TC_PKG_CONFIG_CHECK(libquicktime, no, LIBQUICKTIME, libquicktime,
[http://libquicktime.sourceforge.net/])
if test x"$have_libquicktime" = x"yes" ; then
AC_CHECK_LIB(quicktime, lqt_encode_video,
[AC_DEFINE([LIBQUICKTIME_000904], [1], [Have libquicktime 1.0.0 or newer])],
[],
[$LIBQUICKTIME_LIBS $LIBQUICKTIME_EXTRA_LIBS])
fi
TC_PKG_HAVE(libquicktime, LIBQUICKTIME)
dnl
dnl LZO
dnl
TC_PKG_CHECK(lzo, no, LZO, no, [lzo/lzo1x.h], lzo2, lzo_version, lzo,
[http://www.oberhumer.com/opensource/lzo/])
TC_PKG_HAVE(lzo, LZO)
dnl
dnl A52
dnl
A52_EXTRA_LIBS="$A52_EXTRA_LIBS -lm"
TC_PKG_CHECK(a52, no, A52, no, [a52dec/a52.h], a52, a52_init, liba52,
[http://liba52.sourceforge.net/])
TC_PKG_HAVE(a52, A52)