forked from ukhas/dl-fldigi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
353 lines (295 loc) · 11 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_COPYRIGHT([Copyright (C) 2007, 2008, 2009 Stelios Bounanos, M0GLD (m0gld AT enotty DOT net)])
AC_PREREQ(2.61)
dnl major and minor must be integers; patch may
dnl contain other characters or be empty
m4_define(FLDIGI_MAJOR, [3])
m4_define(FLDIGI_MINOR, [21])
m4_define(FLDIGI_PATCH, [.50])
m4_define(FLARQ_MAJOR, [4])
m4_define(FLARQ_MINOR, [3])
m4_define(FLARQ_PATCH, [.3])
AC_INIT([dl-fldigi], FLDIGI_MAJOR.FLDIGI_MINOR[]FLDIGI_PATCH, [[email protected]])
# substitute in Makefiles
AC_SUBST([FLDIGI_VERSION_MAJOR], [FLDIGI_MAJOR])
AC_SUBST([FLDIGI_VERSION_MINOR], [FLDIGI_MINOR])
AC_SUBST([FLDIGI_VERSION_PATCH], [FLDIGI_PATCH])
AC_SUBST([FLDIGI_VERSION], [FLDIGI_MAJOR.FLDIGI_MINOR[]FLDIGI_PATCH])
AC_SUBST([FLARQ_VERSION_MAJOR], [FLARQ_MAJOR])
AC_SUBST([FLARQ_VERSION_MINOR], [FLARQ_MINOR])
AC_SUBST([FLARQ_VERSION_PATCH], [FLARQ_PATCH])
AC_SUBST([FLARQ_VERSION], [FLARQ_MAJOR.FLARQ_MINOR[]FLARQ_PATCH])
# define in config.h
AC_DEFINE([FLDIGI_VERSION_MAJOR], [FLDIGI_MAJOR], [Fldigi major version number])
AC_DEFINE([FLDIGI_VERSION_MINOR], [FLDIGI_MINOR], [Fldigi minor version number])
AC_DEFINE([FLDIGI_VERSION_PATCH], ["FLDIGI_PATCH"], [Fldigi patch/alpha version string])
AC_DEFINE([FLARQ_VERSION_MAJOR], [FLARQ_MAJOR], [Flarq major version number])
AC_DEFINE([FLARQ_VERSION_MINOR], [FLARQ_MINOR], [Flarq minor version number])
AC_DEFINE([FLARQ_VERSION_PATCH], ["FLARQ_PATCH"], [Flarq patch/alpha version string])
AC_DEFINE([FLDIGI_VERSION], ["FLDIGI_MAJOR.FLDIGI_MINOR[]FLDIGI_PATCH"], [Fldigi version string])
AC_DEFINE([FLARQ_VERSION], ["FLARQ_MAJOR.FLARQ_MINOR[]FLARQ_PATCH"], [Flarq version string])
AC_SUBST([AC_CONFIG_ARGS], [$ac_configure_args])
AC_CONFIG_AUX_DIR([build-aux])
# define build, build_cpu, build_vendor, build_os
AC_CANONICAL_BUILD
# define host, host_cpu, host_vendor, host_os
AC_CANONICAL_HOST
# define target, target_cpu, target_vendor, target_os
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall foreign std-options 1.9.6])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([src/main.cxx])
AC_CONFIG_HEADER([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
FLDIGI_AUTHORS="Dave Freese, Stelios Bounanos, Leigh Klotz, Remi Chateauneu, and others"
FLARQ_AUTHORS="Dave Freese"
PACKAGE_HOME="http://www.w1hkj.com/Fldigi.html"
PACKAGE_DL="http://www.w1hkj.com/download.html"
PACKAGE_PROJ="http://developer.berlios.de/project/showfiles.php?group_id=9149"
PACKAGE_NEWBUG="https://fedorahosted.org/fldigi/newticket"
PACKAGE_DOCS="http://www.w1hkj.com/FldigiHelp/index.html"
PACKAGE_GUIDE="http://www.w1hkj.com/beginners.html"
FLARQ_DOCS="http://www.w1hkj.com/FlarqHelpFiles/flarq.html"
AC_DEFINE_UNQUOTED([FLDIGI_AUTHORS], ["$FLDIGI_AUTHORS"], [Fldigi authors])
AC_DEFINE_UNQUOTED([FLARQ_AUTHORS], ["$FLARQ_AUTHORS"], [Flarq authors])
AC_DEFINE_UNQUOTED([PACKAGE_HOME], ["$PACKAGE_HOME"], [Home page])
AC_DEFINE_UNQUOTED([PACKAGE_DL], ["$PACKAGE_DL"], [Download page])
AC_DEFINE_UNQUOTED([PACKAGE_PROJ], ["$PACKAGE_PROJ"], [BerliOS page])
AC_DEFINE_UNQUOTED([PACKAGE_NEWBUG], ["$PACKAGE_NEWBUG"], [Trac new ticket page])
AC_DEFINE_UNQUOTED([PACKAGE_DOCS], ["$PACKAGE_DOCS"], [Docs index])
AC_DEFINE_UNQUOTED([PACKAGE_GUIDE], ["$PACKAGE_GUIDE"], [Beginners guide])
AC_DEFINE_UNQUOTED([FLARQ_DOCS], ["$FLARQ_DOCS"], [Flarq Docs index])
AC_SUBST([FLDIGI_AUTHORS], [$FLDIGI_AUTHORS])
AC_SUBST([FLARQ_AUTHORS], [$FLARQ_AUTHORS])
AC_SUBST([PACKAGE_HOME], [$PACKAGE_HOME])
AC_SUBST([PACKAGE_DL], [$PACKAGE_DL])
AC_SUBST([PACKAGE_PROJ], [$PACKAGE_PROJ])
AC_SUBST([PACKAGE_NEWBUG], [$PACKAGE_NEWBUG])
AC_SUBST([PACKAGE_DOCS], [$PACKAGE_DOCS])
AC_SUBST([PACKAGE_GUIDE], [$PACKAGE_GUIDE])
AC_SUBST([FLARQ_DOCS], [$FLARQ_DOCS])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS([arpa/inet.h execinfo.h fcntl.h limits.h memory.h netdb.h netinet/in.h regex.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/utsname.h termios.h unistd.h values.h linux/ppdev.h dev/ppbus/ppi.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_C_VOLATILE
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_PROG_GCC_TRADITIONAL
dnl AC_FUNC_MALLOC
dnl AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_CHECK_FUNCS([getaddrinfo gethostbyname hstrerror gmtime_r localtime_r memmove memset mkdir select setenv snprintf socket socketpair strcasecmp strcasestr strchr strdup strerror strlcpy strncasecmp strrchr strstr strtol uname unsetenv vsnprintf])
# Check for O_CLOEXEC
AC_FCNTL_FLAGS
AC_PRESERVE_HELP_ORDER
### Internationalization
AM_GNU_GETTEXT([external])
AM_CONDITIONAL([USE_NLS], [test "x$USE_NLS" = "xyes"])
### Programs
# Determine if fldigi and flarq have been requested and can be built
# Set ac_cv_want_fldigi and ac_cv_want_flarq to yes/no
# Set WANT_FLDIGI and WANT_FLARQ Makefile conditionals
AC_FLDIGI_PROGRAMS
###### OS support
### OSX
# Set ac_cv_mac_universal to yes/no
# Set DARWIN Makefile conditional
# Substitute MAC_UNIVERSAL_CFLAGS and MAC_UNIVERSAL_LDFLAGS in Makefile
AC_FLDIGI_MACOSX
### win32
# Set WIN32 Makefile conditional
# Set HAVE_WINDRES Makefile conditional
# Substitute WINDRES in Makefile
AC_FLDIGI_WIN32
### Non-POSIX compatibility (i.e. mingw32)
# Sets various Makefile conditionals; see m4/np-compat.m4
AC_FLDIGI_NP_COMPAT
### static flag
# Set ac_cv_static to yes/no
# Substitute RTLIB in Makefile
AC_FLDIGI_STATIC
### optimizations
# Set ac_cv_opt to arg
# Substitute OPT_FLAGS in Makefile
AC_FLDIGI_OPT
### debug flag
# Set ac_cv_debug to yes/no
# Override CXXFLAGS
# Set ENABLE_DEBUG Makefile conditional
# Substitute RDYNAMIC in Makefile
AC_FLDIGI_DEBUG
### benchmark mode
# Set ac_cv_benchmark to yes/no
# Define BENCHMARK_MODE in config.h
# Set ENABLE_BENCHMARK Makefile conditional
AC_FLDIGI_BENCHMARK
### TLS flag
# Set ac_cv_tls to yes/no
# Define USE_TLS in config.h
AC_FLDIGI_TLS
### std::bind or alternatives
# Set ac_cv_std_bind or ac_cv_std_tr1_bind to yes/no
# Define HAVE_STD_BIND or HAVE_STD_TR1_BIND in config.h
# Substitute BOOST_CPPFLAGS and BOOST_LDFLAGS in Makefile
# if falling back to Boost
AC_FLDIGI_BIND
### FLTK
# Substitute FLTK_CFLAGS and FLTK_LIBS in Makefile
# Set FLUID variable
# Set HAVE_FLUID Makefile conditional
AC_FLDIGI_FLTK
### XML-RPC library
# Set ac_cv_xmlrpc to yes/no
# Substitute XMLRPC_CFLAGS and XMLRPC_LIBS in Makefile
# Define USE_XMLRPC in config.h
# Set ENABLE_XMLRPC Makefile conditional
AC_FLDIGI_XMLRPC
### OSS
# Set ac_cv_oss to yes/no
# Define USE_OSS in config.h
AC_FLDIGI_OSS
### libcurl
# check if curl is available
if test "x$ac_cv_want_fldigi" = "xyes"; then
AC_FLDIGI_PKG_CHECK([curl], [libcurl >= 7.10.0], [no], [no])
fi
### libpng
# Required if $ac_cv_want_fldigi is "yes"
# Set ac_cv_png to yes/no (not used)
# Define USE_PNG in config.h (as above)
# Substitute PNG_CFLAGS and PNG_LIBS in Makefile
if test "x$ac_cv_want_fldigi" = "xyes"; then
AC_FLDIGI_PKG_CHECK([png], [libpng >= 1.2.8], [no], [no])
fi
### libsamplerate
# Required if $ac_cv_want_fldigi is "yes"
# Set ac_cv_samplerate to yes/no (not used)
# Define USE_SAMPLERATE in config.h (as above)
# Substitute SAMPLERATE_CFLAGS and SAMPLERATE_LIBS in Makefile
if test "x$ac_cv_want_fldigi" = "xyes"; then
AC_FLDIGI_PKG_CHECK([samplerate], [samplerate >= 0.1.1], [no], [no])
fi
### libsndfile
# Set ac_cv_sndfile to yes/no
# Define USE_SNDFILE in config.h
# Substitute SNDFILE_CFLAGS and SNDFILE_LIBS in Makefile
AC_FLDIGI_PKG_CHECK([sndfile], [sndfile >= 1.0.10], [yes], [yes],
[enable reading/writing of audio files via libsndfile @<:@autodetect@:>@] )
### portaudio
# Set ac_cv_portaudio to yes/no
# Define USE_PORTAUDIO in config.h
# Substitute PORTAUDIO_CFLAGS and PORTAUDIO_LIBS in Makefile
AC_FLDIGI_PKG_CHECK([portaudio], [portaudio-2.0 >= 19], [yes], [yes],
[enable support for PortAudio @<:@autodetect@:>@] )
### pulseaudio
# Set ac_cv_pulseaudio to yes/no
# Define USE_PULSEAUDIO in config.h
# Substitute PULSEAUDIO_CFLAGS and PULSEAUDIO_LIBS in Makefile
AC_FLDIGI_PKG_CHECK([pulseaudio], [libpulse-simple >= 0.9.7], [yes], [yes],
[enable support for PulseAudio @<:@autodetect@:>@] )
if test "x$ac_cv_oss" = "xno" && \
test "x$ac_cv_portaudio" = "xno" && \
test "x$ac_cv_pulseaudio" = "xno"; then
AC_MSG_WARN([*** $PACKAGE will be compiled without audio device support ***])
fi
### hamlib
# Set ac_cv_hamlib to yes/no
# Define USE_HAMLIB in config.h
# Substitute HAMLIB_CFLAGS and HAMLIB_LIBS in Makefile
# Set ENABLE_HAMLIB Makefile conditional
AC_FLDIGI_PKG_CHECK([hamlib], [hamlib >= 1.2.4], [yes], [yes],
[use hamradio control libraries @<:@autodetect@:>@],
[ENABLE_HAMLIB])
# We compile our own copy of hamlib's locator.c if hamlib is not available
# or if it is version <= 1.2.9, which has a broken azimuth_long_path function
AX_COMPARE_VERSION([$pkg_hamlib_version], [le], [1.2.9], [need_locator_c=yes], [need_locator_c=no])
AM_CONDITIONAL([NEED_HAMLIB_LOCATOR], [test "$need_locator_c" = "yes"])
### X11
# Set ac_cv_x to yes/no
# Define USE_X in config.h
# Substitute X_CFLAGS and X_LIBS in Makefile
if test "x$target_darwin" = "xno" && test "x$target_win32" = "xno"; then
AC_FLDIGI_PKG_CHECK([x], [x11], [no], [yes])
fi
### jpeg
if test "x$ac_cv_want_fldigi" = "xyes"; then
AC_FLDIGI_JPEG
fi
### libssl
if test "x$ac_cv_want_fldigi" = "xyes"; then
AC_FLDIGI_PKG_CHECK([ssl], [libssl], [no], [no])
fi
### libintl
# Substitute INTL_CFLAGS in Makefile
# Substitute INTL_LIBS in Makefile
# (default to LIBINTL)
AC_FLDIGI_INTL
### asciidoc
# substitute ASCIIDOC and A2X in doc/Makefile
# set HAVE_ASCIIDOC Makefile conditional
AC_FLDIGI_DOCS
### build info
# Define various build variables in config.h
AC_FLDIGI_BUILD_INFO
### silent build rules
AC_FLDIGI_BUILD_RULES
### output
AH_TOP([
#ifndef CONFIG_H_
#define CONFIG_H_
])
AH_BOTTOM([
#include "pkg.h"
#include "util.h"
#endif /* CONFIG_H_ */
])
AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in doc/Makefile])
AC_OUTPUT
### summary
AC_MSG_RESULT([
Configuration summary:
Version ..................... $VERSION
Static linking .............. $ac_cv_static
CPU optimizations ........... $ac_cv_opt
Debugging ................... $ac_cv_debug
fldigi ...................... $ac_cv_want_fldigi
flarq ....................... $ac_cv_want_flarq
i18n ........................ $USE_NLS
])
if test "x$ac_cv_want_fldigi" = "xyes"; then
AC_MSG_RESULT([ fldigi build options:
sndfile ..................... $ac_cv_sndfile
oss ......................... $ac_cv_oss
portaudio ................... $ac_cv_portaudio
pulseaudio .................. $ac_cv_pulseaudio
hamlib ...................... $ac_cv_hamlib
xmlrpc ...................... $ac_cv_xmlrpc
])
fi