cql_config 1.19 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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"