| 4 | 3.1 Supported Targets |
| 5 | |
| 6 | The 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 | |
| 16 | 3.2 Requirements |
| 17 | |
| 18 | In 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 | |
| 24 | In 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 | |
| 29 | The 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 | |
| 36 | Building 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 | |
| 39 | 3.3 Running configure |
| 40 | Using Default Settings |
| 41 | |
| 42 | Run "./configure" without any options to let the script detect the appropriate settings for the host: |
| 43 | |
| 44 | |
| 45 | $ cd pjproject |
| 46 | $ ./configure |
| 47 | ... |
| 48 | |
| 49 | Notes: |
| 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 | |
| 52 | Features Customization |
| 53 | |
| 54 | With 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 | ... |
| 60 | Optional 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 | ... |
| 74 | Configuring Debug Version and Other Customizations |
| 75 | |
| 76 | The configure script accepts standard customization, which details can be obtained by executing ./configure --help. |
| 77 | |
| 78 | Below is an example of specifying CFLAGS in configure: |
| 79 | |
| 80 | |
| 81 | $ ./configure CFLAGS="-O3 -DNDEBUG -msoft-float -fno-builtin" |
| 82 | ... |
| 83 | Configuring TLS Support |
| 84 | |
| 85 | By 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 | |
| 87 | You can explicitly disable TLS support by giving the configure script --disable-tls option. |
| 88 | |
| 89 | |
| 90 | 3.4 Cross Compilation |
| 91 | |
| 92 | Cross compilation should be supported, using the usual autoconf syntax: |
| 93 | |
| 94 | |
| 95 | $ ./configure --host=arm-elf-linux |
| 96 | ... |
| 97 | |
| 98 | Since 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 | |
| 100 | Please refer to Porting Guide for further information about porting PJ software. |
| 101 | |
| 102 | |
| 103 | 3.5 Running make |
| 104 | |
| 105 | Once the configure script completes successfully, start the build process by invoking these commands: |
| 106 | |
| 107 | |
| 108 | $ cd pjproject |
| 109 | $ make dep |
| 110 | $ make |
| 111 | |
| 112 | Note: |
| 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 | |
| 117 | Description of all make targets supported by the Makefile's: |
| 118 | |
| 119 | all |
| 120 | The default (or first) target to build the libraries/binaries. |
| 121 | dep, depend |
| 122 | Build dependencies rule from the source files. |
| 123 | clean |
| 124 | Clean the object files for current target, but keep the output library/binary files intact. |
| 125 | distclean, realclean |
| 126 | Remove all generated files (object, libraries, binaries, and dependency files) for current target. |
| 127 | |
| 128 | |
| 129 | |
| 130 | Note: |
| 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 | |
| 135 | 3.6 Build Customizations |
| 136 | |
| 137 | Build features can be customized by specifying the options when running ./configure as described in Running Configure above. |
| 138 | |
| 139 | In 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 | |
| 142 | export CFLAGS += -msoft-float -fno-builtin |
| 143 | export LDFLAGS += |
| 144 | |