summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--driver/Makefile.in8
-rw-r--r--driver/base.c2
-rw-r--r--driver/ioctl.c2
-rw-r--r--driver/kmem.h2
-rw-r--r--pcitool.spec.in2
6 files changed, 13 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f956d3a..10add39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,13 +47,17 @@ if (NOT DEFINED PCILIB_SERVER_DIR)
endif (NOT DEFINED PCILIB_SERVER_DIR)
if (NOT DEFINED PCILIB_DOC_DIR)
- set(PCILIB_DOC_DIR "${CMAKE_CURRENT_BINARY_DIR}/docs/" CACHE PATH "Directory to install documentation")
+ set(PCILIB_DOC_DIR "${CMAKE_BINARY_DIR}/docs/" CACHE PATH "Directory to install documentation")
endif (NOT DEFINED PCILIB_DOC_DIR)
if (NOT DEFINED PCILIB_DEBUG_DIR)
set(PCILIB_DEBUG_DIR "." CACHE PATH "Directory to write debug information")
endif (NOT DEFINED PCILIB_DEBUG_DIR)
+if (NOT DEFINED PCILIB_DYNAMIC_HEADERS_INC)
+ set(PCILIB_DYNAMIC_HEADERS_INC "-I${CMAKE_BINARY_DIR}")
+endif (NOT DEFINED PCILIB_DYNAMIC_HEADERS_INC)
+
SET(ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_LIBDIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}")
if (NOT DISABLE_PYTHON)
diff --git a/driver/Makefile.in b/driver/Makefile.in
index eea5a7b..2f5238a 100644
--- a/driver/Makefile.in
+++ b/driver/Makefile.in
@@ -10,8 +10,7 @@ MAININSTALLDIR ?= /lib/modules/$(KERNELVER)/kernel/extra
HEADERDIR ?= /lib/modules/$(KERNELVER)/source/include
PWD := $(shell pwd)
-#EXTRA_CFLAGS += -I$(M)/..
-EXTRA_CFLAGS += -I${CMAKE_BINARY_DIR}/driver
+EXTRA_CFLAGS += -I$(M)/.. ${PCILIB_DYNAMIC_HEADERS_INC}
ifdef DUMMY_DEVICE
ifneq ($(DUMMY_DEVICE), 0)
@@ -19,6 +18,7 @@ ifneq ($(DUMMY_DEVICE), 0)
endif
endif
+# Grepping in '../pcilib/build.h' is correct as we will always have this file in the releases...
default:
@KERNEL_GCC_VERSION=`cat /proc/version | head -n1 | cut -d " " -f 7` ;\
GCC_VERSION=`$(CC) --version | head -n 1 | tr ' ' '\n' | grep -e "[0-9]\+\.[0-9]" | tail -n 1` ;\
@@ -65,10 +65,10 @@ default:
grep "#define PCILIB_RELEASE" ../pcilib/build.h &> /dev/null ;\
if [ $$? -eq 0 ]; then \
revision="Release \" PCILIB_RELEASE \" (r\" PCILIB_REVISION \") from \" PCILIB_REVISION_BRANCH \" by \" PCILIB_REVISION_AUTHOR \" at $$build_path, last modification from $$build_lastmod" ;\
- /bin/echo -e "#include \"../pcilib/build.h\"\\n#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
+ /bin/echo -e "#include \"pcilib/build.h\"\\n#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
else \
revision="Revision r\" PCILIB_REVISION \" from \" PCILIB_REVISION_BRANCH \" by \" PCILIB_REVISION_AUTHOR \" at $$build_path, last modification from $$build_lastmod" ;\
- /bin/echo -e "#include \"../pcilib/build.h\"\\n#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
+ /bin/echo -e "#include \"pcilib/build.h\"\\n#define PCIDRIVER_BUILD \"$$build\"\\n#define PCIDRIVER_REVISION \"$$revision\"\\n#define PCIDRIVER_CHANGES PCILIB_REVISION_MODIFICATIONS\n" > build.h ;\
fi ;\
fi ;\
$(MAKE) $(CFLAGS) -C $(KERNELDIR) M=$(PWD) CC=$$CC modules
diff --git a/driver/base.c b/driver/base.c
index 5c874a8..3cd42b8 100644
--- a/driver/base.c
+++ b/driver/base.c
@@ -19,7 +19,7 @@
#include <linux/interrupt.h>
#include <linux/wait.h>
-#include "../pcilib/version.h"
+#include "pcilib/version.h"
#include "build.h"
#include "base.h"
diff --git a/driver/ioctl.c b/driver/ioctl.c
index c75dd3a..dd7c7a3 100644
--- a/driver/ioctl.c
+++ b/driver/ioctl.c
@@ -30,7 +30,7 @@
#include <linux/sched.h>
#include <linux/iommu.h>
-#include "../pcilib/version.h"
+#include "pcilib/version.h"
#include "base.h"
diff --git a/driver/kmem.h b/driver/kmem.h
index e793bd6..55ba417 100644
--- a/driver/kmem.h
+++ b/driver/kmem.h
@@ -3,7 +3,7 @@
#include <linux/sysfs.h>
-#include "../pcilib/kmem.h"
+#include "pcilib/kmem.h"
#include "ioctl.h"
/* Define an entry in the kmem list (this list is per device) */
diff --git a/pcitool.spec.in b/pcitool.spec.in
index ddae001..645492b 100644
--- a/pcitool.spec.in
+++ b/pcitool.spec.in
@@ -117,7 +117,7 @@ Pcilib Web API and small demo web server.
%setup -q -n pcitool-%{version}
%build
-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DPCILIB_DYNAMIC_HEADERS_INC="" \
-DPCILIB_PLUGIN_DIR=%{_libdir}/pcilib${PCILIB_ABI_VERSION}/ -DPCILIB_DATA_DIR=%{_datadir}/pcilib${PCILIB_ABI_VERSION}/ \
-DPCILIB_PYTHON_SITEDIR=%{python2_sitearch} \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_INSTALL_BINDIR=%{_bindir} -DCMAKE_INSTALL_DATADIR=%{_datadir} -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} .