1# customized configure.ac
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.57)
5AC_INIT(flac123, 0.0.12, hoesterholt-at-users-dot-sourceforge-dot-net)
6AM_INIT_AUTOMAKE
7AC_CONFIG_SRCDIR([flac123.c])
8##AC_CONFIG_HEADER([config.h])
9AC_REVISION($Id$)
10AC_PREFIX_DEFAULT(/usr)
11
12# Checks for specific systems.
13system_name=`( uname -s ) 2>&1`
14case "$system_name" in
15     Darwin)
16	AC_DEFINE_UNQUOTED(AUDIO_DEFAULT, "macosx",[Define the default libao output device.])
17	AC_DEFINE(DARWIN)
18	if test -d /sw ; then
19	   # Fink needs /sw/include and /sw/lib
20	   CFLAGS="$CFLAGS -I/sw/include"
21	   LDFLAGS="$LDFLAGS -L/sw/lib"
22	   with_ao_prefix="/sw"
23	elif test -d /opt/local ; then
24	   # Macports needs /opt/local/include and /opt/local/lib
25	   CFLAGS="$CFLAGS -I/opt/local/include"
26	   LDFLAGS="$LDFLAGS -L/opt/local/lib"
27	   with_ao_prefix="/opt/local"
28	fi
29	;;
30     *)
31	# FreeBSD gcc needs /usr/local/
32	AC_DEFINE_UNQUOTED(AUDIO_DEFAULT, "oss",[Define the default libao output device.])
33	CFLAGS="$CFLAGS -I/usr/local/include"
34	LDFLAGS="$LDFLAGS -L/usr/local/lib"
35	;;
36esac
37
38# let the user override the default libao output device
39AC_ARG_WITH(default_audio,
40[  --with-default-audio=string   Specify default libao output plugin [[oss, esd, arts, macosx, etc.]] ])
41
42if test "x$with_default_audio" != "x" -a "x$with_default_audio" != "xyes"; then
43   AC_DEFINE_UNQUOTED(AUDIO_DEFAULT, "$with_default_audio",[Define the default libao output device.])
44fi
45
46AC_PROG_CC
47
48# Checks for libraries.
49AC_CHECK_LIB(FLAC, FLAC__stream_decoder_new, [haveflac=yes], [haveflac=no], -lm)
50if test "$haveflac" = "yes"; then
51	FLAC_LIBS="-lFLAC -logg -lm"
52	AC_SUBST(FLAC_LIBS)
53else
54	AC_MSG_ERROR(FLAC required!)
55fi
56
57AC_CHECK_LIB(popt, poptGetContext, [havepopt=yes])
58if test "$havepopt" = "yes"; then
59	POPT_LIBS="-lpopt"
60	AC_SUBST(POPT_LIBS)
61else
62	AC_MSG_ERROR(popt required!)
63fi
64
65AM_PATH_AO(,AC_MSG_ERROR(libao required!))
66
67# Checks for header files.  None at this time.
68
69# Checks for typedefs, structures, and compiler characteristics.
70AC_C_CONST
71
72# end of checks
73
74AC_CONFIG_FILES([Makefile])
75AC_OUTPUT
76