forked from windytan/redsea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
91 lines (77 loc) · 2.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
AC_PREREQ([2.69])
AC_INIT([redsea], [0.21-SNAPSHOT], [[email protected]], [redsea],
[https://github.com/windytan/redsea])
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_ARG_WITH([liquid],
[AS_HELP_STRING([--without-liquid],
[disable support for demodulation using liquid-dsp])])
AC_ARG_WITH([macports],
[AS_HELP_STRING([--without-macports],
[disable check for MacPorts directories when compiling])])
AC_ARG_ENABLE([tmc],
[AS_HELP_STRING([--disable-tmc],
[disable support for Traffic Message Channel (TMC)])])
AS_IF([test "x$enable_tmc" != xno],
[AC_DEFINE([ENABLE_TMC], [1],
[Define to compile TMC])
])
LIQUID=
AS_IF([test "x$with_liquid" != xno],
[AC_CHECK_LIB([liquid], [symtrack_cccf_create],
[AC_SUBST([LIQUID], ["-lliquid"])
AC_DEFINE([HAVE_LIQUID], [1],
[Define if you have liquid])
],
[AC_MSG_FAILURE(
[Could not find liquid-dsp (use --without-liquid to disable)])])])
AS_IF([test "x$with_liquid" != xno],
[AC_CHECK_LIB([liquid], [modemcf],
[AC_DEFINE([MODEM_IS_MODEMCF], [1],
[modem is called modemcf])])])
MACPORTS_LD=
AS_IF([test "x$with_macports" != xno],
[AC_CHECK_FILE(/opt/local/lib,
[AC_SUBST([MACPORTS_LD], ["-L/opt/local/lib"])])])
MACPORTS_CF=
AS_IF([test "x$with_macports" != xno],
[AC_CHECK_FILE(/opt/local/lib,
[AC_SUBST([MACPORTS_CF], ["-I/opt/local/include"])])])
AC_CHECK_LIB([sndfile], [main],
[AC_SUBST([SNDFILE], ["-lsndfile"])
AC_DEFINE([HAVE_SNDFILE], [1],
[Define if you have libsndfile])
],
[AC_MSG_FAILURE(
[Could not find libsndfile])])
WIN_CF=
LIBC=
AC_MSG_CHECKING([whether compiling for Windows])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if !defined(_WIN32) && !defined(_WIN64)
#error not compiling for Windows
#endif
]])],
# Windows
[AC_MSG_RESULT([yes]); AC_SUBST([WIN_CF], ["-D_USE_MATH_DEFINES=1"])],
# Unix
[AC_MSG_RESULT([no]); AC_SUBST([LIBC], ["-lc"])])
CPP_STD=c++14
AC_CANONICAL_HOST
case "${host_os}" in
darwin*|msys*|mingw*)
AC_SUBST([ICONV], ["-liconv"])
;;
cygwin*)
AC_SUBST([ICONV], ["-liconv"])
AC_SUBST([CPP_STD], ["gnu++14"])
;;
esac
AC_PROG_CXX
AC_PROG_RANLIB
AC_LANG([C++])
AC_OUTPUT