-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.ac
371 lines (292 loc) · 9.33 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
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
AC_PREREQ(2.61)
AC_INIT([rakarrack],[0.6.2],[Josep Andreu [email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/main.C])
AC_CONFIG_HEADER([src/config.h])
AC_ARG_ENABLE(optimizations,
AC_HELP_STRING([--enable-optimizations[=yes/no]],[enable optimizations (default=yes)]),
[ac_optimizations="$enableval"], [ac_optimizations="yes"])
if test "x$ac_optimizations" = "xyes"; then
OPTS=""
else
OPTS="no"
fi
AC_ARG_ENABLE(vectorize,
AC_HELP_STRING([--enable-vectorize[=yes/no]],[enable vectorize (default=yes)]),
[ac_vectorize="$enableval"], [ac_vectorize="yes"])
if test "x$ac_vectorize" = "xyes"; then
VECTOR="-ftree-vectorize -fvect-cost-model"
else
ac_vectorize="no"
fi
AC_ARG_ENABLE(sse,
AC_HELP_STRING([--enable-sse],[enable sse (default=automatic check)]),
[ac_sse="$enableval"])
if test "x$ac_sse" = "xyes"; then
SSE="-msse -mfpmath=sse"
else
ac_sse="no"
fi
AC_ARG_ENABLE(sse2,
AC_HELP_STRING([--enable-sse2],[enable sse2 (default=automatic check)]),
[ac_sse2="$enableval"])
if test "x$ac_sse2" = "xyes"; then
SSE="-msse2 -mfpmath=sse"
else
ac_sse2="no"
fi
AC_ARG_ENABLE(altivec,
AC_HELP_STRING([--enable-altivec],[enable altivec (default=automatic check)]),
[ac_altivec="$enableval"])
if test "x$ac_altivec" = "xyes"; then
ALTIVEC="-maltivec"
else
ac_altivec="no"
fi
AC_ARG_ENABLE(jack-session,
AC_HELP_STRING([--enable-jack-session], [enable JACK session support (default=yes)]),
[ac_jack_session="$enableval"],
[ac_jack_session="yes"])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_CHECK_PROG([FLTKCONFIG], [fltk-config], [fltk-config])
if test -z "$FLTKCONFIG"; then
AC_MSG_ERROR([fltk not installed!])
else
ac_fltk="yes"
fi
AC_CHECK_PROG([ACONNECT],[aconnect],[aconnect])
if test -z "$ACONNECT"; then
AC_MSG_ERROR([aconnect not installed!])
fi
# Checks gcc version
GCC_VERSION=`$CC -dumpversion | cut -f 2 -d "."`
if test "$GCC_VERSION" = "5"; then
ADDS="-fvar-tracking-assignments-toggle -fexcess-precision=fast"
else
ADDS=""
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([floor memset memmove pow select sqrt strdup strstr])
# Checks for libraries.
AC_CHECK_LIB([X11], [XOpenDisplay],[ac_X11="yes"],[ac_X11="no"])
if test "x$ac_X11" = "xno"; then
AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
else
LIBS="$LIBS -lX11"
fi
AC_CHECK_LIB([Xft], [main], [ac_libXft="yes"], [ac_libXft="no"])
if test "x$ac_libXft" = "xno"; then
AC_MSG_ERROR([Xft library not found.])
else
LIBS="$LIBS -lXft"
fi
AC_CHECK_LIB([Xrender], [main], [ac_Xrender="yes"], [ac_Xrender="no"])
if test "x$ac_Xrender" = "xno"; then
AC_MSG_ERROR([Xrender library not found.])
else
LIBS="$LIBS -lXrender"
fi
AC_CHECK_LIB([dl], [main], [ac_dl="yes"], [ac_dl="no"])
if test "x$ac_dl" = "xno"; then
AC_MSG_ERROR([dl library not found.])
else
LIBS="$LIBS -ldl"
fi
AC_CHECK_LIB([Xpm],[main], [ac_Xpm="yes"], [ac_Xpm="no"])
if test "x$ac_Xpm" = "xno"; then
AC_MSG_ERROR([Xpm library not found.])
else
LIBS="$LIBS -lXpm"
fi
AC_CHECK_LIB([fontconfig], [main], [ac_fontconfig="yes"], [ac_fontconfig="no"])
if test "x$ac_fontconfig" = "xno"; then
AC_MSG_ERROR([fontconfig library not found.])
else
LIBS="$LIBS -lfontconfig"
fi
AC_CHECK_LIB([freetype], [main], [ac_freetype="yes"], [ac_freetype="no"])
if test "x$ac_freetype" = "xno"; then
AC_MSG_ERROR([freetype library not found.])
else
LIBS="$LIBS -lfreetype"
fi
AC_CHECK_LIB([m], [main], [ac_m="yes"], [ac_m="no"])
if test "x$ac_m" = "xno"; then
AC_MSG_ERROR([Math library not found.])
else
LIBS="$LIBS -lm"
fi
AC_CHECK_LIB([pthread], [main], [ac_pthread="yes"], [ac_pthread="no"] )
if test "x$ac_pthread" = "xno"; then
AC_MSG_ERROR([pthread library not found.])
else
LIBS="$LIBS -lpthread"
fi
AC_CHECK_LIB([rt], [main], [ac_rt="yes"], [ac_rt="no"])
if test "x$ac_rt" = "xno"; then
AC_MSG_ERROR([rt library not found.])
else
LIBS="$LIBS -lrt"
fi
AC_CHECK_LIB([z], [main], [ac_z="yes"], [ac_zm="no"])
if test "x$ac_z" = "xno"; then
AC_MSG_ERROR([z library not found.])
else
LIBS="$LIBS -lz"
fi
AC_CHECK_LIB([asound], [main], [ac_asound="yes"], [ac_asound="no"])
if test "x$ac_asound" = "xno"; then
AC_MSG_ERROR([ALSA libasound library not found.])
else
LIBS="$LIBS -lasound"
fi
AC_CHECK_LIB([jack],main, [ac_jack="yes"], [ac_jack="no"])
if test "x$ac_jack" = "xno"; then
AC_MSG_ERROR([JACK library not found.])
else
LIBS="$LIBS -ljack"
fi
AC_CHECK_LIB([sndfile],sf_open, [ac_sndfile="yes"], [ac_sndfile="no"])
if test "x$ac_sndfile" = "xno"; then
AC_MSG_ERROR([sndfile library not found.])
else
LIBS="$LIBS -lsndfile"
fi
AC_CHECK_LIB([samplerate],src_simple, [ac_samplerate="yes"], [ac_samplerate="no"])
if test "x$ac_samplerate" = "xno"; then
AC_MSG_ERROR([samplerate library not found.])
else
LIBS="$LIBS -lsamplerate"
fi
AC_CHECK_LIB([fftw3], [main], [ac_fftw3="yes"], [ac_fftw3="no"])
if test "x$ac_m" = "xno"; then
AC_MSG_ERROR([fftw library not found.])
else
LIBS="$LIBS -lfftw3"
fi
if test "x$ac_jack_session" = "xyes"; then
AC_CHECK_LIB(jack, jack_set_session_callback, [ac_jack_session="yes"], [ac_jack_session="no"])
else
AC_MSG_WARN([*** JACK latency support will be disabled.])
fi
if test "x$prefix" = "xNONE"; then
AC_DEFINE_UNQUOTED(PREFIX, "/usr/local", [Install prefix])
else
AC_DEFINE_UNQUOTED(PREFIX, "$prefix", [Install prefix])
fi
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h libintl.h stdlib.h string.h sys/ioctl.h unistd.h sndfile.h samplerate.h fftw3.h X11/xpm.h])
AC_CHECK_HEADER(alsa/asoundlib.h, true, AC_MSG_ERROR([Alsa is required]))
AC_SUBST(SAMPLERATE_CFLAG)
AC_SUBST(SAMPLERATE_LIBS)
if test "x$prefix" = "xNONE"; then
prefix=/usr/local
fi
AC_ARG_ENABLE(datadir,
AC_HELP_STRING([--enable-datadir[=yes/no]],[use datadir (default=no)]),
[ac_dd="$enableval"], [ac_dd="no"])
if test "x$ac_dd" = "xyes"; then
DATADIR="$datadir"
else
DATADIR="$prefix/share/${PACKAGE}"
fi
AC_ARG_ENABLE(docdir,
AC_HELP_STRING([--enable-docdir[=yes/no]],[use docdir (default=no)]),
[ac_hd="$enableval"], [ac_hd="no"])
if test "x$ac_hd" = "xyes"; then
HELPDIR="$docdir"
else
HELPDIR="$prefix/share/doc/${PACKAGE}"
fi
AC_DEFINE_UNQUOTED(DATADIR,"$DATADIR",[DATADIR])
AC_DEFINE_UNQUOTED(HELPDIR,"$HELPDIR",[HELPDIR])
AC_DEFINE([WEBSITE],["rakarrack.sf.net"],[WEBSITE])
if test -z "$OPTS";then
if test -z "$ALTIVEC";then
if test -z "$SSE"; then
SSE=$(cat /proc/cpuinfo | grep sse2)
if test -z "$SSE"; then
SSE=""
ac_sse2="no"
else
SSE="-msse2 -mfpmath=sse"
ac_sse2="yes"
fi
if test -z "$SSE"; then
SSE=$(cat /proc/cpuinfo | grep sse)
if test -z "$SSE"; then
SSE=""
ac_sse="no"
else
SSE="-msse -mfpmath=sse"
ac_sse="yes"
fi
fi
fi
fi
if test -z "$ALTIVEC"; then
ALTIVEC=$(cat /proc/cpuinfo | grep altivec)
if test -z "$ALTIVEC"; then
ALTIVEC=""
ac_altivec="no"
else
ALTIVEC="-maltivec"
ac_altivec="yes"
fi
fi
fi
if test "x$ac_jack_session" = "xyes"; then
AC_CHECK_HEADER(jack/session.h, [ac_jack_session="yes"], [ac_jack_session="no"])
if test "x$ac_jack_session" = "xyes"; then
AC_DEFINE(JACK_SESSION, 1, [Define if JACK session support is available.])
else
AC_MSG_WARN([*** jack/session.h file not found.])
AC_MSG_WARN([*** JACK session support will be disabled.])
fi
fi
LIBS="`$FLTKCONFIG --use-images --ldflags` $LIBS"
CXXFLAGS="-Wall $SSE $ALTIVEC -ffast-math $VECTOR -pipe $ADDS -fsigned-char `$FLTKCONFIG --use-images --cxxflags` `pkg-config --cflags sndfile` `pkg-config --cflags jack` $CXXFLAGS"
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile data/Makefile icons/Makefile doc/Makefile doc/help/Makefile doc/help/imagenes/Makefile doc/help/css/Makefile extra/Makefile])
AC_OUTPUT
echo
echo " $PACKAGE_NAME $PACKAGE_VERSION"
echo
echo
echo " Optimizations__________________________________________________"
echo " Vectorization. . . . . . . . . . . . . . . . . . . . . .: $ac_vectorize"
echo " Use altivec. . . . . . . . . . . . . . . . . . . . . . .: $ac_altivec"
echo " Use sse . . . . . . . . . . . . . . . . . . . . . . . .: $ac_sse"
echo " Use sse2 . . . . . . . . . . . . . . . . . . . . . . . .: $ac_sse2"
echo
echo " Library________________________________________________________"
echo " X11 support . . . . . . . . . . . . . . . . . . . . . .: $ac_X11"
echo " Xpm support (libxpm) . . . . . . . . . . . . . . . . . .: $ac_Xpm"
echo " Xft support . . . . . . . . . . . . . . . . . . . . . .: $ac_libXft"
echo " Xrender support . . . . . . . . . . . . . . . . . . . .: $ac_Xrender"
echo " Fontconfig support . . . . . . . . . . . . . . . . . . .: $ac_fontconfig"
echo " Freetype support . . . . . . . . . . . . . . . . . . . .: $ac_freetype"
echo " FLTK toolkit . . . . . . . . . . . . . . . . . . . . . .: $ac_fltk"
echo " pthread support (libpthread) . . . . . . . . . . . . . .: $ac_pthread"
echo " JACK Audio Connection Kit library . . . . . . . . . . .: $ac_jack"
echo " JACK Session support . . . . . . . . . . . . . . . . . .: $ac_jack_session"
echo " ALSA MIDI Sequencer support . . . . . . . . . . . . . .: $ac_asound"
echo " Samplerate conversion (libsamplerate). . . . . . . . . .: $ac_samplerate"
echo " General audio file (libsndfile) . . . . . . . . . . . .: $ac_sndfile"
echo " Fast Fourier Transform (fftw3) . . . . . . . . . . . .: $ac_fftw3"
echo
echo " Now maybe you can run 'make' to build the sources."
echo
echo