-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
110 lines (86 loc) · 3.28 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
# $Id: configure.in 159 2007-04-06 17:27:14Z johmathe $
# $Date: 2007-04-06 19:27:14 +0200 (Fri, 06 Apr 2007) $
AC_PREREQ(2.59)
AC_INIT(README.shotdetect)
AM_INIT_AUTOMAKE([shotdetect], 1.0.86)
AM_CONFIG_HEADER(config.h)
AC_PROG_INSTALL
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
dnl Check for libxml2
AC_DEFUN([VERSION_TO_NUMBER],
[`$1 | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
LIBXML_CONFIG_PREFIX=""
AC_ARG_WITH(libxml-prefix,
[ --with-libxml-prefix=[PFX] Specify location of libxml config],
LIBXML_CONFIG_PREFIX=$withval
)
AC_ARG_WITH(libxml-include-prefix,
[ --with-libxml-include-prefix=[PFX] Specify location of libxml headers],
LIBXML_CFLAGS="-I$withval"
)
AC_ARG_WITH(libxml-libs-prefix,
[ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs],
LIBXML_LIBS="-L$withval"
)
AC_SUBST(LIBXML_SRC)
AC_SUBST(LIBXML_REQUIRED_VERSION)
AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
if test "x$LIBXML_CONFIG_PREFIX" != "x"
then
XML_CONFIG=${LIBXML_CONFIG_PREFIX}/bin/xml2-config
else
XML_CONFIG=xml2-config
fi
if ${XML_CONFIG} --libs print > /dev/null 2>&1
then
XMLVERS=`$XML_CONFIG --version`
if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
then
LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
AC_MSG_RESULT($XMLVERS found)
else
AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
fi
else
AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
fi
for i in /usr/local /usr; do
if test -x "$i/bin/xslt-config"; then
XSLT_CONFIG=$i/bin/xslt-config
break
fi
done
if test -z "$XSLT_CONFIG"; then
AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution])
fi
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lavcodec':
AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(shotdetect requires libstdc++))
AC_CHECK_LIB([avcodec], [main],, AC_MSG_ERROR([Please install libavcodec]))
# FIXME: Replace `main' with a function in `-lavutil':
AC_CHECK_LIB([avutil], [main],, AC_MSG_ERROR([Please install libavutil]))
# FIXME: Replace `main' with a function in `-lavformat':
AC_CHECK_LIB([avformat], [main],, AC_MSG_ERROR([Please install libavformat]))
# FIXME: Replace `main' with a function in `-lxml2':
AC_CHECK_LIB([xml2], [main],, AC_MSG_ERROR([Please install libxml2]))
# FIXME: Replace `main' with a function in `-lswscale':
AC_CHECK_LIB([swscale], [main],, AC_MSG_ERROR([Please install libswscale]))
# FIXME: Replace `main' with a function in `-lgd':
AC_CHECK_LIB([gd], [main],, AC_MSG_ERROR([Please install libgd2 !]))
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_CHECK_FUNCS([gettimeofday mkdir strcspn strspn])
AC_OUTPUT(Makefile src/Makefile)