fixes based on a pass over everything with autoconf/automake
authorJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 23 Aug 2002 06:45:23 +0000 (06:45 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 23 Aug 2002 06:45:23 +0000 (06:45 +0000)
20 files changed:
Makefile.am
Makefile.lite
configure.in
doc/Makefile.am
doc/html/Makefile.am
src/Makefile.am
src/flac/Makefile.am
src/flac/decode.c
src/flac/encode.c
src/libOggFLAC/Makefile.am
src/libOggFLAC/include/Makefile.am
src/monkeys_audio_utilities/Makefile.am
src/plugin_winamp2/Makefile.am
src/plugin_winamp2/Makefile.vc
src/plugin_xmms/Makefile.am
src/plugin_xmms/Makefile.lite
src/plugin_xmms/fileinfo.c
src/plugin_xmms/plugin.c
src/test_libOggFLAC/Makefile.am
test/Makefile.am

index 086e199..5286bf8 100644 (file)
@@ -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
index 32cfcc2..aeddb47 100644 (file)
@@ -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)
index 5e60d1a..b6c3c82 100644 (file)
@@ -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 \
 )
index 1423d8c..c1f2391 100644 (file)
@@ -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)
index 34b18eb..dd1e925 100644 (file)
@@ -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
index 063ead4..559d3a9 100644 (file)
@@ -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) \
index cf9cf94..cc77b73 100644 (file)
 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
index 0367b4b..6d0fd96 100644 (file)
@@ -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;
index c7485ed..8127ff7 100644 (file)
@@ -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;
index 617b3b9..a70b60e 100644 (file)
@@ -22,7 +22,7 @@ DEBUGCFLAGS =
 endif
 CFLAGS = @CFLAGS@ $(DEBUGCFLAGS)
 
-SUBDIRS = $(ARCH_SUBDIRS) include .
+SUBDIRS = include .
 
 m4datadir = $(datadir)/aclocal
 m4data_DATA = libOggFLAC.m4
index c6ad8fa..d4bd898 100644 (file)
@@ -16,4 +16,4 @@
 #  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 #  Boston, MA  02111-1307, USA.
 
-SUBDIRS = private
+SUBDIRS = protected
index 052d347..d90e7ad 100644 (file)
@@ -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
index 4dc83e5..d4fa09e 100644 (file)
@@ -19,4 +19,6 @@ EXTRA_DIST = \
        Makefile.vc \
        in2.h \
        in_flac.c \
+       in_flac.dsp \
+       in_flac.dsw \
        out.h
index 2f0f104..3252289 100644 (file)
 \r
 !IFDEF DEBUG\r
 .c.obj:\r
-       $(cc) /GX $(cdebug) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" -DSTRICT -DVERSION=\"1.0.3\" -YX /Od /D "_DEBUG" $<\r
+       $(cc) /GX $(cdebug) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" /I ".." -DSTRICT -DVERSION=\"1.0.3\" -YX /Od /D "_DEBUG" $<\r
 !else\r
 .c.obj:\r
-       $(cc) /O2 $(crelease) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" -DSTRICT -DVERSION=\"1.0.3\" -YX -DNODEBUG $<\r
+       $(cc) /O2 $(crelease) $(cflags) $(cvarsdll) /I "..\..\include" /I ".\include" /I ".." -DSTRICT -DVERSION=\"1.0.3\" -YX -DNODEBUG $<\r
 !endif\r
 \r
 C_FILES= \\r
@@ -33,7 +33,7 @@ OBJS= $(C_FILES:.c=.obj)
 all: in_flac.dll\r
 \r
 in_flac.dll: $(OBJS)\r
-       link.exe /dll /nodefaultlib:libc.lib /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.dll $(OBJS) libFLAC.lib user32.lib kernel32.lib\r
+       link.exe /dll /nodefaultlib:libc.lib /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.dll $(OBJS) libFLAC.lib plugin_common.lib user32.lib kernel32.lib\r
 \r
 clean:\r
        -del *.obj *.pch\r
index 08bc019..6125d2f 100644 (file)
@@ -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
index e1c3c8d..0c3c7a6 100644 (file)
 #
 
 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
 
index 3017073..9982092 100644 (file)
@@ -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
 }
-
-
index 0145741..c8238d4 100644 (file)
@@ -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();
 }
index cf50fce..4fd5f95 100644 (file)
@@ -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 \
index 7d6d4af..a29960a 100644 (file)
 #  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 \