summaryrefslogtreecommitdiff
path: root/configure.in
blob: 93b9ec6f11ff0c8bf32aa093e9e029b1b34c5a60 (plain)
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
dnl Process this file with autoconf to produce a configure script.
AC_INIT(jackd/jackd.c)

AC_CONFIG_AUX_DIR(.)

dnl ---
dnl HOWTO: updating the JACK version number
dnl
dnl major version = ask on jackit-devel :)
dnl minor version = incremented when any of the public or internal
dnl                 interfaces are changed
dnl micro version = incremented when implementation-only
dnl                 changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=83
JACK_MICRO_VERSION=3

dnl ---
dnl HOWTO: updating the jack protocal version
dnl
dnl increment the protocol version whenever a change is
dnl made to the way libjack communicates with jackd
dnl that would break applications linked with an older
dnl version of libjack.
dnl ---
JACK_PROTOCOL_VERSION=10

dnl ---
dnl HOWTO: updating the libjack interface version
dnl
dnl current = incremented whenever the public libjack API is changed 
dnl revision = incremented when the libjack implementation is changed
dnl age = current libjack is both source and binary compatible with
dnl       libjack interfaces current,current-1,...,current-age
dnl
dnl Note! see libtool documentation for detailed documentation
dnl
dnl Note Also! until we reach CURRENT>=1, the rules are somewhat
dnl slacker than this, and closer to those for the JACK version
dnl number.
dnl ---
JACK_API_CURRENT=0
JACK_API_REVISION=22
JACK_API_AGE=0

AC_SUBST(JACK_MAJOR_VERSION)
AC_SUBST(JACK_MINOR_VERSION)
AC_SUBST(JACK_MICRO_VERSION)

AC_SUBST(JACK_PROTOCOL_VERSION)

AC_SUBST(JACK_API_MAJOR_VERSION)
AC_SUBST(JACK_API_MINOR_VERSION)
AC_SUBST(JACK_API_MICRO_VERSION)

JACK_SO_VERSION=${JACK_API_CURRENT}:${JACK_API_REVISION}:${JACK_API_AGE}

JACK_VERSION=$JACK_MAJOR_VERSION.$JACK_MINOR_VERSION.${JACK_MICRO_VERSION}${BETA}
JACK_RELEASE=$JACK_MAJOR_VERSION-$JACK_MINOR_VERSION-${JACK_MICRO_VERSION}${BETA}

AC_SUBST(JACK_SO_VERSION)
AC_SUBST(JACK_VERSION)
AC_SUBST(JACK_RELEASE)

AM_INIT_AUTOMAKE(jack-audio-connection-kit,${JACK_VERSION})
AM_MAINTAINER_MODE

AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_PROG_CXX
AC_PROG_LD
AM_PROG_LIBTOOL
AC_C_BIGENDIAN

AC_CHECK_HEADERS(string.h strings.h)

AC_CHECK_FUNC(getopt_long, , AC_MSG_ERROR([GNU getopt is required to build jack]))
AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
AC_CHECK_FUNCS(on_exit atexit)

dnl
dnl look for system support for POSIX shm API
dnl XXX this could probably be improved
dnl

AC_ARG_ENABLE(posix-shm, [  --enable-posix-shm       use POSIX shm API ],
			TRY_POSIX_SHM=yes , TRY_POSIX_SHM=no ) 


if test "x$TRY_POSIX_SHM" = "xyes"
then

	AC_MSG_CHECKING([POSIX shm support (compile time) ])
	df | grep -s /dev/shm >/dev/null 2>&1
	if test $? = 0 ; then
		AC_DEFINE(USE_POSIX_SHM,1,[Use POSIX shared memory interface])
        	AC_MSG_RESULT([found.
	   			JACK will use shm_open() and friends.])

	else
   		AC_MSG_RESULT([not found. 
			JACK will use System V shm API (shmget() and friends])
	fi
else
	echo  '   JACK will use System V shm API (shmget() and friends)'

fi

JACK_CORE_CFLAGS="-I\$(top_srcdir) -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall"

JACK_CFLAGS="$JACK_CORE_CFLAGS -g"
JACK_OPT_CFLAGS="$JACK_CORE_CFLAGS -O3 -fomit-frame-pointer -ffast-math -fstrength-reduce -funroll-loops -fmove-all-movables"

AC_ARG_ENABLE(optimize,
              [  --enable-optimize       ask the compiler for its best optimizations],
              [ if test "x$enable_optimize" != "xno" ; then JACK_CFLAGS="$JACK_OPT_CFLAGS" ; fi ])

AC_SUBST(JACK_CFLAGS)

dnl
dnl use JACK_CFLAGS for jackd compilation
dnl 

CFLAGS=$JACK_CFLAGS

AC_ARG_ENABLE(debug,
              [  --enable-debug          enable debugging messages in jackd and libjack],
              [ if test "x$enable_debug" != "xno" ; then
                    AC_DEFINE(DEBUG_ENABLED,,[Enable debugging messages])
                fi
              ]
)

USE_CAPABILITIES=false

AC_ARG_ENABLE(capabilities,
              [  --enable-capabilities   use libcap to gain realtime scheduling priviledges],
              [ if test "x$enable_capabilities" != "xno" ; then
                    AC_CHECK_LIB(cap, capgetp,
                                 [AC_CHECK_HEADER(sys/capability.h,
                                                  [HAVE_CAPABILITIES=true],
                                                  [AC_MSG_WARN([*** no kernel support for capabilities])
                                                   HAVE_CAPABILITIES=false]
                                  )],
                                 [AC_MSG_WARN([*** no libcap present])
                                  HAVE_CAPABILITIES=false]
                    )
                    if test "x$HAVE_CAPABILITIES" = "xtrue"; then
                        AC_CHECK_PROG(HAVE_CAPABILITIES, md5sum, true, false)
                    fi
                    if test "x$HAVE_CAPABILITIES" = "xfalse"; then
                        AC_MSG_WARN([*** required program md5sum not found])
                    fi
                    if test "x$HAVE_CAPABILITIES" = "xfalse"; then
                        AC_MSG_ERROR([*** Capabilities support not present. Run configure again without --enable-capabilities.])
                    fi
                    USE_CAPABILITIES=true
                    AC_DEFINE(USE_CAPABILITIES,,[Enable POSIX 1.e capabilities support])
                fi
              ]
)

with_oldtrans=yes
AC_ARG_ENABLE(oldtrans,
              [  --disable-oldtrans      remove old transport interfaces],
              [ if test "x$enable_oldtrans" = "xno" ; then
		    with_oldtrans=no
		fi ])
if test "x$with_oldtrans" != "xno" ; then
	AC_DEFINE(OLD_TRANSPORT,,[Include old transport interfaces])
fi

STRIPPED_JACKD=false
AC_ARG_ENABLE(stripped-jackd,
              [  --enable-stripped-jackd	strip jack before computing its md5 sum ],
              [ if test "x$USE_CAPABILITIES" != "xtrue" ; then
                    AC_MSG_WARN([*** capabilities not enabled, stripped jackd has no effect])
                elif test "x$enable_stripped_jackd" != "xno"; then
                    STRIPPED_JACKD=true
                fi
              ]
)

AC_ARG_ENABLE(timestamps,
              [  --enable-timestamps	allow clients to use the JACK timestamp API ],
              [ if test "x$enable_debug" != "xno" ; then
                    AC_DEFINE(WITH_TIMESTAMPS,,[Enable JACK timestamp API])
                fi
              ]
)

# plugins go in the addon dir.

AS_AC_EXPAND(ADDON_DIR,${libdir}/jack)
AC_SUBST(ADDON_DIR)
AC_DEFINE_UNQUOTED(ADDON_DIR,"$ADDON_DIR",[Directory for plugins])

AC_ARG_WITH(html-dir,
            [  --with-html-dir=PATH    where to install the html documentation])

if test "x$with_html_dir" = "x" ; then
    HTML_DIR='${pkgdatadir}'
else
    HTML_DIR=$with_html_dir
fi

AC_SUBST(HTML_DIR)


# allow specifying default tmpdir
AC_ARG_WITH(default-tmpdir,
            [  --with-default-tmpdir=PATH    where jackd and clients will put tmp files (/tmp)])

if test "x$with_default_tmpdir" = "x" ; then
	DEFAULT_TMP_DIR=/tmp
else
	DEFAULT_TMP_DIR=$with_default_tmpdir
fi

AC_SUBST(DEFAULT_TMP_DIR)
AC_DEFINE_UNQUOTED(DEFAULT_TMP_DIR,"$DEFAULT_TMP_DIR",[Default tmp directory])




# jack depends on alsa 0.9. some example apps depend on libsndfile.
AC_CHECK_LIB(asound,snd_pcm_drop,
	     [
               HAVE_ALSA="true"
               ALSA_LIBS=-lasound
             ],
             [ 
               HAVE_ALSA="false"
               AC_MSG_WARN([ALSA 0.9 support not found])
             ],
	     [-lm]
)
AC_SUBST(ALSA_LIBS)

AC_ARG_ENABLE(portaudio, [  --enable-portaudio       Include PortAudio driver ],
			TRY_PORTAUDIO=yes , TRY_PORTAUDIO=no ) 


HAVE_PA="false"
if test "x$TRY_PORTAUDIO" = "xyes"
then
	# check for portaudio V18
	AC_CHECK_LIB(portaudio, Pa_Initialize,
	     [HAVE_PA="true" PA_LIBS=-lportaudio], [], [-lm -lpthread]
	)
	AC_SUBST(PA_LIBS)
fi

if test "x$HAVE_ALSA" != "xtrue" && test "x$HAVE_PA" != "xtrue"; then
	AC_MSG_ERROR(
	     [*** Neither PortAudio nor ALSA audio available, aborting...])
fi

HAVE_SNDFILE=false
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0,[HAVE_SNDFILE=true], [true])
if test x$HAVE_SNDFILE = xfalse; then
             AC_MSG_WARN([*** the jackrec example client will not be built])
fi

# on some systems, readline depends on termcap or ncurses, respectively
READLINE_DEPS=""
AC_CHECK_LIB(termcap, tgetent, [READLINE_DEPS="$READLINE_DEPS -ltermcap"])
AC_CHECK_LIB(ncurses, tgetent, [READLINE_DEPS="$READLINE_DEPS -lncurses"])
AC_CHECK_LIB(readline, readline,
             [HAVE_READLINE=true], [HAVE_READLINE=false], [$READLINE_DEPS]
)
if test x$HAVE_READLINE = xfalse; then
	AC_MSG_WARN([*** the jack_transport example client will not be built])
fi
AC_SUBST(READLINE_DEPS)

# you need doxygen to make dist.
AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
if test $HAVE_DOXYGEN = "false"; then
             AC_MSG_WARN([*** doxygen not found, docs will not be built])
fi

AM_CONDITIONAL(HAVE_SNDFILE, $HAVE_SNDFILE)
AM_CONDITIONAL(HAVE_READLINE, $HAVE_READLINE)
AM_CONDITIONAL(HAVE_DOXYGEN, $HAVE_DOXYGEN)
AM_CONDITIONAL(USE_CAPABILITIES, $USE_CAPABILITIES)
AM_CONDITIONAL(STRIPPED_JACKD, $STRIPPED_JACKD)
AM_CONDITIONAL(HAVE_ALSA, $HAVE_ALSA)
AM_CONDITIONAL(HAVE_PA, $HAVE_PA)

AC_OUTPUT(
Makefile
jack.pc
jack.spec
jack/Makefile
jack/version.h
jackd/Makefile
jackd/jackd.1
libjack/Makefile
drivers/Makefile
drivers/alsa/Makefile
drivers/dummy/Makefile
drivers/portaudio/Makefile
example-clients/Makefile
doc/Makefile
doc/reference.doxygen
)