You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If you want to use these scripts, you should install Git 1.8+, CMake 2.8+ and M4 1.4+.
30
+
If you are a Homebrew user, you could simply run the following commands to install these tools:
31
+
32
+
```cpp
33
+
brew install git
34
+
brew install cmake
35
+
brew install m4
36
+
```
37
+
38
+
- If you want to build static libraries for iOS and Mac, you should install the latest version of XCode. You should also install the `Command Line Tools` bundled with XCode.
39
+
40
+
41
+
- If you want to build static libraries for Android, you should install [NDK](https://developer.android.com/tools/sdk/ndk/index.html). NDK r9d is required at the moment and you should also specify the ANDROID_NDK environment variable in your shell.
42
+
43
+
- If you want to build static libraries for Tizen, you should download and install [Tizen SDK](https://developer.tizen.org/downloads/tizen-sdk). And you should also add a environment variable named `TIZEN_SDK` in your shell.
44
+
45
+
### For Linux users
46
+
xxx need to improve the document here later.
47
+
48
+
### For Windows users
49
+
In order to run these scripts, you should install [msys2](http://msys2.github.io/) and update the system packages.
50
+
51
+
After that, you should also install the following dependencies:
52
+
53
+
```cpp
54
+
pacman -S gcc
55
+
pacman -S make
56
+
pacman -S autoconf
57
+
pacman -S automake
58
+
pacman -S git
59
+
pacman -S cmake
60
+
pacman -S libtool
61
+
```
62
+
63
+
## How to use
64
+
### For iOS Platform
65
+
For building libpng fat library:
66
+
67
+
```cpp
68
+
cd build/ios
69
+
./build_png.sh
70
+
```
71
+
72
+
Or you can also use `build.sh` script build each static library for different arch.
73
+
The usage would be:
74
+
75
+
```cpp
76
+
usage: $0 [-s] [-k sdk] [-a arch] [-l libname]
77
+
78
+
OPTIONS
79
+
-k <sdk version> Specify which sdk to use ('xcodebuild -showsdks', current: 8.1)
80
+
-s Build for simulator
81
+
-a <arch> Specify which arch to use (current: armv7)
82
+
-l <libname> Specify which static library to build
83
+
```
84
+
85
+
If you want to build *websockets* with *i386* arch, you could use the following command:
86
+
87
+
```cpp
88
+
cd build/ios
89
+
./build.sh -s -a i386 -l websockets (Don't forget the -s option, it is stand for simulator, if you omit it, it will give you errors.)
90
+
```
91
+
92
+
In this way, you can only build one arch a time, if you want to build a fat library, please use `build_xxx.sh` instead.(xxx is the library name, we will follow this conversion throughout this document.)
93
+
94
+
If you use `build_xxx.sh` to build static libraries, all the generated `header files` and `.a files` are under the folder named as `xxx`.
95
+
96
+
Let's give png as an example, after you run `./build_png.sh`, it will generate a folder named `png`:
97
+
98
+
The folder structure would be:
99
+
100
+
```
101
+
-png
102
+
--include(this folder contains the exported header files)
103
+
- prebuilt(this folder contains the fat library)
104
+
```
105
+
106
+
All the other libraries share the same folder structure.
107
+
108
+
### For Android Platform
109
+
For building libpng with armeabi, armeabi-v7a and x86 arch, you can do it like this:
110
+
111
+
```cpp
112
+
cd build/android
113
+
./build_png.sh
114
+
```
115
+
Or you can also use `build.sh` script build each static library for different arch.
116
+
The usage would be:
117
+
118
+
```cpp
119
+
-k <sdk> Use the specified Android API level (default: android-19)
120
+
-a <arch> Use the specified arch (default: armeabi-v7a)
121
+
-n <version> Use the gcc version(default: 4.8)
122
+
-l <libname> Use the specified library name
123
+
EOF
124
+
```
125
+
126
+
If you want to build a `curl` library with `armeabi` arch support, you can do it like this:
127
+
128
+
```cpp
129
+
cd build/android
130
+
./build.sh -a armeabi -l curl
131
+
```
132
+
133
+
### For Mac
134
+
For building libpng x86_64 arch library:
135
+
136
+
```cpp
137
+
cd build/mac
138
+
./build_png.sh
139
+
```
140
+
### For Tizen
141
+
For building libpng armv7 arch library:
142
+
143
+
```cpp
144
+
cd build/tizen
145
+
./build_png.sh
146
+
```
147
+
148
+
### For Linux
149
+
xxx After testing these scripts on Linux, document will be update.
150
+
151
+
## How to build a DEBUG and RELEASE version
152
+
xxx we need to improve the script to add debug and release options.
153
+
154
+
## How to do build clean?
155
+
If you use `./build_xxx.sh` to build static libraries, there is no need to do clean. After generating the static library, script will delete the intermediate files.
156
+
157
+
If you use `./build.sh` manually, you should delete the folders generated in src folder.
158
+
159
+
## How to upgrade a existing library
160
+
If you find a 3rd party library has some critical bug fix, you might need to update it.
161
+
You can following the [README](./contrib/src/README) file to do this job.
0 commit comments