Closed somasis closed 8 years ago
Hi @Somasis,
Like libudev, libudev-compat requires a few extra feature macros to be defined. They are:
__STDC_FORMAT_MACROS
_GNU_SOURCE
_BSD_SOURCE
_XOPEN_SOURCE=700
_POSIX_C_SOURCE=200809L
Vdev's buildconf.mk
and libudev-compat's Makefile should enable them all via the $(DEFS)
variable. It's not clear from your build output that they're enabled. Can you confirm?
Thanks!
Oh, okay, I see now. I looked more at libudev-compat's Makefile, I think I know what the issue is.
In the root buildconf.mk, DEFS is defined just fine. In vdevd's Makefile, $(DEFS) is added to all the $(CC) invocations. That's why they succeed. However, since the CC is being set in the make
arguments rather than using the default, it trips up libudev-compat's Makefile, because of the way it uses the DEFS...
CFLAGS := -Wall -g -fPIC -fstack-protector -fstack-protector-all -pthread -Wno-unused-variable -Wno-unused-but-set-variable
INC := $(INC) -I$(BUILD_LIBUDEV_COMPAT_HEADERS)
DEFS := $(DEFS) -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_GNU_SOURCE
CC := cc $(CFLAGS) $(INC) $(DEFS)
So instead of tacking $(DEFS) and all that stuff on to the end of CC, it should be added separately to all the invocations of $(CC) in the Makefile.