Trying to build on Mac OS-X Leopard with a default config and I run into this issue:
gcc -DHAVE_CONFIG_H -I. -D_PATH_MODDIR=\"/usr/local/lib/rsyslog/\" -pthread -g -O2 -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g -MT rsyslogd-debug.o -MD -MP -MF .deps/rsyslogd-debug.Tpo -c -o rsyslogd-debug.o `test -f 'debug.c' || echo './'`debug.c
debug.c: In function ‘dbgoprint’:
debug.c:805: warning: implicit declaration of function ‘clock_gettime’
debug.c:805: error: ‘CLOCK_REALTIME’ undeclared (first use in this function)
debug.c:805: error: (Each undeclared identifier is reported only once
debug.c:805: error: for each function it appears in.)
debug.c: In function ‘dbgprintf’:
debug.c:884: error: ‘CLOCK_REALTIME’ undeclared (first use in this function)
It appears clock_gettime() is not exposed in OS-X. Has anyone figured a work-around? One suggestion I saw relating to this error in the build of another product was to specify a POSIX define on the gcc lines, as in:
./configure CFLAGS=-D_POSIX_C_SOURCE=200112L
but this produced several other immediate errors:
gcc -DHAVE_CONFIG_H -I. -pthread -D_POSIX_C_SOURCE=200112L -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g -MT lmnet_la-net.lo -MD -MP -MF .deps/lmnet_la-net.Tpo -c net.c -fno-common -DPIC -o .libs/lmnet_la-net.o
In file included from net.c:50:
syslogd.h:98: error: syntax error before 'u_char'
syslogd.h:98: warning: no semicolon at end of struct or union
syslogd.h:98: warning: no semicolon at end of struct or union
syslogd.h:112: error: syntax error before '}' token
syslogd.h:112: warning: type defaults to 'int' in declaration of 'f_filterData'
syslogd.h:112: warning: data definition has no type or storage class
syslogd.h:115: error: syntax error before '}' token
net.c: In function 'addAllowedSenderLine':
net.c:407: warning: implicit declaration of function 'strcasecmp'
net.c: In function 'gethname':
net.c:639: error: 'NI_MAXHOST' undeclared (first use in this function)
net.c:639: error: (Each undeclared identifier is reported only once
net.c:639: error: for each function it appears in.)
net.c:639: warning: unused variable 'ip'
Any help much appreciated.
John.

