1 |
AC_INIT(configure.in) |
2 |
AC_C_BIGENDIAN |
3 |
AC_CANONICAL_SYSTEM |
4 |
|
5 |
AC_SUBST(target) |
6 |
AC_SUBST(target_alias) |
7 |
AC_SUBST(target_cpu) |
8 |
AC_SUBST(target_os) |
9 |
AC_SUBST(target_vendor) |
10 |
|
11 |
|
12 |
|
13 |
AC_MSG_CHECKING([whether x86 architecture]) |
14 |
def_arch_x86=0 |
15 |
case $target_cpu in |
16 |
"i386" | "i486" | "i586" | "i686" | "i786") |
17 |
echo "yes" |
18 |
def_arch_x86=1;; |
19 |
*) |
20 |
echo "no";; |
21 |
esac |
22 |
AC_DEFINE_UNQUOTED(ARCH_X86,$def_arch_x86,[Define to 1 if you build for x86 architecture.]) |
23 |
|
24 |
|
25 |
# determine the right gcc switch for CPU specific optimizations |
26 |
CXX_CPU_SWITCH= |
27 |
if test "$def_arch_x86" = 1; then |
28 |
CXX_CPU_SWITCH="-march=$target_cpu" |
29 |
elif test "$target_cpu" = "powerpc"; then |
30 |
CXX_CPU_SWITCH="-arch=$target_cpu" |
31 |
fi |
32 |
AC_SUBST([CXX_CPU_SWITCH]) |
33 |
|
34 |
|
35 |
AC_MSG_CHECKING([whether UNIX98 compatible]) |
36 |
AC_LANG_SAVE |
37 |
AC_LANG_C |
38 |
AC_TRY_RUN([ |
39 |
#ifndef _GNU_SOURCE |
40 |
#define _GNU_SOURCE 1 |
41 |
#endif |
42 |
#include <features.h> |
43 |
void main(void) { |
44 |
#if _XOPEN_SOURCE >= 500 |
45 |
exit(0); /* UNIX98 compatible */ |
46 |
#else |
47 |
exit(-1); /* not UNIX98 compatible */ |
48 |
#endif |
49 |
} |
50 |
], |
51 |
have_unix98="yes", |
52 |
have_unix98="no", |
53 |
have_unix98="no" |
54 |
) |
55 |
AC_LANG_RESTORE |
56 |
AC_MSG_RESULT([$have_unix98]) |
57 |
if test "$have_unix98" = "no"; then |
58 |
if test "x$HAVE_UNIX98" = "x"; then |
59 |
echo "LinuxSampler only runs on UNIX98 compatible systems, which is mandatory for" |
60 |
echo "pthread_mutexattr_settype() call in Mutex.cpp. You may want to run |
61 |
echo "./configure with environment variable HAVE_UNIX98=1 in case you think you |
62 |
echo "have a UNIX98 compatible system." |
63 |
exit -1; |
64 |
fi |
65 |
fi |
66 |
|
67 |
|
68 |
# Checks for available audio and MIDI systems / drivers |
69 |
# (we throw an error if there's not at least one system for audio output and MIDI input available) |
70 |
have_midi_input_driver="false" |
71 |
have_audio_output_driver="false" |
72 |
|
73 |
AC_CHECK_HEADER(alsa/asoundlib.h, |
74 |
AC_CHECK_LIB(asound, main, |
75 |
have_alsa=1 |
76 |
, |
77 |
have_alsa=0 |
78 |
) |
79 |
, |
80 |
have_alsa=0 |
81 |
) |
82 |
if test "$have_alsa" = "1"; then |
83 |
have_midi_input_driver="true" |
84 |
have_audio_output_driver="true"; |
85 |
fi |
86 |
AM_CONDITIONAL(HAVE_ALSA, test $have_alsa = "1") |
87 |
AC_DEFINE_UNQUOTED(HAVE_ALSA,$have_alsa,[Define to 1 if you have ALSA installed.]) |
88 |
|
89 |
|
90 |
echo -n "checking Alsa version... " |
91 |
AC_LANG_SAVE |
92 |
AC_LANG_C |
93 |
AC_TRY_RUN([ |
94 |
#include <alsa/asoundlib.h> |
95 |
void main(void) { |
96 |
/* ensure backward compatibility */ |
97 |
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) |
98 |
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR |
99 |
#endif |
100 |
exit(SND_LIB_MAJOR); |
101 |
} |
102 |
], |
103 |
alsa_major=0, |
104 |
alsa_major=$?, |
105 |
alsa_major=0 |
106 |
) |
107 |
AC_TRY_RUN([ |
108 |
#include <alsa/asoundlib.h> |
109 |
void main(void) { |
110 |
/* ensure backward compatibility */ |
111 |
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) |
112 |
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR |
113 |
#endif |
114 |
exit(SND_LIB_MINOR); |
115 |
} |
116 |
], |
117 |
alsa_minor=0, |
118 |
alsa_minor=$?, |
119 |
alsa_minor=0 |
120 |
) |
121 |
AC_TRY_RUN([ |
122 |
#include <alsa/asoundlib.h> |
123 |
void main(void) { |
124 |
/* ensure backward compatibility */ |
125 |
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) |
126 |
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR |
127 |
#endif |
128 |
exit(SND_LIB_SUBMINOR); |
129 |
} |
130 |
], |
131 |
alsa_subminor=0, |
132 |
alsa_subminor=$?, |
133 |
alsa_subminor=0 |
134 |
) |
135 |
AC_LANG_RESTORE |
136 |
echo "$alsa_major.$alsa_minor.$alsa_subminor"; |
137 |
AC_DEFINE_UNQUOTED(ALSA_MAJOR,$alsa_major,[Define to the major version number of your Alsa installation.]) |
138 |
AC_DEFINE_UNQUOTED(ALSA_MINOR,$alsa_minor,[Define to the minor version number of your Alsa installation.]) |
139 |
AC_DEFINE_UNQUOTED(ALSA_SUBMINOR,$alsa_subminor,[Define to the subminor version number of your Alsa installation.]) |
140 |
|
141 |
|
142 |
# JACK |
143 |
PKG_CHECK_MODULES(JACK, jack, HAVE_JACK=true, HAVE_JACK=false) |
144 |
AC_SUBST(JACK_LIBS) |
145 |
AC_SUBST(JACK_CFLAGS) |
146 |
if test $HAVE_JACK = false; then |
147 |
HAVE_JACK=0; |
148 |
else |
149 |
HAVE_JACK=1 |
150 |
have_audio_output_driver="true"; |
151 |
AC_CHECK_LIB(jack, jack_client_name_size, [AC_DEFINE(HAVE_JACK_CLIENT_NAME_SIZE, 1, [Define to 1 if you have the `jack_client_name_size' function.])], , $JACK_LIBS) |
152 |
fi |
153 |
AM_CONDITIONAL(HAVE_JACK, test $HAVE_JACK = 1) |
154 |
AC_DEFINE_UNQUOTED(HAVE_JACK,$HAVE_JACK,[Define to 1 if you have JACK installed.]) |
155 |
|
156 |
|
157 |
# Check presence of libgig |
158 |
libgig_version="1.0.0" |
159 |
PKG_CHECK_MODULES(GIG, gig >= $libgig_version, HAVE_GIG=true, HAVE_GIG=false) |
160 |
if test "$HAVE_GIG" = "false"; then |
161 |
echo "Required libgig version not found!" |
162 |
echo "You need to have libgig version ${libgig_version} installed!" |
163 |
exit -1; |
164 |
fi |
165 |
AC_SUBST(GIG_CFLAGS) |
166 |
AC_SUBST(GIG_LIBS) |
167 |
|
168 |
|
169 |
# SQLITE3 |
170 |
PKG_CHECK_MODULES(SQLITE3, sqlite3, HAVE_SQLITE3=true, HAVE_SQLITE3=false) |
171 |
AC_SUBST(SQLITE3_LIBS) |
172 |
AC_SUBST(SQLITE3_CFLAGS) |
173 |
if test $HAVE_SQLITE3 = false; then |
174 |
HAVE_SQLITE3=0; |
175 |
else |
176 |
HAVE_SQLITE3=1 |
177 |
fi |
178 |
AM_CONDITIONAL(HAVE_SQLITE3, test $HAVE_SQLITE3 = 1) |
179 |
AC_DEFINE_UNQUOTED(HAVE_SQLITE3,$HAVE_SQLITE3,[Define to 1 if you have SQLITE3 installed.]) |
180 |
|
181 |
|
182 |
if test "$have_midi_input_driver" = "false"; then |
183 |
echo "No supported MIDI input system found!" |
184 |
echo "Sorry, LinuxSampler only supports ALSA as MIDI input driver at the moment!" |
185 |
exit -1; |
186 |
fi |
187 |
if test "$have_audio_output_driver" = "false"; then |
188 |
echo "No supported audio output system found!" |
189 |
echo "Sorry, LinuxSampler only supports ALSA and JACK as audio output driver at the moment!" |
190 |
exit -1; |
191 |
fi |
192 |
|
193 |
|
194 |
AM_CONFIG_HEADER(config.h) |
195 |
AM_INIT_AUTOMAKE(linuxsampler, 0.3.1) |
196 |
|
197 |
AC_LANG_CPLUSPLUS |
198 |
AC_PROG_CXX |
199 |
|
200 |
# autoconf 2.59/libtool 1.5.12 bug? work-around. Without a check like |
201 |
# this, the dlfcn.h check in am_prog_libtool may fail. |
202 |
AC_CHECK_HEADER(stdlib.h) |
203 |
|
204 |
AM_PROG_LIBTOOL |
205 |
|
206 |
AC_OUTPUT(Makefile src/Makefile src/network/Makefile src/engines/Makefile src/engines/gig/Makefile src/engines/common/Makefile src/common/Makefile src/lib/Makefile src/lib/fileloader/Makefile src/lib/fileloader/libgig/Makefile src/testcases/Makefile src/drivers/Makefile src/drivers/audio/Makefile src/drivers/midi/Makefile) |