76
83
LDFLAGS="$LDFLAGS $ldflags_save"
78
85
dnl --------------------------------------------------
79
dnl Check for libraries
80
dnl --------------------------------------------------
82
AM_PATH_OGG(,AC_MSG_ERROR(Ogg needed!))
83
AM_PATH_VORBIS(,AC_MSG_ERROR(Vorbis needed!))
84
AM_PATH_AO(,AC_MSG_ERROR(libao needed!))
85
AM_PATH_CURL(,AC_MSG_ERROR(libcurl needed!))
87
ACX_PTHREAD(,AC_MSG_ERROR(POSIX threads required!))
86
dnl Allow tools to be selectively built
87
dnl --------------------------------------------------
88
AC_ARG_ENABLE(ogg123, [ --disable-ogg123 Skip building ogg123], build_ogg123="$enableval", build_ogg123="yes")
89
AC_ARG_ENABLE(oggdec, [ --disable-oggdec Skip building oggdec], build_oggdec="$enableval", build_oggdec="yes")
90
AC_ARG_ENABLE(oggenc, [ --disable-oggenc Skip building oggenc], build_oggenc="$enableval", build_oggenc="yes")
91
AC_ARG_ENABLE(ogginfo,[ --disable-ogginfo Skip building ogginfo], build_ogginfo="$enableval", build_ogginfo="yes")
92
AC_ARG_ENABLE(vcut, [ --disable-vcut Skip building vcut], build_vcut="$enableval", build_vcut="yes")
93
AC_ARG_ENABLE(vorbiscomment, [ --disable-vorbiscomment Skip building vorbiscomment], build_vorbiscomment="$enableval", build_vorbiscomment="yes")
94
AC_ARG_WITH(flac, [ --without-flac Do not compile FLAC support], build_flac="$enableval", build_flac="yes")
95
AC_ARG_WITH(speex, [ --without-speex Do not compile Speex support], build_speex="$enableval", build_speex="yes")
97
dnl --------------------------------------------------
98
dnl Check for generally needed libraries
99
dnl --------------------------------------------------
101
XIPH_PATH_OGG(,AC_MSG_ERROR(Ogg needed!))
102
XIPH_PATH_VORBIS(,AC_MSG_ERROR(Vorbis needed!))
104
SHARE_LIBS='$(top_builddir)/share/libutf8.a $(top_builddir)/share/libgetopt.a'
105
SHARE_CFLAGS='-I$(top_srcdir)/include'
107
I18N_CFLAGS='-I$(top_srcdir)/intl'
90
111
AC_CHECK_LIB(socket, socket, SOCKET_LIBS="-lsocket")
91
112
AC_CHECK_LIB(nsl, gethostbyname, SOCKET_LIBS="-lnsl $SOCKET_LIBS")
93
SHARE_LIBS='$(top_builddir)/share/libutf8.a $(top_builddir)/share/libgetopt.a'
94
SHARE_CFLAGS='-I$(top_srcdir)/include'
115
dnl --------------------------------------------------
116
dnl Check for ogg123 critical libraries and other optional libraries
117
dnl --------------------------------------------------
119
if test "x$build_ogg123" = xyes; then
120
AC_MSG_RESULT([checking for ogg123 requirements])
121
XIPH_PATH_AO(,build_ogg123=no; AC_MSG_WARN(libao missing))
122
AM_PATH_CURL(,build_ogg123=no; AC_MSG_WARN(libcurl missing))
124
ACX_PTHREAD(,build_ogg123=no; AC_MSG_WARN(POSIX threads missing))
127
dnl -------------------- FLAC ----------------------
130
AC_CHECK_LIB(m,log,FLAC_LIBS="-lm")
131
AC_CHECK_LIB(FLAC, [FLAC__stream_decoder_process_single],
132
[have_libFLAC=yes; FLAC_LIBS="-lFLAC $FLAC_LIBS"],
133
AC_MSG_WARN([libFLAC missing])
134
have_libFLAC=no, [$FLAC_LIBS]
136
AC_CHECK_LIB(OggFLAC, [OggFLAC__stream_decoder_new],
137
[FLAC_LIBS="-lOggFLAC $FLAC_LIBS $OGG_LIBS"],
138
AC_MSG_WARN([libOggFLAC missing])
139
have_libFLAC=no, [$FLAC_LIBS $OGG_LIBS]
141
AC_CHECK_HEADER(FLAC/stream_decoder.h,,
142
AC_MSG_WARN(libFLAC headers missing)
145
if test "x$have_libFLAC" = xyes; then
146
if test "x$build_flac" = xyes; then
147
AC_DEFINE(HAVE_LIBFLAC)
155
dnl ------------------- Speex ------------------------
158
AC_CHECK_LIB(m,log,SPEEX_LIBS="-lm")
159
AC_CHECK_LIB(speex, [speex_decoder_init],
160
[have_libspeex=yes; SPEEX_LIBS="-lspeex $SPEEX_LIBS"],
161
AC_MSG_WARN(libspeex missing)
162
have_libspeex=no, [$SPEEX_LIBS]
164
AC_CHECK_HEADER(speex.h,,
165
AC_MSG_WARN(libspeex headers missing)
166
have_libspeex=no,[ ])
168
if test "x$have_libspeex" = xyes; then
169
if test "x$build_speex" = xyes; then
170
AC_DEFINE(HAVE_LIBSPEEX)
96
178
dnl --------------------------------------------------
97
179
dnl Check for library functions
98
180
dnl --------------------------------------------------
101
184
AC_CHECK_FUNCS(atexit on_exit)
102
185
AM_LANGINFO_CODESET
105
188
dnl Work around FHS stupidity
106
189
dnl --------------------------------------------------
108
if test "$prefix" = "/usr"; then
109
MANDIR='$(datadir)/man'
191
if test -z "$mandir"; then
192
if test "$prefix" = "/usr"; then
193
MANDIR='$(datadir)/man'
195
MANDIR='$(prefix)/man'
111
MANDIR='$(prefix)/man'
115
203
dnl --------------------------------------------------
116
204
dnl Do substitutions
117
205
dnl --------------------------------------------------
207
# add optional subdirs to the build
209
if test "x$build_ogg123" = xyes; then
210
OPT_SUBDIRS="$OPT_SUBDIRS ogg123"
211
if test "x$have_libFLAC" = xyes; then
212
OGG123_FLAC_OBJS='flac_format.$(OBJEXT) easyflac.$(OBJEXT)'
213
OGGENC_FLAC_OBJS='flac.$(OBJEXT) easyflac.$(OBJEXT)'
218
AC_SUBST(OGG123_FLAC_OBJS)
219
AC_SUBST(OGGENC_FLAC_OBJS)
220
if test "x$have_libspeex" = xyes; then
221
OGG123_SPEEX_OBJS='speex_format.$(OBJEXT)'
225
AC_SUBST(OGG123_SPEEX_OBJS)
227
if test "x$build_oggenc" = xyes; then
228
OPT_SUBDIRS="$OPT_SUBDIRS oggenc"
230
if test "x$build_oggdec" = xyes; then
231
OPT_SUBDIRS="$OPT_SUBDIRS oggdec"
233
if test "x$build_ogginfo" = xyes; then
234
OPT_SUBDIRS="$OPT_SUBDIRS ogginfo"
236
if test "x$build_vcut" = xyes; then
237
OPT_SUBDIRS="$OPT_SUBDIRS vcut"
239
if test "x$build_vorbiscomment" = xyes; then
240
OPT_SUBDIRS="$OPT_SUBDIRS vorbiscomment"
242
AC_SUBST(OPT_SUBDIRS)
120
245
AC_SUBST(PROFILE)
121
246
AC_SUBST(SOCKET_LIBS)
123
248
AC_SUBST(SHARE_LIBS)
124
249
AC_SUBST(CURL_CFLAGS)
125
250
AC_SUBST(CURL_LIBS)
127
AC_OUTPUT(Makefile include/Makefile share/Makefile win32/Makefile oggenc/Makefile oggenc/man/Makefile ogg123/Makefile vorbiscomment/Makefile vcut/Makefile ogginfo/Makefile debian/Makefile)
251
AC_SUBST(I18N_CFLAGS)
254
AC_OUTPUT(Makefile intl/Makefile po/Makefile.in include/Makefile share/Makefile win32/Makefile oggdec/Makefile oggenc/Makefile oggenc/man/Makefile ogg123/Makefile vorbiscomment/Makefile vcut/Makefile ogginfo/Makefile debian/Makefile)
256
if test "x$build_oggenc" = xyes -a "x$have_libFLAC" != xyes; then
257
AC_MSG_WARN([FLAC and OggFLAC libraries or headers missing, oggenc
258
will NOT be built with FLAC read support.])
261
if test "x$build_ogg123" != xyes; then
262
AC_MSG_WARN([Prerequisites for ogg123 not met, ogg123 will be skipped.
263
Please ensure that you have POSIX threads, libcurl and libao libraries and
264
headers present if you would like to build ogg123.])
266
if test "x$have_libFLAC" != xyes; then
267
AC_MSG_WARN([FLAC and OggFLAC libraries or headers missing, ogg123
268
will NOT be built with FLAC read support.])
270
if test "x$have_libspeex" != xyes; then
271
AC_MSG_WARN([Speex libraries or headers missing, ogg123 will NOT be
272
built with Speex read support.])