[xiph-cvs] cvs commit: vorbis-tools/vorbiscomment Makefile.am

Ralph Giles giles at xiph.org
Mon Jun 23 19:29:33 PDT 2003



giles       03/06/23 22:29:33

  Modified:    .        Makefile.am configure.in
               ogg123   Makefile.am
               oggdec   Makefile.am
               oggenc   Makefile.am
               oggenc/man Makefile.am
               ogginfo  Makefile.am
               vcut     Makefile.am
               vorbiscomment Makefile.am
  Log:
  Fix the conditional build stuff.
  
  First, do configure substitution on the top-level subdirs, with DIST_SUBDIRS backup to include everything in 'make dist'. This is cleaner than the previous method of conditionalizing the program-specific makefiles.
  
  Second, switch to configure addition of conditional obj files for optional codec support in ogg123. the AM_CONDITIONAL source method is cleaner for this since the build details are all in the Makefile. However, this only really works in automake 1.7; earlier versions require the matching object files to be in the _LDADD and _DEPENDENCIES lines. If configure is generating these anyway, we might as well simplify the Makefile.am's to rely entirely on substitution.
  
  Also, check for the OggFLAC library as well as FLAC, since these can be installed independently on some distributions.

Revision  Changes    Path
1.13      +3 -1      vorbis-tools/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Makefile.am	11 Jul 2002 03:26:50 -0000	1.12
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.13
@@ -2,7 +2,9 @@
 
 AUTOMAKE_OPTIONS = foreign dist-zip
 
-SUBDIRS = po intl include share oggenc ogg123 vorbiscomment vcut oggdec ogginfo debian win32 
+SUBDIRS = po intl include share debian win32 @OPT_SUBDIRS@
+DIST_SUBDIRS = po intl include share debian win32 ogg123 oggenc oggdec ogginfo \
+	vcut vorbiscomment
 
 EXTRA_DIST = README AUTHORS COPYING vorbis-tools.spec acinclude.m4 config.h
 

<p><p>1.49      +53 -23    vorbis-tools/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/configure.in,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- configure.in	24 Jun 2003 00:45:26 -0000	1.48
+++ configure.in	24 Jun 2003 02:29:32 -0000	1.49
@@ -32,7 +32,7 @@
 
 AC_CANONICAL_HOST
 
-casecflags_save="$CFLAGS"
+cflags_save="$CFLAGS"
 ldflags_save="$LDFLAGS"
 if test -z "$GCC"; then
         case $host in
@@ -110,6 +110,7 @@
 AC_CHECK_LIB(socket, socket, SOCKET_LIBS="-lsocket")
 AC_CHECK_LIB(nsl, gethostbyname, SOCKET_LIBS="-lnsl $SOCKET_LIBS")
 
+
 dnl --------------------------------------------------
 dnl Check for ogg123 critical libraries and other optional libraries
 dnl --------------------------------------------------
@@ -128,12 +129,17 @@
 
 dnl -------------------- FLAC ----------------------
 
-FLAC_LIBS=
-
-AC_CHECK_LIB(m,log,FLAC_EXTRA_LIBS="-lm")
-AC_CHECK_LIB(FLAC, FLAC__stream_decoder_process_single,have_libFLAC=yes,
-  AC_MSG_WARN(libFLAC missing)
-  have_libFLAC=no, $FLAC_EXTRA_LIBS
+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"],
+  AC_MSG_WARN([libOggFLAC missing])
+  have_libFLAC=no, [$FLAC_LIBS]
 )
 AC_CHECK_HEADER(FLAC/stream_decoder.h,,
   AC_MSG_WARN(libFLAC headers missing)
@@ -142,22 +148,21 @@
 if test "x$have_libFLAC" = xyes; then
    if test "x$build_flac" = xyes; then
       AC_DEFINE(HAVE_LIBFLAC)
-      FLAC_LIBS="$FLAC_EXTRA_LIBS -lFLAC -lOggFLAC"
    fi
 else
    build_flac="no"
+   FLAC_LIBS=""
 fi
-AM_CONDITIONAL(HAVE_LIBFLAC, test "x$build_flac" = xyes)
 AC_SUBST(FLAC_LIBS)
 
 dnl ------------------- Speex ------------------------
 
-SPEEX_LIBS=
-
-AC_CHECK_LIB(m,log,SPEEX_EXTRA_LIBS="-lm")
-AC_CHECK_LIB(speex, speex_decoder_init,have_libspeex=yes,
+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_EXTRA_LIBS
+  have_libspeex=no, [$SPEEX_LIBS]
 )
 AC_CHECK_HEADER(speex.h,,
   AC_MSG_WARN(libspeex headers missing)
@@ -166,15 +171,13 @@
 if test "x$have_libspeex" = xyes; then
    if test "x$build_speex" = xyes; then
       AC_DEFINE(HAVE_LIBSPEEX)
-      SPEEX_LIBS="$SPEEX_EXTRA_LIBS -lspeex"
    fi
 else
    build_speex="no"
+   SPEEX_LIBS=""
 fi
-AM_CONDITIONAL(HAVE_LIBSPEEX, test "x$build_speex" = xyes)
 AC_SUBST(SPEEX_LIBS)
 
-
 dnl --------------------------------------------------
 dnl Check for library functions
 dnl --------------------------------------------------
@@ -204,12 +207,39 @@
 dnl Do substitutions
 dnl --------------------------------------------------
 
-AM_CONDITIONAL(BUILD_OGG123, test "x$build_ogg123" = xyes)
-AM_CONDITIONAL(BUILD_OGGDEC, test "x$build_oggdec" = xyes)
-AM_CONDITIONAL(BUILD_OGGENC, test "x$build_oggenc" = xyes)
-AM_CONDITIONAL(BUILD_OGGINFO, test "x$build_ogginfo" = xyes)
-AM_CONDITIONAL(BUILD_VCUT, test "x$build_vcut" = xyes)
-AM_CONDITIONAL(BUILD_VORBISCOMMENT, test "x$build_vorbiscomment" = xyes)
+# add optional subdirs to the build
+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)'
+  else
+    OGG123_FLAC_OBJS=''
+  fi
+  AC_SUBST(OGG123_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"
+fi
+if test "x$build_oggdec" = xyes; then
+  OPT_SUBDIRS="$OPT_SUBDIRS oggdec"
+fi
+if test "x$build_ogginfo" = xyes; then
+  OPT_SUBDIRS="$OPT_SUBDIRS ogginfo"
+fi
+if test "x$build_vcut" = xyes; then
+  OPT_SUBDIRS="$OPT_SUBDIRS vcut"
+fi
+if test "x$build_vorbiscomment" = xyes; then
+  OPT_SUBDIRS="$OPT_SUBDIRS vorbiscomment"
+fi
+AC_SUBST(OPT_SUBDIRS)
 
 AC_SUBST(DEBUG)
 AC_SUBST(PROFILE)

<p><p>1.29      +18 -47    vorbis-tools/ogg123/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Makefile.am,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Makefile.am	12 Jan 2003 20:19:22 -0000	1.28
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.29
@@ -2,66 +2,37 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-mans = ogg123.1
-docs = ogg123rc-example
-ogg123sources = audio.c buffer.c callbacks.c \
-                cfgfile_options.c cmdline_options.c \
-                file_transport.c format.c http_transport.c \
-                ogg123.c oggvorbis_format.c playlist.c \
-                status.c transport.c  vorbis_comments.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
-flacsources = flac_format.c easyflac.c easyflac.h
-speexsources = speex_format.c
-
-
-if HAVE_LIBFLAC
-flaccompile = $(flacsources)
-flaclibs = @FLAC_LIBS@
-else
-flaccompile =
-flaclibs = 
-endif
-
-if HAVE_LIBSPEEX
-speexcompile = $(speexsources)
-speexlibs = @SPEEX_LIBS@
-else
-speexcompile = 
-speexlibs = 
-endif
-
-
-if BUILD_OGG123
-
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
-bin_PROGRAMS = ogg123
 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
 mandir = @MANDIR@
 
-INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \
+bin_PROGRAMS = ogg123
+
+CFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \
            @PTHREAD_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@
 
-ogg123_LDADD = @SHARE_LIBS@ \
+ogg123_LDADD = @OGG123_FLAC_OBJS@ @OGG123_SPEEX_OBJS@ @SHARE_LIBS@ \
                @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@ \
                @SOCKET_LIBS@ @LIBICONV@ @CURL_LIBS@ @PTHREAD_CFLAGS@ \
-               @PTHREAD_LIBS@ @I18N_LIBS@ $(flaclibs) $(speexlibs)
-
-ogg123_DEPENDENCIES = @SHARE_LIBS@
-ogg123_SOURCES = $(ogg123sources) $(speexcompile) $(flaccompile)
-
-man_MANS = $(mans) 
-doc_DATA = $(docs)
+               @PTHREAD_LIBS@ @I18N_LIBS@ @FLAC_LIBS@ @SPEEX_LIBS@
 
-endif
-
-EXTRA_DIST = $(ogg123sources) $(flacsources) $(speexsources) $(mans) $(docs)
+ogg123_DEPENDENCIES = @OGG123_FLAC_OBJS@ @OGG123_SPEEX_OBJS@ @SHARE_LIBS@
+ogg123_SOURCES = audio.c buffer.c callbacks.c \
+                cfgfile_options.c cmdline_options.c \
+                file_transport.c format.c http_transport.c \
+                ogg123.c oggvorbis_format.c playlist.c \
+                status.c transport.c  vorbis_comments.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
+EXTRA_ogg123_SOURCES = flac_format.c easyflac.c easyflac.h speex_format.c
 
+man_MANS = ogg123.1
+doc_DATA = ogg123rc-example
 
 debug:
         $(MAKE) all CFLAGS="@DEBUG@"

<p><p>1.8       +0 -6      vorbis-tools/oggdec/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggdec/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile.am	11 Jul 2002 02:45:37 -0000	1.7
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.8
@@ -5,8 +5,6 @@
 mans = oggdec.1
 oggdecsources = oggdec.c
 
-if BUILD_OGGDEC
-
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
@@ -23,10 +21,6 @@
 man_MANS = $(mans)
 mandir = @MANDIR@
 
-endif
-
-
-EXTRA_DIST = $(oggdecsources) $(mans)
 
 debug:
         $(MAKE) all CFLAGS="@DEBUG@"

<p><p>1.22      +0 -5      vorbis-tools/oggenc/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/Makefile.am,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Makefile.am	11 Jul 2002 02:45:38 -0000	1.21
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.22
@@ -7,8 +7,6 @@
 oggencsources = oggenc.c audio.c encode.c platform.c \
                  audio.h encode.h platform.h resample.c resample.h
 
-if BUILD_OGGENC
-
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
@@ -24,9 +22,6 @@
 
 oggenc_SOURCES = $(oggencsources)
 
-endif
-
-EXTRA_DIST = $(oggencsources)
 
 debug:
         $(MAKE) all CFLAGS="@DEBUG@"

<p><p>1.6       +0 -6      vorbis-tools/oggenc/man/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/man/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile.am	2 Jul 2002 16:45:16 -0000	1.5
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.6
@@ -4,11 +4,5 @@
 
 mans = oggenc.1
 
-if BUILD_OGGENC
-
 mandir = @MANDIR@
 man_MANS = $(mans)
-
-endif
-
-EXTRA_DIST = $(mans)

<p><p>1.14      +0 -5      vorbis-tools/ogginfo/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogginfo/Makefile.am,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Makefile.am	11 Jul 2002 02:45:38 -0000	1.13
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.14
@@ -5,8 +5,6 @@
 mans = ogginfo.1
 ogginfosources = ogginfo2.c
 
-if BUILD_OGGINFO
-
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
@@ -22,9 +20,6 @@
 
 ogginfo_SOURCES = $(ogginfosources)
 
-endif
-
-EXTRA_DIST = $(ogginfosources) $(mans)
 
 debug:
         $(MAKE) all CFLAGS="@DEBUG@"

<p><p>1.8       +0 -6      vorbis-tools/vcut/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vcut/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile.am	11 Jul 2002 02:45:38 -0000	1.7
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.8
@@ -5,8 +5,6 @@
 mans = vcut.1
 vcutsources = vcut.c vcut.h
 
-if BUILD_VCUT
-
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
@@ -20,10 +18,6 @@
 vcut_LDADD = @VORBIS_LIBS@ @OGG_LIBS@ @I18N_LIBS@
 
 vcut_SOURCES = $(vcutsources)
-
-endif
-
-EXTRA_DIST = $(vcutsources) $(mans)
 
 debug:
         $(MAKE) all CFLAGS="@DEBUG@"

<p><p>1.18      +0 -6      vorbis-tools/vorbiscomment/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vorbiscomment/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Makefile.am	11 Jul 2002 02:45:39 -0000	1.17
+++ Makefile.am	24 Jun 2003 02:29:32 -0000	1.18
@@ -5,8 +5,6 @@
 mans = vorbiscomment.1
 vorbiscommentsources = vcedit.c vcedit.h vcomment.c
 
-if BUILD_VORBISCOMMENT
-
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
@@ -21,10 +19,6 @@
 vorbiscomment_DEPENDENCIES = @SHARE_LIBS@
 
 vorbiscomment_SOURCES = $(vorbiscommentsources)
-
-endif
-
-EXTRA_DIST = $(vorbiscommentsources) $(mans)
 
 debug:
         $(MAKE) all CFLAGS="@DEBUG@"

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list