[vorbis-dev] automake 1.6 compatability patch

Bill Currie billc at wirelessmatrixcorp.com
Wed Aug 14 10:18:18 PDT 2002


This patch cleans up the vorbis-tools Makefile.am files so they work with both
automake 1.4 and 1.6. Some changes to configure.in were also needed in order
to get things to work (and to fix some ac 2.50 issues).

Please remove config.h from cvs as it is a generated file and empty anyway.

automake 1.6 isn't really incompatable with 1.4, it's just more picky about
you sticking to the rules:

 o  you're not allowed to define *_CAPS (eg, foo_SOURCES) in a conditional to
    make this work as desired (eg for progs foo and bar):

        bin_PROGRAMS=@TARGETS@
        EXTRA_PROGRAMS=foo bar
        foo_SOURCES=foo.c
        bar_SOURCES=bar.c baz.c

    you then build up TARGETS in configure.in and AC_SUBST(TARGETS) ("TARGETS"
    can be any name).

    you then don't need to worry about EXTRA_DIST unless you have files that
    don't get mentioned elsewhere but are needed in the distribution tarball
    anyway (eg, header files that don't get installed).

    You can also have EXTRA_MANS, EXTRA_DATA, EXTRA_LIBRARIES etc

 o  AM_CONFIG_HEADER is required
 o  AC_CANONICAL_HOST is obsolete and AC_CANONICAL_SYSTEM should be used
    instead

All of the other trees I build (ogg vorbis ao) are automake 1.6/autoconf 2.50
clean.

Bill (taniwha)

-------------- next part --------------
? autom4te.cache
? stamp-h1
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/configure.in,v
retrieving revision 1.44
diff -u -r1.44 configure.in
--- configure.in	11 Jul 2002 14:10:34 -0000	1.44
+++ configure.in	14 Aug 2002 17:12:18 -0000
@@ -5,8 +5,9 @@
 dnl ------------------------------------------------
 
 AC_INIT(oggenc/encode.c)
+AM_CONFIG_HEADER(config.h)
+AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(vorbis-tools,1.0)
-
 dnl --------------------------------------------------  
 dnl Check for programs
 dnl --------------------------------------------------  
@@ -26,7 +27,6 @@
 dnl Set build flags based on environment
 dnl --------------------------------------------------
 
-AC_CANONICAL_HOST
 
 casecflags_save="$CFLAGS"
 ldflags_save="$LDFLAGS"
@@ -80,13 +80,19 @@
 dnl --------------------------------------------------
 dnl Allow tools to be selectively built
 dnl --------------------------------------------------
-AC_ARG_ENABLE(ogg123, [  --disable-ogg123   Skip building ogg123], build_ogg123="$enableval", build_ogg123="yes")
-AC_ARG_ENABLE(oggdec, [  --disable-oggdec   Skip building oggdec], build_oggdec="$enableval", build_oggdec="yes")
-AC_ARG_ENABLE(oggenc, [  --disable-oggenc   Skip building oggenc], build_oggenc="$enableval", build_oggenc="yes")
-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="yes")
-AC_ARG_ENABLE(vorbiscomment, [  --disable-vorbiscomment   Skip building vorbiscomment], build_vorbiscomment="$enableval", build_vorbiscomment="yes")
-
+AC_ARG_ENABLE(ogg123, [  --disable-ogg123   Skip building ogg123], build_ogg123="$enableval", build_ogg123="yes" OGG123=ogg123)
+AC_ARG_ENABLE(oggdec, [  --disable-oggdec   Skip building oggdec], build_oggdec="$enableval", build_oggdec="yes" OGGDEC=oggdec)
+AC_ARG_ENABLE(oggenc, [  --disable-oggenc   Skip building oggenc], build_oggenc="$enableval", build_oggenc="yes" OGGENC=oggenc)
+AC_ARG_ENABLE(ogginfo,[  --disable-ogginfo  Skip building ogginfo], build_ogginfo="$enableval", build_ogginfo="yes" OGGINFO=ogginfo)
+AC_ARG_ENABLE(vcut,   [  --disable-vcut     Skip building vcut], build_vcut="$enableval", build_vcut="yes" VCUT=vcut)
+AC_ARG_ENABLE(vorbiscomment, [  --disable-vorbiscomment   Skip building vorbiscomment], build_vorbiscomment="$enableval", build_vorbiscomment="yes" VORBISCOMMENT=vorbiscomment)
+
+AC_SUBST(OGG123)
+AC_SUBST(OGGDEC)
+AC_SUBST(OGGENC)
+AC_SUBST(OGGINFO)
+AC_SUBST(VCUT)
+AC_SUBST(VORBISCOMMENT)
 
 dnl --------------------------------------------------
 dnl Check for generally needed libraries
Index: ogg123/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Makefile.am,v
retrieving revision 1.26
diff -u -r1.26 Makefile.am
--- ogg123/Makefile.am	11 Jul 2002 02:45:37 -0000	1.26
+++ ogg123/Makefile.am	14 Aug 2002 17:12:18 -0000
@@ -2,8 +2,8 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-mans = ogg123.1
-docs = ogg123rc-example
+man_pages = ogg123.1
+doc_files = ogg123rc-example
 ogg123sources = audio.c buffer.c callbacks.c \
                 cfgfile_options.c cmdline_options.c \
                 file_transport.c format.c http_transport.c \
@@ -16,12 +16,19 @@
 
 
 if BUILD_OGG123
+mans=$(man_pages)
+docs=$(doc_files)
+else
+mans=
+docs=$(doc_files)
+endif
 
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
-bin_PROGRAMS = ogg123
+bin_PROGRAMS = @OGG123@
+EXTRA_PROGRAMS = ogg123
 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
 mandir = @MANDIR@
 
@@ -36,11 +43,9 @@
 ogg123_SOURCES = $(ogg123sources)
 
 man_MANS = $(mans) 
+EXTRA_MANS = $(man_pages)
 doc_DATA = $(docs)
-
-endif
-
-EXTRA_DIST = $(ogg123sources) $(mans) $(docs)
+EXTRA_DATA = $(doc_files)
 
 
 debug:
Index: ogg123/cmdline_options.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/cmdline_options.c,v
retrieving revision 1.13
diff -u -r1.13 cmdline_options.c
--- ogg123/cmdline_options.c	11 Jul 2002 02:44:39 -0000	1.13
+++ ogg123/cmdline_options.c	14 Aug 2002 17:12:18 -0000
@@ -20,6 +20,8 @@
 #include <string.h>
 #include <ao/ao.h>
 
+#include "config.h"
+
 #include "getopt.h"
 #include "cmdline_options.h"
 #include "status.h"
Index: oggdec/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggdec/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- oggdec/Makefile.am	11 Jul 2002 02:45:37 -0000	1.7
+++ oggdec/Makefile.am	14 Aug 2002 17:12:18 -0000
@@ -2,16 +2,21 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-mans = oggdec.1
+man_pages = oggdec.1
 oggdecsources = oggdec.c
 
 if BUILD_OGGDEC
+mans=$(man_pages)
+else
+mans=
+endif
 
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
-bin_PROGRAMS = oggdec
+bin_PROGRAMS = @OGGDEC@
+EXTRA_PROGRAMS=oggdec
 
 INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHARE_CFLAGS@
 
@@ -21,12 +26,9 @@
 oggdec_SOURCES = $(oggdecsources)
 
 man_MANS = $(mans)
+EXTRA_MANS = $(man_pages)
 mandir = @MANDIR@
 
-endif
-
-
-EXTRA_DIST = $(oggdecsources) $(mans)
 
 debug:
 	$(MAKE) all CFLAGS="@DEBUG@"
Index: oggenc/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/Makefile.am,v
retrieving revision 1.21
diff -u -r1.21 Makefile.am
--- oggenc/Makefile.am	11 Jul 2002 02:45:38 -0000	1.21
+++ oggenc/Makefile.am	14 Aug 2002 17:12:18 -0000
@@ -8,12 +8,16 @@
                  audio.h encode.h platform.h resample.c resample.h
 
 if BUILD_OGGENC
+else
+endif
 
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
-bin_PROGRAMS = oggenc
+bin_PROGRAMS = @OGGENC@
+EXTRA_PROGRAMS = oggenc
+mandir = @MANDIR@
 
 INCLUDES = @SHARE_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @I18N_CFLAGS@
 
@@ -23,8 +27,6 @@
 oggenc_DEPENDENCIES = @SHARE_LIBS@
 
 oggenc_SOURCES = $(oggencsources)
-
-endif
 
 EXTRA_DIST = $(oggencsources)
 
Index: oggenc/man/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/man/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- oggenc/man/Makefile.am	2 Jul 2002 16:45:16 -0000	1.5
+++ oggenc/man/Makefile.am	14 Aug 2002 17:12:18 -0000
@@ -2,13 +2,14 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-mans = oggenc.1
+man_pages = oggenc.1
 
 if BUILD_OGGENC
+mans = $(man_pages)
+else
+mans =
+endif
 
 mandir = @MANDIR@
 man_MANS = $(mans)
-
-endif
-
-EXTRA_DIST = $(mans)
+EXTRA_MANS = $(man_pages)
Index: ogginfo/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogginfo/Makefile.am,v
retrieving revision 1.13
diff -u -r1.13 Makefile.am
--- ogginfo/Makefile.am	11 Jul 2002 02:45:38 -0000	1.13
+++ ogginfo/Makefile.am	14 Aug 2002 17:12:18 -0000
@@ -2,18 +2,24 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-mans = ogginfo.1
+man_pages = ogginfo.1
 ogginfosources = ogginfo2.c
 
 if BUILD_OGGINFO
+mans=$(man_pages)
+else
+mans=
+endif
 
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
-bin_PROGRAMS = ogginfo
+bin_PROGRAMS = @OGGINFO@
+EXTRA_PROGRAMS = ogginfo
 mandir = @MANDIR@
 man_MANS = $(mans)
+EXTRA_MANS=$(man_pages)
 
 INCLUDES = @SHARE_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @I18N_CFLAGS@
 
@@ -21,10 +27,6 @@
 ogginfo_DEPENDENCIES = @SHARE_LIBS@
 
 ogginfo_SOURCES = $(ogginfosources)
-
-endif
-
-EXTRA_DIST = $(ogginfosources) $(mans)
 
 debug:
 	$(MAKE) all CFLAGS="@DEBUG@"
Index: vcut/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vcut/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- vcut/Makefile.am	11 Jul 2002 02:45:38 -0000	1.7
+++ vcut/Makefile.am	14 Aug 2002 17:12:18 -0000
@@ -2,28 +2,30 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-mans = vcut.1
+man_pages = vcut.1
 vcutsources = vcut.c vcut.h
 
 if BUILD_VCUT
+mans=$(man_pages)
+else
+mans=
+endif
 
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
-bin_PROGRAMS = vcut
+bin_PROGRAMS = @VCUT@
+EXTRA_PROGRAMS = vcut
 mandir = @MANDIR@
 man_MANS = $(mans)
+EXTRA_MANS = $(man_pages)
 
 INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@
 
 vcut_LDADD = @VORBIS_LIBS@ @OGG_LIBS@ @I18N_LIBS@
 
 vcut_SOURCES = $(vcutsources)
-
-endif
-
-EXTRA_DIST = $(vcutsources) $(mans)
 
 debug:
 	$(MAKE) all CFLAGS="@DEBUG@"
Index: vorbiscomment/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vorbiscomment/Makefile.am,v
retrieving revision 1.17
diff -u -r1.17 Makefile.am
--- vorbiscomment/Makefile.am	11 Jul 2002 02:45:39 -0000	1.17
+++ vorbiscomment/Makefile.am	14 Aug 2002 17:12:18 -0000
@@ -2,18 +2,24 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-mans = vorbiscomment.1
+man_pages = vorbiscomment.1
 vorbiscommentsources = vcedit.c vcedit.h vcomment.c
 
 if BUILD_VORBISCOMMENT
+mans=$(man_pages)
+else
+mans=
+endif
 
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
-bin_PROGRAMS = vorbiscomment
+bin_PROGRAMS = @VORBISCOMMENT@
+EXTRA_PROGRAMS = vorbiscomment
 mandir = @MANDIR@
 man_MANS = $(mans)
+EXTRA_MANS = $(man_pages)
 
 INCLUDES = @SHARE_CFLAGS@ @I18N_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@
 
@@ -21,10 +27,6 @@
 vorbiscomment_DEPENDENCIES = @SHARE_LIBS@
 
 vorbiscomment_SOURCES = $(vorbiscommentsources)
-
-endif
-
-EXTRA_DIST = $(vorbiscommentsources) $(mans)
 
 debug:
 	$(MAKE) all CFLAGS="@DEBUG@"
Index: vorbiscomment/vcomment.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vorbiscomment/vcomment.c,v
retrieving revision 1.25
diff -u -r1.25 vcomment.c
--- vorbiscomment/vcomment.c	9 Jul 2002 12:44:54 -0000	1.25
+++ vorbiscomment/vcomment.c	14 Aug 2002 17:12:18 -0000
@@ -8,6 +8,7 @@
  * Of limited usability on its own, but could be useful.
  */
 
+#include "config.h"
 
 #include <stdio.h>
 #include <string.h>



More information about the Vorbis-dev mailing list