[vorbis-dev] Mac OS X / Darwin patch for vorbis-tools
Timothy J. Wood
tjw at omnigroup.com
Mon Jan 29 17:47:32 PST 2001
This patch (along with all the previous patches) gets oggenc and ogg123 working. This does not get vorbiscomment working, although I assume that would be trivial -- just add the getopt stuff to the project just like I did in ogg123.
In addition to this patch, as I just mentioned, getopt1.c getopt.h and getopt.c need to be copied from oggenc to ogg123 and added.
The host check in configure.in is only necessary to define 'DARWIN' so that buffer.c doesn't try to import headers that don't exist on Darwin. If there is a better check for that, please let me know.
The only substantial change here is to add a check for whether dlopen and friends are supported. If they are, then -ldl is added to the link link (as it used to be) to support libao. But, if they aren't supported, -ldl is not added since libao can't possibly need them.
-tim
Index: acinclude.m4
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/acinclude.m4,v
retrieving revision 1.5
diff -u -p -r1.5 acinclude.m4
--- acinclude.m4 2000/12/17 20:29:32 1.5
+++ acinclude.m4 2001/01/30 01:46:02
@@ -210,7 +210,7 @@ AC_ARG_ENABLE(aotest, [ --disable-aotes
AO_LIBS="-L$ao_prefix/lib"
fi
- AO_LIBS="$AO_LIBS -lao -ldl"
+ AO_LIBS="$AO_LIBS -lao $DLOPEN_LIBS"
AC_MSG_CHECKING(for ao)
no_ao=""
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/configure.in,v
retrieving revision 1.14
diff -u -p -r1.14 configure.in
--- configure.in 2001/01/22 22:48:31 1.14
+++ configure.in 2001/01/30 01:46:02
@@ -17,6 +17,7 @@ cflags_save="$CFLAGS"
AC_PROG_CC
CFLAGS="$cflags_save"
+AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
dnl --------------------------------------------------
@@ -32,6 +33,14 @@ dnl ------------------------------------
AC_CANONICAL_HOST
+case $host in
+ *-*-darwin*)
+ DEBUG="-DDARWIN -Wall -g -O0 -fsigned-char"
+ CFLAGS="-DDARWIN -Wall -g -O4 -ffast-math -fsigned-char"
+ PROFILE="-DDARWIN -Wall -g -pg -O4 -ffast-math -fsigned-char";;
+esac
+
+
dnl --------------------------------------------------
dnl Check for headers
dnl --------------------------------------------------
@@ -52,6 +61,10 @@ AM_PATH_OGG(,AC_MSG_ERROR(Ogg needed!))
AM_PATH_VORBIS(,AC_MSG_ERROR(Vorbis needed!))
AM_PATH_AO(,AC_MSG_ERROR(libao needed!))
+if test x"$lt_cv_dlopen" = x"yes"; then
+ DLOPEN_LIBS="-ldl"
+fi
+
dnl --------------------------------------------------
dnl Check for library functions
dnl --------------------------------------------------
@@ -64,5 +77,6 @@ dnl ------------------------------------
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
+AC_SUBST(DLOPEN_LIBS)
AC_OUTPUT(Makefile oggenc/Makefile oggenc/man/Makefile ogg123/Makefile vorbiscomment/Makefile debian/Makefile)
Index: ogg123/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Makefile.am,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile.am
--- ogg123/Makefile.am 2001/01/25 06:54:52 1.11
+++ ogg123/Makefile.am 2001/01/30 01:46:02
@@ -12,7 +12,7 @@ INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@
ogg123_LDADD = @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@
-ogg123_SOURCES = ogg123.c ao_interface.c buffer.c ogg123.h buffer.h
+ogg123_SOURCES = ogg123.c ao_interface.c buffer.c ogg123.h buffer.h getopt.c getopt1.c
EXTRA_DIST = $(man_MANS) $(doc_DATA)
Index: ogg123/buffer.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/buffer.c,v
retrieving revision 1.2
diff -u -p -r1.2 buffer.c
--- ogg123/buffer.c 2001/01/15 04:50:23 1.2
+++ ogg123/buffer.c 2001/01/30 01:46:02
@@ -5,13 +5,17 @@
* that program is used in this buffer.
*/
+#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h> /* for fork and pipe*/
#include <fcntl.h>
+
+#if !defined(DARWIN)
#include <malloc.h>
+#endif
#include "ogg123.h"
#include "buffer.h"
Index: ogg123/ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.22
diff -u -p -r1.22 ogg123.c
--- ogg123/ogg123.c 2001/01/25 11:31:14 1.22
+++ ogg123/ogg123.c 2001/01/30 01:46:03
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>
+#include <sys/socket.h>
#include <errno.h>
#include <time.h>
#include <getopt.h>
--- >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 'vorbis-dev-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 Vorbis-dev
mailing list