build: Several updates of the build scripts

- Redesign the way default compile flags are determined.

  This includes a small semantical change with flag processing:
  * there are now "general" compiler and link flags. These are added (if
    supported) even if CXXFLAGS and/or LINKFLAGS environmental variables
    are set.
  * optimization/debug-mode flags that are applied only if CXXFLAGS
    and/or LINKFLAGS environmental variables are not set.

- Fix define constant for sqlite3.

  When pkg-config detection used, it requires `global_define` flag.
  Otherwise define is applied only when the module is included in the
  build target using 'use' statement.

- Remove openssl dependency

  This dependency was redundant for a long time

Change-Id: Icf66fb5300954893cc2d07e022b8a0998ec894e5
Refs: #2209
diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index 7562249..ceb4675 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -29,7 +29,6 @@
 ~~~~~~~~~
 
 -  ``python`` >= 2.6
--  ``libcrypto``
 -  ``libsqlite3``
 -  ``libcrypto++``
 -  ``pkg-config``
@@ -54,7 +53,7 @@
    In a terminal, enter::
 
        sudo apt-get install build-essential
-       sudo apt-get install libssl-dev libsqlite3-dev libcrypto++-dev
+       sudo apt-get install libsqlite3-dev libcrypto++-dev
 
        # For Ubuntu 12.04
        sudo apt-get install libboost1.48-all-dev
@@ -67,7 +66,7 @@
    In a terminal, enter::
 
        sudo yum install gcc-g++ git
-       sudo yum install openssl-devel sqlite-devel cryptopp-devel boost-devel
+       sudo yum install sqlite-devel cryptopp-devel boost-devel
 
 Optional:
 ~~~~~~~~~