Changes between Version 6 and Version 7 of Getting-Started/Autoconf


Ignore:
Timestamp:
Apr 29, 2009 9:42:40 PM (10 years ago)
Author:
ismangil
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Getting-Started/Autoconf

    v6 v7  
    145145export LDFLAGS += 
    146146 
    147 == Using in your applications == 
     147== Next: Using pjsip libraries in your applications == 
    148148 
    149 [wiki:Getting_Started_Using] 
    150  
    151 Regardless of the build system being used, the following tasks are normally needed to be done in order to build application to use PJSIP and PJMEDIA: 
    152  
    153    1. Put these include directories in the include search path: 
    154           * pjlib/include 
    155           * pjlib-util/include 
    156           * pjnath/include 
    157           * pjmedia/include 
    158           * pjsip/include 
    159    2. Put these library directories in the library search path: 
    160           * pjlib/lib 
    161           * pjlib-util/lib 
    162           * pjnath/lib 
    163           * pjmedia/lib 
    164           * pjsip/lib 
    165    3. 
    166  
    167       Include the relevant PJ header files in the application source file. For example, using these would include ALL APIs exported by PJ: 
    168          #include <pjlib.h> 
    169          #include <pjlib-util.h> 
    170          #include <pjnath.h> 
    171          #include <pjsip.h> 
    172          #include <pjsip_ua.h> 
    173          #include <pjsip_simple.h> 
    174          #include <pjsua-lib/pjsua.h> 
    175          #include <pjmedia.h> 
    176          #include <pjmedia-codec.h> 
    177  
    178       (Note: the documentation of the relevant libraries should say which header files should be included to get the declaration of the APIs). 
    179    4. 
    180  
    181       Declare the OS macros. 
    182           * For Windows applications built with Visual Studio, we need to declare PJ_WIN32=1 macro in the project settings (declaring the macro in the source file may not be sufficient). 
    183           * For Windows Mobile applications build with Visual C++, we need to declare PJ_WIN32_WINCE=1 macro in the project settings. 
    184           * For GNU build system/autoconf based build system, we need to declare PJ_AUTOCONF=1 macro when compiling the applications. 
    185  
    186       (Note: the old PJ build system requires declaring the target processor with PJ_M_XXX=1 macro, but this has been made obsolete. The target processor will be detected from compiler's predefined macro by pjlib/config.h file). 
    187    5. 
    188  
    189       Link with the appropriate PJ libraries. The following libraries will need to be included in the library link specifications: 
    190  
    191       pjlib 
    192           Base library used by all libraries.  
    193       pjlib-util 
    194           Auxiliary library containing scanner, XML, STUN, MD5, getopt, etc, used by the SIP and media stack.  
    195       pjnath 
    196           NAT helper library (STUN, TURN, ICE).  
    197       pjsip 
    198           SIP core stack library.  
    199       pjsip-ua 
    200           SIP user agent library containing INVITE session, call transfer, client registration, etc.  
    201       pjsip-simple 
    202           SIP SIMPLE library for base event framework, presence, instant messaging, etc.  
    203       pjsua 
    204           High level SIP UA library, combining SIP and media stack into high-level easy to use API.  
    205       pjmedia 
    206           The media framework.  
    207       pjmedia-codec 
    208           Container library for various codecs such as GSM, Speex, and iLBC.  
    209  
    210         
    211  
    212       Note: the actual library names will be appended with the target name and the build configuration. For example: 
    213  
    214       For Visual Studio builds 
    215  
    216           The actual library names will look like pjlib-i386-win32-vc6-debug.lib, pjlib-i386-win32-vc6-release.lib, etc., depending on whether we are building the Debug or Release version of the library. 
    217  
    218           An easier way to link with the libraries is to include PJ project files in the workspace, and to configure project dependencies so that the application depends on the PJ libraries. This way, we don't need to manually add each PJ libraries to the input library file specification, since VS will automatically link the dependency libraries with the application. 
    219       For Windows Mobile builds 
    220  
    221           Unfortunately the PJ libraries built for Windows Mobile will not be placed in the usual lib directory, but rather under the output directory under build/wince-evc4 project directory. 
    222  
    223           An easier way to link with the libraries is to include PJ project files in the workspace, and to configure project dependencies so that the application depends on the PJ libraries. This way, we don't need to manually add each PJ libraries to the input library file specification, since VS will automatically link the dependency libraries with the application. 
    224       For GNU builds 
    225  
    226           Use the template Makefile below (as described in Building Application using PJSIP with GNU Tools): 
    227           # Modify this to point to the PJSIP location. 
    228           PJBASE=/home/myself/pjproject-0.5.10.2 
    229  
    230           include $(PJBASE)/build.mak 
    231  
    232           CC      = $(APP_CC) 
    233           LDFLAGS = $(APP_LDFLAGS) 
    234           LDLIBS  = $(APP_LDLIBS) 
    235           CFLAGS  = $(APP_CFLAGS) 
    236           CPPFLAGS= ${CFLAGS} 
    237  
    238           # If your application is in a file named myapp.cpp or myapp.c 
    239           # this is the line you will need to build the binary. 
    240           all: myapp 
    241  
    242           myapp: myapp.cpp 
    243                    $(CC) -o $@ $< $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) 
    244  
    245           clean: 
    246                   rm -f myapp.o myapp 
    247  
    248         
    249    6. 
    250  
    251       Link with system spesific libraries: 
    252  
    253       Windows 
    254  
    255           Add (among other things): wsock32.lib, ws2_32.lib, ole32.lib, dsound.lib 
    256       Linux, *nix, *BSD 
    257  
    258           Add (among other things): '-lpthread -lm' (at least). If you use the template Makefile above, these would have been added by PJ. 
    259       MacOS X 
    260  
    261           Add (among other things): '-framework CoreAudio -lpthread -lm'. If you use the template Makefile above, these would have been added by PJ. 
    262  
    263   
     149Follow the steps described in [wiki:Getting_Started_Using building applications with GNU tools]