cql_config 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. DIR=$(readlink -f $0 | xargs dirname)
  3. if ! [ -f ${DIR}/cql_config_defines.sh ] || ! [ -x ${DIR}/cql_config_defines.sh ]
  4. then
  5. echo "missing path configuration file for DataStax Cassandra (cql_config_defines.h)"
  6. exit 0
  7. fi
  8. source ${DIR}/cql_config_defines.sh
  9. if [ $# -ne 1 ]
  10. then
  11. echo "run: \`$0 --help\` for more help"
  12. exit 0
  13. fi
  14. if [ $1 == "--help" ]
  15. then
  16. echo "--help"
  17. echo " print this help message"
  18. echo "--cppflags"
  19. echo " get cpp compilation flags"
  20. echo "--includedir"
  21. echo " get include path"
  22. echo "--libdir"
  23. echo " get lib path"
  24. echo "--version"
  25. echo " get version"
  26. exit 0
  27. fi
  28. if [ $1 == "--cppflags" ]
  29. then
  30. exit 0
  31. fi
  32. if [ $1 == "--includedir" ]
  33. then
  34. echo "${CPP_DRIVER_PATH}/include/"
  35. exit 0
  36. fi
  37. if [ $1 == "--libdir" ]
  38. then
  39. echo "${CPP_DRIVER_PATH}/build/"
  40. exit 0
  41. fi
  42. if [ $1 == "--version" ]
  43. then
  44. MAJOR=`grep VERSION_MAJOR ${CPP_DRIVER_PATH}/include/cassandra.h | cut -d " " -f 3`
  45. MINOR=`grep VERSION_MINOR ${CPP_DRIVER_PATH}/include/cassandra.h | cut -d " " -f 3`
  46. PATCH=`grep VERSION_PATCH ${CPP_DRIVER_PATH}/include/cassandra.h | cut -d " " -f 3`
  47. echo "${MAJOR}.${MINOR}.${PATCH}"
  48. exit 0
  49. fi
  50. echo "wrong parameter"
  51. echo "run: \`$0 --help\` for more help"