NIMk / AVRemote

UPNP A/V Transport client
http://nimk.nl/avremote
GNU Affero General Public License v3.0
8 stars 2 forks source link

Compiling on OS X #1

Open audionerd opened 13 years ago

audionerd commented 13 years ago

AVRemote won't compile on OS X out of the box.

First off, there's an issue with miniupnp in which it needs _DARWIN_C_SOURCE defined or it won't compile.

Then, apparently, OS X doesn't know about POLLRDHUP, which causes an error on line 194 of src/avremote.c:

fds[0].events = POLLRDHUP; // needs _GNU_SOURCE

I was able to compile (with warnings) using this:

./configure CFLAGS='-D_DARWIN_C_SOURCE -DPOLLRDHUP=0x2000'

A better solution for this would probably be explicit defines, e.g.:

#ifdef __APPLE__ 
#define _DARWIN_C_SOURCE 
#endif

#ifndef POLLRDHUP
#define POLLRDHUP 0x2000
#endif
jaromil commented 11 years ago

stumbled into this just now. included your fix on the repository we have on code.dyne.org thanks!