[vorbis-dev] macosx (lots of little changes)

Brian Olson bolson at silcom.com
Wed Jan 2 02:38:20 PST 2002



oops, I really did mean for this to go to the dev list, I've been up too 
long hacking today...

happy new year. a day off is a day to pick up a new project, so I 
wrestled my way through making ogg vorbis work on macosx.

first, libao (not entirely a proper patch, but 2 source file diffs and a 
diff of a configure'd Makefile to one that works.):
http://bolson.org/pub/libao-0.8.2-diff.tar.gz

libogg and libvorbis compiled without incident. vorbis-tools were more 
complicated.

I think this ERROR sholudn't be an error, maybe it should be a warning. 
My above changes mean libao doesn't need dlopen(). I was unable to get 
dlopen() working on macosx, so I cut it out and made libao more static. 
It's all still there, behind -DHAS_DLFCN_H which was already being 
tested for.
--- aclocal.m4.orig     Wed Jan  2 01:14:59 2002
+++ aclocal.m4  Wed Jan  2 01:00:30 2002
@@ -261,8 +261,8 @@
    # see where dl* and friends live
    AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
      AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
-      AC_MSG_ERROR([could not find dlopen() needed by libao sound 
drivers
-      your system may not be supported.])
+#      AC_MSG_ERROR([could not find dlopen() needed by libao sound 
drivers
+#      your system may not be supported.])
      ])
    ])

<p>macosx doesn't seem to have pthread_sigmask(). this is not a perfect 
solution, I can't ^C out of ogg123.
--- ogg123/buffer.c.orig        Wed Jan  2 01:21:20 2002
+++ ogg123/buffer.c     Tue Jan  1 16:15:31 2002
@@ -75,7 +75,11 @@
    sigaddset(&set, SIGINT);
    sigaddset(&set, SIGTSTP);
    sigaddset(&set, SIGCONT);
+#ifdef __APPLE__
+  if (sigprocmask(SIG_BLOCK, &set, NULL) != 0 )
+#else
    if (pthread_sigmask(SIG_BLOCK, &set, NULL) != 0)
+#endif
      DEBUG("pthread_sigmask failed");
  }

I was getting segfaults using NULL instead of the dummy variable.
--- ogg123/callbacks.c.orig     Wed Jan  2 01:25:13 2002
+++ ogg123/callbacks.c  Tue Jan  1 18:14:29 2002
@@ -40,10 +40,11 @@
    audio_reopen_arg_t *reopen_arg = (audio_reopen_arg_t *) arg;
    audio_device_t *current;
    ao_sample_format format;
+  int dummy_o;

    /* We DO NOT want to get cancelled part way through this and have our
       audio devices in an unknown state */
-  pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+  pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &dummy_o);

<p>    close_audio_devices (reopen_arg->devices);
@@ -113,7 +114,7 @@
    free(reopen_arg->format);
    free(reopen_arg);

-  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &dummy_o);
  }

<p>I don't like being required to go get libcurl (needs a teeny bit of 
autoconf tweaking to add -DNO_CURL as needed (there is already  a check 
for -lcurl))
--- ogg123/http_transport.c.orig        Wed Jan  2 01:28:23 2002
+++ ogg123/http_transport.c     Tue Jan  1 15:37:18 2002
@@ -1,3 +1,4 @@
+#ifndef NO_CURL
  /********************************************************************
   *                                                                  *
   * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
@@ -328,3 +329,4 @@
    &http_tell,
    &http_close
  };
+#endif
--- ogg123/transport.c.orig     Wed Jan  2 01:32:04 2002
+++ ogg123/transport.c  Tue Jan  1 15:35:52 2002
@@ -21,10 +21,13 @@
  #include "transport.h"

  extern transport_t file_transport;
+#ifdef NO_CURL
+transport_t *transports[] = { &file_transport, NULL };
+#else
  extern transport_t http_transport;

  transport_t *transports[] = { &http_transport, &file_transport, NULL };
-
+#endif

  transport_t *get_transport_by_name (char *name)
  {

ogg123/Makefile needs to not use "-lm", it contains a definiton of 
getopt which collides with one included in share/libgetopt.a, I don't 
know how to make autoconf/configure do this though. On top of that 
obfuscation is the libtool script, in one place it discards a 
"-framework ___" that I need; in another place it adds a "-lm" I don't 
want. I end up building vorbis-tools with "make CC=cc\ -no-cpp-precomp\ 
-DNO_CURL", and then I go back and fixup by copy and paste the link 
commands that fail.

I hope some of this is useful, to  the project in general, and to other 
macosx users out there.

[insert clever signoff here]
Brian Olson http://bolson.org/

<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 '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