-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
174 lines (114 loc) · 3.67 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
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
166
167
168
169
170
171
172
173
dnl Require autoconf version >= 2.57
AC_PREREQ(2.57)
dnl ############# Initialisation
AC_INIT([mast], [0.2.3], [[email protected]])
AC_CONFIG_SRCDIR(src/mast.h)
AC_CONFIG_AUX_DIR(build)
AC_CANONICAL_SYSTEM
dnl Version 1.7 of automake is recommended
AM_INIT_AUTOMAKE(1.7)
AM_CONFIG_HEADER(src/config.h)
dnl ############# Compiler and tools Checks
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_C_BIGENDIAN
AC_C_INLINE
dnl ############# Configure Arguments
AC_ARG_ENABLE(debug,
[--enable-debug=[no/yes] turn on debugging],
[ Debugging="Enabled"
AC_DEFINE(DEBUGGING, 1, [ Define if debugging is enabled. ]) ],
[ Debugging="Disabled" ]
)
dnl ############## Check for tools to build documentation
AC_PATH_PROG( [ASCIIDOC], [asciidoc] )
#AC_SUBST( POD2MAN )
AC_PATH_PROG( [XMLTO], [xmlto] )
#AC_SUBST( XMLTO )
if test "x$ac_cv_path_ASCIIDOC" != "x" -a "x$ac_cv_path_XMLTO" != "x"; then
BUILD_DOC="Yes"
else
BUILD_DOC="No"
AC_MSG_WARN([Not re-building documentation because tools are missing])
fi
AM_CONDITIONAL(BUILD_DOC, test x$BUILD_DOC = xYes)
dnl ############## Library Checks
dnl Check for ortp (required)
PKG_CHECK_MODULES(ORTP, ortp >= 0.13.2, ,
[ AC_MSG_ERROR(
[ Version 0.13.2 or greater of the oRTP library is required to build MAST.
It can be downloaded from http://www.linphone.org/ortp/ ])
]
)
dnl This is a hack because ortp broke backward compatibility
PKG_CHECK_MODULES(ORTP2, ortp >= 0.22.0,
[ AC_DEFINE_UNQUOTED( ORTP2, 1, [ Define if separate RTCP port ] ) ],
[ ]
)
dnl Check for Secret Rabbit Code (it is optional)
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.2,
[ HAVE_LIBSRC="Yes" ],
[ HAVE_LIBSRC="No" ]
)
dnl Check for libsndfile (it is optional)
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
[ HAVE_SNDFILE="Yes" ],
[ HAVE_SNDFILE="No" ]
)
dnl Check for JACK (it is optional)
PKG_CHECK_MODULES(JACK, jack,
[ HAVE_JACK="Yes" ],
[ HAVE_JACK="No" ]
)
dnl Check for twolame (it is optional)
PKG_CHECK_MODULES(TwoLAME, twolame >= 0.3.10,
[
HAVE_TWOLAME="Yes"
AC_DEFINE_UNQUOTED( HAVE_TWOLAME, 1, [ Define if libtwolame is available ] )
],
[ HAVE_TWOLAME="No" ]
)
AM_CONDITIONAL([HAVE_TWOLAME], [test x$HAVE_TWOLAME = xYes])
dnl ############## Header Checks
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h signal.h malloc.h])
dnl ############## Type checks
AC_CHECK_TYPE(u_int32_t, unsigned long)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(u_int8_t, unsigned char)
dnl ############## Compiler and Linker Flags
CFLAGS="$CFLAGS $ORTP_CFLAGS"
CXXFLAGS="$CFLAGS $ORTP_CFLAGS"
if test x$Debugging = xEnabled; then
CFLAGS="$CFLAGS -g -Wunused -Wall -Werror"
CXXFLAGS="$CXXFLAGS -g -Wunused -Wall -Werror"
else
CFLAGS="$CFLAGS -O2"
CXXFLAGS="$CXXFLAGS -O2"
fi
dnl ############## Decide what to build
BUILD_PROGRAMS="mast_info mast_rawcast mast_rawrecord"
if test x$HAVE_JACK = "xYes" -a x$HAVE_LIBSRC = "xYes"; then
BUILD_PROGRAMS="$BUILD_PROGRAMS mast_cast"
fi
if test x$HAVE_SNDFILE = "xYes" -a x$HAVE_LIBSRC = "xYes"; then
BUILD_PROGRAMS="$BUILD_PROGRAMS mast_filecast mast_record"
fi
AC_SUBST(BUILD_PROGRAMS)
dnl ############## Final Output
AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile libgsm/Makefile])
AC_OUTPUT
dnl ############## Display Message
echo "
Multicast Audio Streaming Toolkit $VERSION
Install path ........... $prefix
Rebuilding Docs ........ $BUILD_DOC
Debugging .............. $Debugging
Jack Support ........... $HAVE_JACK
Libsamplerate support .. $HAVE_LIBSRC
Libsndfile support ..... $HAVE_SNDFILE
MPEG Audio Support ..... $HAVE_TWOLAME
Next type 'make' and then 'make install'."