-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.m4
165 lines (144 loc) · 3.68 KB
/
config.m4
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
dnl $Id$
dnl config.m4 for extension av
PHP_ARG_WITH(av, whether to include libav support,
[ --with-av Include libav support])
if test -z "$PHP_AV_DIR"; then
PHP_ARG_WITH(av-dir, for the location of libav,
[ --with-av-dir[=DIR] AV: Set the path to libav install prefix], no, no)
fi
if test "$PHP_AV" != "no"; then
# --with-av -> check with-path
SEARCH_PATH="/usr/local /usr"
SEARCH_FOR="include/libavcodec/avcodec.h"
if test -r $PHP_AV_DIR/$SEARCH_FOR; then
AV_DIR=$PHP_AV_DIR
else # search default path list
AC_MSG_CHECKING([for libavcodec files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
AV_DIR=$i
AC_MSG_RESULT(found in $i)
break
fi
done
fi
if test -z "$AV_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall libavcodec distribution])
fi
PHP_ADD_INCLUDE($AV_DIR/include)
PHP_CHECK_LIBRARY(avcodec,avcodec_open2,
[
PHP_ADD_LIBRARY_WITH_PATH(avcodec, $AV_DIR/lib, AV_SHARED_LIBADD)
AC_DEFINE(HAVE_AVLIB,1,[ ])
],[
AC_MSG_ERROR([wrong libavcodec lib version or lib not found])
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avcodec,avcodec_encode_audio2,
[
AC_DEFINE(HAVE_AVCODEC_ENCODE_AUDIO2,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avcodec,avcodec_encode_video2,
[
AC_DEFINE(HAVE_AVCODEC_ENCODE_VIDEO2,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avcodec,avcodec_default_get_buffer2,
[
AC_DEFINE(HAVE_AVCODEC_DEFAULT_GET_BUFFER2,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avcodec,av_codec_is_encoder,
[
AC_DEFINE(HAVE_AV_CODEC_IS_ENCODER,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avcodec,avcodec_fill_audio_frame,
[
AC_DEFINE(HAVE_AVCODEC_FILL_AUDIO_FRAME,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avformat,ffurl_read_complete,
[
AC_DEFINE(HAVE_FFURL_READ_COMPLETE,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avformat,ffurl_write,
[
AC_DEFINE(HAVE_FFURL_WRITE,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avformat,ffurl_seek,
[
AC_DEFINE(HAVE_FFURL_SEEK,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avformat,avio_open,
[
PHP_ADD_LIBRARY_WITH_PATH(avformat, $AV_DIR/lib, AV_SHARED_LIBADD)
AC_DEFINE(HAVE_AVFORMAT,1,[ ])
],[
AC_MSG_ERROR([wrong libavformat lib version or lib not found])
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(avutil,av_dict_get,
[
PHP_ADD_LIBRARY_WITH_PATH(avutil, $AV_DIR/lib, AV_SHARED_LIBADD)
AC_DEFINE(HAVE_AVUTIL,1,[ ])
],[
AC_MSG_ERROR([wrong libavutil lib version or lib not found])
],[
-L$AV_DIR/lib -lm
])
PHP_CHECK_LIBRARY(swscale,sws_scale,
[
PHP_ADD_LIBRARY_WITH_PATH(swscale, $AV_DIR/lib, AV_SHARED_LIBADD)
AC_DEFINE(HAVE_SWSCALE,1,[ ])
],[
AC_MSG_ERROR([wrong libswscale lib version or lib not found])
],[
-L$AV_DIR/lib -lm
])
if test -r "$AV_DIR/include/libswresample/swresample.h"; then
PHP_CHECK_LIBRARY(swresample,swr_convert,
[
PHP_ADD_LIBRARY_WITH_PATH(swresample, $AV_DIR/lib, AV_SHARED_LIBADD)
AC_DEFINE(HAVE_SWRESAMPLE,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
fi
if test -r "$AV_DIR/include/libavresample/avresample.h"; then
PHP_CHECK_LIBRARY(avresample,avresample_convert,
[
PHP_ADD_LIBRARY_WITH_PATH(avresample, $AV_DIR/lib, AV_SHARED_LIBADD)
AC_DEFINE(HAVE_AVRESAMPLE,1,[ ])
],[
],[
-L$AV_DIR/lib -lm
])
fi
PHP_SUBST(AV_SHARED_LIBADD)
PHP_NEW_EXTENSION(av, av.c av_utils.c faststart.c, $ext_shared)
fi