forked from karlstav/cava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
188 lines (142 loc) · 4.64 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
AC_INIT([cava], [m4_esyscmd_s([cat version])], [[email protected]])
AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign])
dnl AC_CONFIG_MACRO_DIRS([m4])
AM_PROG_AR
LT_INIT
AC_PROG_CC
AC_PROG_CC_STDC
AM_PROG_LIBTOOL
dnl ############################
dnl checking if debug is enabled
dnl ############################
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],
[enable debug messages and frequency table output])
)
AS_IF([test "x$enable_debug" = "xyes"], [
dnl enabling debug mode
CPPFLAGS="$CPPFLAGS -DDEBUG"
])
dnl ######################
dnl checking for pthread
dnl ######################
AC_CHECK_HEADERS([pthread.h],
AC_CHECK_LIB(pthread, pthread_create, LIBS="$LIBS -lpthread",
AC_MSG_ERROR([pthread.h found but there is no pthread library to make use of])
),
AC_MSG_ERROR([no pthread.h header header file found])
)
dnl ######################
dnl checking for alloca.h
dnl ######################
AC_CHECK_HEADER([alloca.h], [CPPFLAGS="$CPPFLAGS -DHAVE_ALLOCA_H"])
dnl ######################
dnl checking for alsa dev
dnl ######################
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
if [[ $have_alsa = "yes" ]] ; then
LIBS="$LIBS -lasound"
CPPFLAGS="$CPPFLAGS -DALSA"
fi
if [[ $have_alsa = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No alsa dev files found building without alsa support])
fi
dnl ######################
dnl checking for pulse dev
dnl ######################
AC_CHECK_LIB(pulse-simple, pa_simple_new, have_pulse=yes, have_pulse=no)
if [[ $have_pulse = "yes" ]] ; then
LIBS="$LIBS -lpulse-simple -lpulse"
CPPFLAGS="$CPPFLAGS -DPULSE"
fi
if [[ $have_pulse = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No pusleaudio dev files found building without pulseaudio support])
fi
dnl ######################
dnl checking for sndio dev
dnl ######################
AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
if [[ $have_sndio = "yes" ]] ; then
LIBS="$LIBS -lsndio"
CPPFLAGS="$CPPFLAGS -DSNDIO"
fi
if [[ $have_sndio = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No sndio dev files found building without sndio support])
fi
dnl ######################
dnl checking for math lib
dnl ######################
AC_CHECK_LIB(m, sqrt, have_m=yes, have_m=no)
if [[ $have_m = "yes" ]] ; then
LIBS="$LIBS -lm"
fi
if [[ $have_m = "no" ]] ; then
AC_MSG_ERROR([math library is required!])
fi
dnl ######################
dnl checking for fftw3
dnl ######################
AC_CHECK_LIB(fftw3,fftw_execute, have_fftw=yes, have_fftw=no)
if [[ $have_fftw = "yes" ]] ; then
LIBS="$LIBS -lfftw3"
fi
if [[ $have_fftw = "no" ]] ; then
AC_MSG_ERROR([fftw library is required!])
fi
dnl ######################
dnl checking for ncursesw
dnl ######################
curses_config_bin="ncursesw6-config ncursesw5-config"
AC_PATH_PROGS(CURSES_CONFIG, $curses_config_bin)
AC_CHECK_LIB(ncursesw, initscr,
curses_lib=ncursesw
)
AC_CHECK_LIB($curses_lib, initscr,
if test "$CURSES_CONFIG" = "" ; then
LIBS="$LIBS -l$curses_lib"
CPPFLAGS="$CPPFLAGS -DNCURSES"
fi
if test "$CURSES_CONFIG" != "" ; then
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags` -DNCURSES"
LIBS="$LIBS `$CURSES_CONFIG --libs`"
fi
AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header]))
,
AC_MSG_NOTICE([WARNING: building without ncursesw support ncursesw is recomended!])
)
dnl ######################
dnl checking for system iniparser
dnl ######################
AC_SEARCH_LIBS([iniparser_load], [iniparser], [
AC_CHECK_HEADERS([iniparser.h], [have_system_iniparser=yes])
])
AM_CONDITIONAL([SYSTEM_LIBINIPARSER], [test "x$have_system_iniparser" = "xyes"])
if test "x$have_system_iniparser" = "xyes"; then
AC_SUBST(SYSTEM_LIBINIPARSER, 1)
AC_MSG_NOTICE([Using installed iniparser])
else
AC_SUBST(SYSTEM_LIBINIPARSER, 0)
AC_CONFIG_FILES(iniparser/Makefile)
AC_MSG_NOTICE([Building iniparser])
fi
dnl ############################
dnl checking if legacy iniparser is enabled
dnl ############################
AC_ARG_ENABLE([legacy_iniparser],
AS_HELP_STRING([--enable-legacy_iniparser],
[enable legacy iniparser mode necessary to build cava with iniparser < 4.0])
)
AS_IF([test "x$enable_legacy_iniparser" = "xyes"], [
dnl enabling legacy-iniparser mode
CPPFLAGS="$CPPFLAGS -DLEGACYINIPARSER"
])
dnl ############################
dnl Set font directory
dnl ############################
DEFAULT_FONT_DIR="/usr/share/consolefonts"
AC_ARG_VAR(FONT_DIR, [Directory where the font will be installed.])
if test -z "$FONT_DIR" ; then
FONT_DIR="$DEFAULT_FONT_DIR"
fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT