-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
104 lines (89 loc) · 3.39 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([cello], [1.0], [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AM_SILENT_RULES([yes])
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CXX
PLAT_PREFIX=Linux
if test `uname -s` = "Darwin"
then
CFLAGS+=" -I/usr/local/include "
LDFLAGS+=" -L/usr/local/lib -framework CoreFoundation"
PLAT_PREFIX=Mac
fi
CFLAGS+=" -DKL_USERSPACE "
# We always build with -fPIC in case our static libraries end up
# being linked into a consumer's shared library
AC_MSG_CHECKING(whether fPIC compiler option is accepted)
SAVED_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIC -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
[AC_MSG_RESULT(yes)
CFLAGS="$SAVED_CFLAGS -fPIC"],
[AC_MSG_RESULT(no)
CFLAGS="$SAVED_CFLAGS"])
AC_PROG_RANLIB
AC_PROG_LIBTOOL
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
AC_CHECK_HEADERS([zlib.h],
[break],
[AC_MSG_ERROR([zlib-dev headers not found or not usable])])
AC_CHECK_HEADERS([Processing.NDI.Lib.h], HEADER_LIBNDI="yes")
if test "x$HEADER_LIBNDI" == "xyes" ; then
LDFLAGS+=" -lndi "
fi
AM_CONDITIONAL(LIBNDI, test x"$HEADER_LIBNDI" == x"yes")
PKG_CHECK_MODULES(AVCODEC, [libavcodec >= 1.0], LIBS_LIBAVCODEC="yes")
if test "x$LIBS_LIBAVCODEC" == "xyes" ; then
CFLAGS+=" `pkg-config libavcodec --cflags-only-I`"
LDFLAGS+=" `pkg-config --libs libavcodec libavformat libavutil libswresample libavfilter libavformat libavdevice`"
fi
AC_CHECK_HEADERS([readline/readline.h], HEADER_LIBREADLINE="yes")
if test "x$HEADER_LIBREADLINE" == "xyes" ; then
LDFLAGS+=" -lreadline "
fi
AM_CONDITIONAL(LIBREADLINE, test x"$HEADER_LIBREADLINE" == x"yes")
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([memset strrchr])
# Add debug support
AC_ARG_ENABLE(debug,
AS_HELP_STRING(
[--enable-debug],
[enable debugging, default: no]),
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],
[debug=false])
AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
AM_COND_IF(DEBUG,
AC_DEFINE(DEBUG, 1, [Define to 0 if this is a release build]),
AC_DEFINE(DEBUG, 0, [Define to 1 or higher if this is a debug build]))
# Path to Blackmagic SDK
AC_ARG_WITH([bmsdk],
[AS_HELP_STRING([--with-bmsdk=path],
[specify alternate path to Blackmagic SDK])],
[],
[with_bmsdk=no])
AS_IF([test "x$with_bmsdk" != xno],
[AC_CHECK_FILE([$with_bmsdk/$PLAT_PREFIX/include/DeckLinkAPI.h],
[AC_SUBST([BLACKMAGIC_SDK_PATH], [$with_bmsdk/$PLAT_PREFIX/include])
AC_DEFINE([HAVE_BMSDK], [1],
[Define if you have BlackMagic SDK installed])
],
[AC_MSG_FAILURE(
[--with-bmsdk was given, but SDK not found at specified path])]
)],[AC_MSG_WARN([Falling back to Linux SDK which won't work on other platforms]); AC_SUBST([BLACKMAGIC_SDK_PATH], [${ac_pwd}/include/decklink-sdk])])
AC_CONFIG_FILES([Makefile tools/Makefile])
AC_OUTPUT