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