Fixed #139
[platform/upstream/ejdb.git] / INSTALL
1 Building
2 ========
3
4 Prerequisites
5 -------------
6
7  * git  
8  * GNU make 
9  * cmake >= 2.8.12
10  * gcc >= 4.7 or clang >= 3.4 C compiller
11  * zlib-dev 
12  
13 Make
14 ----
15
16 ```sh
17 git clone https://github.com/Softmotions/ejdb.git
18 cd ejdb
19 mkdir build
20 cd build
21 cmake -DCMAKE_BUILD_TYPE=Release ../
22 make 
23 make install
24 # Or you can create tgz package:
25 make package
26 ```
27
28 ### CMake basic build(-D) options
29
30 ```
31 // Build ejdb sample projects
32 BUILD_SAMPLES:BOOL=ON
33
34 // Build shared libraries
35 BUILD_SHARED_LIBS:BOOL=ON
36
37 // Build test cases
38 BUILD_TESTS:BOOL=OFF
39
40 // Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo.
41 CMAKE_BUILD_TYPE:STRING=Release
42
43 // Install path prefix, prepended onto install directories.
44 CMAKE_INSTALL_PREFIX:PATH=/usr/local
45
46 // Enable PPA package build
47 ENABLE_PPA:BOOL=OFF
48
49 // Build .deb instalation packages
50 PACKAGE_DEB:BOOL=OFF
51
52 // Build .tgz package archive
53 PACKAGE_TGZ:BOOL=ON
54
55 // Upload debian packages to the launchpad ppa repository
56 UPLOAD_PPA:BOOL=OFF
57 ```
58
59 ### Building Windows libs
60
61 You need to checkout the [MXE cross build environment](http://mxe.cc)
62 Then create/edit MXE settings file:
63
64 ```sh
65 cd <mxe checkout dir>
66 nano ./settings.mk
67 ```
68
69 Save the following content in `settings.mk`:
70
71 ```
72 JOBS := 1
73 MXE_TARGETS := x86_64-w64-mingw32.static i686-w64-mingw32.static
74 LOCAL_PKG_LIST := winpthreads pcre zlib lzo bzip2 cunit
75 .DEFAULT local-pkg-list:
76 local-pkg-list: $(LOCAL_PKG_LIST)
77 ```
78
79 Build MXE packages:
80
81 ```sh
82  cd <mxe checkout dir>
83  make
84 ```
85
86 Build libejdb windows binaries:
87
88 ```sh
89 export MXE_HOME=<mxe checkout dir>
90 cd <ejdb checkout dir>
91 mkdir build-win32
92 cd build-wind32
93 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../win64-tc.cmake ..
94 make package
95 ```
96
97 EJDB binary package installation
98 ===================================
99      
100 Ubuntu
101 ------
102
103 ```sh
104 sudo add-apt-repository ppa:adamansky/ejdb
105 sudo apt-get update
106 sudo apt-get install ejdb ejdb-dbg
107 ```