neophenix / Redis-hiredis

Perl wrapper around hiredis client
BSD 3-Clause "New" or "Revised" License
11 stars 8 forks source link

I am unable to install with Xcode 4.5 and CLI Tools installed #4

Closed clok closed 11 years ago

clok commented 12 years ago

I have used the Redis::hiredis module on many Linux systems, but now that I developing on a OS X Mountain Lion I am receiving the following error when I attempt to make the module. Potentially an issue with compiling with clang over gcc?

> perl Makefile.PL 
Checking if your kit is complete...
Looks good
Writing Makefile for Redis::hiredis

> make
cp lib/Redis/hiredis.pm blib/lib/Redis/hiredis.pm
/usr/bin/perl /System/Library/Perl/5.12/ExtUtils/xsubpp  -typemap /System/Library/Perl/5.12/ExtUtils/typemap -typemap typemap  Redis-hiredis.xs > Redis-hiredis.xsc && mv Redis-hiredis.xsc Redis-hiredis.c
Please specify prototyping behavior for Redis-hiredis.xs (see perlxs manual)
clang -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   Redis-hiredis.c
clang -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   dict.c
clang -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   hiredis.c
hiredis.c:799:31: error: second argument to 'va_arg' is of incomplete type 'void'
                    va_arg(ap,void);
                    ~~~~~~~~~~^~~~~
/usr/bin/../lib/clang/4.1/include/stdarg.h:35:50: note: expanded from macro 'va_arg'
#define va_arg(ap, type)    __builtin_va_arg(ap, type)
                                                 ^
1 error generated.
make: *** [hiredis.o] Error 1
clok commented 12 years ago

Looks like by manually changing the Makefile CC = clang to CC = gcc the compile work properly and all test passed.

> make
Skip blib/lib/Redis/hiredis.pm (unchanged)
gcc -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   Redis-hiredis.c
gcc -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   dict.c
gcc -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   hiredis.c
gcc -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   net.c
gcc -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   sds.c
Running Mkbootstrap for Redis::hiredis ()
chmod 644 hiredis.bs
rm -f blib/arch/auto/Redis/hiredis/hiredis.bundle
clang -mmacosx-version-min=10.8  -arch i386 -arch x86_64 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector Redis-hiredis.o dict.o hiredis.o net.o sds.o  -o blib/arch/auto/Redis/hiredis/hiredis.bundle  \
            \

chmod 755 blib/arch/auto/Redis/hiredis/hiredis.bundle
cp hiredis.bs blib/arch/auto/Redis/hiredis/hiredis.bs
chmod 644 blib/arch/auto/Redis/hiredis/hiredis.bs
Manifying blib/man3/Redis::hiredis.3pm

> make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/001_strings.t ....... ok     
t/002_generic.t ....... ok     
t/003_lists.t ......... ok     
t/004_sets.t .......... ok     
t/005_zsets.t ......... ok     
t/006_hashes.t ........ ok     
t/007_transactions.t .. ok     
t/008_pipeline.t ...... skipped: $ENV{'REDISHOST'} isn't set
t/009_errors.t ........ skipped: $ENV{'REDISHOST'} isn't set
t/010_argv.t .......... ok   
t/011_autoload.t ...... ok   
t/012_connect_unix.t .. skipped: $ENV{'REDISPATH'} isn't set
All tests successful.
Files=12, Tests=159,  0 wallclock secs ( 0.05 usr  0.03 sys +  0.26 cusr  0.05 csys =  0.39 CPU)
Result: PASS
neophenix commented 11 years ago

Closing now that builds work on OS X