| 1 | /** |
| 2 | @page includesbuild Include files and how to build |
| 3 | |
| 4 | @section includefiles Include files |
| 5 | |
| 6 | You can find all the Babeltrace library include files (C headers) in the |
| 7 | \c babeltrace2 directory under the include files directory chosen when |
| 8 | installing Babeltrace. By default, this is <code>/usr/include</code>. |
| 9 | If you build Babeltrace from source without specifying an installation |
| 10 | prefix, this is <code>/usr/local/include</code>. |
| 11 | |
| 12 | The documentation modules in \ref apiref always show which header file |
| 13 | to include to use the documented functions and types. |
| 14 | |
| 15 | You can also use the "master" include file which provides everything, |
| 16 | but which necessarily makes the compilation slower: |
| 17 | |
| 18 | @code |
| 19 | #include <babeltrace2/babeltrace.h> |
| 20 | @endcode |
| 21 | |
| 22 | @section howtobuild How to build |
| 23 | |
| 24 | Multiple types of applications can use the Babeltrace library: |
| 25 | |
| 26 | - A user plugin (shared object) to be loaded by the \c babeltrace2 |
| 27 | converter program or by another application. |
| 28 | - A user application or library which loads plugins to manually connect |
| 29 | existing components in a specific way. |
| 30 | - A user application or library which creates its own component classes |
| 31 | and manually connects them. |
| 32 | |
| 33 | In any way, the only library to link to is `libbabeltrace2`. |
| 34 | |
| 35 | @subsection howtobuildplugin Build a plugin |
| 36 | |
| 37 | To build a user plugin: |
| 38 | |
| 39 | <ol> |
| 40 | <li>Compile the source files which form your plugin: |
| 41 | |
| 42 | @verbatim |
| 43 | cc -c -fpic my-plugin.c |
| 44 | @endverbatim |
| 45 | </li> |
| 46 | |
| 47 | <li>Create the plugin shared object: |
| 48 | |
| 49 | @verbatim |
| 50 | cc -shared my-plugin.o -lbabeltrace2 -o my-plugin.so |
| 51 | @endverbatim |
| 52 | </li> |
| 53 | </ol> |
| 54 | |
| 55 | @subsection howtobuildapp Build an application |
| 56 | |
| 57 | To build an application which uses the Babeltrace library: |
| 58 | |
| 59 | <ol> |
| 60 | <li>Compile the source files which form your application: |
| 61 | |
| 62 | @verbatim |
| 63 | cc -c my-app.c |
| 64 | @endverbatim |
| 65 | </li> |
| 66 | |
| 67 | <li>Create the executable application: |
| 68 | |
| 69 | @verbatim |
| 70 | cc my-app.o -lbabeltrace2 -o my-app |
| 71 | @endverbatim |
| 72 | </li> |
| 73 | </ol> |
| 74 | */ |