]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[github21] cql_config script added.
authorTomek Mrugalski <tomasz@isc.org>
Wed, 22 Jun 2016 14:56:38 +0000 (16:56 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 23 Jun 2016 12:36:03 +0000 (14:36 +0200)
tools/Makefile.am
tools/cql_config [new file with mode: 0755]
tools/cql_config_defines.sh [new file with mode: 0755]

index 92a7c37d903f66ff3df8bb20a68310913656f07a..950adad80d07629e050ffce7c33e6a9663e145a0 100644 (file)
@@ -16,4 +16,9 @@ system_messages_SOURCES = system_messages.cc
 # For bare distcheck
 EXTRA_DIST = system_messages
 
+# Scripts for Cassandra support. Ultimately those scripts will have to be
+# incorporated in DataStax cpp-driver source tree, but until that happens,
+# let's keep them in Kea rpo
+EXTRA_DIST += cql_config cql_config_defines.sh
+
 endif
diff --git a/tools/cql_config b/tools/cql_config
new file mode 100755 (executable)
index 0000000..19a426a
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/bash
+DIR=$(readlink -f $0 | xargs dirname)
+if ! [ -f ${DIR}/cql_config_defines.sh ] || ! [ -x ${DIR}/cql_config_defines.sh ]
+then
+       echo "missing path configuration file for DataStax Cassandra (cql_config_defines.h)"
+       exit 0
+fi
+source ${DIR}/cql_config_defines.sh
+
+if [ $# -ne 1 ]
+then
+       echo "run: \`$0 --help\` for more help"
+       exit 0
+fi
+if [ $1 == "--help" ]
+then
+       echo "--help"
+       echo "    print this help message"
+       echo "--cppflags"
+       echo "    get cpp compilation flags"
+       echo "--includedir"
+       echo "    get include path"
+       echo "--libdir"
+       echo "    get lib path"
+       echo "--version"
+       echo "    get version"
+       exit 0
+fi
+if [ $1 == "--cppflags" ]
+then
+       exit 0
+fi
+if [ $1 == "--includedir" ]
+then
+       echo "${CPP_DRIVER_PATH}/include/"
+       exit 0
+fi
+if [ $1 == "--libdir" ]
+then
+       echo "${CPP_DRIVER_PATH}/build/"
+       exit 0
+fi
+if [ $1 == "--version" ]
+then
+       MAJOR=`grep VERSION_MAJOR ${CPP_DRIVER_PATH}/include/cassandra.h | cut -d " " -f 3`
+       MINOR=`grep VERSION_MINOR ${CPP_DRIVER_PATH}/include/cassandra.h | cut -d " " -f 3`
+       PATCH=`grep VERSION_PATCH ${CPP_DRIVER_PATH}/include/cassandra.h | cut -d " " -f 3`
+       echo "${MAJOR}.${MINOR}.${PATCH}"
+       exit 0
+fi
+echo "wrong parameter"
+echo "run: \`$0 --help\` for more help"
diff --git a/tools/cql_config_defines.sh b/tools/cql_config_defines.sh
new file mode 100755 (executable)
index 0000000..bf3810d
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# This auxiliary script is considered temporary in nature. It will not be
+# necessary once the DataStax cpp-driver project accepts proper cql_config
+# script.
+
+# This variable should point to the directory where cpp-driver is compiled.
+# You can download cpp-driver sources from https://github.com/datastax/cpp-driver
+CPP_DRIVER_PATH="/please/specify/path/to/cpp-driver/in/cql_config_defines.sh"
+export CPP_DRIVER_PATH