diff --git a/INSTALL b/INSTALL index e26a35b5..f567f50c 100644 --- a/INSTALL +++ b/INSTALL @@ -7,9 +7,9 @@ You need the following installed: Perl Debian/Ubuntu users need: - libssl-dev libcrypt-openssl-rsa-perl libao2 libao-dev libio-socket-inet6-perl + libssl-dev libcrypt-openssl-rsa-perl libao2 libao-dev libio-socket-inet6-perl libwww-perl avahi-utils -Perl modules (e.g. `perl -MCPAN -e 'install X'`): +Perl modules (install from CPAN if needed e.g. `perl -MCPAN -e 'install X'`): HTTP::Message Crypt::OpenSSL::RSA IO::Socket::INET6 diff --git a/Makefile b/Makefile index 030111be..27e5be0f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PKGFLAGS:=$(shell pkg-config --cflags --libs openssl ao) -CFLAGS:=-D__i386 -O2 +CFLAGS:=-O2 LDFLAGS:=-lm -lpthread PAUFLAGS:=-lportaudio diff --git a/README.md b/README.md index 246ff986..75255de8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Shairport v0.03 +Shairport v0.04 ============== James Laird April 11, 2011 @@ -38,8 +38,9 @@ Changelog * 0.02 April 11, 2011 * bugfix: libao compatibility * 0.03 April 11, 2011 - * bugfix: ipv6 didn't work - - * IO::Socket::INET6 is required too + * bugfix: ipv6 didn't work - IO::Socket::INET6 is required too +* 0.04 April 12, 2011 + * cross-platform count_leading_zeros under GCC - will now compile cleanly on ARM and other platforms How to compile and install on Mac OSX 10.6 @@ -55,10 +56,10 @@ prerequisite: install XCode, install homebrew (https://github.com/mxcl/homebrew) OSX 10.5 only bundles perl 5.8, which won't work with shairport. After getting a update here (http://www.perl.org/get.html), it worked. -Available launch options for +Available launch options for ------ $ shairport.pl --apname=My Name --password=secret - + How to run as a daemon on Mac OSX 10.6 ------ diff --git a/alac.c b/alac.c index cd0860a2..19156f75 100644 --- a/alac.c +++ b/alac.c @@ -218,18 +218,13 @@ static int count_leading_zeros(int32_t input) } return i; } -#elif defined(__GNUC__) && (defined(_X86) || defined(__i386) || defined(i386)) +#elif defined(__GNUC__) /* for some reason the unrolled version (below) is * actually faster than this. yay intel! */ static int count_leading_zeros(int input) { - int output = 0; - if (!input) return 32; - __asm("bsr %1, %0\n" - : "=r" (output) - : "r" (input)); - return (0x1f - output); + return __builtin_clz(input); } #elif defined(_MSC_VER) && defined(_M_IX86) static int count_leading_zeros(int input) diff --git a/shairport.pl b/shairport.pl index 1422abf4..4a523960 100755 --- a/shairport.pl +++ b/shairport.pl @@ -114,10 +114,10 @@ my $listen; Proto => 'tcp'); }; if ($@) { - print "**************************************\n\n", - "* IO::Socket::INET6 not present! *\n", - "* Install this if iTunes won't play. *\n", - "**************************************\n\n"; + print "**************************************\n", + "* IO::Socket::INET6 not present! *\n", + "* Install this if iTunes won't play. *\n", + "**************************************\n\n"; $listen = new IO::Socket::INET(Listen => 1, LocalPort => 5000,