I tried to compile it, but it failed:
- Code: Select all
$ ./configure --enable-debug
checking build system type... i686-apple-darwin12.5.0
checking host system type... i686-apple-darwin12.5.0
checking target system type... i686-apple-darwin12.5.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... none needed
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for C/C++ restrict keyword... __restrict
checking for inline... inline
checking whether gcc supports -g -O2 -O2 -Wall -m64... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking for rm... /bin/rm
checking for mt... /usr/local/bin/mt
checking return type of signal handlers... void
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for struct stat.st_blksize... yes
checking whether to enable assertions... yes
checking for pthread_mutex_init in -lpthread... yes
checking for library containing clock_gettime... no
as_fn_error 1 could not find the library containing clock_gettime! 4867 5
checking for library containing sem_init... none required
checking for library containing rint... none required
checking for library containing seteuid... none required
checking for library containing atoll... none required
checking for library containing hstrerror... none required
checking for library containing getaddrinfo... none required
checking for library containing socket... none required
checking for library containing gethostbyname... none required
checking for library containing sendfile... none required
checking sys/sendfile.h usability... no
checking sys/sendfile.h presence... no
checking for sys/sendfile.h... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for library containing mhash_init... no
checking for library containing MD5Init... no
checking for library containing MD5_Init... -lcrypto
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mbuffer.1
config.status: creating config.h
config.status: config.h is unchanged
tk-pb4540s-macosx:mbuffer-20130220 tristank$ make
gcc -g -O2 -O2 -Wall -m64 -DHAVE_CONFIG_H -I. -I. -c -o log.o log.c
gcc -g -O2 -O2 -Wall -m64 -DHAVE_CONFIG_H -I. -I. -c -o network.o network.c
gcc -g -O2 -O2 -Wall -m64 -DHAVE_CONFIG_H -I. -I. -c -o mbuffer.o mbuffer.c
mbuffer.c:65:3: warning: sendfile is unable to send from buffers [-W#warnings]
#warning sendfile is unable to send from buffers
^
mbuffer.c:503:9: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
(void) clock_gettime(ClockSrc,&now);
^
mbuffer.c:563:10: warning: implicit declaration of function 'mac_sem_post' is invalid in C99 [-Wimplicit-function-declaration]
err = sem_post(&Buf2Dev);
^
mbuffer.c:216:18: note: expanded from macro 'sem_post'
#define sem_post mac_sem_post
^
mbuffer.c:721:9: warning: implicit declaration of function 'mac_sem_wait' is invalid in C99 [-Wimplicit-function-declaration]
err = sem_wait(&Dev2Buf); /* Wait for one or more buffer blocks to be free */
^
mbuffer.c:215:18: note: expanded from macro 'sem_wait'
#define sem_wait mac_sem_wait
^
mbuffer.c:766:19: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
pthread_exit((void *) in);
^
mbuffer.c:767:12: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
return (void *) in;
^
mbuffer.c:864:15: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
pthread_exit((void *) ret);
^
mbuffer.c:962:2: warning: 'MD5_Init' is deprecated [-Wdeprecated-declarations]
MD5_INIT(MD5ctxt);
^
mbuffer.c:88:25: note: expanded from macro 'MD5_INIT'
#define MD5_INIT(ctxt) MD5_Init(&ctxt);
^
/usr/include/openssl/md5.h:113:5: note: 'MD5_Init' declared here
int MD5_Init(MD5_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
mbuffer.c:985:4: warning: 'MD5_Final' is deprecated [-Wdeprecated-declarations]
MD5_END(hashvalue,MD5ctxt);
^
mbuffer.c:90:28: note: expanded from macro 'MD5_END'
#define MD5_END(hash,ctxt) MD5_Final(hash,&(ctxt))
^
/usr/include/openssl/md5.h:115:5: note: 'MD5_Final' declared here
int MD5_Final(unsigned char *md, MD5_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
mbuffer.c:1008:3: warning: 'MD5_Update' is deprecated [-Wdeprecated-declarations]
MD5_UPDATE(MD5ctxt,SendAt,size);
^
mbuffer.c:89:33: note: expanded from macro 'MD5_UPDATE'
#define MD5_UPDATE(ctxt,at,num) MD5_Update(&ctxt,at,num)
^
/usr/include/openssl/md5.h:114:5: note: 'MD5_Update' declared here
int MD5_Update(MD5_CTX *c, const void *data, size_t len) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
mbuffer.c:1171:15: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
pthread_exit((void *)status);
^
mbuffer.c:2060:11: warning: implicit declaration of function 'mac_sem_init' is invalid in C99 [-Wimplicit-function-declaration]
if (0 != sem_init(&Buf2Dev,0,0))
^
mbuffer.c:213:18: note: expanded from macro 'sem_init'
#define sem_init mac_sem_init
^
mbuffer.c:2106:19: warning: incompatible pointer types assigning to 'void (*)(int, struct __siginfo *, void *)' from 'void (*)(int)' [-Wincompatible-pointer-types]
sig.sa_sigaction = SIG_IGN;
^ ~~~~~~~
13 warnings generated.
gcc -g -O2 -O2 -Wall -m64 -DHAVE_CONFIG_H -I. -I. log.o network.o mbuffer.o -lcrypto -lpthread -o mbuffer
Undefined symbols for architecture x86_64:
"_clock_gettime", referenced from:
_outputThread in mbuffer.o
_inputThread in mbuffer.o
_enforceSpeedLimit in mbuffer.o
"_mac_sem_init", referenced from:
_main in mbuffer.o
"_mac_sem_post", referenced from:
_outputThread in mbuffer.o
_inputThread in mbuffer.o
_requestInputVolume in mbuffer.o
_terminateOutputThread in mbuffer.o
_syncSenders in mbuffer.o
"_mac_sem_wait", referenced from:
_outputThread in mbuffer.o
_inputThread in mbuffer.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mbuffer] Error 1
Any suggestions? Thanks.