diff --git a/linux/lib/Makefile b/linux/lib/Makefile index b06222bc..c8f05624 100644 --- a/linux/lib/Makefile +++ b/linux/lib/Makefile @@ -28,11 +28,17 @@ STATIC_LIB := $(LIB_DIR)/$(LIB_NAME).a LIB_VER_FLAG := -DLIB_VERSION=\"v$(LIB_VER_MAJ).$(LIB_VER_MIN).$(LIB_VER_PAT)\" # Path to driver interface headers -DRIVER_HEADER_DIR ?= /usr/include +# Changing default to make our lives easier for now... +##DRIVER_HEADER_DIR ?= /usr/include +DRIVER_HEADER_DIR ?= ../../common -CFLAGS := -Wall -Wextra -Wno-unused-parameter -fPIC -std=gnu99 $(LIB_VER_FLAG) \ - -I$(INC_DIR) -I$(DRIVER_HEADER_DIR) -LDFLAGS := + +CFLAGS := -Wall -Wextra -Wno-unused-parameter \ + -fPIC \ + -std=gnu99 -D_GNU_SOURCE $(LIB_VER_FLAG) \ + -I$(INC_DIR) -I$(DRIVER_HEADER_DIR) + +LDFLAGS := -fPIC ifdef DEBUG CFLAGS += -O0 -ggdb3 diff --git a/linux/lib/src/bladerf.c b/linux/lib/src/bladerf.c index 4aa6c0af..a39c43c7 100644 --- a/linux/lib/src/bladerf.c +++ b/linux/lib/src/bladerf.c @@ -7,7 +7,6 @@ #include "bladeRF.h" /* Kernel module interface */ - /* TODO Should there be a "big-lock" wrapped around accesses to a device */ struct bladerf { int fd; /* File descriptor to associated driver device node */ @@ -17,7 +16,7 @@ struct bladerf { ssize_t bladerf_get_device_list(struct bladerf_devinfo **devices) { struct bladerf_devinfo *ret; - const size_t num_devices = 3; /* Initial guess */ + const size_t num_devices = 3; /* Initial guess. Realloc as neccessary */ ret = calloc(num_devices, sizeof(*ret)); if (!ret) { @@ -50,6 +49,7 @@ struct bladerf * bladerf_open(const char *dev_path) return ret; /* Test that this device is actually a bladeRF */ + return ret; } void bladerf_close(struct bladerf *dev)