Benny Prijono | 10a2080 | 2006-03-02 21:52:18 +0000 | [diff] [blame] | 1 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 2 | Getting Started: Building and Using PJSIP and PJMEDIA |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 3 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 4 | [Last Update: $Date: 2006-10-21 19:14:22 +0100 (Sat, 21 Oct 2006) $] |
| 5 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 6 | _________________________________________________________________ |
| 7 | |
| 8 | This article describes how to download, customize, build, and use the open |
| 9 | source PJSIP and PJMEDIA SIP and media stack. The online (and HTML) version |
| 10 | of this file can be downloaded from http://www.pjsip.org/using.htm |
Benny Prijono | db419fd | 2006-03-05 11:54:33 +0000 | [diff] [blame] | 11 | |
Benny Prijono | eec4d7c | 2006-03-09 16:19:20 +0000 | [diff] [blame] | 12 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 13 | Quick Info |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 14 | _________________________________________________________________ |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 15 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 16 | Building with GNU tools (Linux, *BSD, MacOS X, mingw, etc.) |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 17 | Generally these should be all that are needed to build the libraries, |
| 18 | applications, and samples: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 19 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 20 | $ ./configure |
| 21 | $ make dep && make clean && make |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 22 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 23 | Building Win32 Target with Microsoft Visual Studio |
| 24 | Generally we can just do these steps: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 25 | |
| 26 | 1. Open pjsip-apps/build/pjsip_apps.dsw workspace, |
| 27 | 2. Create an empty pjlib/include/pj/config_site.h, and |
| 28 | 3. build the pjsua application. |
| 29 | |
| 30 | Building for Windows Mobile |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 31 | Generally these are all that are needed: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 32 | |
| 33 | 1. Open pjsip-apps/build/wince-evc4/wince_demos.vcw EVC4 workspace, |
| 34 | 2. Create an empty pjlib/include/pj/config_site.h, and |
| 35 | 3. build the pjsua_wince application. |
| 36 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 37 | Locating Output Binaries/Libraries |
| 38 | Libraries will be put in lib directory, and binaries will be put in |
| 39 | bin directory, under each projects. |
| 40 | |
| 41 | Running the Applications |
| 42 | After successful build, you can try running pjsua application on |
| 43 | pjsip-apps/bin directory. PJSUA manual is in |
| 44 | http://www.pjsip.org/pjsua.htm. |
Benny Prijono | eec4d7c | 2006-03-09 16:19:20 +0000 | [diff] [blame] | 45 | |
| 46 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 47 | Table of Contents: |
| 48 | _________________________________________________________________ |
Benny Prijono | eec4d7c | 2006-03-09 16:19:20 +0000 | [diff] [blame] | 49 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 50 | 1. Getting the Source Distribution |
| 51 | |
| 52 | 1.1 Getting the Release tarball |
| 53 | |
| 54 | 1.2 Getting from Subversion trunk |
| 55 | |
| 56 | 1.3 Source Directories Layout |
| 57 | |
| 58 | 2. Build Preparation |
| 59 | |
| 60 | 2.1 config_site.h file |
| 61 | |
| 62 | 2.2 Disk Space Requirements |
| 63 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 64 | 3. Building Linux, *nix, *BSD, and MacOS X Targets with GNU Build |
| 65 | Systems |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 66 | |
| 67 | 3.1 Supported Targets |
| 68 | |
| 69 | 3.2 Requirements |
| 70 | |
| 71 | 3.3 Running configure |
| 72 | |
| 73 | 3.4 Running make |
| 74 | |
| 75 | 3.5 Cross Compilation |
| 76 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 77 | 3.6 Build Customizations |
| 78 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 79 | 4. Building for Windows Targets with Microsoft Visual Studio |
| 80 | |
| 81 | 4.1 Requirements |
| 82 | |
| 83 | 4.2 Building the Projects |
| 84 | |
| 85 | 4.3 Debugging the Sample Application |
| 86 | |
| 87 | 5. Building for Windows Mobile Targets (Windows CE/WinCE/PDA/SmartPhone) |
| 88 | |
| 89 | 5.1 Requirements |
| 90 | |
| 91 | 5.2 Building the Projects |
| 92 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 93 | 6. Using PJPROJECT with Applications |
Benny Prijono | eec4d7c | 2006-03-09 16:19:20 +0000 | [diff] [blame] | 94 | |
| 95 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 96 | Appendix I: Common Problems/Frequently Asked Question (FAQ) |
Benny Prijono | eec4d7c | 2006-03-09 16:19:20 +0000 | [diff] [blame] | 97 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 98 | I.1 fatal error C1083: Cannot open include file: 'pj/config_site.h': |
| 99 | No such file or directory |
| 100 | |
| 101 | |
| 102 | 1. Getting the Source Code Distribution |
| 103 | _________________________________________________________________ |
| 104 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 105 | All libraries (PJLIB, PJLIB-UTIL, PJSIP, PJMEDIA, and PJMEDIA-CODEC) are |
| 106 | currently distributed under a single source tree, collectively named as |
| 107 | PJPROJECT or just PJ libraries. These libraries can be obtained by either |
| 108 | downloading the release tarball or getting them from the Subversion trunk. |
| 109 | |
| 110 | |
| 111 | 1.1 Getting the Release tarball |
| 112 | _________________________________________________________________ |
| 113 | |
| 114 | Getting the released tarball is a convenient way to obtain stable version of |
| 115 | PJPROJECT. The tarball may not contain the latest features or bug-fixes, but |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 116 | normally it is considered more stable as each will be tested more rigorously |
| 117 | before released. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 118 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 119 | The latest released tarball can be downloaded from the |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 120 | http://www.pjsip.org/download.htm. |
| 121 | |
| 122 | |
| 123 | 1.2 Getting from Subversion trunk |
| 124 | _________________________________________________________________ |
| 125 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 126 | PJPROJECT Subversion repository will always contain the latest/most |
| 127 | up-to-date version of the sources. Normally the Subversion repository is |
| 128 | always kept in a "good" state. However, there's always a chance that things |
| 129 | break and the tree doesn't build correctly (particularly for the |
| 130 | "not-so-popular" targets), so please consult the mailing list should there |
| 131 | be any problems. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 132 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 133 | Using Subversion also has benefits of keeping the local copy of the source |
| 134 | up to date with the main PJ source tree and to easily track the changes made |
| 135 | to the local copy, if any. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 136 | |
| 137 | |
| 138 | What is Subversion |
| 139 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 140 | Subversion (SVN) is Open Source version control system similar to CVS. |
| 141 | Subversion homepage is in http://subversion.tigris.org/ |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 142 | |
| 143 | |
| 144 | Getting Subversion Client |
| 145 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 146 | A Subversion (SVN) client is needed to download the PJ source files from |
| 147 | pjsip.org SVN tree. SVN client binaries can be downloaded from |
| 148 | http://subversion.tigris.org/, and the program should be available for |
| 149 | Windows, Linux, MacOS X, and many more platforms. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 150 | |
| 151 | |
| 152 | Getting the Source for The First Time |
| 153 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 154 | Once Subversion client is installed, we can use these commands to initially |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 155 | retrieve the latest sources from the Subversion trunk: |
| 156 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 157 | |
| 158 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 159 | $ svn co http://svn.pjproject.net/repos/pjproject/trunk pjproject |
| 160 | $ cd pjproject |
| 161 | |
| 162 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 163 | Keeping The Local Copy Up-to-Date |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 164 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 165 | Once sources have been downloaded, we can keep the local copy up to date by |
| 166 | periodically synchronizing the local source with the latest revision from |
| 167 | the PJ's Subversion trunk. The mailing list provides best source of |
| 168 | information about the availability of new updates in the trunk. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 169 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 170 | To update the local copy with the latest changes in the main PJ's |
| 171 | repository: |
| 172 | |
| 173 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 174 | |
| 175 | $ cd pjproject |
| 176 | $ svn update |
| 177 | |
| 178 | |
| 179 | Tracking Local and Remote Changes |
| 180 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 181 | To see what files have been changed locally: |
| 182 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 183 | |
| 184 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 185 | $ cd pjproject |
| 186 | $ svn status |
| 187 | |
| 188 | The above command only compares local file against the original local copy, |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 189 | so it doesn't require Internet connection while performing the check. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 190 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 191 | To see both what files have been changed locally and what files have been |
| 192 | updated in the PJ's Subversion repository: |
| 193 | |
| 194 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 195 | |
| 196 | $ cd pjproject |
| 197 | $ svn status -u |
| 198 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 199 | Note that this command requires active Internet connection to query the |
| 200 | status of PJPROJECT's source repository. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 201 | |
| 202 | |
| 203 | 1.3 Source Directories Layout |
| 204 | _________________________________________________________________ |
| 205 | |
| 206 | Top-Level Directory Layout |
| 207 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 208 | The top-level directories (denoted as $TOP here) in the source distribution |
| 209 | contains the following sub-directories: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 210 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 211 | $TOP/build |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 212 | Contains makefiles that are common for all projects. |
| 213 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 214 | $TOP/pjlib |
| 215 | Contains header and source files of PJLIB. PJLIB is the base |
| 216 | portability and framework library which is used by all other |
| 217 | libraries |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 218 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 219 | $TOP/pjlib-util |
| 220 | Contains PJLIB-UTIL header and source files. PJLIB-UTIL is an |
| 221 | auxiliary library that contains utility functions such as scanner, |
| 222 | XML, STUN, MD5 algorithm, getopt() implementation, etc. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 223 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 224 | $TOP/pjmedia |
| 225 | Contains PJMEDIA and PJMEDIA-CODEC header and source files. The |
| 226 | sources of various codecs (such as GSM, Speex, and iLBC) can be found |
| 227 | under this directory. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 228 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 229 | $TOP/pjsip |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 230 | Contains PJSIP header and source files. |
| 231 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 232 | $TOP/pjsip-apps |
| 233 | Contains source code for PJSUA and various sample applications. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 234 | |
| 235 | |
| 236 | Individual Directory Inside Each Project |
| 237 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 238 | Each library directory further contains these sub-directories: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 239 | |
| 240 | bin |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 241 | Contains binaries produced by the build process. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 242 | |
| 243 | build |
| 244 | Contains build scripts/makefiles, project files, project workspace, |
| 245 | etc. to build the project. In particular, it contains one Makefile |
| 246 | file to build the project with GNU build systems, and a *.dsw |
| 247 | workspace file to build the library with Microsoft Visual Studio 6 or |
| 248 | later. |
| 249 | |
| 250 | build/output |
| 251 | The build/output directory contains the object files and other files |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 252 | generated by the build process. To support building multiple targets |
| 253 | with a single source tree, each build target will occupy a different |
| 254 | subdirectory under this directory. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 255 | |
| 256 | build/wince-evc4 |
| 257 | This directory contains the project/workspace files to build Windows |
| 258 | CE/WinCE version of the project using Microsoft Embedded Visual C++ |
| 259 | 4. |
| 260 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 261 | build/wince-evc4/output |
| 262 | This directory contains the library, executable, and object files |
| 263 | generated by Windows Mobile build process. |
| 264 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 265 | docs |
| 266 | Contains Doxygen configuration file (doxygen.cfg) to generate online |
| 267 | documentation from the source files. The output documentation will be |
| 268 | put in this directory as well (for example, docs/html directory for |
| 269 | the HTML files). |
| 270 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 271 | (to generate Doxygen documentation from the source tree, just run |
| 272 | "doxygen docs/doxygen.cfg" in the individual project directory. The |
| 273 | generated files will reside in docs directory). |
| 274 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 275 | include |
| 276 | Contains the header files for the project. |
| 277 | |
| 278 | lib |
| 279 | Contains libraries produced by the build process. |
| 280 | |
| 281 | src |
| 282 | Contains the source files of the project. |
| 283 | |
| 284 | |
| 285 | 2. Build Preparation |
| 286 | _________________________________________________________________ |
| 287 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 288 | 2.1 Create config_site.h file |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 289 | _________________________________________________________________ |
| 290 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 291 | Before source files can be built, the pjlib/include/pj/config_site.h file |
| 292 | must be created (it can just be an empty file). |
| 293 | |
| 294 | Note: |
| 295 | When the Makefile based build system is used, this process is taken |
| 296 | care by the Makefiles. But when non-Makefile based build system (such |
| 297 | as Visual Studio) is used, the config_site.h file must be created |
| 298 | manually. |
| 299 | |
| 300 | |
| 301 | What is config_site.h File |
| 302 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 303 | The pjlib/include/pj/config_site.h contains local customizations to the |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 304 | libraries. |
| 305 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 306 | All customizations should be put in this file instead of modifying PJ's |
| 307 | files, because if PJ's files get modified, then those modified files will |
| 308 | not be updated the next time the source is synchronized. Or in other case, |
| 309 | the local modification may be overwritten with the fresh copy from the SVN. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 310 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 311 | Putting the local customization to the config_site.h solves this problem, |
| 312 | because this file is not included in the version control, so it will never |
| 313 | be overwritten by "svn update" command. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 314 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 315 | Please find list of configuration macros that can be overriden from these |
| 316 | files: |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 317 | * PJLIB Configuration (the pjlib/config.h file) |
| 318 | * PJLIB-UTIL Configuration (the pjlib-util/config.h file) |
| 319 | * PJMEDIA Configuration (the pjmedia/config.h file) |
| 320 | * PJSIP Configuration (the pjsip/sip_config.h file) |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 321 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 322 | A sample config_site.h file is also available in |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 323 | pjlib/include/config_site_sample.h. |
| 324 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 325 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 326 | Creating config_site.h file |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 327 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 328 | The simplest way is just to create an empty file, to use whetever default |
| 329 | values set by the libraries. |
| 330 | |
| 331 | Another way to create the config_site.h file is to write something like the |
| 332 | following: |
| 333 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 334 | |
| 335 | // Uncomment to get minimum footprint (suitable for 1-2 concurrent calls |
| 336 | only) |
| 337 | //#define PJ_CONFIG_MINIMAL_SIZE |
| 338 | // Uncomment to get maximum performance |
| 339 | //#define PJ_CONFIG_MAXIMUM_SPEED |
| 340 | #include <pj/config_site_sample.h> |
| 341 | |
| 342 | |
| 343 | 2.2 Disk Space Requirements |
| 344 | _________________________________________________________________ |
| 345 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 346 | The building process needs: |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 347 | about 50-60 MB of disk space to store the uncompressed source files, and |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 348 | * about 30-50 MB of additional space for building each target |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 349 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 350 | (Visual Studio Debug and Release are considered as separate targets) |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 351 | |
| 352 | |
| 353 | 3. Building Linux, *nix, *BSD, and MacOS X Targets with GNU Build Systems |
| 354 | _________________________________________________________________ |
| 355 | |
| 356 | 3.1 Supported Targets |
| 357 | _________________________________________________________________ |
| 358 | |
| 359 | The new, autoconf based GNU build system can be used to build the |
| 360 | libraries/applications for the following targets: |
| 361 | * Linux/uC-Linux (i386, Opteron, Itanium, MIPS, PowerPC, etc.), |
| 362 | * MacOS X (PowerPC), |
| 363 | * mingw (i386), |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 364 | * FreeBSD and maybe other BSD's (i386, Opteron, etc.), |
| 365 | * RTEMS with cross compilation (ARM, powerpc), |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 366 | * etc. |
| 367 | |
| 368 | |
| 369 | 3.2 Requirements |
| 370 | _________________________________________________________________ |
| 371 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 372 | In order to use PJ's GNU build system, these typical GNU tools are needed: |
| 373 | * GNU make (other make will not work), |
| 374 | * GNU binutils for the target, and |
| 375 | * GNU gcc for the target. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 376 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 377 | In addition, the appropriate "SDK" must be installed for the particular |
| 378 | target (this could just be a libc and the appropriate system abstraction |
| 379 | library such as Posix). |
| 380 | |
| 381 | The build system is known to work on the following hosts: |
| 382 | * Linux, many types of distributions. |
| 383 | * MacOS X 10.2 |
| 384 | * mingw (Win2K, XP) |
| 385 | * FreeBSD (must use gmake instead of make) |
| 386 | |
| 387 | Building Win32 applications with cygwin is currently not supported (there is |
| 388 | some Windows header conflicts), but cross-compilations might just work. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 389 | |
| 390 | |
| 391 | 3.3 Running configure |
| 392 | _________________________________________________________________ |
| 393 | |
| 394 | Using Default Settings |
| 395 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 396 | Run "./configure" without any options to let the script detect the |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 397 | appropriate settings for the host: |
| 398 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 399 | |
| 400 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 401 | $ cd pjproject |
| 402 | $ ./configure |
| 403 | ... |
| 404 | |
| 405 | Notes: |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 406 | The default settings build the libraries in "release" mode, with |
| 407 | default CFLAGS set to "-O2 -DNDEBUG". To change the default CFLAGS, |
| 408 | we can use the usual "./configure CFLAGS='-g'" construct. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 409 | |
| 410 | Features Customization |
| 411 | |
| 412 | With the new autoconf based build system, most configuration/customization |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 413 | can be specified as configure arguments. The list of customizable features |
| 414 | can be viewed by running "./configure --help" command: |
| 415 | |
| 416 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 417 | |
| 418 | $ cd pjproject |
| 419 | $ ./configure --help |
| 420 | ... |
| 421 | Optional Features: |
| 422 | --disable-floating-point Disable floating point where possible |
| 423 | --disable-sound Exclude sound (i.e. use null sound) |
| 424 | --disable-small-filter Exclude small filter in resampling |
| 425 | --disable-large-filter Exclude large filter in resampling |
| 426 | --disable-g711-plc Exclude G.711 Annex A PLC |
| 427 | --disable-speex-aec Exclude Speex Acoustic Echo Canceller/AEC |
| 428 | --disable-g711-codec Exclude G.711 codecs from the build |
| 429 | --disable-l16-codec Exclude Linear/L16 codec family from the build |
| 430 | --disable-gsm-codec Exclude GSM codec in the build |
| 431 | --disable-speex-codec Exclude Speex codecs in the build |
| 432 | --disable-ilbc-codec Exclude iLBC codec in the build |
| 433 | ... |
| 434 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 435 | Configuring Debug Version and Other Customizations |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 436 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 437 | The configure script accepts standard customization, which details can be |
| 438 | obtained by executing ./configure --help. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 439 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 440 | Below is an example of specifying CFLAGS in configure: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 441 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 442 | |
| 443 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 444 | $ ./configure CFLAGS="-O3 -DNDEBUG -msoft-float -fno-builtin" |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 445 | ... |
| 446 | |
| 447 | |
| 448 | 3.4 Cross Compilation |
| 449 | _________________________________________________________________ |
| 450 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 451 | Cross compilation should be supported, using the usual autoconf syntax: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 452 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 453 | |
| 454 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 455 | $ ./configure --host=arm-elf-linux |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 456 | ... |
| 457 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 458 | Since cross-compilation is not tested as often as the "normal" build, please |
| 459 | watch for the ./configure output for incorrect settings (well ideally this |
| 460 | should be done for normal build too). |
| 461 | |
| 462 | Please refer to Porting Guide for further information about porting PJ |
| 463 | software. |
| 464 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 465 | |
| 466 | 3.5 Running make |
| 467 | _________________________________________________________________ |
| 468 | |
| 469 | Once the configure script completes successfully, start the build process by |
| 470 | invoking these commands: |
| 471 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 472 | |
| 473 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 474 | $ cd pjproject |
| 475 | $ make dep |
| 476 | $ make |
| 477 | |
| 478 | Note: |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 479 | gmake may need to be specified instead of make for some hosts, to |
| 480 | invoke GNU make instead of the native make. |
| 481 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 482 | |
| 483 | Description of all make targets supported by the Makefile's: |
| 484 | |
| 485 | all |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 486 | The default (or first) target to build the libraries/binaries. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 487 | |
| 488 | dep, depend |
| 489 | Build dependencies rule from the source files. |
| 490 | |
| 491 | clean |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 492 | Clean the object files for current target, but keep the output |
| 493 | library/binary files intact. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 494 | |
| 495 | distclean, realclean |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 496 | Remove all generated files (object, libraries, binaries, and |
| 497 | dependency files) for current target. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 498 | |
| 499 | |
| 500 | Note: |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 501 | make can be invoked either in the top-level PJ directory or in build |
| 502 | directory under each project to build only the particular project. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 503 | |
| 504 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 505 | 3.6 Build Customizations |
| 506 | _________________________________________________________________ |
| 507 | |
| 508 | Build features can be customized by specifying the options when running |
| 509 | ./configure as described in Running Configure above. |
| 510 | |
| 511 | In addition, additional CFLAGS and LDFLAGS options can be put in user.mak |
| 512 | file in PJ root directory (this file may need to be created if it doesn't |
| 513 | exist). Below is a sample of user.mak file contents: |
| 514 | |
| 515 | |
| 516 | |
| 517 | export CFLAGS += -msoft-float -fno-builtin |
| 518 | export LDFLAGS += |
| 519 | |
| 520 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 521 | 4. Building for Windows Targets with Microsoft Visual Studio |
| 522 | _________________________________________________________________ |
| 523 | |
| 524 | 4.1 Requirements |
| 525 | _________________________________________________________________ |
| 526 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 527 | The Microsoft Visual Studio based project files can be used with one of the |
| 528 | following: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 529 | |
| 530 | * Microsoft Visual Studio 6, |
| 531 | * Microsoft Visual Studio .NET 2002, |
| 532 | * Microsoft Visual Studio .NET 2003, |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 533 | * Microsoft Visual C++ Express 2005 with Platform SDK, |
| 534 | * DirectX SDK is needed if PJMEDIA DirectSound sound backend is explicitly |
| 535 | choosen (default is using PortAudio, which uses DirectSound via run-time |
| 536 | bindings, so DirectX SDK is not needed) |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 537 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 538 | For the host, the following are required: |
| 539 | * Windows NT, 2000, XP, 2003, or later , |
| 540 | * Windows 95/98 should work too, but this has not been tested, |
| 541 | * Sufficient amount of RAM for the build process. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 542 | |
| 543 | |
| 544 | 4.2 Building the Projects |
| 545 | _________________________________________________________________ |
| 546 | |
| 547 | Follow the steps below to build the libraries/application using Visual |
| 548 | Studio: |
| 549 | 1. Open Visual Studio 6 workspace file pjsip-apps/build/pjsip_apps.dsw. If |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 550 | later version of Visual Studio is being used, it should convert the |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 551 | workspace file and project files into the new formats. |
| 552 | 2. Set pjsua as Active Project. |
| 553 | 3. Select Debug or Release build as appropriate. |
| 554 | 4. Build the project. This will build pjsua application and all libraries |
| 555 | needed by pjsua. |
| 556 | 5. After successful build, the pjsua application will be placed in |
| 557 | pjsip-apps/bin directory, and the libraries in lib directory under each |
| 558 | projects. |
| 559 | |
| 560 | To build the samples: |
| 561 | 1. (Still using the same workspace) |
| 562 | 2. Set samples project as Active Project |
| 563 | 3. Select Debug or Release build as appropriate. |
| 564 | 4. Build the project. This will build all sample applications and all |
| 565 | libraries needed. |
| 566 | 5. After successful build, the sample applications will be placed in |
| 567 | pjsip-apps/bin/samples directory, and the libraries in lib directory |
| 568 | under each projects. |
| 569 | |
| 570 | 4.3 Debugging the Sample Application |
| 571 | _________________________________________________________________ |
| 572 | |
| 573 | The sample applications are build using Samples.mak makefile, therefore it |
| 574 | is difficult to setup debugging session in Visual Studio for these |
| 575 | applications. To solve this issue, the pjsip_apps workspace contain one |
| 576 | project called sample_debug which can be used to debug the sample |
| 577 | application. |
| 578 | |
| 579 | To setup debugging using sample_debug project: |
| 580 | 1. (Still using pjsip_apps workspace) |
| 581 | 2. Set sample_debug project as Active Project |
| 582 | 3. Edit debug.c file inside this project. |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 583 | 4. Modify the #include line to include the particular sample application to |
| 584 | debug |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 585 | 5. Select Debug build. |
| 586 | 6. Build and debug the project. |
| 587 | |
| 588 | |
| 589 | 5. Building for Windows Mobile Targets (Windows CE/WinCE/PDA/SmartPhone) |
| 590 | _________________________________________________________________ |
| 591 | |
| 592 | PJ supports building SIP and media stacks and applications for Windows |
| 593 | Mobile targets. A very simple WinCE SIP user agent (with media) application |
| 594 | is provided just as proof of concept that the port works. |
| 595 | |
| 596 | 5.1 Requirements |
| 597 | _________________________________________________________________ |
| 598 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 599 | One of the following development tools is needed to build SIP and media |
| 600 | components for Windows Mobile: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 601 | * Microsoft Embedded Visual C++ 4 with appropriate SDKs, or |
| 602 | * Microsoft Visual Studio 2005 for Windows Mobile with appropriate SDKs. |
| 603 | |
| 604 | Note that VS2005 is not directly supported (as I don't have the tools), but |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 605 | it is reported to work (I assumed that VS2005 for Windows Mobile can import |
| 606 | EVC4 workspace file). |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 607 | |
| 608 | 5.2 Building the Projects |
| 609 | _________________________________________________________________ |
| 610 | |
| 611 | The Windows Mobile port is included in the main source distribution. Please |
| 612 | follow the following steps to build the WinCE libraries and sample |
| 613 | application: |
| 614 | 1. Open pjsip-apps/build/wince-evc4/wince_demos.vcw workspace file. If |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 615 | later version of EVC4 is being used, this may cause the workspace file |
| 616 | to be converted to the appropriate format. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 617 | 2. Select pjsua_wince project as the Active Project. |
| 618 | 3. Select the appropriate SDK (for example Pocket PC 2003 SDK or SmartPhone |
| 619 | 2003 SDK) |
| 620 | 4. Select the appropriate configuration (for example, Win32 (WCE Emulator |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 621 | Debug) to debug the program in emulator, or other configurations such as |
| 622 | ARMV4, MIPS, SH3, SH4, or whatever suitable for the device) |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 623 | 5. Select the appropriate device (Emulator or the actual Device). |
| 624 | 6. Build the project. This will build the sample WinCE application and all |
| 625 | libraries (SIP, Media, etc.) needed by this application. |
| 626 | |
| 627 | Notes |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 628 | |
| 629 | + If the config_site.h includes config_site_sample.h file, then |
| 630 | there are certain configuration in config_site_sample.h that get |
| 631 | activated for Windows CE targets. Please make sure that these |
| 632 | configurations are suitable for the application. |
| 633 | + The libraries, binaries and object files produced by the build |
| 634 | process are located under build/wince-evc4/output directory of each |
| 635 | projects. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 636 | |
| 637 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 638 | 6. Using PJPROJECT with Applications |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 639 | _________________________________________________________________ |
| 640 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 641 | Regardless of the build system being used, the following tasks are normally |
| 642 | needed to be done in order to build application to use PJSIP and PJMEDIA: |
| 643 | 1. Put these include directories in the include search path: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 644 | + pjlib/include |
| 645 | + pjlib-util/include |
| 646 | + pjmedia/include |
| 647 | + pjsip/include |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 648 | 2. Put these library directories in the library search path: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 649 | + pjlib/lib |
| 650 | + pjlib-util/lib |
| 651 | + pjmedia/lib |
| 652 | + pjsip/lib |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 653 | 3. Include the relevant PJ header files in the application source file. For |
| 654 | example, using these would include ALL APIs exported by PJ: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 655 | |
| 656 | #include <pjlib.h> |
| 657 | #include <pjlib-util.h> |
| 658 | #include <pjsip.h> |
| 659 | #include <pjsip_ua.h> |
| 660 | #include <pjsip_simple.h> |
| 661 | #include <pjsua.h> |
| 662 | #include <pjmedia.h> |
| 663 | #include <pjmedia-codec.h> |
| 664 | (Note: the documentation of the relevant libraries should say which |
| 665 | header files should be included to get the declaration of the APIs). |
| 666 | 4. Declare the OS macros. |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 667 | + For Windows applications built with Visual Studio, we need to |
| 668 | declare PJ_WIN32=1 macro in the project settings (declaring the |
| 669 | macro in the source file may not be sufficient). |
| 670 | + For Windows Mobile applications build with Visual C++, we need to |
| 671 | declare PJ_WIN32_WINCE=1 macro in the project settings. |
| 672 | + For GNU build system/autoconf based build system, we need to |
| 673 | declare PJ_AUTOCONF=1 macro when compiling the applications. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 674 | (Note: the old PJ build system requires declaring the target processor |
| 675 | with PJ_M_XXX=1 macro, but this has been made obsolete. The target |
| 676 | processor will be detected from compiler's predefined macro by |
| 677 | pjlib/config.h file). |
| 678 | 5. Link with the appropriate PJ libraries. The following libraries will |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 679 | need to be included in the library link specifications: |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 680 | |
| 681 | pjlib |
| 682 | Base library used by all libraries. |
| 683 | |
| 684 | pjlib-util |
| 685 | Auxiliary library containing scanner, XML, STUN, MD5, getopt, |
| 686 | etc, used by the SIP and media stack. |
| 687 | |
| 688 | pjsip |
| 689 | SIP core stack library. |
| 690 | |
| 691 | pjsip-ua |
| 692 | SIP user agent library containing INVITE session, call |
| 693 | transfer, client registration, etc. |
| 694 | |
| 695 | pjsip-simple |
| 696 | SIP SIMPLE library for base event framework, presence, instant |
| 697 | messaging, etc. |
| 698 | |
| 699 | pjsua |
| 700 | High level SIP UA library, combining SIP and media stack into |
| 701 | high-level easy to use API. |
| 702 | |
| 703 | pjmedia |
| 704 | The media framework. |
| 705 | |
| 706 | pjmedia-codec |
| 707 | Container library for various codecs such as GSM, Speex, and |
| 708 | iLBC. |
| 709 | |
| 710 | |
| 711 | Note: the actual library names will be appended with the target name and the |
| 712 | build configuration. For example: |
| 713 | |
| 714 | For Visual Studio builds |
| 715 | The actual library names will look like |
| 716 | pjlib-i386-win32-vc6-debug.lib, |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 717 | pjlib-i386-win32-vc6-release.lib, etc., depending on whether we |
| 718 | are building the Debug or Release version of the library. |
| 719 | |
| 720 | An easier way to link with the libraries is to include PJ |
| 721 | project files in the workspace, and to configure project |
| 722 | dependencies so that the application depends on the PJ |
| 723 | libraries. This way, we don't need to manually add each PJ |
| 724 | libraries to the input library file specification, since VS |
| 725 | will automatically link the dependency libraries with the |
| 726 | application. |
| 727 | |
| 728 | For Windows Mobile builds |
| 729 | Unfortunately the PJ libraries built for Windows Mobile will |
| 730 | not be placed in the usual lib directory, but rather under the |
| 731 | output directory under build/wince-evc4 project directory. |
| 732 | |
| 733 | An easier way to link with the libraries is to include PJ |
| 734 | project files in the workspace, and to configure project |
| 735 | dependencies so that the application depends on the PJ |
| 736 | libraries. This way, we don't need to manually add each PJ |
| 737 | libraries to the input library file specification, since VS |
| 738 | will automatically link the dependency libraries with the |
| 739 | application. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 740 | |
| 741 | For GNU builds |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 742 | Application's Makefile can get the PJ library suffix by |
| 743 | including PJ's build.mak file from the root PJ directory (the |
| 744 | suffix is contained in TARGET_NAME variable). For example, to |
| 745 | link with PJLIB and PJMEDIA, we can use this syntax in the |
| 746 | LDFLAGS: "-lpj-$(TARGET_NAME) -lpjmedia-$(TARGET_NAME)" |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 747 | |
| 748 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 749 | 6. Link with system spesific libraries: |
| 750 | |
| 751 | Windows |
| 752 | Add (among other things): wsock32.lib, ws2_32.lib, ole32.lib, |
| 753 | dsound.lib |
| 754 | |
| 755 | Linux, *nix, *BSD |
| 756 | Add (among other things): '-lpthread -lm' (at least). |
| 757 | |
| 758 | MacOS X |
| 759 | Add (among other things): '-framework CoreAudio -lpthread -lm'. |
| 760 | |
| 761 | |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 762 | Appendix I: Common Problems/Frequently Asked Question (FAQ) |
| 763 | _________________________________________________________________ |
| 764 | |
| 765 | I.1 fatal error C1083: Cannot open include file: 'pj/config_site.h': No such |
| 766 | file or directory |
| 767 | |
Benny Prijono | abd2ae9 | 2006-09-13 11:02:26 +0000 | [diff] [blame] | 768 | This error normally occurs when the config_site.h file has not been created. |
| 769 | This file needs to be created manually (an empty file is sufficient). Please |
| 770 | follow the Build Preparation instructions above to create this file. |
Benny Prijono | c341683 | 2006-09-12 18:58:19 +0000 | [diff] [blame] | 771 | |
| 772 | |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
Benny Prijono | 646b7b7 | 2006-10-21 18:28:07 +0000 | [diff] [blame^] | 777 | |
| 778 | |
| 779 | _________________________________________________________________ |
| 780 | |
| 781 | Feedback: |
| 782 | Thanks for using PJ libraries and for reading this document. Please |
| 783 | send feedbacks or general comments to <bennylp at pjsip dot org>. |
Benny Prijono | eec4d7c | 2006-03-09 16:19:20 +0000 | [diff] [blame] | 784 | |