summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-09-01 17:05:38 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-09-01 17:05:38 +0200
commit4535ac71e075946f374aef0bb1e2997869f148fe (patch)
tree7439eea8c02b5164ef459f5b7a7565a1d0c3f42c
parent6bad94bb8546a3a5595d340e7a2d809635e3bd5d (diff)
downloadpcitool-4535ac71e075946f374aef0bb1e2997869f148fe.tar.gz
pcitool-4535ac71e075946f374aef0bb1e2997869f148fe.tar.bz2
pcitool-4535ac71e075946f374aef0bb1e2997869f148fe.tar.xz
pcitool-4535ac71e075946f374aef0bb1e2997869f148fe.zip
Fixes out-of-source builds and minor build issues
-rw-r--r--CMakeLists.txt42
-rw-r--r--apps/pio_test.c1
-rw-r--r--apps/xilinx.c1
-rw-r--r--dma/CMakeLists.txt2
-rw-r--r--dma/ipe.c1
-rw-r--r--dma/ipe_benchmark.c1
-rw-r--r--dma/nwl.c1
-rw-r--r--dma/nwl_engine.c1
-rw-r--r--dma/nwl_loopback.c1
-rw-r--r--pcilib/CMakeLists.txt2
-rw-r--r--pcilib/bar.c1
-rw-r--r--pcilib/error.c1
-rw-r--r--pcilib/fifo.c1
-rw-r--r--pcilib/pci.c1
-rw-r--r--pcitool/CMakeLists.txt2
-rw-r--r--pcitool/cli.c1
-rw-r--r--protocols/CMakeLists.txt2
17 files changed, 42 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6fce9a..6e62519 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,28 @@ set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library")
#list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+if(NOT DEFINED BIN_INSTALL_DIR)
+ set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif(NOT DEFINED BIN_INSTALL_DIR)
+
+if(NOT DEFINED LIB_INSTALL_DIR)
+ set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif(NOT DEFINED LIB_INSTALL_DIR)
+
+if(NOT DEFINED INCLUDE_INSTALL_DIR)
+ set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
+endif(NOT DEFINED INCLUDE_INSTALL_DIR)
+
+if(NOT DEFINED DATA_INSTALL_DIR)
+ set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
+endif(NOT DEFINED DATA_INSTALL_DIR)
+
+if(NOT DEFINED LOCALE_INSTALL_DIR)
+ set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale")
+endif(NOT DEFINED LOCALE_INSTALL_DIR)
+
+SET(ENV{PKG_CONFIG_PATH} "${LIB_INSTALL_DIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}")
+
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
@@ -45,26 +67,6 @@ set(PACKAGE_TARNAME "${TARNAME}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket")
-if(NOT DEFINED BIN_INSTALL_DIR)
- set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
-endif(NOT DEFINED BIN_INSTALL_DIR)
-
-if(NOT DEFINED LIB_INSTALL_DIR)
- set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
-endif(NOT DEFINED LIB_INSTALL_DIR)
-
-if(NOT DEFINED INCLUDE_INSTALL_DIR)
- set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
-endif(NOT DEFINED INCLUDE_INSTALL_DIR)
-
-if(NOT DEFINED DATA_INSTALL_DIR)
- set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
-endif(NOT DEFINED DATA_INSTALL_DIR)
-
-if(NOT DEFINED LOCALE_INSTALL_DIR)
- set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale")
-endif(NOT DEFINED LOCALE_INSTALL_DIR)
-
set(PCILIB_PLUGIN_DIR "${LIB_INSTALL_DIR}/pcilib" CACHE PATH "Directory to install plugins")
set(PCILIB_DATA_DIR "${DATA_INSTALL_DIR}/pcilib" CACHE PATH "Directory to install data files")
set(PCILIB_MODEL_DIR "${PCILIB_DATA_DIR}/models" CACHE PATH "Directory to install XML models")
diff --git a/apps/pio_test.c b/apps/pio_test.c
index 84439ee..f211bf1 100644
--- a/apps/pio_test.c
+++ b/apps/pio_test.c
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#define _POSIX_C_SOURCE 199309L
#include <stdio.h>
#include <stdlib.h>
diff --git a/apps/xilinx.c b/apps/xilinx.c
index 0fe146b..a7b63e1 100644
--- a/apps/xilinx.c
+++ b/apps/xilinx.c
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#define _POSIX_C_SOURCE 199309L
#include <stdio.h>
#include <stdlib.h>
diff --git a/dma/CMakeLists.txt b/dma/CMakeLists.txt
index 38f13eb..4ddaece 100644
--- a/dma/CMakeLists.txt
+++ b/dma/CMakeLists.txt
@@ -1,6 +1,8 @@
include_directories(
${CMAKE_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/pcilib
+ ${CMAKE_BINARY_DIR}/pcilib
)
set(HEADERS ${HEADERS} nwl.h nwl_private.h nwl_engine.h nwl_irq.h nwl_loopback.h ipe.h ipe_private.h)
diff --git a/dma/ipe.c b/dma/ipe.c
index 3e46cb3..1c8e3e8 100644
--- a/dma/ipe.c
+++ b/dma/ipe.c
@@ -1,5 +1,6 @@
#define _PCILIB_DMA_IPE_C
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
diff --git a/dma/ipe_benchmark.c b/dma/ipe_benchmark.c
index 3ce04d3..2f86444 100644
--- a/dma/ipe_benchmark.c
+++ b/dma/ipe_benchmark.c
@@ -1,5 +1,6 @@
#define _PCILIB_DMA_IPE_C
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
diff --git a/dma/nwl.c b/dma/nwl.c
index d22df29..d173157 100644
--- a/dma/nwl.c
+++ b/dma/nwl.c
@@ -1,5 +1,6 @@
#define _PCILIB_DMA_NWL_C
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#define _GNU_SOURCE
#include <stdio.h>
diff --git a/dma/nwl_engine.c b/dma/nwl_engine.c
index 15ae27e..c3dea49 100644
--- a/dma/nwl_engine.c
+++ b/dma/nwl_engine.c
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
diff --git a/dma/nwl_loopback.c b/dma/nwl_loopback.c
index 1a0cd93..e5de50e 100644
--- a/dma/nwl_loopback.c
+++ b/dma/nwl_loopback.c
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/pcilib/CMakeLists.txt b/pcilib/CMakeLists.txt
index be59cb7..e21f1ba 100644
--- a/pcilib/CMakeLists.txt
+++ b/pcilib/CMakeLists.txt
@@ -1,6 +1,8 @@
include_directories(
${CMAKE_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/pcilib
+ ${CMAKE_BINARY_DIR}/pcilib
)
set(HEADERS pcilib.h pci.h export.h bar.h fifo.h model.h bank.h register.h kmem.h irq.h locking.h lock.h dma.h event.h plugin.h tools.h error.h debug.h env.h version.h config.h)
diff --git a/pcilib/bar.c b/pcilib/bar.c
index 418f864..074a0b2 100644
--- a/pcilib/bar.c
+++ b/pcilib/bar.c
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
diff --git a/pcilib/error.c b/pcilib/error.c
index 2c4296e..06af292 100644
--- a/pcilib/error.c
+++ b/pcilib/error.c
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
diff --git a/pcilib/fifo.c b/pcilib/fifo.c
index 593400f..7ed87b8 100644
--- a/pcilib/fifo.c
+++ b/pcilib/fifo.c
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
diff --git a/pcilib/pci.c b/pcilib/pci.c
index 62ac92d..ca17931 100644
--- a/pcilib/pci.c
+++ b/pcilib/pci.c
@@ -1,6 +1,7 @@
//#define PCILIB_FILE_IO
#define _XOPEN_SOURCE 700
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
diff --git a/pcitool/CMakeLists.txt b/pcitool/CMakeLists.txt
index 4aea142..0c0eef2 100644
--- a/pcitool/CMakeLists.txt
+++ b/pcitool/CMakeLists.txt
@@ -1,6 +1,8 @@
include_directories(
${CMAKE_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/pcilib
+ ${CMAKE_BINARY_DIR}/pcilib
${FASTWRITER_INCLUDE_DIRS}
)
diff --git a/pcitool/cli.c b/pcitool/cli.c
index 57801ab..7cd8196 100644
--- a/pcitool/cli.c
+++ b/pcitool/cli.c
@@ -1,6 +1,7 @@
#define _XOPEN_SOURCE 700
#define _POSIX_C_SOURCE 200112L
#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>
diff --git a/protocols/CMakeLists.txt b/protocols/CMakeLists.txt
index 2c482f6..88a1e8e 100644
--- a/protocols/CMakeLists.txt
+++ b/protocols/CMakeLists.txt
@@ -1,6 +1,8 @@
include_directories(
${CMAKE_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/pcilib
+ ${CMAKE_BINARY_DIR}/pcilib
)
set(HEADERS ${HEADERS} default.h software.h)