-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathconfigure.ac
More file actions
118 lines (91 loc) · 2.63 KB
/
configure.ac
File metadata and controls
118 lines (91 loc) · 2.63 KB
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
AC_INIT(myconfig, version-0.1)
AC_LANG(C++)
AC_PROG_CXX
dnl list of all possible optional components
all_options="jpeg png tiff funkyimage v4l2 ffmpeg awesomevideo"
dnl When a component is found, append it here
options=
dnl Force the compiler to run once and do all the basic checks
dnl if you don't, it will do the test on the first invocation
dnl below and so your pretty section titles won't work as well
AC_CHECK_HEADERS(iostream)
dnl Small macro to print out a nice, pretty section title.
define(SECTION_TITLE,
[
echo >& AS_MESSAGE_FD
echo ' $1 ' | sed -e's/./-/g' >&AS_MESSAGE_FD
echo ' $1' >& AS_MESSAGE_FD
echo ' $1 ' | sed -e's/./-/g' >&AS_MESSAGE_FD
])
SECTION_TITLE([Checking for image libraries])
a=0
AC_CHECK_HEADERS(jpeglib.h, [], [a=1])
AC_SEARCH_LIBS(jpeg_set_defaults, jpeg, [], [a=1])
if test $a == 0
then
options="$options jpeg"
fi
a=0
AC_CHECK_HEADERS(png.h, [], [a=1])
AC_SEARCH_LIBS(png_create_info_struct, png, [], [a=1])
if test $a == 0
then
options="$options png"
fi
a=0
AC_CHECK_HEADERS(tiffio.h, [], [a=1])
AC_SEARCH_LIBS(TIFFOpen, tiff, [], [a=1])
if test $a == 0
then
options="$options tiff"
fi
a=0
AC_CHECK_HEADERS(funkyimage.h, [], [a=1])
AC_SEARCH_LIBS(funkyopen, funkyimage, [], [a=1])
if test $a == 0
then
options="$options tiff"
fi
SECTION_TITLE([Checking for video options])
a=0
AC_CHECK_HEADERS(linux/videodev2.h, [], [a=1])
if test $a == 0
then
options="$options v4l2"
fi
dnl this one is quite big, so give some helpful extra
dnl messages
AC_MSG_CHECKING([for ffmpeg])
AC_MSG_RESULT([])
a=0
AC_CHECK_HEADERS([libavcodec/avcodec.h libavformat/avformat.h libswscale/swscale.h], [], [a=1])
AC_SEARCH_LIBS(main, avutil, [], [a=1])
AC_SEARCH_LIBS(av_read_frame, avformat, [], [a=1])
AC_SEARCH_LIBS(avcodec_open2, avcodec, [], [a=1])
AC_SEARCH_LIBS(sws_getContext, swscale, [], [a=1])
if test $a == 0
then
options="$options ffmpeg"
else
AC_MSG_NOTICE([ffmpeg not found])
fi
a=0
AC_CHECK_HEADERS(awesomevid.h, [], [a=1])
AC_SEARCH_LIBS(openawesome, awesomevid, [], [a=1])
if test $a == 0
then
options="$options awesomevideo"
fi
dnl Now process the options strings. Essentially, we want two lists
dnl one for the options present (which we have) and one for the options
dnl missing (which we don't)
SECTION_TITLE([Configuration results])
echo "Options:" >& AS_MESSAGE_FD
echo "$options" >& AS_MESSAGE_FD
echo >& AS_MESSAGE_FD
echo "Missing options:" >& AS_MESSAGE_FD
echo "$options" "$all_options" | tr ' ' '\n' | sort | uniq -u | tr '\n' ' ' >& AS_MESSAGE_FD
echo -e "\n\n" >& AS_MESSAGE_FD
echo "CXXFLAGS=$CXXFLAGS" >& AS_MESSAGE_FD
echo "LDFLAGS=$LDFLAGS" >& AS_MESSAGE_FD
echo "LIBS=$LIBS" >& AS_MESSAGE_FD