You need to sign in or sign up before continuing.
configure.ac 18.5 KB
Newer Older
1 2 3 4
dnl AC_INIT(src/main.c)
dnl AM_INIT_AUTOMAKE(mpd, 0.10.0)

AC_PREREQ(2.52)
Warren Dukes's avatar
Warren Dukes committed
5
AC_INIT(mpd, 0.12.0, shank@mercury.chem.pitt.edu)
6
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
Warren Dukes's avatar
Warren Dukes committed
7 8 9 10 11 12 13 14 15

dnl MAD wants this stuff
AC_SUBST(CCAS)
AC_SUBST(CCASFLAGS)

AC_SUBST(MAD_SUBDIR)
AC_SUBST(MAD_LIB)
AC_SUBST(ID3_SUBDIR)
AC_SUBST(ID3_LIB)
16
AC_SUBST(MP4FF_LIB)
17
AC_SUBST(MP4FF_SUBDIR)
Warren Dukes's avatar
Warren Dukes committed
18 19 20
AC_SUBST(MPD_LIBS)
AC_SUBST(MPD_CFLAGS)

21 22 23
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
24
AC_PROG_MAKE_SET
25

26 27
AM_CONFIG_HEADER(config.h)

28 29 30 31
MPD_CFLAGS=""
if test x$CC = xgcc; then
	MPD_CFLAGS="-Wall"
fi
Warren Dukes's avatar
Warren Dukes committed
32 33
MPD_LIBS=""

34
AC_ARG_ENABLE(audio,[  --disable-audio    disable support for playing],,enable_ao=yes)
35
AC_ARG_ENABLE(shout,[  --disable-shout    disable support for streaming through shout],,enable_shout=yes)
Warren Dukes's avatar
Warren Dukes committed
36
AC_ARG_ENABLE(iconv,[  --disable-iconv     disable iconv support],,enable_iconv=yes)
Warren Dukes's avatar
Warren Dukes committed
37
AC_ARG_ENABLE(ipv6,[  --disable-ipv6     disable IPv6 support],,enable_ipv6=yes)
38
AC_ARG_ENABLE(alsa,[  --disable-oss     disable OSS support],,enable_oss=yes)
Warren Dukes's avatar
Warren Dukes committed
39
AC_ARG_ENABLE(alsa,[  --disable-alsa     disable ALSA Mixer support],,enable_alsa=yes)
Warren Dukes's avatar
Warren Dukes committed
40 41 42
AC_ARG_ENABLE(ogg,[  --disable-ogg     disable ogg support],,enable_ogg=yes)
AC_ARG_ENABLE(flac,[  --disable-flac    disable flac support],,enable_flac=yes)
AC_ARG_ENABLE(mp3,[  --disable-mp3     disable mp3 support],,enable_mp3=yes)
43
AC_ARG_ENABLE(aac,[  --disable-aac     disable AAC support],,enable_aac=yes)
Warren Dukes's avatar
Warren Dukes committed
44
AC_ARG_ENABLE(audiofile,[  --disable-audiofile disable audiofile support, disables wave support],,enable_audiofile=yes)
45
AC_ARG_ENABLE(mod,[  --disable-mod     disable MOD support],,enable_mod=yes)
Warren Dukes's avatar
Warren Dukes committed
46
AC_ARG_ENABLE(id3,[  --disable-id3     disable id3 support],,enable_id3=yes)
47
AC_ARG_ENABLE(mpd_mad,[  --enable-mpd-mad     use mpd libmad],use_mpd_mad=yes,)
Warren Dukes's avatar
Warren Dukes committed
48 49
AC_ARG_ENABLE(mpd_id3tag,[  --enable-mpd-id3tag    use mpd libid3tag],use_mpd_id3tag=yes,)

Warren Dukes's avatar
Warren Dukes committed
50 51 52 53
AC_ARG_WITH(iconv,[  --with-iconv=PFX   Prefix where iconv is installed (optional)], iconv_prefix="$withval", iconv_prefix="")
AC_ARG_WITH(iconv-libraries,[  --with-iconv-libraries=DIR   Directory where libiconv library is installed (optional)], iconv_libraries="$withval", iconv_libraries="")
AC_ARG_WITH(iconv-includes,[  --with-iconv-includes=DIR   Directory where libiconv header files are installed (optional)], iconv_includes="$withval", iconv_includes="")

Warren Dukes's avatar
Warren Dukes committed
54 55 56 57 58 59 60 61
AC_ARG_WITH(id3tag,[  --with-id3tag=PFX   Prefix where libid3tag is installed (optional)], id3tag_prefix="$withval", id3tag_prefix="")
AC_ARG_WITH(id3tag-libraries,[  --with-id3tag-libraries=DIR   Directory where libid3tag library is installed (optional)], id3tag_libraries="$withval", id3tag_libraries="")
AC_ARG_WITH(id3tag-includes,[  --with-id3tag-includes=DIR   Directory where libid3tag header files are installed (optional)], id3tag_includes="$withval", id3tag_includes="")

AC_ARG_WITH(mad,[  --with-mad=PFX   Prefix where libmad is installed (optional)], mad_prefix="$withval", mad_prefix="")
AC_ARG_WITH(mad-libraries,[  --with-mad-libraries=DIR   Directory where libmad library is installed (optional)], mad_libraries="$withval", mad_libraries="")
AC_ARG_WITH(mad-includes,[  --with-mad-includes=DIR   Directory where mad header files are installed (optional)], mad_includes="$withval", mad_includes="")

62 63 64
AC_ARG_WITH(faad,[  --with-faad=PFX   Prefix where faad2 is installed], faad_prefix="$withval", faad_prefix="")
AC_ARG_WITH(faad-libraries,[  --with-faad-libraries=DIR   Directory where faad2 library is installed (optional)], faad_libraries="$withval", faad_libraries="")
AC_ARG_WITH(faad-includes,[  --with-faad-includes=DIR   Directory where faad2 header files are installed (optional)], faad_includes="$withval", faad_includes="")
65

Warren Dukes's avatar
Warren Dukes committed
66 67 68 69 70 71 72
AC_C_BIGENDIAN

AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)

Warren Dukes's avatar
Warren Dukes committed
73 74
AC_CHECK_HEADER(sys/inttypes.h,AC_DEFINE(HAVE_SYS_INTTYPES_H,1,[Define if sys/types.h present]),)

Warren Dukes's avatar
Warren Dukes committed
75 76 77
AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)

78 79
AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)

80 81 82
dnl doesn't work for systems that don't have CODESET like OpenBSD
dnl AC_CHECK_HEADER(langinfo.h,[enable_langinfo=yes;AC_DEFINE(HAVE_LANGINFO,1,[Define if nl_langinfo.h is present])],enable_langinfo=no)
AM_LANGINFO_CODESET
83
AC_CHECK_HEADER(locale.h,[enable_locale=yes;AC_DEFINE(HAVE_LOCALE,1,[Define if locale.h is present])],enable_locale=no)
Warren Dukes's avatar
Warren Dukes committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97

if test x$enable_ipv6 = xyes; then
	AC_MSG_CHECKING(for ipv6)
	AC_EGREP_CPP([AP_maGiC_VALUE],
	[
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#ifdef PF_INET6
#ifdef AF_INET6
AP_maGiC_VALUE
#endif
#endif
	],
98
	AC_DEFINE(HAVE_IPV6, 1, [Define if IPv6 support present])
Warren Dukes's avatar
Warren Dukes committed
99 100 101 102 103
	AC_MSG_RESULT([yes]),
	AC_MSG_RESULT([no])
)
fi

104 105 106 107 108
if test x$enable_ao = xyes; then
	XIPH_PATH_AO(MPD_LIBS="$MPD_LIBS $AO_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AO_CFLAGS",AC_MSG_ERROR(Must have libao installed!!!))
	AC_DEFINE(HAVE_AUDIO, 1, [Define to play audio])
fi

109 110 111 112
if test x$enable_shout = xyes; then
	XIPH_PATH_SHOUT([AC_DEFINE(HAVE_SHOUT, 1, [Define to enable libshout support]) MPD_LIBS="$MPD_LIBS $SHOUT_LIBS" MPD_CFLAGS="$MPD_CFLAGS $SHOUT_CFLAGS"], enable_shout=no)
fi

113
AC_CHECK_HEADER(sys/soundcard.h,[enable_oss=yes;AC_DEFINE(HAVE_OSS,1,[Define to enable OSS])],[AC_MSG_WARN(Soundcard headers not found -- disabling OSS support);enable_oss=no])
Warren Dukes's avatar
Warren Dukes committed
114

Warren Dukes's avatar
Warren Dukes committed
115 116 117 118
if test x$enable_alsa = xyes; then
	AC_MSG_CHECKING(for alsa)
	AC_EGREP_CPP([AP_maGiC_VALUE],
	[
Warren Dukes's avatar
Warren Dukes committed
119 120 121 122 123 124
#include <alsa/asoundlib.h>
#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR)
#if SND_LIB_MAJOR>0 || (SND_LIB_MAJOR==0 && SND_LIB_MINOR>=6)
AP_maGiC_VALUE
#endif
#endif
Warren Dukes's avatar
Warren Dukes committed
125 126 127 128 129 130 131
	],
	enable_alsa=yes
	AC_MSG_RESULT([yes]),
	enable_alsa=no
	AC_MSG_RESULT([no])
	)
fi
Warren Dukes's avatar
Warren Dukes committed
132

133 134 135 136
if test x$enable_alsa = xyes; then
	AC_CHECK_LIB(asound,main,[MPD_LIBS="$MPD_LIBS -lasound";AC_DEFINE(HAVE_ALSA,1,[Define if alsa support is present])],enable_alsa=no)
fi

Warren Dukes's avatar
Warren Dukes committed
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
if test x$enable_iconv = xyes; then
  	if test "x$iconv_libraries" != "x" ; then
  		ICONV_LIBS="-L$iconv_libraries"
  	elif test "x$iconv_prefix" != "x" ; then
    		ICONV_LIBS="-L$iconv_prefix/lib"
  	elif test "x$prefix" != "xNONE"; then
    		ICONV_LIBS="-L$libdir"
  	fi

  	ICONV_LIBS="$ICONV_LIBS -liconv"

  	if test "x$iconv_includes" != "x" ; then
  		ICONV_CFLAGS="-I$iconv_includes"
  	elif test "x$iconv_prefix" != "x" ; then
    		ICONV_CFLAGS="-I$iconv_prefix/include"
  	elif test "x$prefix" != "xNONE"; then
    		ICONV_CFLAGS="-I$includedir"
  	fi

	oldcflags=$CFLAGS
	oldlibs=$LIBS
158
	oldcppflags=$CPPFLAGS
Warren Dukes's avatar
Warren Dukes committed
159 160
	CFLAGS="$CFLAGS $MPD_CFLAGS $ICONV_CFLAGS"
	LIBS="$LIBS $MPD_LIBS $ICONV_LIBS"
161
	CPPFLAGS=$CFLAGS
Warren Dukes's avatar
Warren Dukes committed
162 163
	AC_CHECK_HEADER(iconv.h,MPD_CFLAGS="$MPD_CFLAGS $ICONV_CFLAGS",enable_iconv=no)
	if test x$enable_iconv = xyes; then
164
		AC_CHECK_LIB(iconv,main,MPD_LIBS="$MPD_LIBS $ICONV_LIBS",)
Warren Dukes's avatar
Warren Dukes committed
165 166 167 168
		AC_DEFINE(HAVE_ICONV,1,[Define to use iconv])
	fi
	CFLAGS=$oldcflags
	LIBS=$oldlibs
169
	CPPFLAGS=$oldcppflags
Warren Dukes's avatar
Warren Dukes committed
170 171
fi

Warren Dukes's avatar
Warren Dukes committed
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
ID3_SUBDIR=""

if test x$enable_id3 = xyes; then
	if test x$use_mpd_id3tag = xyes; then
		ID3_SUBDIR="libid3tag"
	else
  		if test "x$id3tag_libraries" != "x" ; then
  			ID3TAG_LIBS="-L$id3tag_libraries"
  		elif test "x$id3tag_prefix" != "x" ; then
    			ID3TAG_LIBS="-L$id3tag_prefix/lib"
  		elif test "x$prefix" != "xNONE"; then
    			ID3TAG_LIBS="-L$libdir"
  		fi

  		ID3TAG_LIBS="$ID3TAG_LIBS -lid3tag -lz"

  		if test "x$id3tag_includes" != "x" ; then
  			ID3TAG_CFLAGS="-I$id3tag_includes"
  		elif test "x$id3tag_prefix" != "x" ; then
191
    			ID3TAG_CFLAGS="-I$id3tag_prefix/include"
Warren Dukes's avatar
Warren Dukes committed
192
  		elif test "x$prefix" != "xNONE"; then
193
    			ID3TAG_CFLAGS="-I$includedir"
Warren Dukes's avatar
Warren Dukes committed
194 195 196 197 198
  		fi

  		ID3TAG_CFLAGS="$ID3TAG_CFLAGS"

		oldcflags=$CFLAGS
199
		oldlibs=$LIBS
200
		oldcppflags=$CPPFLAGS
201 202
		CFLAGS="$CFLAGS $MPD_CFLAGS $ID3TAG_CFLAGS"
		LIBS="$LIBS $MPD_LIBS $ID3TAG_LIBS"
203
		CPPFLAGS=$CFLAGS
204
		AC_CHECK_HEADERS(id3tag.h,use_libid3tag=yes,
Warren Dukes's avatar
Warren Dukes committed
205
			[use_libid3tag=no;use_mpd_id3tag=yes])
206 207 208 209 210 211 212
		if test x$use_libid3tag = xyes; then
			AC_CHECK_LIB(id3tag,id3_file_open,
				[ID3_LIB="$ID3TAG_LIBS";
     				MPD_CFLAGS="$MPD_CFLAGS $ID3TAG_CFLAGS";
				use_libid3tag=yes],
				[use_libid3tag=no;use_mpd_id3tag=yes])
		fi
Warren Dukes's avatar
Warren Dukes committed
213
		CFLAGS=$oldcflags
214
		LIBS=$oldlibs
215
		CPPFLAGS=$oldcppflags
Warren Dukes's avatar
Warren Dukes committed
216 217
	fi
	if test x$use_mpd_id3tag = xyes; then
218
		AC_DEFINE(USE_MPD_ID3TAG,1,[Define to use mpd libid3tag])
Warren Dukes's avatar
Warren Dukes committed
219 220 221 222
		ID3_LIB="libid3tag/libid3tag.la"
		ID3_SUBDIR="libid3tag"
		AC_CONFIG_SUBDIRS(src/libid3tag)
	fi
223
	AC_DEFINE(HAVE_ID3TAG,1,[Define to use id3tag])
Warren Dukes's avatar
Warren Dukes committed
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
fi

MAD_SUBDIR=""

if test x$enable_mp3 = xyes; then
	if test x$use_mpd_mad = xyes; then
		MAD_SUBDIR="libmad"
	else
  		if test "x$mad_libraries" != "x" ; then
  			MAD_LIBS="-L$mad_libraries"
  		elif test "x$mad_prefix" != "x" ; then
    			MAD_LIBS="-L$mad_prefix/lib"
  		elif test "x$prefix" != "xNONE"; then
    			MAD_LIBS="-L$libdir"
  		fi

  		MAD_LIBS="$MAD_LIBS -lmad"

  		if test "x$mad_includes" != "x" ; then
  			MAD_CFLAGS="-I$mad_includes"
  		elif test "x$mad_prefix" != "x" ; then
245
    			MAD_CFLAGS="-I$mad_prefix/include"
Warren Dukes's avatar
Warren Dukes committed
246
  		elif test "x$prefix" != "xNONE"; then
247
    			MAD_CFLAGS="-I$includedir"
Warren Dukes's avatar
Warren Dukes committed
248 249
  		fi

250 251
		oldcflags=$CFLAGS
		oldlibs=$LIBS
252
		oldcppflags=$CPPFLAGS
253 254
		CFLAGS="$CFLAGS $MPD_CFLAGS $MAD_CFLAGS"
		LIBS="$LIBS $MPD_LIBS $MAD_LIBS"
255
		CPPFLAGS=$CFLAGS
256 257 258 259 260 261 262
		AC_CHECK_HEADERS(mad.h,use_libmad=yes,
			[use_libmad=no;use_mpd_mad=yes])
		if test x$use_libmad = xyes; then
			AC_CHECK_LIB(mad,mad_stream_init,[MAD_LIB="$MAD_LIBS";
				MPD_CFLAGS="$MPD_CFLAGS $MAD_CFLAGS";
     				use_libmad=yes],[use_libmad=no;use_mpd_mad=yes])
		fi
263 264
		CFLAGS=$oldcflags
		LIBS=$oldlibs
265
		CPPFLAGS=$oldcppflags
Warren Dukes's avatar
Warren Dukes committed
266 267
	fi
	if test x$use_mpd_mad = xyes; then
268
		AC_DEFINE(USE_MPD_MAD,1,[Define to use mpd libmad])
Warren Dukes's avatar
Warren Dukes committed
269 270 271 272
		MAD_LIB="libmad/libmad.la"
		MAD_SUBDIR="libmad"
		AC_CONFIG_SUBDIRS(src/libmad)
	fi
273
	AC_DEFINE(HAVE_MAD,1,[Define to use libmad])
Warren Dukes's avatar
Warren Dukes committed
274 275
fi

276 277
MP4FF_SUBDIR=""

278 279 280 281 282 283 284 285 286
if test x$enable_aac = xyes; then
  	if test "x$faad_libraries" != "x" ; then
  		FAAD_LIBS="-L$faad_libraries"
  	elif test "x$faad_prefix" != "x" ; then
    		FAAD_LIBS="-L$faad_prefix/lib"
  	elif test "x$prefix" != "xNONE"; then
    		FAAD_LIBS="-L$libdir"
  	fi

287
 	FAAD_LIBS="$FAAD_LIBS -lfaad"
288 289 290 291 292 293 294 295 296 297 298

  	if test "x$faad_includes" != "x" ; then
  		FAAD_CFLAGS="-I$faad_includes"
  	elif test "x$faad_prefix" != "x" ; then
    		FAAD_CFLAGS="-I$faad_prefix/include"
  	elif test "x$prefix" != "xNONE"; then
    		FAAD_CFLAGS="-I$includedir"
  	fi

	oldcflags=$CFLAGS
	oldlibs=$LIBS
299
	oldcppflags=$CPPFLAGS
300
	CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS -I."
301
	LIBS="$LIBS $MPD_LIBS $FAAD_LIBS"
302
	CPPFLAGS=$CFLAGS
303
	AC_CHECK_HEADER(faad.h,,enable_aac=no)
304 305 306
	if test x$enable_aac = xyes; then
		AC_CHECK_DECL(FAAD2_VERSION,,enable_aac=no,[#include <faad.h>])
	fi
307
	if test x$enable_aac = xyes; then
Warren Dukes's avatar
Warren Dukes committed
308
		AC_CHECK_DECL(faacDecInit2,,enable_aac=no,[#include <faad.h>])
309 310
	fi
	if test x$enable_aac = xyes; then
Warren Dukes's avatar
Warren Dukes committed
311 312 313
		AC_CHECK_LIB(faad,faacDecInit2,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no)
	fi
	if test x$enable_aac = xyes; then
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
  		AC_MSG_CHECKING(that FAAD2 uses buffer and bufferlen)
		AC_COMPILE_IFELSE([
#include <faad.h>

int main() {
	char buffer;
	long bufferlen = 0;
	faacDecHandle decoder;
	faacDecFrameInfo frameInfo;
	faacDecConfigurationPtr config;
	unsigned char channels;
	long sampleRate;
        mp4AudioSpecificConfig mp4ASC;

	decoder = faacDecOpen();
	config = faacDecGetCurrentConfiguration(decoder);
	config->outputFormat = FAAD_FMT_16BIT;
	faacDecSetConfiguration(decoder,config);
	AudioSpecificConfig(&buffer, bufferlen, &mp4ASC);
	faacDecInit(decoder,&buffer,bufferlen,&sampleRate,&channels);
	faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
	faacDecDecode(decoder,&frameInfo,&buffer,bufferlen);

	return 0;
}
],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FAAD_BUFLEN_FUNCS,1,[Define if FAAD2 uses buflen in function calls])],[AC_MSG_RESULT(no);
		AC_MSG_CHECKING(that FAAD2 can even be used)
		AC_COMPILE_IFELSE([
#include <faad.h>

int main() {
	char buffer;
	faacDecHandle decoder;
	faacDecFrameInfo frameInfo;
	faacDecConfigurationPtr config;
	unsigned char channels;
	long sampleRate;
	long bufferlen = 0;
	unsigned long dummy1_32;
        unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
                                dummy7_8, dummy8_8;

	decoder = faacDecOpen();
	config = faacDecGetCurrentConfiguration(decoder);
	config->outputFormat = FAAD_FMT_16BIT;
	faacDecSetConfiguration(decoder,config);
	AudioSpecificConfig(&buffer,&dummy1_32,&dummy2_8,
                                &dummy3_8,&dummy4_8,&dummy5_8,
                                &dummy6_8,&dummy7_8,&dummy8_8);
	faacDecInit(decoder,&buffer,&sampleRate,&channels);
	faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
	faacDecDecode(decoder,&frameInfo,&buffer);
	faacDecClose(decoder);

	return 0;
}
],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no);enable_aac=no])
		])
	fi
	if test x$enable_aac = xyes; then
		AC_CHECK_TYPES(mp4AudioSpecificConfig,,,[#include <faad.h>])
		AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR,faacDecFrameInfo.samplerate],,,[#include <faad.h>])
376
		AC_DEFINE(HAVE_FAAD,1,[Define to use FAAD2 for AAC decoding])
377 378
	else
		AC_MSG_WARN([faad2 lib needed for MP4/AAC support -- disabling MP4/AAC support])
379 380 381
	fi
	CFLAGS=$oldcflags
	LIBS=$oldlibs
382
	CPPFLAGS=$oldcppflags
383 384
fi

Warren Dukes's avatar
Warren Dukes committed
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
if test x$enable_ogg = xyes; then
	XIPH_PATH_OGG(MPD_LIBS="$MPD_LIBS $OGG_LIBS" MPD_CFLAGS="$MPD_CFLAGS $OGG_CFLAGS",enable_ogg=no)
fi

if test x$enable_ogg = xyes; then
	enable_vorbistest=no
	XIPH_PATH_VORBIS(,enable_ogg=no)
	if test x$enable_ogg = xyes; then

dnl
dnl Vorbis Test
dnl vorbistest in XIPH_PATH_OGG is broken on my debian system
dnl so here i used my own hacked up version till i get vorbis-dev gets
dnl upgraded in debian (hopefully when 1.0.1 comes out)
dnl
		
  		AC_MSG_CHECKING(that Vorbis is usable)

    		ac_save_CFLAGS="$CFLAGS"
    		ac_save_LIBS="$LIBS"
    		CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
    		LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"

      		AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>

int main ()
{
    vorbis_block 	vb;
    vorbis_dsp_state	vd;
    vorbis_info		vi;

    vorbis_info_init (&vi);
    vorbis_encode_init (&vi, 2, 44100, -1, 128, -1);
    /*vorbis_analysis_init (&vd, &vi);
    vorbis_block_init (&vd, &vb);*/
    /* this function was added in 1.0rc3, so this is what we're testing for */
    /*vorbis_bitrate_addblock (&vb);*/

    return 0;
}

], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) enable_ogg=no,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
       		CFLAGS="$ac_save_CFLAGS"
       		LIBS="$ac_save_LIBS"
	fi
dnl 
dnl End of Vorbis Test
dnl
	if test x$enable_ogg = xyes; then
439
		MPD_LIBS="$MPD_LIBS $VORBIS_LIBS $VORBISFILE_LIBS $VORBISENC_LIBS" 
440
		MPD_CFLAGS="$MPD_CFLAGS $VORBIS_CFLAGS $VORBISFILE_CFLAGS $VORBISENC_CFLAGS"
Warren Dukes's avatar
Warren Dukes committed
441 442 443 444
	fi
fi

if test x$enable_ogg = xyes; then
445
	AC_DEFINE(HAVE_OGG,1,[Define for ogg vorbis support])
Warren Dukes's avatar
Warren Dukes committed
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
fi

if test x$enable_flac = xyes; then
	oldmpdcflags="$MPD_CFLAGS"
	oldmpdlibs="$MPD_LIBS"
	AM_PATH_LIBFLAC(MPD_LIBS="$MPD_LIBS $LIBFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBFLAC_CFLAGS",enable_flac=no)
fi

if test x$enable_flac = xyes; then
	oldcflags="$CFLAGS"
	oldlibs="$LIBS"
	CFLAGS="$CFLAGS $MPD_CFLAGS"
	LIBS="$LIBS $MPD_LIBS"
	AC_CHECK_LIB(FLAC, FLAC__metadata_object_vorbiscomment_find_entry_from,
	          ,[enable_flac=no;AC_MSG_WARN(You need FLAC 1.1 -- disabling flac support)])
	if test x$enable_flac = xno; then
		MPD_CFLAGS="$oldmpdcflags"
		MPD_LIBS="$oldmpdlibs"
	fi
	CFLAGS="$oldcflags"
	LIBS="$oldlibs"
fi


if test x$enable_flac = xyes; then
471
	AC_DEFINE(HAVE_FLAC,1,[Define for FLAC support])
Warren Dukes's avatar
Warren Dukes committed
472 473 474
fi

if test x$enable_audiofile = xyes; then
475
	AM_PATH_AUDIOFILE(0.1.7, MPD_LIBS="$MPD_LIBS $AUDIOFILE_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AUDIOFILE_CFLAGS",
Warren Dukes's avatar
Warren Dukes committed
476 477 478
		[enable_audiofile=no;AC_MSG_WARN(You need audiofile  -- disabling audiofile support)])
fi

479 480 481 482
if test x$enable_audiofile = xyes; then
	AC_DEFINE(HAVE_AUDIOFILE,1,[Define for audiofile support])
fi

483 484
if test x$enable_mod = xyes; then
	AM_PATH_LIBMIKMOD(3.1.7, MPD_CFLAGS="$MPD_CFLAGS $LIBMIKMOD_CFLAGS"
485
		MPD_LIBS="$MPD_LIBS $LIBMIKMOD_LIBS $LIBMIKMOD_LDADD", enable_mod=no)
486 487 488 489 490
	if test x$enable_mod = xyes; then
		AC_DEFINE(HAVE_MIKMOD, 1, [Define for mikmod support])
	fi
fi

491
AC_OUTPUT(src/mp4ff/Makefile doc/Makefile src/Makefile Makefile )
492 493 494

echo ""
echo "########### MPD CONFIGURATION ############"
495 496 497 498 499 500 501 502 503
echo ""
echo "Volume Mixer Support:"
if test x$enable_oss = xyes; then
	echo "OSS mixer support .............enabled"
else
	echo "OSS mixer support .............disabled"
fi

if test x$enable_alsa = xyes; then
Warren Dukes's avatar
Warren Dukes committed
504
	echo "ALSA mixer support ............enabled"
505
else
Warren Dukes's avatar
Warren Dukes committed
506
	echo "ALSA mixer support ............disabled"
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
fi

echo ""
echo "i18n Support:"
if test x$enable_iconv = xyes; then
	echo "iconv support .................enabled"
else
	echo "iconv support .................disabled"
fi

if test x$enable_locale = xyes; then
	echo "locale support ................enabled"
else
	echo "locale support ................disabled"
fi

523
if test x$am_cv_langinfo_codeset = xyes; then
524 525 526 527 528 529 530
	echo "langinfo support ..............enabled"
else
	echo "langinfo support ..............disabled"
fi

echo ""
echo "Audio Format Support:"
531 532 533 534 535 536
if test x$enable_ao = xyes; then
	echo "Playing audio .................enabled"
else
	echo "Playing audio .................disabled"
fi

537 538 539 540 541 542
if test x$enable_shout = xyes; then
	echo "Streaming through shout .......enabled"
else
	echo "Streaming through shout .......disabled"
fi

543 544 545
if test x$enable_id3 = xyes; then
	echo "ID3 tag support ...............enabled"
	if test x$use_mpd_id3tag = xyes; then
Warren Dukes's avatar
Warren Dukes committed
546
		echo "  using MPD's libid3tag........yes"
547
	else
Warren Dukes's avatar
Warren Dukes committed
548
		echo "  using MPD's libid3tag........no"
549 550 551 552 553 554 555 556
	fi
else
	echo "ID3 tag support ...............disabled"
fi

if test x$enable_mp3 = xyes; then
	echo "mp3 support ...................enabled"
	if test x$use_mpd_mad = xyes; then
Warren Dukes's avatar
Warren Dukes committed
557
		echo "  using MPD's libmad...........yes"
558
	else
Warren Dukes's avatar
Warren Dukes committed
559
		echo "  using MPD's libmad...........no"
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583
	fi
else
	echo "mp3 support ...................disabled"
fi

if test x$enable_ogg = xyes; then
	echo "Ogg Vorbis support ............enabled"
else
	echo "Ogg Vorbis support ............disabled"
fi

if test x$enable_flac = xyes; then
	echo "FLAC support ..................enabled"
else
	echo "FLAC support ..................disabled"
fi

if test x$enable_audiofile = xyes; then
	echo "Wave file support .............enabled"
else
	echo "Wave file support .............disabled"
fi

if test x$enable_aac = xyes; then
Warren Dukes's avatar
Warren Dukes committed
584
	echo "MP4/AAC support ...............enabled"
585
else
Warren Dukes's avatar
Warren Dukes committed
586
	echo "MP4/AAC support ...............disabled"
587 588
fi

589 590 591 592 593 594
if test x$enable_mod = xyes; then
	echo "MOD support ...................enabled"
else
	echo "MOD support ...................disabled"
fi

595 596
echo ""
echo "##########################################"
597 598 599
echo ""
echo "You are now ready to compile MPD"
echo "Type \"make\" to compile MPD"