forked from GStreamer/gst-plugins-bad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2778 lines (2501 loc) · 83.7 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
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
AC_PREREQ([2.69])
dnl initialize autoconf
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, git and prerelease does Werror too
AC_INIT([GStreamer Bad Plug-ins],[1.15.0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-bad])
AG_GST_INIT
dnl initialize automake
AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
dnl define PACKAGE_VERSION_* variables
AS_VERSION
dnl check if this is a release version
AS_NANO(GST_GIT="no", GST_GIT="yes")
dnl can autoconf find the source ?
AC_CONFIG_SRCDIR([docs/plugins/gst-plugins-bad-plugins-docs.sgml])
dnl define the output header for config
AC_CONFIG_HEADERS([config.h])
dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
AM_MAINTAINER_MODE([enable])
dnl sets host_* variables
AC_CANONICAL_HOST
dnl use pretty build output with automake >= 1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
[AM_DEFAULT_VERBOSITY=1
AC_SUBST(AM_DEFAULT_VERBOSITY)])
dnl PKG_CONFIG_SYSROOT_DIR is a valid environment variable
m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
dnl our libraries and install dirs use GST_API_VERSION in the filename
dnl to allow side-by-side installation of different API versions
GST_API_VERSION=1.0
AC_SUBST(GST_API_VERSION)
AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
[GStreamer API Version])
AG_GST_LIBTOOL_PREPARE
dnl CURRENT, REVISION, AGE
dnl - library source changed -> increment REVISION
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
dnl sets GST_LT_LDFLAGS
AS_LIBTOOL(GST, 1500, 0, 1500)
dnl *** required versions of GStreamer stuff ***
GST_REQ=1.15.0.1
GSTPB_REQ=1.15.0.1
dnl *** autotools stuff ****
dnl allow for different autotools
AS_AUTOTOOLS_ALTERNATE
dnl Add parameters for aclocal
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
dnl set up gettext
dnl the version check needs to stay here because autopoint greps for it
AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])
AG_GST_GETTEXT([gst-plugins-bad-$GST_API_VERSION])
dnl *** check for arguments to configure ***
AG_GST_ARG_DISABLE_FATAL_WARNINGS
AG_GST_ARG_ENABLE_EXTRA_CHECKS
AG_GST_ARG_DEBUG
AG_GST_ARG_PROFILING
AG_GST_ARG_VALGRIND
AG_GST_ARG_GCOV
AG_GST_ARG_EXAMPLES
AG_GST_ARG_WITH_PKG_CONFIG_PATH
AG_GST_ARG_WITH_PACKAGE_NAME
AG_GST_ARG_WITH_PACKAGE_ORIGIN
AG_GST_ARG_WITH_PLUGINS
AG_GST_ARG_ENABLE_EXTERNAL
AG_GST_ARG_ENABLE_EXPERIMENTAL
AG_GST_PKG_CONFIG_PATH
dnl *** checks for platform ***
AG_GST_PLATFORM
dnl * hardware/architecture *
dnl common/m4/gst-arch.m4
dnl check CPU type
AG_GST_ARCH
dnl Determine endianness
AC_C_BIGENDIAN
dnl *** software ***
dnl check for large file support
dnl affected plugins must include config.h
AC_SYS_LARGEFILE
dnl *** checks for programs ***
dnl find a compiler
AC_PROG_CC
AC_PROG_CC_STDC
dnl determine c++ compiler
AC_PROG_CXX
dnl determine if c++ is available on this system
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
AC_PROG_OBJC
dnl check if the compiler supports '-c' and '-o' options
AM_PROG_CC_C_O
dnl check if the compiler supports do while(0) macros
AG_GST_CHECK_DOWHILE_MACROS
AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
dnl check for gobject-introspection
GOBJECT_INTROSPECTION_CHECK([1.31.1])
dnl check for documentation tools
GTK_DOC_CHECK([1.12])
AG_GST_PLUGIN_DOCS([1.12])
dnl *** checks for libraries ***
dnl check for libm, for sin() etc.
LT_LIB_M
AC_SUBST(LIBM)
AC_FUNC_MMAP
dnl check for pthreads
AX_PTHREAD
dnl *** checks for header files ***
AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
if test "x$HAVE_UNISTD_H" != "xyes"; then
GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
fi
AC_CHECK_HEADERS([sys/time.h])
dnl used by ext/dts
AX_CREATE_STDINT_H
AC_CHECK_HEADERS([pthread.h], HAVE_PTHREAD_H=yes)
AM_CONDITIONAL(HAVE_PTHREAD_H, test "x$HAVE_PTHREAD_H" = "xyes")
dnl *** checks for types/defines ***
dnl *** checks for structures ***
dnl *** checks for compiler characteristics ***
dnl *** checks for library functions ***
AC_CHECK_FUNCS([gmtime_r pipe2])
dnl *** checks for headers ***
AC_CHECK_HEADERS([sys/utsname.h])
dnl *** checks for dependency libraries ***
dnl *** checks for socket and nsl libraries ***
AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
dnl GLib is required
GLIB_REQ=2.40.0
AG_GST_GLIB_CHECK([$GLIB_REQ])
dnl Needed by plugins that use g_module_*() API
PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
dnl checks for gstreamer
dnl uninstalled is selected preferentially -- see pkg-config(1)
AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
AG_GST_CHECK_GST_NET($GST_API_VERSION, [$GST_REQ], yes)
AG_GST_PKG_CHECK_MODULES(GST_VIDEO, gstreamer-video-[$GST_API_VERSION], [$GSTPB_REQ], yes)
AG_GST_PKG_CHECK_MODULES(GST_AUDIO, gstreamer-audio-[$GST_API_VERSION], [$GSTPB_REQ], yes)
AG_GST_PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-[$GST_API_VERSION], [$GSTPB_REQ], yes)
AG_GST_PKG_CHECK_MODULES(GST_GL, gstreamer-gl-[$GST_API_VERSION], [$GSTPB_REQ], no)
AG_GST_PKG_CHECK_MODULES(GST_SDP, gstreamer-sdp-[$GST_API_VERSION], [$GSTPB_REQ], yes)
if test "x$HAVE_GST_GL" = "xyes"; then
AC_MSG_CHECKING([GStreamer OpenGL window systems ...])
GST_GL_WINSYS=`$PKG_CONFIG --variable=gl_winsys gstreamer-gl-1.0`
AC_MSG_RESULT([$GST_GL_WINSYS])
GST_GL_HAVE_WINDOW_X11=""
GST_GL_HAVE_WINDOW_WAYLAND=""
GST_GL_HAVE_WINDOW_ANDROID=""
GST_GL_HAVE_WINDOW_COCOA=""
GST_GL_HAVE_WINDOW_EAGL=""
case "$GST_GL_WINSYS" in *x11*) GST_GL_HAVE_WINDOW_X11="1" ;; esac
case "$GST_GL_WINSYS" in *wayland*) GST_GL_HAVE_WINDOW_WAYLAND="1" ;; esac
case "$GST_GL_WINSYS" in *android*) GST_GL_HAVE_WINDOW_ANDROID="1" ;; esac
case "$GST_GL_WINSYS" in *cocoa*) GST_GL_HAVE_WINDOW_COCOA="1" ;; esac
case "$GST_GL_WINSYS" in *eagl*) GST_GL_HAVE_WINDOW_EAGL="1" ;; esac
AC_MSG_CHECKING([GStreamer OpenGL platforms ...])
GST_GL_PLATFORMS=`$PKG_CONFIG --variable=gl_platforms gstreamer-gl-1.0`
AC_MSG_RESULT([$GST_GL_PLATFORMS])
GST_GL_HAVE_PLATFORM_GLX=""
GST_GL_HAVE_PLATFORM_EGL=""
GST_GL_HAVE_PLATFORM_CGL=""
GST_GL_HAVE_PLATFORM_EAGL=""
case "$GST_GL_PLATFORMS" in *glx*) GST_GL_HAVE_PLATFORM_GLX="1" ;; esac
case "$GST_GL_PLATFORMS" in *egl*) GST_GL_HAVE_PLATFORM_EGL="1" ;; esac
case "$GST_GL_PLATFORMS" in *cgl*) GST_GL_HAVE_PLATFORM_CGL="1" ;; esac
case "$GST_GL_PLATFORMS" in *eagl*) GST_GL_HAVE_PLATFORM_EAGL="1" ;; esac
AC_MSG_CHECKING([GStreamer OpenGL apis ...])
GST_GL_APIS=`$PKG_CONFIG --variable=gl_apis gstreamer-gl-1.0`
AC_MSG_RESULT([$GST_GL_APIS])
GST_GL_HAVE_API_GLES2=""
GST_GL_HAVE_API_GL=""
case "$GST_GL_APIS" in *gles2*) GST_GL_HAVE_API_GLES2="1" ;; esac
case "$GST_GL_APIS" in "gl"|"gl "*|*" gl"|*" gl "*) GST_GL_HAVE_API_GL="1" ;; esac
fi
AM_CONDITIONAL(USE_OPENGL, test "x$GST_GL_HAVE_API_GL" = "x1")
AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
dnl check for uninstalled plugin directories for unit tests
AG_GST_CHECK_UNINSTALLED_SETUP([
AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [$GSTPB_REQ])
AG_GST_CHECK_GST_PLUGINS_UGLY($GST_API_VERSION, [$GSTPB_REQ])
AG_GST_CHECK_GST_PLUGINS_LIBAV($GST_API_VERSION, [$GSTPB_REQ])
])
dnl Check for documentation xrefs
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
AC_SUBST(GLIB_PREFIX)
AC_SUBST(GST_PREFIX)
AC_SUBST(GSTPB_PREFIX)
dnl GTK is optional and used in examples
HAVE_GTK=NO
GTK2_REQ=2.14.0
GTK3_REQ=2.91.3
if test "x$BUILD_EXAMPLES" = "xyes"; then
AC_MSG_CHECKING([which gtk+ version to compile examples against (optional)])
AC_ARG_WITH([gtk],
AS_HELP_STRING([--with-gtk=3.0|2.0],[which gtk+ version to compile against (default: 2.0)]),
[case "$with_gtk" in
2.0) GTK_REQ=$GTK2_REQ ;;
3.0) GTK_REQ=$GTK3_REQ ;;
*) AC_MSG_ERROR([invalid gtk+ version specified]);;
esac],
[with_gtk=2.0
GTK_REQ=$GTK2_REQ])
AC_MSG_RESULT([$with_gtk (>= $GTK_REQ)])
PKG_CHECK_MODULES(GTK, gtk+-x11-$with_gtk >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
fi
AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
dnl Check for -Bsymbolic-functions linker flag used to avoid
dnl intra-library PLT jumps, if available.
AC_ARG_ENABLE(Bsymbolic,
[AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
[SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
LDFLAGS=-Wl,-Bsymbolic-functions
LIBS=
AC_TRY_LINK([], [return 0],
AC_MSG_RESULT(yes)
enable_Bsymbolic=yes,
AC_MSG_RESULT(no)
enable_Bsymbolic=no)
LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
dnl *** set variables based on configure arguments ***
dnl GTK is optional and used in examples
HAVE_GTK3=NO
HAVE_GTK3_WAYLAND=""
if test "x$BUILD_EXAMPLES" = "xyes"; then
PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.4, HAVE_GTK3=yes, HAVE_GTK3=no)
if test "x$HAVE_GTK3" = "xyes"; then
HAVE_GTK=yes
GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
AC_SUBST(GTK_VERSION)
GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
AC_SUBST(GTK_BASE_DIR)
GTK3_TARGETS=`$PKG_CONFIG --variable=targets gtk+-3.0`
case "$GTK3_TARGETS" in *wayland*) HAVE_GTK3_WAYLAND="1" ;; esac
fi
fi
AC_SUBST(GTK3_LIBS)
AC_SUBST(GTK3_CFLAGS)
AC_SUBST(HAVE_GTK3)
AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
AM_CONDITIONAL(HAVE_GTK3_WAYLAND, test "x$HAVE_GTK3_WAYLAND" = "x1")
dnl x11 is optional for librfb
HAVE_X11=NO
PKG_CHECK_MODULES(X11, x11, HAVE_X11=yes, HAVE_X11=no)
AC_SUBST(X11_LIBS)
AC_SUBST(X11_CFLAGS)
AC_SUBST(HAVE_X11)
AM_CONDITIONAL(HAVE_X11, test "x$HAVE_X11" = "xyes")
if test "x$HAVE_X11" = "xyes"; then
AC_DEFINE(HAVE_X11, 1, [Define if you have X11 library])
fi
dnl exif (used on jifmux tests) ****
PKG_CHECK_MODULES(EXIF, libexif >= 0.6.16, HAVE_EXIF="yes", HAVE_EXIF="no")
AC_SUBST(EXIF_LIBS)
AC_SUBST(EXIF_CFLAGS)
AM_CONDITIONAL(USE_EXIF, test "x$HAVE_EXIF" = "xyes")
AG_GST_CHECK_FEATURE(IQA, [iqa], iqa , [
PKG_CHECK_MODULES(DSSIM, dssim, [
HAVE_DSSIM="yes"
HAVE_IQA="yes"
], [
HAVE_DSSIM="no"
HAVE_IQA="no"
])
if test "x$HAVE_DSSIM" = "xyes"; then
AC_DEFINE(HAVE_DSSIM, 1, [Define if you have dssim library])
fi
AC_SUBST(DSSIM_LIBS)
AC_SUBST(DSSIM_CFLAGS)
])
AM_CONDITIONAL(HAVE_DSSIM, test "x$HAVE_DSSIM" = "xyes")
dnl Orc
ORC_CHECK([0.4.17])
dnl set license and copyright notice
GST_LICENSE="LGPL"
AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
AC_SUBST(GST_LICENSE)
dnl define LIBDIR so we can inform people where we live
AS_AC_EXPAND(LIBDIR, $libdir)
AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
dnl set location of plugin directory
AG_GST_SET_PLUGINDIR
dnl set release date/time
AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
["${srcdir}/gst-plugins-bad.doap"],
[$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
dnl If only building static libraries, define GST_STATIC_COMPILATION. This is
dnl needed only on Windows, but it doesn't hurt to have it everywhere.
if test x$enable_static = xyes -a x$enable_shared = xno; then
GST_STATIC_CFLAGS="-DGST_STATIC_COMPILATION"
fi
AC_ARG_WITH([player-tests],
AS_HELP_STRING([--with-player-tests],[Enable GstPlayer tests that need network access (default: no)]))
if test x$with_player_tests = xyes; then
AC_PATH_PROG([WGET], [wget], no)
if test x$WGET = xno; then
AC_MSG_WARN([wget required for GstPlayer tests but not found - disabling])
with_player_tests=no
fi
fi
AM_CONDITIONAL(WITH_GST_PLAYER_TESTS, test "x$with_player_tests" = "xyes")
# set by AG_GST_PARSE_SUBSYSTEM_DISABLES above
dnl make sure it doesn't complain about unused variables if debugging is disabled
NO_WARNINGS=""
AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""])
dnl define an ERROR_CFLAGS Makefile variable
dnl -Waggregate-return - libexif returns aggregates
dnl -Wundef - Windows headers check _MSC_VER unconditionally
AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
-Wwrite-strings -Wformat-security -Wold-style-definition
-Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar
-Wnested-externs $NO_WARNINGS])
dnl define an ERROR_CXXFLAGS Makefile variable
AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wredundant-decls
-Wwrite-strings -Wformat-nonliteral -Wformat-security
-Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar $NO_WARNINGS])
dnl define an ERROR_OBJCFLAGS Makefile variable
AG_GST_SET_ERROR_OBJCFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wredundant-decls
-Wwrite-strings -Wformat-nonliteral -Wformat-security
-Winit-self -Wmissing-include-dirs -Wno-multichar $NO_WARNINGS])
dnl define correct level for debugging messages
AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
dnl used in examples
AG_GST_DEFAULT_ELEMENTS
dnl *** plug-ins to include ***
dnl these are all the gst plug-ins, compilable without additional libs
AG_GST_CHECK_PLUGIN(accurip)
AG_GST_CHECK_PLUGIN(adpcmdec)
AG_GST_CHECK_PLUGIN(adpcmenc)
AG_GST_CHECK_PLUGIN(aiff)
AG_GST_CHECK_PLUGIN(videoframe_audiolevel)
AG_GST_CHECK_PLUGIN(asfmux)
AG_GST_CHECK_PLUGIN(audiobuffersplit)
AG_GST_CHECK_PLUGIN(audiofxbad)
AG_GST_CHECK_PLUGIN(audiolatency)
AG_GST_CHECK_PLUGIN(audiomixmatrix)
AG_GST_CHECK_PLUGIN(compositor)
AG_GST_CHECK_PLUGIN(audiovisualizers)
AG_GST_CHECK_PLUGIN(autoconvert)
AG_GST_CHECK_PLUGIN(bayer)
AG_GST_CHECK_PLUGIN(camerabin2)
AG_GST_CHECK_PLUGIN(coloreffects)
AG_GST_CHECK_PLUGIN(debugutils)
AG_GST_CHECK_PLUGIN(dvbsuboverlay)
AG_GST_CHECK_PLUGIN(dvdspu)
AG_GST_CHECK_PLUGIN(faceoverlay)
AG_GST_CHECK_PLUGIN(festival)
AG_GST_CHECK_PLUGIN(fieldanalysis)
AG_GST_CHECK_PLUGIN(freeverb)
AG_GST_CHECK_PLUGIN(frei0r)
AG_GST_CHECK_PLUGIN(gaudieffects)
AG_GST_CHECK_PLUGIN(geometrictransform)
AG_GST_CHECK_PLUGIN(gdp)
AG_GST_CHECK_PLUGIN(id3tag)
AG_GST_CHECK_PLUGIN(inter)
AG_GST_CHECK_PLUGIN(interlace)
AG_GST_CHECK_PLUGIN(ivfparse)
AG_GST_CHECK_PLUGIN(ivtc)
AG_GST_CHECK_PLUGIN(jp2kdecimator)
AG_GST_CHECK_PLUGIN(jpegformat)
AG_GST_CHECK_PLUGIN(librfb)
AG_GST_CHECK_PLUGIN(midi)
AG_GST_CHECK_PLUGIN(mpegdemux)
AG_GST_CHECK_PLUGIN(mpegtsdemux)
AG_GST_CHECK_PLUGIN(mpegtsmux)
AG_GST_CHECK_PLUGIN(mpegpsmux)
AG_GST_CHECK_PLUGIN(mxf)
AG_GST_CHECK_PLUGIN(netsim)
AG_GST_CHECK_PLUGIN(onvif)
AG_GST_CHECK_PLUGIN(pcapparse)
AG_GST_CHECK_PLUGIN(pnm)
AG_GST_CHECK_PLUGIN(proxy)
AG_GST_CHECK_PLUGIN(rawparse)
AG_GST_CHECK_PLUGIN(removesilence)
AG_GST_CHECK_PLUGIN(sdp)
AG_GST_CHECK_PLUGIN(segmentclip)
AG_GST_CHECK_PLUGIN(siren)
AG_GST_CHECK_PLUGIN(smooth)
AG_GST_CHECK_PLUGIN(speed)
AG_GST_CHECK_PLUGIN(subenc)
AG_GST_CHECK_PLUGIN(stereo)
AG_GST_CHECK_PLUGIN(timecode)
AG_GST_CHECK_PLUGIN(videofilters)
AG_GST_CHECK_PLUGIN(videoparsers)
AG_GST_CHECK_PLUGIN(videosignal)
AG_GST_CHECK_PLUGIN(vmnc)
AG_GST_CHECK_PLUGIN(y4m)
AG_GST_CHECK_PLUGIN(yadif)
dnl *** plug-ins to exclude ***
AC_CHECK_HEADER(AVFoundation/AVFoundation.h, HAVE_AVFOUNDATION="yes", HAVE_AVFOUNDATION="no", [-])
AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])
AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h, HAVE_VIDEOTOOLBOX="yes", HAVE_VIDEOTOOLBOX="no", [-])
if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
old_LIBS=$LIBS
LIBS="$LIBS -framework VideoToolbox"
AC_CHECK_FUNC(VTCompressionSessionPrepareToEncodeFrames, [
AC_DEFINE(HAVE_VIDEOTOOLBOX_10_9_6, 1, [Define if building with VideoToolbox >= 10.9.6])
], [
])
LIBS=$old_LIBS
fi
AM_CONDITIONAL(HAVE_AVFOUNDATION, test "x$HAVE_AVFOUNDATION" = "xyes")
if test "x$HAVE_AVFOUNDATION" = "xyes"; then
AC_DEFINE(HAVE_AVFOUNDATION, 1, [Define if building with AVFoundation])
fi
AM_CONDITIONAL(HAVE_IOS, test "x$HAVE_IOS" = "xyes")
if test "x$HAVE_IOS" = "xyes"; then
AC_DEFINE(HAVE_IOS, 1, [Define if building for Apple iOS])
fi
AM_CONDITIONAL(HAVE_VIDEOTOOLBOX, test "x$HAVE_VIDEOTOOLBOX" = "xyes")
if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then
AC_DEFINE(HAVE_VIDEOTOOLBOX, 1, [Define if building with VideoToolbox])
fi
dnl disable gst plugins we might not be able to build on this
dnl platform: (ugly but minimally invasive)
dnl FIXME: maybe move to sys, or make work with winsock2
AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
if test "x$HAVE_WINSOCK2_H" = "xyes"; then
WINSOCK2_LIBS="-lws2_32"
AC_SUBST(WINSOCK2_LIBS)
fi
dnl Vulkan
PKG_CHECK_MODULES(XCB, xcb >= 1.10, GST_VULKAN_HAVE_WINDOW_XCB=1, GST_VULKAN_HAVE_WINDOW_XCB=0)
AM_CONDITIONAL(USE_XCB, test "x$GST_VULKAN_HAVE_WINDOW_XCB" = "x1")
PKG_CHECK_MODULES(VULKAN_WAYLAND, wayland-client >= 1.4, GST_VULKAN_HAVE_WINDOW_WAYLAND=1, GST_VULKAN_HAVE_WINDOW_WAYLAND=0)
AM_CONDITIONAL(USE_WAYLAND, test "x$GST_VULKAN_HAVE_WINDOW_WAYLAND" = "x1")
VULKAN_CONFIG_DEFINES="
#define GST_VULKAN_HAVE_WINDOW_XCB $GST_VULKAN_HAVE_WINDOW_XCB
#define GST_VULKAN_HAVE_WINDOW_WAYLAND $GST_VULKAN_HAVE_WINDOW_WAYLAND"
AC_CONFIG_COMMANDS([ext/vulkan/vkconfig.h], [
outfile=vkconfig.h-tmp
cat > $outfile <<\_______EOF
/* vkconfig.h
*
* This is a generated file. Please modify `configure.ac'
*/
#ifndef __GST_VULKAN_CONFIG_H__
#define __GST_VULKAN_CONFIG_H__
#include <gst/gst.h>
G_BEGIN_DECLS
_______EOF
cat >>$outfile <<_______EOF
$vulkan_config_defines
_______EOF
cat >>$outfile <<_______EOF
G_END_DECLS
#endif /* __GST_VULKAN_CONFIG_H__ */
_______EOF
if cmp -s $outfile ext/vulkan/vkconfig.h; then
AC_MSG_NOTICE([ext/vulkan/vkconfig.h is unchanged])
rm -f $outfile
else
mv $outfile ext/vulkan/vkconfig.h
fi
],[
vulkan_config_defines='$VULKAN_CONFIG_DEFINES'
])
dnl *** sys plug-ins ***
dnl DirectSound
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
AG_GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], directsoundsrc, [
HAVE_DIRECTSOUND="no"
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
LIBS="$LIBS -lwinmm -ldsound -ldxerr9 -luser32"
AC_MSG_CHECKING(for DirectSound LDFLAGS)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
#include <dxerr9.h>
#include <dsound.h>
#include <mmsystem.h>
]], [[
DXGetErrorString9 (0);
DirectSoundCreate(NULL, NULL, NULL);
]])],
[HAVE_DIRECTSOUND="yes"],
[HAVE_DIRECTSOUND="no"])
AC_MSG_RESULT($HAVE_DIRECTSOUND)
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
if test "x$HAVE_DIRECTSOUND" = "xyes"; then
dnl this is much more than we want
DIRECTSOUND_LIBS="-lwinmm -ldsound -ldxerr9 -luser32"
AC_SUBST(DIRECTX_CFLAGS)
AC_SUBST(DIRECTX_LDFLAGS)
AC_SUBST(DIRECTSOUND_LIBS)
fi
AC_SUBST(HAVE_DIRECTSOUND)
])
dnl WASAPI
translit(dnm, m, l) AM_CONDITIONAL(USE_WASAPI, true)
AG_GST_CHECK_FEATURE(WASAPI, [WASAPI plug-in], wasapi, [
HAVE_WASAPI="no"
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
LIBS="$LIBS -lole32 -lwinmm -lksuser"
AC_MSG_CHECKING(for WASAPI LDFLAGS)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
#include <stdio.h>
#include <mmsystem.h>
#include <mmdeviceapi.h>
]], [[
int main ()
{
HRESULT hr = S_OK;
hr = CoInitialize(NULL);
if (FAILED(hr)) {
printf("CoInitialize failed: hr = 0x%08x", hr);
return __LINE__;
}
int result = 0;
// result = do_everything(argc, argv);
CoUninitialize();
return result;
}
]])],
[HAVE_WASAPI="yes"],
[HAVE_WASAPI="no"])
AC_MSG_RESULT($HAVE_WASAPI)
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
if test "x$HAVE_WASAPI" = "xyes"; then
WASAPI_LIBS="-lole32 -lwinmm -lksuser"
AC_SUBST(WASAPI_LIBS)
fi
AC_SUBST(HAVE_WASAPI)
])
dnl Direct3D
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECT3D, true)
AG_GST_CHECK_FEATURE(DIRECT3D, [Direct3D plug-in], direct3dsink, [
HAVE_DIRECT3D="no"
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
LIBS="$LIBS -ld3d9 -lgdi32"
AC_MSG_CHECKING(for Direct3D LDFLAGS)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
#include <d3d9.h>
]], [[
Direct3DCreate9(D3D_SDK_VERSION);
]])],
[HAVE_DIRECT3D="yes"],
[HAVE_DIRECT3D="no"])
AC_MSG_RESULT($HAVE_DIRECT3D)
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
if test "x$HAVE_DIRECT3D" = "xyes"; then
DIRECT3D_LIBS="-ld3d9 -lgdi32"
AC_SUBST(DIRECT3D_LIBS)
fi
AC_SUBST(HAVE_DIRECT3D)
])
dnl winscreencap
translit(dnm, m, l) AM_CONDITIONAL(USE_WINSCREENCAP, true)
AG_GST_CHECK_FEATURE(WINSCREENCAP, [winscreencap plug-in], winscreencap, [
HAVE_WINSCREENCAP="no"
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
LIBS="$LIBS -ld3d9 -lgdi32"
AC_MSG_CHECKING(for Direct3D LDFLAGS)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
#include <d3d9.h>
]], [[
Direct3DCreate9(D3D_SDK_VERSION);
]])],
[HAVE_WINSCREENCAP="yes"],
[HAVE_WINSCREENCAP="no"])
AC_MSG_RESULT($HAVE_WINSCREENCAP)
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
if test "x$HAVE_WINSCREENCAP" = "xyes"; then
WINSCREENCAP_LIBS="-ld3d9 -lgdi32"
AC_SUBST(WINSCREENCAP_LIBS)
fi
AC_SUBST(HAVE_WINSCREENCAP)
])
dnl winks
translit(dnm, m, l) AM_CONDITIONAL(USE_WINKS, true)
AG_GST_CHECK_FEATURE(WINKS, [Winks plug-in], winks, [
HAVE_WINKS="no"
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $DIRECTX_CFLAGS"
LDFLAGS="$LDFLAGS $DIRECTX_LDFLAGS"
LIBS="$LIBS -lole32 -luuid -lstrmiids"
AC_MSG_CHECKING(for Winks LDFLAGS)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
#include <strmif.h>
#include <uuids.h>
]], [[
int main () {
IGraphBuilder *pGraph = NULL;
HRESULT hr = CoInitialize(NULL);
hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
&IID_IGraphBuilder, (void **)&pGraph);
return 0;
}
]])],
[HAVE_WINKS="yes"],
[HAVE_WINKS="no"])
AC_MSG_RESULT($HAVE_WINKS)
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
if test "x$HAVE_WINKS" = "xyes"; then
dnl this is much more than we want
WINKS_LIBS="-ldxguid -lole32 -luuid -lstrmiids -lksuser -lsetupapi"
AC_SUBST(DIRECTX_CFLAGS)
AC_SUBST(DIRECTX_LDFLAGS)
AC_SUBST(WINKS_LIBS)
fi
AC_SUBST(HAVE_WINKS)
])
dnl *** Android Media ***
translit(dnm, m, l) AM_CONDITIONAL(USE_ANDROID_MEDIA, true)
HAVE_ANDROID_MEDIA="no"
AG_GST_CHECK_FEATURE(ANDROID_MEDIA, [Android Media], androidmedia, [
case "$host" in
*android*)
AC_CHECK_HEADER(jni.h, HAVE_ANDROID_MEDIA="yes", HAVE_ANDROID_MEDIA="no")
;;
*)
HAVE_ANDROID_MEDIA="no"
;;
esac
])
dnl *** AppleMedia (OS X and iOS) ***
translit(dnm, m, l) AM_CONDITIONAL(USE_APPLE_MEDIA, true)
HAVE_APPLE_MEDIA="no"
dnl SystemConfiguration.h is common to OS X and iOS, so we check for that
AG_GST_CHECK_FEATURE(APPLE_MEDIA, [Apple video], applemedia, [
AC_CHECK_HEADER(SystemConfiguration/SystemConfiguration.h, HAVE_APPLE_MEDIA="yes", HAVE_APPLE_MEDIA="no")
dnl OSX 10.7 and earlier lack VideoToolbox/VideoToolbox.h
if test "x$HAVE_IOS" = "xno"; then
AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h,, HAVE_APPLE_MEDIA="no")
fi
])
dnl in case header SystemConfiguration/SystemConfiguration.h is found on other platforms
case "$host" in
*-*darwin*)
;;
*)
HAVE_APPLE_MEDIA="no"
;;
esac
dnl *** bluez ***
translit(dnm, m, l) AM_CONDITIONAL(USE_BLUEZ, true)
AG_GST_CHECK_FEATURE(BLUEZ, [Bluez], bluez, [
PKG_CHECK_MODULES([BLUEZ5], [bluez >= 5.0], [
PKG_CHECK_MODULES([GIO_UNIX], gio-unix-2.0 > 2.24, [
AC_CHECK_PROG([GDBUS_CODEGEN],[gdbus-codegen],[gdbus-codegen])
HAVE_BLUEZ=yes
AC_DEFINE(HAVE_BLUEZ5,[1],[Bluez5 detected])
], [
HAVE_BLUEZ=no
])
], [
HAVE_BLUEZ=no
])
])
dnl *** OS/X AVCVideoServices ***
translit(dnm, m, l) AM_CONDITIONAL(USE_AVC, true)
HAVE_AVC="no"
AG_GST_CHECK_FEATURE(AVC, [AVC Video Services], avcsrc, [
AC_LANG_PUSH([C++])
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -framework AVCVideoServices -framework CoreFoundation"
save_LIBS="$LIBS"
LIBS="$LIBS -framework AVCVideoServices -framework CoreFoundation"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[HAVE_AVC=yes],[HAVE_AVC=no])
LIBS=$save_LIBS
CPPFLAGS=$save_CPPFLAGS
AC_LANG_POP([C++])
])
dnl in case header AVCVideoServices/AVCVideoServices.h is found on other platforms
case "$host" in
*-*darwin*)
;;
*)
HAVE_AVC="no"
;;
esac
dnl check for shm_open (for shm plugin)
translit(dnm, m, l) AM_CONDITIONAL(USE_SHM, true)
AG_GST_CHECK_FEATURE(SHM, [POSIX shared memory source and sink], shm, [
if test "x$HAVE_SYS_SOCKET_H" = "xyes"; then
case $host in
*-darwin* | *-macos10*)
AC_DEFINE(HAVE_OSX,[1],[Apple Mac OS X operating system detected])
HAVE_SHM=yes
;;
*-*-OpenBSD*)
HAVE_SHM=yes
;;
*)
AC_CHECK_LIB([rt], [shm_open],
AC_CHECK_DECL([MSG_NOSIGNAL], HAVE_SHM=yes, HAVE_SHM=no, [
#include <sys/socket.h>
]),
HAVE_SHM=no)
AC_SUBST(SHM_LIBS, "-lrt")
;;
esac
else
HAVE_SHM=no
fi
])
dnl check for unix sockets (ipcpipeline plugin)
translit(dnm, m, l) AM_CONDITIONAL(USE_IPCPIPELINE, true)
AG_GST_CHECK_FEATURE(IPCPIPELINE, [Unix sockets], ipcpipeline, [
if test "x$HAVE_SYS_SOCKET_H" = "xyes"; then
AC_CHECK_FUNC(pipe, [
AC_CHECK_FUNC(socketpair, [HAVE_IPCPIPELINE=yes], [HAVE_IPCPIPELINE=no])
], [
HAVE_IPCPIPELINE=no
])
else
HAVE_IPCPIPELINE=no
fi
])
dnl check for Video CD
translit(dnm, m, l) AM_CONDITIONAL(USE_VCD, true)
AG_GST_CHECK_FEATURE(VCD, [Video CD], vcdsrc, [
AC_CHECK_HEADER(linux/cdrom.h, HAVE_VCD="yes", HAVE_VCD="no")
])
dnl check for OpenSL ES
translit(dnm, m, l) AM_CONDITIONAL(USE_OPENSLES, true)
AG_GST_CHECK_FEATURE(OPENSLES, [OpenSL ES], opensl, [
AC_CHECK_HEADER(SLES/OpenSLES.h, HAVE_OPENSLES="yes", HAVE_OPENSLES="no")
])
dnl *** UVC H264 ***
translit(dnm, m, l) AM_CONDITIONAL(USE_UVCH264, true)
AG_GST_CHECK_FEATURE(UVCH264, [UVC H264], uvch264, [
AC_CHECK_HEADER(linux/uvcvideo.h, HAVE_UVCVIDEO_H=yes, HAVE_UVCVIDEO_H=no)
PKG_CHECK_MODULES(G_UDEV, gudev-1.0 , [
AC_DEFINE([HAVE_GUDEV], 1, [Define if gudev is installed])
HAVE_GUDEV="yes" ],
[HAVE_GUDEV="no"])
PKG_CHECK_MODULES(LIBUSB, libusb-1.0 , [
AC_DEFINE([HAVE_LIBUSB], 1, [Define if libusb 1.x is installed])
HAVE_LIBUSB="yes" ],
[HAVE_LIBUSB="no"])
if test "x$HAVE_UVCVIDEO_H" = "xyes" && \
test "x$HAVE_GUDEV" = "xyes" && \
test "x$HAVE_LIBUSB" = "xyes"; then
HAVE_UVCH264=yes
else
HAVE_UVCH264=no
fi
])
AC_SUBST(LIBUDEV_CFLAGS)
AC_SUBST(LIBUDEV_LIBS)
AC_SUBST(LIBUSB_CFLAGS)
AC_SUBST(LIBUSB_LIBS)
dnl *** CUDA ***
translit(dnm, m, l) AM_CONDITIONAL(USE_CUDA, true)
AG_GST_CHECK_FEATURE(CUDA, [NVIDIA CUDA API],, [
AC_ARG_WITH([cuda-prefix],
AS_HELP_STRING([--with-cuda-prefix],
[Use the provided prefix for detecting the cuda installation]),
[AS_IF([test "x$with_cuda_prefix" != "x"],
[CUDA_PREFIX="$with_cuda_prefix"])],
[CUDA_PREFIX=""])
HAVE_CUDA="yes"
if test "x$CUDA_PREFIX" != "x"; then
dnl only override if not already set
if test "x$CUDA_CFLAGS" = "x" -a "x$CUDA_LIBS" = "x"; then
dnl this is an educated guess, user can always override these
CUDA_CFLAGS="-I$CUDA_PREFIX/include"
CUDA_LIBS="-L$CUDA_PREFIX/lib -L$CUDA_PREFIX/lib64 -L$CUDA_PREFIX/lib/stubs -L$CUDA_PREFIX/lib64/stubs -lcuda -lcudart"
fi
else
PKG_CHECK_MODULES([CUDA], [cuda-9.2 cudart-9.2],, [
PKG_CHECK_MODULES([CUDA], [cuda-9.1 cudart-9.1],, [
PKG_CHECK_MODULES([CUDA], [cuda-9.0 cudart-9.0],, [
PKG_CHECK_MODULES([CUDA], [cuda-8.0 cudart-8.0],, [
PKG_CHECK_MODULES([CUDA], [cuda-7.5 cudart-7.5],, [
PKG_CHECK_MODULES([CUDA], [cuda-7.0 cudart-7.0],, [
PKG_CHECK_MODULES([CUDA], [cuda-6.5 cudart-6.5],, [
AC_MSG_WARN([Could not find cuda headers/libraries])])])])])])])])
fi
HAVE_CUDA_H=no
HAVE_CUDART_H=no
HAVE_CUDA_DYN_H=no
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CUDA_CFLAGS $save_CPPFLAGS "
AC_CHECK_HEADER([dynlink_cuda.h], [HAVE_CUDA_DYN_H=yes],
AC_MSG_WARN([Could not find dynlink_cuda.h]))
AC_CHECK_HEADER([cuda.h], [HAVE_CUDA_H=yes],
AC_MSG_WARN([Could not find cuda.h]))
AC_CHECK_HEADER([cuda_runtime_api.h], [HAVE_CUDART_H=yes],
AC_MSG_WARN([Could not find cuda_runtime_api.h]))
CPPFLAGS=$save_CPPFLAGS
dnl libcuda and libcudart libraries
save_LIBS="$LIBS"
LIBS="$CUDA_LIBS $save_LIBS"
HAVE_CUDART_LIB="no"
AC_CHECK_LIB(cudart,cudaGetErrorString,[HAVE_CUDART_LIB="yes"], [
AC_MSG_WARN([Could not find cudart library])])
HAVE_CUDA_LIB="no"
AC_CHECK_LIB(cuda,cuInit,[HAVE_CUDA_LIB="yes"], [
AC_MSG_WARN([Could not find cuda library])])
LIBS="$save_LIBS"
])
dnl *** NVDEC ***
translit(dnm, m, l) AM_CONDITIONAL(USE_NVDEC, true)
AG_GST_CHECK_FEATURE(NVDEC, [nvdec], nvdec, [
HAVE_NVCUVID_H=no
HAVE_NCUVID_DYN_H=no
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CUDA_CFLAGS $save_CPPFLAGS"
AC_CHECK_HEADER([nvcuvid.h], [HAVE_NVCUVID_H=yes],
AC_MSG_WARN([Could not find nvcuvid.h]))
AC_CHECK_HEADER([dynlink_nvcuvid.h], [HAVE_NVCUVID_DYN_H=yes],
AC_MSG_WARN([Could not find dynlink_nvcuvid.h]))
CPPFLAGS=$save_CPPFLAGS
HAVE_NVCUVID=no
save_LIBS="$LIBS"
LIBS="$CUDA_LIBS $save_LIBS"