Commit 3bea128a authored by j's avatar j

- use AM_CONDITIONAL for FLAC/Speex and make --without-* work

- remove unused AC_SUBST of OGG*_FLAC_OBJS and OGG123_SPEEX_OBJS


svn path=/trunk/vorbis-tools/; revision=9395
parent 98484b74
......@@ -94,8 +94,8 @@ AC_ARG_ENABLE(oggenc, [ --disable-oggenc Skip building oggenc], build_oggenc=
AC_ARG_ENABLE(ogginfo,[ --disable-ogginfo Skip building ogginfo], build_ogginfo="$enableval", build_ogginfo="yes")
AC_ARG_ENABLE(vcut, [ --disable-vcut Skip building vcut], build_vcut="$enableval", build_vcut="no")
AC_ARG_ENABLE(vorbiscomment, [ --disable-vorbiscomment Skip building vorbiscomment], build_vorbiscomment="$enableval", build_vorbiscomment="yes")
AC_ARG_WITH(flac, [ --without-flac Do not compile FLAC support], build_flac="$enableval", build_flac="yes")
AC_ARG_WITH(speex, [ --without-speex Do not compile Speex support], build_speex="$enableval", build_speex="yes")
AC_ARG_WITH(flac, [ --without-flac Do not compile FLAC support], build_flac=no, build_flac="yes")
AC_ARG_WITH(speex, [ --without-speex Do not compile Speex support], build_speex=no, build_speex="yes")
dnl --------------------------------------------------
dnl Check for generally needed libraries
......@@ -130,28 +130,28 @@ fi
dnl -------------------- FLAC ----------------------
FLAC_LIBS=""
AC_CHECK_LIB(m,log,FLAC_LIBS="-lm")
AC_CHECK_LIB(FLAC, [FLAC__stream_decoder_process_single],
[have_libFLAC=yes; FLAC_LIBS="-lFLAC $FLAC_LIBS"],
AC_MSG_WARN([libFLAC missing])
have_libFLAC=no, [$FLAC_LIBS]
)
AC_CHECK_LIB(OggFLAC, [OggFLAC__stream_decoder_new],
[FLAC_LIBS="-lOggFLAC $FLAC_LIBS $OGG_LIBS"],
AC_MSG_WARN([libOggFLAC missing])
have_libFLAC=no, [$FLAC_LIBS $OGG_LIBS]
)
AC_CHECK_HEADER(FLAC/stream_decoder.h,,
AC_MSG_WARN(libFLAC headers missing)
have_libFLAC=no,[ ])
if test "x$have_libFLAC" = xyes; then
if test "x$build_flac" = xyes; then
AC_DEFINE(HAVE_LIBFLAC, 1, [Defined if we have libFLAC])
fi
else
build_flac="no"
FLAC_LIBS=""
if test "x$build_flac" = xyes; then
AC_CHECK_LIB(m,log,FLAC_LIBS="-lm")
AC_CHECK_LIB(FLAC, [FLAC__stream_decoder_process_single],
[have_libFLAC=yes; FLAC_LIBS="-lFLAC $FLAC_LIBS"],
AC_MSG_WARN([libFLAC missing])
have_libFLAC=no, [$FLAC_LIBS]
)
AC_CHECK_LIB(OggFLAC, [OggFLAC__stream_decoder_new],
[FLAC_LIBS="-lOggFLAC $FLAC_LIBS $OGG_LIBS"],
AC_MSG_WARN([libOggFLAC missing])
have_libFLAC=no, [$FLAC_LIBS $OGG_LIBS]
)
AC_CHECK_HEADER(FLAC/stream_decoder.h,,
AC_MSG_WARN(libFLAC headers missing)
have_libFLAC=no,[ ])
if test "x$have_libFLAC" = xyes; then
AC_DEFINE(HAVE_LIBFLAC, 1, [Defined if we have libFLAC])
else
build_flac="no"
FLAC_LIBS=""
fi
fi
AM_CONDITIONAL(HAVE_LIBFLAC, test "x$have_libFLAC" = "xyes")
AC_SUBST(FLAC_LIBS)
......@@ -159,24 +159,25 @@ AC_SUBST(FLAC_LIBS)
dnl ------------------- Speex ------------------------
SPEEX_LIBS=""
AC_CHECK_LIB(m,log,SPEEX_LIBS="-lm")
AC_CHECK_LIB(speex, [speex_decoder_init],
[have_libspeex=yes; SPEEX_LIBS="-lspeex $SPEEX_LIBS"],
AC_MSG_WARN(libspeex missing)
have_libspeex=no, [$SPEEX_LIBS]
)
AC_CHECK_HEADER(speex.h,,
AC_MSG_WARN(libspeex headers missing)
have_libspeex=no,[ ])
if test "x$have_libspeex" = xyes; then
if test "x$build_speex" = xyes; then
AC_DEFINE(HAVE_LIBSPEEX, 1, [Defined if we have libspeex])
fi
else
build_speex="no"
SPEEX_LIBS=""
if test "x$build_speex" = xyes; then
AC_CHECK_LIB(m,log,SPEEX_LIBS="-lm")
AC_CHECK_LIB(speex, [speex_decoder_init],
[have_libspeex=yes; SPEEX_LIBS="-lspeex $SPEEX_LIBS"],
AC_MSG_WARN(libspeex missing)
have_libspeex=no, [$SPEEX_LIBS]
)
AC_CHECK_HEADER(speex.h,,
AC_MSG_WARN(libspeex headers missing)
have_libspeex=no,[ ])
if test "x$have_libspeex" = xyes; then
AC_DEFINE(HAVE_LIBSPEEX, 1, [Defined if we have libspeex])
else
build_speex="no"
SPEEX_LIBS=""
fi
fi
AM_CONDITIONAL(HAVE_LIBSPEEX, test "x$have_libspeex" = "xyes")
AC_SUBST(SPEEX_LIBS)
dnl --------------------------------------------------
......@@ -212,21 +213,6 @@ dnl --------------------------------------------------
OPT_SUBDIRS=""
if test "x$build_ogg123" = xyes; then
OPT_SUBDIRS="$OPT_SUBDIRS ogg123"
if test "x$have_libFLAC" = xyes; then
OGG123_FLAC_OBJS='flac_format.$(OBJEXT) easyflac.$(OBJEXT)'
OGGENC_FLAC_OBJS='flac.$(OBJEXT) easyflac.$(OBJEXT)'
else
OGG123_FLAC_OBJS=''
OGGENC_FLAC_OBJS=''
fi
AC_SUBST(OGG123_FLAC_OBJS)
AC_SUBST(OGGENC_FLAC_OBJS)
if test "x$have_libspeex" = xyes; then
OGG123_SPEEX_OBJS='speex_format.$(OBJEXT)'
else
OGG123_SPEEX_OBJS=''
fi
AC_SUBST(OGG123_SPEEX_OBJS)
fi
if test "x$build_oggenc" = xyes; then
OPT_SUBDIRS="$OPT_SUBDIRS oggenc"
......@@ -272,7 +258,7 @@ else
will NOT be built with FLAC read support.])
fi
if test "x$have_libspeex" != xyes; then
AC_MSG_WARN([Speex libraries or headers missing, ogg123 will NOT be
built with Speex read support.])
AC_MSG_WARN([Speex libraries or headers missing, ogg123
will NOT be built with Speex read support.])
fi
fi
## Process this file with automake to produce Makefile.in
if HAVE_LIBFLAC
flac_sources = flac_format.c easyflac.c easyflac.h
else
flac_sources =
endif
if HAVE_LIBSPEEX
speex_sources = speex_format.c
else
speex_sources =
endif
datadir = @datadir@
localedir = $(datadir)/locale
......@@ -12,12 +22,12 @@ bin_PROGRAMS = ogg123
INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \
@PTHREAD_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@
ogg123_LDADD = @OGG123_FLAC_OBJS@ @OGG123_SPEEX_OBJS@ @SHARE_LIBS@ \
ogg123_LDADD = @SHARE_LIBS@ \
@VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@ \
@SOCKET_LIBS@ @LIBICONV@ @CURL_LIBS@ @PTHREAD_CFLAGS@ \
@PTHREAD_LIBS@ @I18N_LIBS@ @FLAC_LIBS@ @SPEEX_LIBS@
ogg123_DEPENDENCIES = @OGG123_FLAC_OBJS@ @OGG123_SPEEX_OBJS@ @SHARE_LIBS@
ogg123_DEPENDENCIES = @SHARE_LIBS@
ogg123_SOURCES = audio.c buffer.c callbacks.c \
cfgfile_options.c cmdline_options.c \
file_transport.c format.c http_transport.c \
......@@ -26,12 +36,13 @@ ogg123_SOURCES = audio.c buffer.c callbacks.c \
audio.h buffer.h callbacks.h compat.h \
cfgfile_options.h cmdline_options.h \
format.h ogg123.h playlist.h status.h \
transport.h vorbis_comments.h
transport.h vorbis_comments.h \
$(flac_sources) $(speex_sources)
man_MANS = ogg123.1
doc_DATA = ogg123rc-example
EXTRA_ogg123_SOURCES = flac_format.c easyflac.c easyflac.h speex_format.c \
EXTRA_ogg123_SOURCES = \
$(man_MANS) $(doc_DATA)
debug:
......
......@@ -15,11 +15,11 @@ bin_PROGRAMS = oggenc
INCLUDES = @SHARE_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @I18N_CFLAGS@
oggenc_LDADD = @OGGENC_FLAC_OBJS@ @SHARE_LIBS@ \
oggenc_LDADD = @SHARE_LIBS@ \
@VORBISENC_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ \
@LIBICONV@ @I18N_LIBS@ @FLAC_LIBS@
oggenc_DEPENDENCIES = @OGGENC_FLAC_OBJS@ @SHARE_LIBS@
oggenc_DEPENDENCIES = @SHARE_LIBS@
oggenc_SOURCES = $(flac_sources) \
oggenc.c audio.c encode.c platform.c \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment