Index: vorbis/autogen.sh
--- vorbis~autotools/autogen.sh	2004-07-26 11:13:27.000000000 +0200
+++ vorbis/autogen.sh	2004-07-26 13:04:58.000000000 +0200
@@ -61,15 +61,15 @@
 echo "Generating configuration files for $package, please wait...."
 
 echo "  aclocal $ACLOCAL_FLAGS"
-aclocal $ACLOCAL_FLAGS
+aclocal $ACLOCAL_FLAGS || exit 1
 #echo "  autoheader"
 #autoheader
 echo "  $LIBTOOLIZE --automake"
-$LIBTOOLIZE --automake
+$LIBTOOLIZE --automake || exit 1
 echo "  automake --add-missing $AUTOMAKE_FLAGS"
-automake --add-missing $AUTOMAKE_FLAGS 
+automake --add-missing $AUTOMAKE_FLAGS || exit 1
 echo "  autoconf"
-autoconf
+autoconf || exit 1
 
 cd $olddir
 $srcdir/configure "$@" && echo
Index: vorbis/configure.in
--- vorbis~autotools/configure.in	2004-07-26 11:12:57.000000000 +0200
+++ vorbis/configure.in	2004-07-26 13:12:40.000000000 +0200
@@ -5,6 +5,10 @@
 dnl ------------------------------------------------
 
 AC_INIT(lib/mdct.c)
+
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
 AM_INIT_AUTOMAKE(libvorbis,1.0.1)
 AM_MAINTAINER_MODE
 
@@ -67,8 +71,6 @@
 dnl Set build flags based on environment
 dnl --------------------------------------------------
 
-AC_CANONICAL_HOST
-
 dnl Set some target options
 
 cflags_save="$CFLAGS"
@@ -182,12 +184,14 @@
 dnl Check for libraries
 dnl --------------------------------------------------
 
-AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
+AC_CHECK_LIB(m, cos, VORBIS_LIBS="-lm", VORBIS_LIBS="")
 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
 
 XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
-LIBS="$LIBS $OGG_LIBS"
+libs_save=$LIBS
+LIBS="$OGG_LIBS $VORBIS_LIBS"
 AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
+LIBS=$libs_save
 
 dnl --------------------------------------------------
 dnl Check for library functions
@@ -200,9 +204,26 @@
 dnl Do substitutions
 dnl --------------------------------------------------
 
-AC_SUBST(LIBS)
+AC_SUBST(VORBIS_LIBS)
 AC_SUBST(DEBUG)
 AC_SUBST(PROFILE)
 AC_SUBST(pthread_lib)
 
-AC_OUTPUT(Makefile lib/Makefile lib/modes/Makefile lib/books/Makefile lib/books/coupled/Makefile lib/books/uncoupled/Makefile lib/books/floor/Makefile doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile include/Makefile include/vorbis/Makefile examples/Makefile win32/Makefile debian/Makefile vq/Makefile vorbis.pc vorbisenc.pc vorbisfile.pc)
+AC_OUTPUT([
+Makefile
+lib/Makefile
+lib/modes/Makefile
+lib/books/Makefile
+lib/books/coupled/Makefile
+lib/books/uncoupled/Makefile
+lib/books/floor/Makefile
+doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile
+include/Makefile include/vorbis/Makefile
+examples/Makefile
+win32/Makefile
+debian/Makefile
+vq/Makefile
+vorbis.pc
+vorbisenc.pc
+vorbisfile.pc
+])
Index: vorbis/debian/Makefile.am
--- vorbis~autotools/debian/Makefile.am	2004-07-26 11:12:55.000000000 +0200
+++ vorbis/debian/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 EXTRA_DIST = changelog control copyright libvorbis-dev.docs \
 	libvorbis-dev.examples libvorbis-dev.install libvorbis0a.install \
 	libvorbisenc2.install libvorbisfile3.install rules
Index: vorbis/doc/Makefile.am
--- vorbis~autotools/doc/Makefile.am	2004-07-26 11:13:14.000000000 +0200
+++ vorbis/doc/Makefile.am	2004-07-26 15:15:37.772250920 +0200
@@ -1,7 +1,5 @@
 ## Process this with automake to create Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 SUBDIRS = vorbisfile vorbisenc
 
 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
Index: vorbis/doc/vorbisenc/Makefile.am
--- vorbis~autotools/doc/vorbisenc/Makefile.am	2004-07-26 11:13:07.000000000 +0200
+++ vorbis/doc/vorbisenc/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/vorbisenc
 
 doc_DATA = index.html overview.html reference.html style.css\
Index: vorbis/doc/vorbisfile/Makefile.am
--- vorbis~autotools/doc/vorbisfile/Makefile.am	2004-07-26 11:13:12.000000000 +0200
+++ vorbis/doc/vorbisfile/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/vorbisfile
 
 doc_DATA = OggVorbis_File.html callbacks.html chaining_example_c.html\
Index: vorbis/examples/Makefile.am
Index: vorbis/include/Makefile.am
--- vorbis~autotools/include/Makefile.am	2004-07-26 11:12:57.000000000 +0200
+++ vorbis/include/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,5 +1,3 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 SUBDIRS = vorbis
Index: vorbis/include/vorbis/Makefile.am
--- vorbis~autotools/include/vorbis/Makefile.am	2004-07-26 11:12:56.000000000 +0200
+++ vorbis/include/vorbis/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 includedir = $(prefix)/include/vorbis
 
 include_HEADERS = codec.h vorbisfile.h vorbisenc.h
Index: vorbis/lib/books/Makefile.am
--- vorbis~autotools/lib/books/Makefile.am	2004-07-26 11:13:19.000000000 +0200
+++ vorbis/lib/books/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,4 +1,3 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
 SUBDIRS = coupled uncoupled floor
Index: vorbis/lib/Makefile.am
--- vorbis~autotools/lib/Makefile.am	2004-07-26 11:13:27.000000000 +0200
+++ vorbis/lib/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 SUBDIRS = modes books
 
 INCLUDES = -I$(top_srcdir)/include @OGG_CFLAGS@
@@ -18,6 +16,7 @@
 			registry.h scales.h window.h lookup.h lookup_data.h\
 			codec_internal.h backends.h bitrate.h 
 libvorbis_la_LDFLAGS = -no-undefined -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@
+libvorbis_la_LIBADD = @OGG_LIBS@ @VORBIS_LIBS@
 
 libvorbisfile_la_SOURCES = vorbisfile.c
 libvorbisfile_la_LDFLAGS = -no-undefined -version-info @VF_LIB_CURRENT@:@VF_LIB_REVISION@:@VF_LIB_AGE@
Index: vorbis/lib/modes/Makefile.am
--- vorbis~autotools/lib/modes/Makefile.am	2004-07-26 11:13:18.000000000 +0200
+++ vorbis/lib/modes/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 EXTRA_DIST = floor_all.h psych_44.h residue_44.h setup_11.h setup_32.h \
 	     setup_8.h psych_11.h psych_8.h residue_44u.h setup_16.h \
 	     setup_44.h setup_X.h psych_16.h residue_16.h residue_8.h \
Index: vorbis/vq/Makefile.am
--- vorbis~autotools/vq/Makefile.am	2004-07-26 11:13:00.000000000 +0200
+++ vorbis/vq/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 INCLUDES = -I../lib -I$(top_srcdir)/include @OGG_CFLAGS@
 
 EXTRA_PROGRAMS = latticebuild latticepare latticehint\
Index: vorbis/win32/Makefile.am
--- vorbis~autotools/win32/Makefile.am	2004-07-26 11:13:05.000000000 +0200
+++ vorbis/win32/Makefile.am	2004-07-26 13:04:58.000000000 +0200
@@ -1,8 +1,5 @@
 ## Process this with automake to create Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
-
 EXTRA_DIST = vorbis.def vorbis_dynamic.dsp vorbis_static.dsp\
 	vorbisfile.def vorbisfile_dynamic.dsp vorbisfile_static.dsp\
 	vorbisenc.def vorbisenc_dynamic.dsp vorbisenc_static.dsp\
Index: vorbis/lib/books/coupled/Makefile.am
--- vorbis~autotools/lib/books/coupled/Makefile.am	2004-07-26 11:13:19.000000000 +0200
+++ vorbis/lib/books/coupled/Makefile.am	2004-07-26 13:11:15.000000000 +0200
@@ -1,5 +1,3 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
-EXTRA_DIST = res_books_stereo.h
\ No newline at end of file
+EXTRA_DIST = res_books_stereo.h
Index: vorbis/lib/books/floor/Makefile.am
--- vorbis~autotools/lib/books/floor/Makefile.am	2004-07-26 11:13:19.000000000 +0200
+++ vorbis/lib/books/floor/Makefile.am	2004-07-26 13:11:48.000000000 +0200
@@ -1,5 +1,3 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 EXTRA_DIST = floor_books.h
Index: vorbis/lib/books/uncoupled/Makefile.am
--- vorbis~autotools/lib/books/uncoupled/Makefile.am	2004-07-26 11:13:24.000000000 +0200
+++ vorbis/lib/books/uncoupled/Makefile.am	2004-07-26 13:11:47.000000000 +0200
@@ -1,5 +1,3 @@
 ## Process this file with automake to produce Makefile.in
 
-AUTOMAKE_OPTIONS = foreign
-
 EXTRA_DIST = res_books_uncoupled.h
