Commit 1f99eac2 authored by Josh Coalson's avatar Josh Coalson

fixes based on a pass over everything with autoconf/automake

parent 3e94dad4
......@@ -29,7 +29,7 @@
#
SUBDIRS = doc include man src test
SUBDIRS = doc include man src test build flac.pbproj obj
DISTCLEANFILES = libtool-disable-static
......@@ -39,9 +39,7 @@ EXTRA_DIST = \
COPYING.LGPL \
Makefile.lite \
autogen.sh \
build \
depcomp \
flac.pbproj \
strip_fPIC.sh
AUTOMAKE_OPTIONS = foreign
......@@ -27,8 +27,8 @@
# clean : remove all non-distro files
#
.PHONY: doc libFLAC libFLAC++ libOggFLAC libOggFLAC++ share plugin_xmms flac metaflac test_libFLAC test_libFLAC++ test_libOggFLAC test_libOggFLAC++ test_streams
all: doc libFLAC libFLAC++ libOggFLAC libOggFLAC++ share plugin_xmms flac metaflac test_libFLAC test_libFLAC++ test_libOggFLAC test_libOggFLAC++ test_streams
.PHONY: doc libFLAC libFLAC++ libOggFLAC libOggFLAC++ share plugin_common plugin_xmms flac metaflac test_libFLAC test_libFLAC++ test_libOggFLAC test_libOggFLAC++ test_streams
all: doc libFLAC libFLAC++ libOggFLAC libOggFLAC++ share plugin_common plugin_xmms flac metaflac test_libFLAC test_libFLAC++ test_libOggFLAC test_libOggFLAC++ test_streams
DEFAULT_CONFIG = release
......@@ -64,7 +64,10 @@ flac: libFLAC libOggFLAC
metaflac: libFLAC share
(cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
plugin_xmms: libFLAC
plugin_common: libFLAC
(cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
plugin_xmms: libFLAC plugin_common
(cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
test_streams: libFLAC
......@@ -94,6 +97,7 @@ clean:
-(cd src/share ; $(MAKE) -f Makefile.lite clean)
-(cd src/flac ; $(MAKE) -f Makefile.lite clean)
-(cd src/metaflac ; $(MAKE) -f Makefile.lite clean)
-(cd src/plugin_common ; $(MAKE) -f Makefile.lite clean)
-(cd src/plugin_xmms ; $(MAKE) -f Makefile.lite clean)
-(cd src/test_libFLAC ; $(MAKE) -f Makefile.lite clean)
-(cd src/test_libFLAC++ ; $(MAKE) -f Makefile.lite clean)
......
......@@ -105,7 +105,6 @@ AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
SHARE_LIBS='$(top_builddir)/src/share/libutf8.a $(top_builddir)/src/share/libgetopt.a'
dnl check for i18n(internationalization); these are from libiconv/gettext
AM_WITH_NLS
AM_ICONV
AM_LANGINFO_CODESET
......@@ -232,15 +231,25 @@ AC_OUTPUT( \
src/libOggFLAC++/Makefile \
src/flac/Makefile \
src/metaflac/Makefile \
src/monkeys_audio_utilities/flac_mac/Makefile \
src/monkeys_audio_utilities/flac_ren/Makefile \
src/monkeys_audio_utilities/Makefile \
src/plugin_common/Makefile \
src/plugin_winamp2/Makefile \
src/plugin_winamp3/Makefile \
src/plugin_xmms/Makefile \
src/share/Makefile \
src/test_libFLAC/Makefile \
src/test_libFLAC++/Makefile \
src/test_libOggFLAC/Makefile \
src/test_libOggFLAC++/Makefile \
src/test_streams/Makefile \
include/Makefile \
include/FLAC/Makefile \
include/FLAC/ordinals.h \
include/FLAC++/Makefile \
include/OggFLAC/Makefile \
include/OggFLAC++/Makefile \
include/share/Makefile \
doc/Makefile \
doc/html/Makefile \
......@@ -248,4 +257,9 @@ AC_OUTPUT( \
doc/html/ru/Makefile \
man/Makefile \
test/Makefile \
build/Makefile \
obj/bin/Makefile \
obj/lib/Makefile \
obj/Makefile \
flac.pbproj/Makefile \
)
......@@ -27,7 +27,7 @@ FLAC.tag: Doxyfile
docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
doc_DATA = \
doc_DATA = \
FLAC.tag
EXTRA_DIST = Doxyfile Makefile.lite $(doc_DATA)
......@@ -35,3 +35,11 @@ doc_DATA = \
api
EXTRA_DIST = $(doc_DATA)
# The install targets don't copy whole directories so we have to
# handle 'api/' specially:
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(docdir)/api
(cd api && $(INSTALL_DATA) * $(DESTDIR)$(docdir)/api)
uninstall-local:
rm -rf $(DESTDIR)$(docdir)/api
......@@ -21,15 +21,9 @@ endif
if FLaC__HAS_OGG
OGGFLAC_DIRS = libOggFLAC libOggFLAC++
#@@@@ tests not written yet: test_libOggFLAC++
OGGFLAC_TEST_DIRS = test_libOggFLAC
OGGFLAC_TEST_DIRS = test_libOggFLAC test_libOggFLAC++
endif
EXTRA_DIST = \
monkeys_audio_utilities \
plugin_winamp2 \
plugin_winamp3
SUBDIRS = \
libFLAC \
libFLAC++ \
......@@ -37,7 +31,11 @@ SUBDIRS = \
share \
flac \
metaflac \
monkeys_audio_utilities \
plugin_common \
$(XMMS_DIRS) \
plugin_winamp2 \
plugin_winamp3 \
test_libFLAC \
test_libFLAC++ \
$(OGGFLAC_TEST_DIRS) \
......
......@@ -18,6 +18,10 @@
bin_PROGRAMS = flac
CFLAGS = @CFLAGS@ @OGG_CFLAGS@
if FLaC__HAS_OGG
NEED_OGGFLAC_LIB = $(top_builddir)/src/libOggFLAC/libOggFLAC.la
endif
EXTRA_DIST = \
Makefile.lite \
Makefile.vc
......@@ -33,4 +37,4 @@ flac_SOURCES = \
encode.h \
file.h
flac_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la @OGG_LIBS@ @SHARE_LIBS@ -lm
flac_LDADD = $(NEED_OGGFLAC_LIB) $(top_builddir)/src/libFLAC/libFLAC.la @OGG_LIBS@ @SHARE_LIBS@ -lm
......@@ -120,7 +120,24 @@ int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool
{
DecoderSession decoder_session;
if(!DecoderSession_construct(&decoder_session, options.common.is_ogg, options.common.verbose, /*is_wave_out=*/true, options.common.continue_through_decode_errors, analysis_mode, aopts, options.common.skip, infilename, outfilename))
if(!
DecoderSession_construct(
&decoder_session,
#ifdef FLAC__HAS_OGG
options.common.is_ogg,
#else
/*is_ogg=*/false,
#endif
options.common.verbose,
/*is_wave_out=*/true,
options.common.continue_through_decode_errors,
analysis_mode,
aopts,
options.common.skip,
infilename,
outfilename
)
)
return 1;
if(!DecoderSession_init_decoder(&decoder_session, infilename))
......@@ -139,7 +156,24 @@ int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool
decoder_session.is_big_endian = options.is_big_endian;
decoder_session.is_unsigned_samples = options.is_unsigned_samples;
if(!DecoderSession_construct(&decoder_session, options.common.is_ogg, options.common.verbose, /*is_wave_out=*/false, options.common.continue_through_decode_errors, analysis_mode, aopts, options.common.skip, infilename, outfilename))
if(!
DecoderSession_construct(
&decoder_session,
#ifdef FLAC__HAS_OGG
options.common.is_ogg,
#else
/*is_ogg=*/false,
#endif
options.common.verbose,
/*is_wave_out=*/false,
options.common.continue_through_decode_errors,
analysis_mode,
aopts,
options.common.skip,
infilename,
outfilename
)
)
return 1;
if(!DecoderSession_init_decoder(&decoder_session, infilename))
......@@ -155,6 +189,8 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__
{
#ifdef FLAC__HAS_OGG
d->is_ogg = is_ogg;
#else
(void)is_ogg;
#endif
d->verbose = verbose;
......
......@@ -140,7 +140,21 @@ flac__encode_aif(FILE *infile, long infilesize, const char *infilename, const ch
(void)lookahead; /* silence compiler warning about unused parameter */
(void)lookahead_length; /* silence compiler warning about unused parameter */
if(!EncoderSession_construct(&encoder_session, options.common.use_ogg, options.common.verify, options.common.verbose, infile, infilename, outfilename))
if(!
EncoderSession_construct(
&encoder_session,
#ifdef FLAC__HAS_OGG
options.common.use_ogg,
#else
/*use_ogg=*/false,
#endif
options.common.verify,
options.common.verbose,
infile,
infilename,
outfilename
)
)
return 1;
/* lookahead[] already has "FORMxxxxAIFF", do sub-chunks */
......@@ -456,7 +470,21 @@ int flac__encode_wav(FILE *infile, long infilesize, const char *infilename, cons
(void)lookahead;
(void)lookahead_length;
if(!EncoderSession_construct(&encoder_session, options.common.use_ogg, options.common.verify, options.common.verbose, infile, infilename, outfilename))
if(!
EncoderSession_construct(
&encoder_session,
#ifdef FLAC__HAS_OGG
options.common.use_ogg,
#else
/*use_ogg=*/false,
#endif
options.common.verify,
options.common.verbose,
infile,
infilename,
outfilename
)
)
return 1;
/*
......@@ -738,7 +766,21 @@ int flac__encode_raw(FILE *infile, long infilesize, const char *infilename, cons
FLAC__ASSERT(!options.common.sector_align || options.sample_rate == 44100);
FLAC__ASSERT(!options.common.sector_align || infilesize >= 0);
if(!EncoderSession_construct(&encoder_session, options.common.use_ogg, options.common.verify, options.common.verbose, infile, infilename, outfilename))
if(!
EncoderSession_construct(
&encoder_session,
#ifdef FLAC__HAS_OGG
options.common.use_ogg,
#else
/*use_ogg=*/false,
#endif
options.common.verify,
options.common.verbose,
infile,
infilename,
outfilename
)
)
return 1;
/* get the file length */
......@@ -918,6 +960,8 @@ FLAC__bool EncoderSession_construct(EncoderSession *e, FLAC__bool use_ogg, FLAC_
#ifdef FLAC__HAS_OGG
e->use_ogg = use_ogg;
#else
(void)use_ogg;
#endif
e->verify = verify;
e->verbose = verbose;
......
......@@ -22,7 +22,7 @@ DEBUGCFLAGS =
endif
CFLAGS = @CFLAGS@ $(DEBUGCFLAGS)
SUBDIRS = $(ARCH_SUBDIRS) include .
SUBDIRS = include .
m4datadir = $(datadir)/aclocal
m4data_DATA = libOggFLAC.m4
......
......@@ -16,4 +16,4 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
SUBDIRS = private
SUBDIRS = protected
......@@ -15,4 +15,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
SUBDIRS = flacmac flacren
SUBDIRS = flac_mac flac_ren
......@@ -19,4 +19,6 @@ EXTRA_DIST = \
Makefile.vc \
in2.h \
in_flac.c \
in_flac.dsp \
in_flac.dsw \
out.h
......@@ -19,10 +19,10 @@
!IFDEF DEBUG
.c.obj:
$(cc) /GX $(cdebug) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" -DSTRICT -DVERSION=\"1.0.3\" -YX /Od /D "_DEBUG" $<
$(cc) /GX $(cdebug) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" /I ".." -DSTRICT -DVERSION=\"1.0.3\" -YX /Od /D "_DEBUG" $<
!else
.c.obj:
$(cc) /O2 $(crelease) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" -DSTRICT -DVERSION=\"1.0.3\" -YX -DNODEBUG $<
$(cc) /O2 $(crelease) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" /I ".." -DSTRICT -DVERSION=\"1.0.3\" -YX -DNODEBUG $<
!endif
C_FILES= \
......@@ -33,7 +33,7 @@ OBJS= $(C_FILES:.c=.obj)
all: in_flac.dll
in_flac.dll: $(OBJS)
link.exe /dll /nodefaultlib:libc.lib /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.dll $(OBJS) libFLAC.lib user32.lib kernel32.lib
link.exe /dll /nodefaultlib:libc.lib /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.dll $(OBJS) libFLAC.lib plugin_common.lib user32.lib kernel32.lib
clean:
-del *.obj *.pch
......
......@@ -23,6 +23,14 @@ EXTRA_DIST = \
Makefile.lite \
id3_tag.c
noinst_HEADERS = \
charset.h \
configure.h \
genres.h \
id3_tag.h \
mylocale.h \
wrap_id3.h
CFLAGS = @CFLAGS@ @XMMS_CFLAGS@
xmmsinputplugindir = @XMMS_INPUT_PLUGIN_DIR@
......@@ -31,7 +39,7 @@ LIBTOOL = $(top_builddir)/libtool-disable-static
xmmsinputplugin_LTLIBRARIES = libxmms-flac.la
plugin_sources = plugin.c wrap_id3.c configure.c charset.c
plugin_sources = configure.c charset.c plugin.c wrap_id3.c
id3v2_sources = id3_tag.c
if FLaC__HAS_ID3LIB
......
......@@ -20,15 +20,14 @@
#
LIB_NAME = libxmms-flac
INCLUDES = $(shell xmms-config --cflags) -I./include -I../../include
LIBS = ../../obj/lib/libFLAC.a
INCLUDES = $(shell xmms-config --cflags) -I./include -I../../include -I..
LIBS = ../../obj/lib/libFLAC.a ../../obj/lib/libplugin-common.a
OBJS = \
plugin.o \
charset.o \
configure.o \
wrap_id3.o \
charset.o
plugin.o \
wrap_id3.o
include ../../build/lib.mk
......
......@@ -36,12 +36,12 @@ gboolean get_file_info(char *filename, flac_file_info_struct *tmp_file_info)
return FALSE;
}
tmp_file_info->sample_rate = streaminfo.data.stream_info.sample_rate;
tmp_file_info->channels = streaminfo.data.stream_info.channels;
tmp_file_info->bits_per_sample = streaminfo.data.stream_info.bits_per_sample;
tmp_file_info->total_samples = streaminfo.data.stream_info.total_samples;
tmp_file_info->sample_rate = streaminfo.data.stream_info.sample_rate;
tmp_file_info->channels = streaminfo.data.stream_info.channels;
tmp_file_info->bits_per_sample = streaminfo.data.stream_info.bits_per_sample;
tmp_file_info->total_samples = streaminfo.data.stream_info.total_samples;
tmp_file_info->length_in_msec = streaminfo.data.stream_info.total_samples * 10 / (streaminfo.data.stream_info.sample_rate / 100);
tmp_file_info->length_in_msec = streaminfo.data.stream_info.total_samples * 10 / (streaminfo.data.stream_info.sample_rate / 100);
return TRUE;
}
......@@ -88,8 +88,7 @@ static gint genre_comp_func(gconstpointer a, gconstpointer b)
static gchar* channel_mode_name(int mode)
{
static const gchar *channel_mode[] =
{N_("Mono"), N_("Stereo")};
static const gchar *channel_mode[] = {N_("Mono"), N_("Stereo")};
if (mode < 1 || mode > 2)
return "";
return gettext(channel_mode[mode]);
......@@ -315,11 +314,9 @@ void FLAC_XMMS__file_info_box(char *filename)
label_set_text(flac_bitrate, _("Bits/Samples: %d"), tmp_file_info->bits_per_sample);
/* tmp_file_info->length_in_msec */
label_set_text(flac_samplerate, _("Samplerate: %ld Hz"), tmp_file_info->sample_rate);
label_set_text(flac_samplerate, _("Samplerate: %ld Hz"), tmp_file_info->sample_rate);
label_set_text(flac_channel, _("Channel: %s"), channel_mode_name(tmp_file_info->channel);
#if 0
label_set_text(flac_fileinfo, _("%d frames\nFilesize: %lu B"), num_frames, ftell(fh));
#endif
}
......@@ -125,22 +125,19 @@ void FLAC_XMMS__init()
flac_cfg.convert_char_set = FALSE;
cfg = xmms_cfg_open_default_file();
xmms_cfg_read_boolean(cfg, "flac", "tag_override", &flac_cfg.tag_override);
if (!xmms_cfg_read_string(cfg, "flac", "tag_format",
&flac_cfg.tag_format))
if(!xmms_cfg_read_string(cfg, "flac", "tag_format", &flac_cfg.tag_format))
flac_cfg.tag_format = g_strdup("%p - %t");
xmms_cfg_read_boolean(cfg, "flac", "convert_char_set", &flac_cfg.convert_char_set);
if (!xmms_cfg_read_string(cfg, "flac", "file_char_set",
&flac_cfg.file_char_set))
{
if(!xmms_cfg_read_string(cfg, "flac", "file_char_set", &flac_cfg.file_char_set))
flac_cfg.file_char_set = get_current_charset();
}
if (!xmms_cfg_read_string(cfg, "flac", "user_char_set",
&flac_cfg.user_char_set))
{
if(!xmms_cfg_read_string(cfg, "flac", "user_char_set", &flac_cfg.user_char_set))
flac_cfg.user_char_set = get_current_charset();
}
decoder_ = FLAC__file_decoder_new();
}
......
......@@ -23,7 +23,7 @@ CFLAGS = @CFLAGS@ @OGG_CFLAGS@
INCLUDES =
noinst_PROGRAMS = test_libOggFLAC
test_libOggFLAC_LDADD = $(top_builddir)/src/libOggFLAC/libOggFLAC.la $(top_builddir)/src/libOggFLAC/libFLAC.la @OGG_LIBS@ -lm
test_libOggFLAC_LDADD = $(top_builddir)/src/libOggFLAC/libOggFLAC.la $(top_builddir)/src/libFLAC/libFLAC.la @OGG_LIBS@ -lm
test_libOggFLAC_SOURCES = \
decoders.c \
encoders.c \
......
......@@ -15,16 +15,22 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
if FLaC__HAS_OGG
OGG_TESTS = \
./test_libOggFLAC.sh \
./test_libOggFLAC++.sh
endif
TESTS = \
./test_libFLAC.sh \
./test_libFLAC++.sh \
./test_libOggFLAC.sh \
./test_libOggFLAC++.sh \
$(OGG_TESTS) \
./test_metaflac.sh \
./test_streams.sh \
./test_bins.sh
EXTRA_DIST = \
Makefile.lite \
test_libFLAC.sh \
test_libFLAC++.sh \
test_libOggFLAC.sh \
......
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