Changes between Version 1 and Version 2 of Getting-Started/Autoconf


Ignore:
Timestamp:
Apr 28, 2009 2:21:29 PM (10 years ago)
Author:
ismangil
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Getting-Started/Autoconf

    v1 v2  
    22[[TracNav(Getting-Started/TOC)]] 
    33 
     43.1 Supported Targets 
     5 
     6The new, autoconf based GNU build system can be used to build the libraries/applications for the following targets: 
     7 
     8    * Linux/uC-Linux (i386, Opteron, Itanium, MIPS, PowerPC, etc.), 
     9    * MacOS X (PowerPC), 
     10    * mingw (i386), 
     11    * FreeBSD and maybe other BSD's (i386, Opteron, etc.), 
     12    * RTEMS with cross compilation (ARM, powerpc), 
     13    * etc. 
     14 
     15  
     163.2 Requirements 
     17 
     18In order to use PJ's GNU build system, these typical GNU tools are needed: 
     19 
     20    * GNU make (other make will not work), 
     21    * GNU binutils for the target, and 
     22    * GNU gcc for the target. 
     23 
     24In addition, the following libraries are optional, but they will be used if they are present: 
     25 
     26    * ALSA header files/libraries (optional) if ALSA support is wanted. 
     27    * OpenSSL header files/libraries (optional) if TLS support is wanted. 
     28 
     29The build system is known to work on the following hosts: 
     30 
     31    * Linux, many types of distributions. 
     32    * MacOS X 10.2 
     33    * mingw (Win2K, XP) 
     34    * FreeBSD (must use gmake instead of make) 
     35 
     36Building Win32 applications with Cygwin is currently not supported by the autoconf script (there are some conflicts with Windows headers), but one can still use the old configure script by calling ./configure-legacy. More over, cross-compilations might also work with Cygwin using this build system. 
     37 
     38  
     393.3 Running configure 
     40Using Default Settings 
     41 
     42Run "./configure" without any options to let the script detect the appropriate settings for the host: 
     43         
     44 
     45$ cd pjproject 
     46$ ./configure 
     47... 
     48 
     49Notes: 
     50    The default settings build the libraries in "release" mode, with default CFLAGS set to "-O2". To change the default CFLAGS, we can use the usual "./configure CFLAGS='-g'" construct.  
     51 
     52Features Customization 
     53 
     54With the new autoconf based build system, most configuration/customization can be specified as configure arguments. The list of customizable features can be viewed by running "./configure --help" command: 
     55         
     56 
     57$ cd pjproject 
     58$ ./configure --help 
     59... 
     60Optional Features: 
     61--disable-floating-point        Disable floating point where possible 
     62--disable-sound         Exclude sound (i.e. use null sound) 
     63--disable-small-filter  Exclude small filter in resampling 
     64--disable-large-filter  Exclude large filter in resampling 
     65--disable-g711-plc      Exclude G.711 Annex A PLC 
     66--disable-speex-aec     Exclude Speex Acoustic Echo Canceller/AEC 
     67--disable-g711-codec    Exclude G.711 codecs from the build 
     68--disable-l16-codec     Exclude Linear/L16 codec family from the build 
     69--disable-gsm-codec     Exclude GSM codec in the build 
     70--disable-speex-codec   Exclude Speex codecs in the build 
     71--disable-ilbc-codec    Exclude iLBC codec in the build 
     72--disable-tls   Force excluding TLS support (default is autodetected based on OpenSSL availability) 
     73...      
     74Configuring Debug Version and Other Customizations 
     75 
     76The configure script accepts standard customization, which details can be obtained by executing ./configure --help. 
     77 
     78Below is an example of specifying CFLAGS in configure: 
     79         
     80 
     81$ ./configure CFLAGS="-O3 -DNDEBUG -msoft-float -fno-builtin" 
     82... 
     83Configuring TLS Support 
     84 
     85By default, TLS support is configured based on the availability of OpenSSL header files and libraries. If OpenSSL is available at the default include and library path locations, TLS will be enabled by the configure script. 
     86 
     87You can explicitly disable TLS support by giving the configure script --disable-tls option. 
     88 
     89  
     903.4 Cross Compilation 
     91 
     92Cross compilation should be supported, using the usual autoconf syntax: 
     93         
     94 
     95$ ./configure --host=arm-elf-linux 
     96... 
     97 
     98Since cross-compilation is not tested as often as the "normal" build, please watch for the ./configure output for incorrect settings (well ideally this should be done for normal build too). 
     99 
     100Please refer to Porting Guide for further information about porting PJ software. 
     101 
     102  
     1033.5 Running make 
     104 
     105Once the configure script completes successfully, start the build process by invoking these commands: 
     106         
     107 
     108$ cd pjproject 
     109$ make dep 
     110$ make 
     111 
     112Note: 
     113    gmake may need to be specified instead of make for some hosts, to invoke GNU make instead of the native make.  
     114 
     115  
     116 
     117Description of all make targets supported by the Makefile's: 
     118 
     119all 
     120    The default (or first) target to build the libraries/binaries.  
     121dep, depend 
     122    Build dependencies rule from the source files.  
     123clean 
     124    Clean the object files for current target, but keep the output library/binary files intact.  
     125distclean, realclean 
     126    Remove all generated files (object, libraries, binaries, and dependency files) for current target.  
     127 
     128  
     129 
     130Note: 
     131 
     132    make can be invoked either in the top-level PJ directory or in build directory under each project to build only the particular project. 
     133 
     134  
     1353.6 Build Customizations 
     136 
     137Build features can be customized by specifying the options when running ./configure as described in Running Configure above. 
     138 
     139In addition, additional CFLAGS and LDFLAGS options can be put in user.mak file in PJ root directory (this file may need to be created if it doesn't exist). Below is a sample of user.mak file contents: 
     140         
     141 
     142export CFLAGS += -msoft-float -fno-builtin 
     143export LDFLAGS += 
     144