-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
83 lines (71 loc) · 2.89 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT([salfet], [0.1.0], [http://github.com/Kojoley/salfet/issues])
AC_CONFIG_SRCDIR([salfet.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC_C99
PKG_PROG_PKG_CONFIG([0.20])
AC_ARG_ENABLE([static-link],
AS_HELP_STRING([--enable-static-link], [Link statically with libraries [no]]),
[ enable_static_link=${enableval} ], [ enable_static_link=no ])
if test "x$enable_static_link" = "xyes" ; then
# Tell pkg-config to link against static libraries, incl. all dependencies
PKG_CONFIG+=" --static"
fi
AC_ARG_ENABLE([static],
AS_HELP_STRING([--enable-static], [Link statically [no]]),
[ enable_static=${enableval} ], [ enable_static=no ])
if test "x$enable_static" = "xyes" ; then
CFLAGS+=" --static"
LDFLAGS+=" --static"
fi
AC_ARG_ENABLE([static-link],
AS_HELP_STRING([--enable-static-link], [Link statically with libraries [no]]),
[ enable_static_link=${enableval} ], [ enable_static_link=no ])
AC_ARG_VAR(FFMPEG_PATH, [path to FFmpeg])
# Checks for header files.
AC_CHECK_HEADERS([inttypes.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
# Check if path to FFmpeg was supplied
if test -n "$FFMPEG_PATH"; then
AC_MSG_CHECKING([custom FFmpeg path])
if test -d "$FFMPEG_PATH"; then
AC_MSG_RESULT([exists])
AC_MSG_CHECKING([for .pc files])
FFMPEG_CUSTOM_PATH="$FFMPEG_PATH/doc/examples/pc-uninstalled"
if test -d "$FFMPEG_CUSTOM_PATH"; then
# Easy way, works in latest FFmpeg. It have nice pc-uninstalled
export PKG_CONFIG_PATH="$FFMPEG_CUSTOM_PATH:$PKG_CONFIG_PATH"
export PKG_CONFIG_LIBDIR="$FFMPEG_CUSTOM_PATH:$PKG_CONFIG_LIBDIR"
else
# Hard way, for older FFmpeg. Search pc files in FFmpeg dir
FFMPEG_CUSTOM_PATH=`find "$FFMPEG_PATH" -mindepth 2 -maxdepth 2 | grep uninstalled.pc$ | xargs -L1 dirname | tr '\n' ':'`
if test -n "$FFMPEG_CUSTOM_PATH"; then
export PKG_CONFIG_PATH="$FFMPEG_CUSTOM_PATH:$PKG_CONFIG_PATH"
export PKG_CONFIG_LIBDIR="$FFMPEG_CUSTOM_PATH:$PKG_CONFIG_LIBDIR"
# Because of strange pc-uninstalled files content
m4_pattern_allow([^PKG_CONFIG_DISABLE_UNINSTALLED$])
export PKG_CONFIG_DISABLE_UNINSTALLED=1
CFLAGS+=" -I$FFMPEG_PATH"
LDFLAGS+=`find "$FFMPEG_PATH" -mindepth 2 -maxdepth 2 | grep uninstalled.pc$ | xargs -L1 dirname | sed 's/^/ -L/' | tr -d '\n'`
else
AC_MSG_RESULT([could not locate])
AC_MSG_FAILURE([Build FFmpeg first! If already, please send bug report])
fi
fi
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([is not directory])
AC_MSG_ERROR([Provide correct path to FFmpeg])
fi
fi
# Checks for libraries.
PKG_CHECK_MODULES([FFMPEG], [libavformat >= 53.17.0 libavcodec >= 53.34.0 libswscale >= 0.9.0 libavutil >= 51.12.0])
# Checks for library functions.
AC_CONFIG_FILES([Makefile])
AC_OUTPUT