3 .
scripts
/configure.sh ||
exit 1
7 check_cc_flag
-std=gnu99
-pipe -Wall -Wshadow -Wcast-align -Wpointer-arith \
8 -Wwrite-strings -Wundef -Wmissing-prototypes -Wredundant-decls
10 for i
in -Wdeclaration-after-statement -Wold-style-definition -Wno-pointer-sign
23 try_link
-lsocket && COMPAT_LIBS
="$COMPAT_LIBS -lsocket"
26 try_link
-lnsl && COMPAT_LIBS
="$COMPAT_LIBS -lnsl"
31 COMPAT_LIBS
="$COMPAT_LIBS -lrt"
32 elif try_link
-lposix4
34 COMPAT_LIBS
="$COMPAT_LIBS -lposix4"
39 makefile_vars CONFIG_CYGWIN
41 makefile_vars COMPAT_LIBS
46 if check_library NCURSES
"" -lncursesw
51 if check_library NCURSES
"" -lncurses || check_library NCURSES
"" -lcurses
54 msg_error
"Your ncurses does not support wide characters!"
55 msg_error
"Install ncursesw if you need wide character support,"
56 msg_error
"you can ignore this warning otherwise."
64 check_library MPC
"" "-lmpcdec"
70 check_library FLAC
"" "-lFLAC -lm" && return 0
71 check_library FLAC
"" "-lFLAC -lvorbisfile -lm"
77 pkg_config MAD
"mad" "" "-lmad -lm"
83 app_config MIKMOD libmikmod-config
&& return 0
84 # mikmod is linked against pthread
85 check_library MIKMOD
"$PTHREAD_CFLAGS" "-lmikmod $PTHREAD_LIBS"
91 pkg_config MODPLUG
"libmodplug" "-I/usr/include/libmodplug" "-lmodplug -lstdc++ -lm"
97 if test "$CONFIG_TREMOR" = y
99 pkg_config VORBIS
"vorbisidec" "" "-lvorbisidec -lm"
102 pkg_config VORBIS
"vorbisfile" "" "-lvorbisfile -lvorbis -lm -logg"
109 pkg_config WAVPACK
"wavpack" "" "-lwavpack"
115 # the alsa.pc file should be always available
116 pkg_config ALSA
"alsa >= 1.0.11"
122 pkg_config AO
"ao" "" "-lao"
128 app_config ARTS artsc-config
138 check_library OSS
"" "-lossaudio"
148 msg_checking
"for header <sys/soundcard.h>"
149 if test -f /usr
/include
/sys
/soundcard.h
152 makefile_vars OSS_CFLAGS OSS_LIBS
162 msg_checking
"for header <sys/audioio.h>"
163 if test -f /usr
/include
/sys
/audioio.h
177 check_library WAVEOUT
"" "-lwinmm"
185 check_header faad.h
&&
186 check_library MP4
"" "-lmp4v2 -lfaad -lm"
192 check_header faad.h
&&
193 check_library AAC
"" "-lfaad -lm"
199 pkg_config FFMPEG
"libavformat"
208 # unset CONFIG_* variables: if check succeeds 'y', otherwise 'n'
212 prefix Installation prefix [$prefix]
213 bindir User executables [\$prefix/bin]
214 datadir Read-only data [\$prefix/share]
215 libdir Libraries [\$prefix/lib]
216 mandir Man pages [\$datadir/man]
217 exampledir Examples [\$datadir/doc/cmus/examples]
218 DEBUG Debugging level (0-2) [$DEBUG]
220 Optional Features: y/n
221 CONFIG_FLAC Free Lossless Audio Codec (.flac, .fla) [auto]
222 CONFIG_MAD MPEG Audio Decoder (.mp3, .mp2, streams) [auto]
223 CONFIG_MODPLUG libmodplug (.mod, .x3m, ...) [auto]
224 CONFIG_MIKMOD libmikmod (.mod, .x3m, ...) [n]
225 CONFIG_MPC libmpcdec (Musepack .mpc, .mpp, .mp+) [auto]
226 CONFIG_VORBIS Ogg/Vorbis (.ogg, application/ogg, audio/x-ogg) [auto]
227 CONFIG_TREMOR Use Tremor as Ogg/Vorbis input plugin [n]
229 CONFIG_WAVPACK WavPack (.wv, audio/x-wavpack) [auto]
230 CONFIG_MP4 MPEG-4 AAC (.mp4, .m4a, .m4b) [auto]
231 CONFIG_AAC AAC (.aac, audio/aac, audio/aacp) [auto]
232 CONFIG_FFMPEG FFMPEG (.shn, .wma) [auto]
233 CONFIG_ALSA ALSA [auto]
234 CONFIG_AO Libao cross-platform audio library [auto]
235 CONFIG_ARTS ARTS [auto]
236 CONFIG_OSS Open Sound System [auto]
237 CONFIG_SUN Sun Audio [auto]
238 CONFIG_WAVEOUT Windows Wave Out [auto]
240 Also many standard variables like CC are recognized."
242 parse_command_line
"$@"
248 die
"DEBUG must be 0-2"
252 var_default bindir
"${prefix}/bin"
253 var_default datadir
"${prefix}/share"
254 var_default libdir
"${prefix}/lib"
255 var_default mandir
"${datadir}/man"
256 var_default exampledir
"${datadir}/doc/cmus/examples"
260 check check_cc_depgen
261 check check_endianness
268 check check_flac CONFIG_FLAC
269 check check_mad CONFIG_MAD
270 check check_mikmod CONFIG_MIKMOD
271 check check_modplug CONFIG_MODPLUG
272 check check_mpc CONFIG_MPC
273 check check_vorbis CONFIG_VORBIS
274 check check_wavpack CONFIG_WAVPACK
275 check check_mp4 CONFIG_MP4
276 check check_aac CONFIG_AAC
277 check check_ffmpeg CONFIG_FFMPEG
278 # nothing to check, just validate the variable values
279 check true CONFIG_TREMOR
280 check true CONFIG_WAV
281 check check_alsa CONFIG_ALSA
282 check check_ao CONFIG_AO
283 check check_arts CONFIG_ARTS
284 check check_oss CONFIG_OSS
285 check check_sun CONFIG_SUN
286 check check_waveout CONFIG_WAVEOUT
288 test "$WORDS_BIGENDIAN" = y
&& CFLAGS
="${CFLAGS} -DWORDS_BIGENDIAN"
293 config_header config
/datadir.h DATADIR
294 config_header config
/libdir.h LIBDIR
295 config_header config
/debug.h DEBUG
296 config_header config
/tremor.h CONFIG_TREMOR
298 makefile_vars bindir datadir libdir mandir exampledir
299 makefile_vars CONFIG_FLAC CONFIG_MAD CONFIG_MIKMOD CONFIG_MODPLUG CONFIG_MPC CONFIG_VORBIS CONFIG_WAVPACK CONFIG_WAV CONFIG_MP4 CONFIG_AAC CONFIG_FFMPEG
300 makefile_vars CONFIG_ALSA CONFIG_AO CONFIG_ARTS CONFIG_OSS CONFIG_SUN CONFIG_WAVEOUT