Using Anjuta

Now, we will see the Anjuta interface allowing you to run all these commands without using the command line.

2.4.1. Configure

As Anjuta is using Autotools, the first step is similar, you need to run configure. Select Build ▸ Configure Project…, to get the following dialog:

Figure 2-3Configure dialog

The Regenerate project checkbox will not be described now as it is related to project creation (see in Section 3.1.6 ― Generate project).

The Configuration field is an user name used to reference this particular configuration to switch between different ones later. For Anjuta each configuration corresponds to one build directory and a set of configure options. Anjuta already provides some default configurations that you can select here.

It is recommended to use the Debug configuration for debugging. It will compile your program with all optimizations disabled. When optimizations are enabled, some variables and functions are removed, you will not be able to see them with the debugger. Moreover some lines in your source code are re-ordered, so some steps will go backward.

The Build Directory field allow to select the directory used to build the project. It must be different for each configuration.

If you build the project in the source directory (leaving the Build Directory field empty), you cannot create a new configuration. It is a limitation of Autotools. You need to select Build ▸ Remove Configuration that will run make distclean in the source directory first.

The Configure Options field allow passing different options to the configure script.

Clicking on Execute will run the configure script. All the output will appears in the message view of Anjuta. If the script runs without error, it will enable all other entries in the Build menu.

2.4.2. Menu items

The build operations in Anjuta, rely on make only like Autotools. It is working for non Autotools project too. The compile command is even working with only a C source file because make has some builtin rules to compile them. Here is the correspondence between the Anjuta menu item and make commands.

Build ▸ Compile

make current_file

Build ▸ Build

cd current_file_directory; make

Build ▸ Build Project

cd project_directory; make

Build ▸ Build Tarball

cd project_directory; make dist

Build ▸ Install

cd current_file_directory; make install

Build ▸ Install Project

cd project_directory; make install

Build ▸ Clean

cd current_file_directory; make clean

Build ▸ Clean Project

cd project_directory; make clean

Build ▸ Remove Configuration

cd project_directory; make distclean

The last menu entry not described above ,Build ▸ Select Configuration, allows you to switch easily between different configurations and so between different build directories.

2.4.3. Options

A few common build options are available in the preferences page that you can get by selecting Edit ▸ Preferences ▸ Build autotools.

Figure 2-4Build preferences