-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfigure.ac
More file actions
129 lines (112 loc) · 3.97 KB
/
Copy pathconfigure.ac
File metadata and controls
129 lines (112 loc) · 3.97 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
119
120
121
122
123
124
125
126
127
128
AC_INIT([MarkYUV], [1.4], [mjpeg0@silicontrip.org])
AM_INIT_AUTOMAKE([MarkYUV],[1.4])
AC_PROG_CC
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h strings.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT64_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset regcomp sqrt strcasecmp])
AC_ARG_WITH(mjpegtools, AC_HELP_STRING([--with-mjpegtools=PATH], [PATH where mjpegtools are installed.]),with_mjpegtools=$withval)
AC_ARG_WITH(ffmpeg, AC_HELP_STRING([--with-ffmpeg=PATH], [PATH where libavcodec is installed.]),with_ffmpeg=$withval)
AC_ARG_WITH(fftw, AC_HELP_STRING([--with-fftw=PATH], [PATH where FFTW is installed.]),with_fftw=$withval)
AC_ARG_WITH(freetype, AC_HELP_STRING([--with-freetype=PATH], [PATH where Freetype is installed.]),with_freetype=$withval)
if test x$with_mjpegtools = xyes ; then
AC_MSG_ERROR([
*** A directory must be specified for --with-mjpegtools option.])
fi
if test x$with_mjpegtools = x ; then
with_mjpegtools=/usr/local
fi
if test x$with_ffmpeg = xyes ; then
AC_MSG_ERROR([
*** A directory must be specified for --with-ffmpeg option.])
fi
if test x$with_ffmpeg = x ; then
with_ffmpeg=/usr/local
fi
if test x$with_freetype = xyes ; then
AC_MSG_ERROR([
*** A directory must be specified for --with-freetype option.])
fi
if test x$with_freetype = x ; then
with_freetype=/usr/local
fi
OLD_CFLAGS="$CFLAGS"
OLD_LIBS="$LIBS"
LIBS="$LIBS -L$with_mjpegtools/lib"
CFLAGS="$CFLAGS -I$with_mjpegtools/include"
AC_CHECK_LIB([mjpegutils],[mjpeg_default_handler_verbosity],have_mjpegutils="yes",[echo "Error! mjpegutils must be installed" ; exit -1])
MJPEG_LIBS="-L$with_mjpegtools/lib"
MJPEG_CFLAGS="-I$with_mjpegtools/include"
LIBS="$OLD_LIBS"
CFLAGS="$OLD_CFLAGS"
LIBS="$LIBS -L$with_ffmpeg/lib"
CFLAGS="$CFLAGS -I$with_ffmpeg/include"
AC_CHECK_LIB([avcodec],[av_free_packet],have_ffmpeg="yes",have_ffmpeg="no")
AC_CHECK_LIB([avcodec],[avcodec_decode_audio2],have_audio2="yes")
AC_CHECK_LIB([avcodec],[avcodec_decode_audio3],have_audio3="yes")
AC_CHECK_LIB([avcodec],[avcodec_decode_video],have_video="yes")
AC_CHECK_LIB([avcodec],[avcodec_decode_video2],have_video2="yes")
AC_CHECK_HEADER([libavcodec/avcodec.h],have_avcodec="yes")
AC_CHECK_HEADER([libavformat/avformat.h],have_avformat="yes")
AC_CHECK_HEADER([libswscale/swscale.h],have_swscale="yes")
FFMPEG_LIBS="-L$with_ffmpeg/lib"
FFMPEG_CFLAGS="-I$with_ffmpeg/include"
LIBS="$OLD_LIBS"
CFLAGS="$OLD_CFLAGS"
LIBS="$LIBS -L$with_fftw/lib"
CFLAGS="$CFLAGS -I$with_fftw/include"
AC_CHECK_LIB([fftw3],[fftw_plan_r2r_2d],have_fftw="yes",have_fftw="no")
FFTW_LIBS="-L$with_fftw/lib"
FFTW_CFLAGS="-I$with_fftw/include"
LIBS="$OLD_LIBS"
CFLAGS="$OLD_CFLAGS"
LIBS="$LIBS -L$with_freetype/lib"
CFLAGS="$CFLAGS -I$with_ffreetype/include"
AC_CHECK_LIB([freetype],[FT_New_Face],have_freetype="yes",have_freetype="no")
FREETYPE_LIBS="-L$with_freetype/lib"
FREETYPE_CFLAGS="-I$with_ffreetype/include"
LIBS="$OLD_LIBS"
CFLAGS="$OLD_CFLAGS"
AC_LANG_PUSH([Objective C])
AC_CHECK_HEADER([QuartzCore/CIFilter.h],have_coreimage="yes",have_coreimage="no")
if test "x$have_coreimage" = "xyes"
then
AC_PROG_OBJC
fi
if test "x$have_audio3" = "xyes"
then
AC_DEFINE("HAVE_AVCODEC_DECODE_AUDIO3")
fi
if test "x$have_video2" = "xyes"
then
AC_DEFINE("HAVE_AVCODEC_DECODE_VIDEO2")
fi
AM_CONDITIONAL(HAVE_COREIMAGE, test "x$have_coreimage" = xyes)
AM_CONDITIONAL(HAVE_FFTW, test "x$have_fftw" = xyes)
AM_CONDITIONAL(HAVE_FFMPEG, test "x$have_avformat" = xyes)
AM_CONDITIONAL(HAVE_FREETYPE, test "x$have_freetype" = xyes)
AC_SUBST(MJPEG_LIBS)
AC_SUBST(MJPEG_CFLAGS)
AC_SUBST(FFTW_LIBS)
AC_SUBST(FFTW_CFLAGS)
AC_SUBST(FFMPEG_LIBS)
AC_SUBST(FFMPEG_CFLAGS)
AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS)
echo "FFMPEG: $have_ffmpeg"
echo "FFTW: ${have_fftw}"
echo "FREETYPE: ${have_freetype}"
echo "Core Image: ${have_coreimage}"