forked from alexlee188/ghpsdr3-alex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
395 lines (291 loc) · 9.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
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([ghpsdr3], [rxtx-rtp-symm], [andrew att montefusco dott com])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([README])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
# Python checks for pylauncher
AM_PATH_PYTHON([2.5],, [:])
#
# Checking for build cpu
# and, if 64 bit, add some linking option
#
case $build_cpu in
x86_64)
AC_MSG_NOTICE([Platform: 64 bit])
LDFLAGS="$LDFLAGS -L/lib64 -L/usr/lib64"
export LDFLAGS
AC_MSG_NOTICE([${LDFLAGS}])
;;
esac
# compiling `client.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
AM_PROG_CC_C_O
# library (in DttSP) used but `RANLIB' is undefined: the usual way to define `RANLIB' is to add `AC_PROG_RANLIB'
AC_PROG_RANLIB
#
# Check for user options in order to selectively compile servers
#
AC_ARG_ENABLE([perseus],
[ --enable-perseus enable Perseus SDR server generation],
[perseus=${enableval}], [perseus=no]
)
AC_ARG_ENABLE([usrp],
[ --enable-usrp enable USRP server generation],
[usrp=${enableval}], [usrp=no]
)
#
# Check for compilation options which affect debugging
#
AC_ARG_ENABLE([debug-threads],
AC_HELP_STRING([--enable-debug-threads],
[Enable thread debugging facilities in dspserver]),
[threaddebug=$enableval], [threaddebug=no])
THREAD_DEBUG_CFLAGS=""
if test "x$threaddebug" = "xyes"; then
THREAD_DEBUG_CFLAGS="-DTHREAD_DEBUG"
fi
AC_SUBST([THREAD_DEBUG_CFLAGS])
#
# Checks for libraries.
# Check both libraries binary and header files
#
have_m=no
AC_SEARCH_LIBS([round], [m],[have_m=yes])
have_pthreads=no
AC_SEARCH_LIBS([pthread_create], [pthread],[have_pthreads=yes])
have_portaudio2=no
AC_SEARCH_LIBS([Pa_Initialize], [portaudio],[have_portaudio2=yes])
have_fftw3=no
AC_SEARCH_LIBS([fftwf_malloc], [fftw3f],[have_fftw3=yes])
have_codec2=no
AC_SEARCH_LIBS([codec2_create], [codec2],[have_codec2=yes])
have_pulse_simple=no
AC_SEARCH_LIBS([pa_simple_new], [pulse-simple],[have_pulse_simple=yes])
have_pulse=no
AC_SEARCH_LIBS([pa_strerror], [pulse],[have_pulse=yes])
have_usb=no
AC_SEARCH_LIBS([usb_init], [usb],[have_usb=yes])
have_jack=no
AC_SEARCH_LIBS([jack_client_open], [jack],[have_jack=yes])
have_config=no
AC_SEARCH_LIBS([config_init], [config],[have_config=yes])
have_usb10=no
AC_SEARCH_LIBS([libusb_init], [usb-1.0],[have_usb10=yes])
have_event20=no
AC_SEARCH_LIBS([event_init], [event],[have_event20=yes])
have_event20_pthreads=no
AC_SEARCH_LIBS([evthread_use_pthreads], [event_pthreads],
[have_event20_pthreads=yes])
have_samplerate=no
AC_SEARCH_LIBS([src_new], [samplerate],[have_samplerate=yes])
have_ortp=no
AC_SEARCH_LIBS([ortp_init], [ortp],[have_ortp=yes])
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/timeb.h unistd.h])
if test "x${have_pthreads}" = xyes; then
AC_CHECK_HEADERS([pthread.h], [], [have_pthreads=no])
fi
if test "x${have_pthreads}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The pthread library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_portaudio2}" = xyes; then
AC_CHECK_HEADERS([portaudio.h], [], [have_portaudio2=no])
fi
if test "x${have_portaudio2}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The portaudio2 library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_fftw3}" = xyes; then
AC_CHECK_HEADERS([fftw3.h], [], [have_fftw3=no])
fi
if test "x${have_fftw3}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The fftw3 library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_codec2}" = xyes; then
AC_CHECK_HEADERS([codec2.h], [], [have_codec2=no])
fi
if test "x${have_codec2}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The codec2 library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_pulse_simple}" = xyes; then
AC_CHECK_HEADERS([pulse/simple.h], [], [have_pulse_simple=no])
fi
if test "x${have_pulse_simple}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The pulse-simple library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_pulse}" = xyes; then
AC_CHECK_HEADERS([pulse/error.h], [], [have_pulse=no])
fi
if test "x${have_pulse}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The pulse library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_usb}" = xyes; then
AC_CHECK_HEADERS([usb.h], [], [have_usb=no])
fi
if test "x${have_usb}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The libusb-0.1 library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_jack}" = xyes; then
AC_CHECK_HEADERS([jack/jack.h], [], [have_jack=no])
fi
if test "x${have_jack}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The libjack library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_config}" = xyes; then
AC_CHECK_HEADERS([libconfig.h], [], [have_config=no])
fi
if test "x${have_config}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The libconfig8 library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_usb10}" = xyes; then
AC_CHECK_HEADERS([libusb-1.0/libusb.h], [], [have_usb10=no])
fi
if test "x${have_usb10}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The libusb-1.0 library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_event20}" = xyes; then
AC_CHECK_HEADERS([event2/event.h], [], [have_event20=no])
fi
if test "x${have_event20}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The libevent-2.0 library and header file required to build ghpsdr3. See README for installation instructions.
-----------------------------------])
fi
if test "x${have_event20_pthreads}" = xyes; then
AC_CHECK_HEADERS([event2/thread.h], [], [have_event20_pthreads=no])
fi
if test "x${have_event20_pthreads}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The libevent-2.0 library must be built with pthreads support to build
ghpsdr3. See the README file for installation instructions.
-----------------------------------
])
fi
if test "x${have_samplerate}" = xyes; then
AC_CHECK_HEADERS([samplerate.h], [], [have_samplerate=no])
fi
if test "x${have_samplerate}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The samplerate library and header file required to build ghpsdr3.
-----------------------------------])
fi
if test "x${have_ortp}" = xyes; then
AC_CHECK_HEADERS([ortp/ortp.h], [], [have_ortp=no])
fi
if test "x${have_ortp}" = xno; then
AC_MSG_ERROR([
-----------------------------------
The ortp library and header file required to build ghpsdr3.
-----------------------------------])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT32_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([floor ftime getcwd gethostbyname gettimeofday inet_ntoa memset pow select socket sqrt strrchr strstr strtol])
if test "x${perseus}" = xyes; then
AC_MSG_NOTICE([
-----------------------------------
Perseus SDR enabled.
-----------------------------------])
AC_CONFIG_SUBDIRS([trunk/src/perseus])
fi
AM_CONDITIONAL([MAKE_PERSEUS], [test "x${perseus}" = xyes])
AC_CONFIG_FILES([trunk/src/perseus/Makefile])
if test "x${usrp}" = xyes; then
AC_MSG_NOTICE([
-----------------------------------
USRP enabled.
-----------------------------------])
AC_CONFIG_SUBDIRS([trunk/src/usrp])
fi
AM_CONDITIONAL([MAKE_USRP], [test "x${usrp}" = xyes])
#
# Uncomment the following line when the usrp directory gets populated
#
AC_CONFIG_FILES([trunk/src/usrp/Makefile])
AC_CONFIG_SUBDIRS([trunk/src/QtRadio])
AC_CONFIG_FILES([Makefile
trunk/src/softrock/Makefile
trunk/src/DttSP/Makefile
trunk/src/dspserver/Makefile
trunk/src/widget-server/Makefile
trunk/src/server/Makefile
trunk/bin/Makefile
trunk/src/pylauncher/Makefile
trunk/src/hiqsdr/Makefile
trunk/src/sdriq/Makefile
])
AC_OUTPUT
echo \
"-----------------------------------------------------
${PACKAGE_NAME} Version ${PACKAGE_VERSION}
Prefix: '${prefix}'.
Compiler: '${CC} ${CFLAGS} ${CPPFLAGS}'
Now type 'make @<:@<target>@:>@'
where the otpional <target> is:
all - build all binaries
install - install everything
build: ${build}
build vendor: ${build_vendor}
build os: ${build_os}
build cpu: ${build_cpu}
host: ${host}
host cpu: ${host_cpu}
host vendor: ${host_vendor}
host os: ${host_os}
target: ${target}
target cpu: ${target_cpu}
target vendor: ${target_vendor}
target os: ${target_os}
-----------------------------------------------------"