msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2022-02-11 12:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. Put one translator per line, in the form NAME , YEAR1, YEAR2 msgctxt "_" msgid "translator-credits" msgstr "" #. (itstool) path: bookinfo/title #: C/index.docbook:11 #: C/index.docbook:11 msgid "Anjuta build tutorial" msgstr "" #. (itstool) path: bookinfo/edition #: C/index.docbook:12 #: C/index.docbook:12 msgid "v0.2" msgstr "" #. (itstool) path: bookinfo/copyright #: C/index.docbook:14 #: C/index.docbook:14 msgid "2004 Olivier Pinçon" msgstr "" #. (itstool) path: bookinfo/copyright #: C/index.docbook:18 #: C/index.docbook:18 msgid "2008 Sébastien Granjoux" msgstr "" #. (itstool) path: legalnotice/para #: C/index.docbook:31 #: C/index.docbook:31 msgid "Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You may obtain a copy of the GNU Free Documentation License from the Free Software Foundation by visiting their Web site or by writing to: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA." msgstr "" #. (itstool) path: legalnotice/para #: C/index.docbook:43 #: C/index.docbook:43 msgid "Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any GNOME documentation, and those trademarks are made aware to the members of the GNOME Documentation Project, the names have been printed in caps or initial caps." msgstr "" #. (itstool) path: bookinfo/releaseinfo #: C/index.docbook:53 #: C/index.docbook:53 msgid "This is version 0.2 of Anjuta build tutorial" msgstr "" #. (itstool) path: chapter/title #: C/index.docbook:60 #: C/index.docbook:60 msgid "Introduction" msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:61 #: C/index.docbook:61 msgid "If you come from the Windows world, when you first launched Anjuta, you can told yourself : \"Hey, that looks like MS Visual C++, as I know it pretty well, understanding Anjuta will be a piece of cake.\". Anjuta looks like Microsoft Visual Studio or Borland's C++ Builder. but it has some significative differences essentially in its build system." msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:69 #: C/index.docbook:69 msgid "If you are starting programming directly on GNU/Linux, you have probably already heard of the Autotools. They are a major and probably a bit intimidating part of the development environment." msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:74 #: C/index.docbook:74 msgid "The goal of Anjuta is to make it easier to use the already existing development tools. Anjuta main build system uses the standard Linux build system: Autotools. This tutorial is an updated version of the Anjuta advanced tutorial from Olivier Pinçon. It explains how the build system is working without Anjuta and how to use it within Anjuta. It assumes that you have only a basic understanding of C or C++ and have been written using Anjuta 2.6 (September 2008)." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:90 #: C/index.docbook:90 msgid "Fill a bug in Anjuta bugzilla database." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:94 #: C/index.docbook:94 msgid "Send a message to Anjuta developer mailing list anjuta-devel@lists.sourceforge.net" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:98 #: C/index.docbook:98 msgid "Join Anjuta IRC channel #anjuta on irc.gnome.org" msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:85 #: C/index.docbook:85 msgid "If you find errors, need more explanations or have any idea for improvements on this tutorial or Anjuta in general, you can: <_:itemizedlist-1/>" msgstr "" #. (itstool) path: chapter/title #: C/index.docbook:107 #: C/index.docbook:107 msgid "Building a project" msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:108 #: C/index.docbook:108 msgid "This chapter explains how to build a program starting from the most basic tool: the compiler. This order is important to understand how is it working because each tool adds a new layer on top of the previous ones." msgstr "" #. (itstool) path: sect1/title #: C/index.docbook:114 #: C/index.docbook:114 msgid "Using GCC" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:115 #: C/index.docbook:115 msgid "Here is a typical command to generate an executable from C source files using GCC:" msgstr "" #. (itstool) path: sect1/screen #: C/index.docbook:119 #: C/index.docbook:119 #, no-wrap msgid "" "\n" "$gcc -g -Wall -I/usr/include/libxml2/libxml -lxml2 main.c aux.c -o tut_prog" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:121 #: C/index.docbook:121 msgid "This command tells GCC to compile the source files main.c and aux.c, and produce a binary called 'tut_prog' (this stands for 'tutorial program'). The various switches have the following meaning :" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:128 #: C/index.docbook:128 msgid "-g" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:130 #: C/index.docbook:130 msgid "tells GCC to include debug information into the binary." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:134 #: C/index.docbook:134 msgid "-Wall" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:136 #: C/index.docbook:136 msgid "Warning all : print every warning. This switch is used by the C compiler only." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:140 #: C/index.docbook:140 msgid "-Idir dir" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:142 #: C/index.docbook:142 msgid "Look for included header files (like in #include <myheader.h>) in directory dir. This switch is used by the C preprocessor only." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:148 #: C/index.docbook:148 msgid "-llib lib" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:150 #: C/index.docbook:150 msgid "Link to library lib; here libxml2, used by the linker." msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:155 #: C/index.docbook:155 msgid "In fact, GCC does not do the compilation itself. It gets all arguments from the user and calls other programs passing them the needed arguments with some default one to do the four stages involved in the compilation." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:162 #: C/index.docbook:162 msgid "GCC compilation stage" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:165 #: C/index.docbook:165 msgctxt "_" msgid "external ref='figures/compilation-stages.png' md5='395d9386a3de8f8c479265c6c5c5421f'" msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:170 #: C/index.docbook:170 msgid "Preprocessor" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:171 #: C/index.docbook:171 msgid "Each C source file goes through the preprocessor, named cpp. In this stage, all include files and macros are expanded to get preprocessed C source code. The resulting file .i is rarely generated but it could be interesting to see how complex macros are expanded. You can do this by calling cpp directly or using the -E switch of GCC. The later option is better as it allows to run the preprocessor with all default options." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:183 #: C/index.docbook:183 msgid "Compiler" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:184 #: C/index.docbook:184 msgid "In this stage each file is compiled into assembler code. The compiler depends on the language of the source file, C here. It is a complex program because there is not a one to one correspondence between C instructions and assembler instructions. By example, requesting the fastest or the smallest program will generate different sequences of assembler instructions. The assembler is the language of your computer, the most common one is called x86. The output is a, human readable, assembler source file ending with '.s'. Like the preprocessor output, the assembler code is not normally written on the hard disk. You can stop the compilation at this stage to look at it by running GCC with the -S switch." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:201 #: C/index.docbook:201 msgid "Assembler" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:202 #: C/index.docbook:202 msgid "In this stage each file is assembled: the assembler code is transformed to an object file with .o extension. It is much easier than the compilation as each assembler instruction corresponds to an unique code. The object file contains additional information for debugging or linking the program. The object file is a binary format, called ELF on recent Linux machine, you need to use special program to look in it like objdump. It is possible to write directly assembler code and assemble it using the assembler ,as, or GCC if your source file has a .s extension. These object files are commonly written on your hard disk because it depends only of theirs corresponding C source file (with all files included). If you modify only one source file, you need to regenerate only the corresponding object file. You can stop at this stage, without linking by using -c switch with GCC." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:221 #: C/index.docbook:221 msgid "Linker" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:222 #: C/index.docbook:222 msgid "This stage is used to combine all the object files and libraries into one executable file. The result is a binary file in a format close to the object file, on Linux it is even the same format." msgstr "" #. (itstool) path: sect1/title #: C/index.docbook:230 #: C/index.docbook:230 msgid "Using make" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:231 #: C/index.docbook:231 msgid "When a program is composed of lots of sources files, it is much faster to keep the object files and recompile each source files only when needed. This can be automated using make. It executes a program written in a makefile, normally named Makefile. A sample makefile for the previous tutorial program could be :" msgstr "" #. (itstool) path: example/title #: C/index.docbook:240 #: C/index.docbook:240 msgid "A simple Makefile file" msgstr "" #. (itstool) path: example/programlisting #: C/index.docbook:241 #: C/index.docbook:241 #, no-wrap msgid "" "\n" "CC=gcc \t# the C compiler is gcc\n" "CFLAGS=-g -Wall -I/usr/include/libxml2\n" "LIBS=-lxml2\t\t\t\t\t\n" "\t\t\t\t\n" "tut_prog: main.o aux.o # what we need to have 'tut_prog'...\n" "\t$(CC) $(LIBS) main.o aux.o -o tut_prog # ...and how to get it from the ingredients.\n" "\t\t\t\t\t\n" "main.o: main.c\n" "\t$(CC) -c $(CFLAGS) main.c\n" "\t\t\t\t\t\n" "aux.o: aux.c\n" "\t$(CC) -c $(CFLAGS) aux.c" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:255 #: C/index.docbook:255 msgid "Makefiles are a kind of program but instead of writing what should be done sequentially to get the result, you define some rules and make uses these rules in whatever order to achieve the result." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:262 #: C/index.docbook:262 msgid "Variables" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:263 #: C/index.docbook:263 msgid "Like in any programming language, you can define variables in a make file. All variables contains a string or a list of strings separated by whitespace. A variable is defined using the following syntax: name=value. You can get its value by writing $(name) or ${name}. In the sample above, three variables are defined CC, CFLAGS and LIBS." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:280 #: C/index.docbook:280 msgid "CC" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:281 #: C/index.docbook:281 msgid "Program for compiling C programs, default 'cc'" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:284 #: C/index.docbook:284 msgid "CXX" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:285 #: C/index.docbook:285 msgid "Program for compiling C++ programs, default 'g++'" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:288 #: C/index.docbook:288 msgid "CPP" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:289 #: C/index.docbook:289 msgid "Program for running C preprocessor, default '$(CC) -E'" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:292 #: C/index.docbook:292 msgid "FC" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:293 #: C/index.docbook:293 msgid "Program for running Fortran compiler, default 'f77'" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:296 #: C/index.docbook:296 msgid "RM" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:297 #: C/index.docbook:297 msgid "Command to remove a file, default 'rm -f'" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:300 #: C/index.docbook:300 msgid "CFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:301 #: C/index.docbook:301 msgid "Extra flags for the C compiler" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:304 #: C/index.docbook:312 #: C/index.docbook:304 #: C/index.docbook:312 msgid "CXXFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:305 #: C/index.docbook:309 #: C/index.docbook:305 #: C/index.docbook:309 msgid "Extra flags for the C++ compiler" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:308 #: C/index.docbook:308 msgid "CPPFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:313 #: C/index.docbook:313 msgid "Extra flags for the C preprocessor" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:316 #: C/index.docbook:316 msgid "FFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:317 #: C/index.docbook:317 msgid "Extra flags for the Fortran compiler" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:320 #: C/index.docbook:320 msgid "LDFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:321 #: C/index.docbook:321 msgid "Extra flags for the linker" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:272 #: C/index.docbook:272 msgid "Variables can be redefined when calling make in the command line or using values from environment. Moreover make includes some default rules using predefined variables. Here is a list of the most common ones: <_:variablelist-1/>" msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:327 #: C/index.docbook:327 msgid "Rules" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:328 #: C/index.docbook:328 msgid "The basic syntax for make rules is:" msgstr "" #. (itstool) path: sect2/programlisting #: C/index.docbook:331 #: C/index.docbook:331 #, no-wrap msgid "" "\n" "target: prerequisites\n" "\tcommands\n" "\t..." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:335 #: C/index.docbook:335 msgid "The target and the prerequisites are normally files but they could be actions. The rule is interpreted as in order to make the target or update it if it is older than its prerequisites, you need to make all prerequisites and then run all commands." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:343 #: C/index.docbook:343 msgid "make starts with the first target of the makefile or the one given in the command line and looks for a rule. If this rules has no prerequisites, the associated commands are run and that's all. Else before running the commands, for each prerequisite, make looks for a rule having it as target and repeats the same process." msgstr "" #. (itstool) path: para/programlisting #: C/index.docbook:355 #: C/index.docbook:355 #, no-wrap msgid "" "\n" "Search a rule with tut_prog as target\n" "Found with prerequisites main.o aux.o\n" "\tSearch a rule with main.o as target\n" "\tFound with prequisite main.c\n" "\t\tSearch a rule with main.c as target\n" "\t\tNot found (main.c is a source file)\n" "\tIf main.o does not exist or is older than main.c\n" "\t\tCompile main.c, do not link (-c switch)\n" "\tSearch a rule with aux.o as target\n" "\tFound with prequisite aux.c\n" "\t\tSearch a rule with aux.c as target\n" "\t\tNot found (aux.c is a source file)\n" "\tIf aux.o does not exist or is older than aux.c\n" "\t\tCompile aux.c, do not link (-c switch)\n" "If tut_prog is older than main.o or aux.o\n" "\tLink main.o, aux.o and libxml2" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:351 #: C/index.docbook:351 msgid "In the sample above, if you run make or make tut_prog. make does the following: <_:programlisting-1/>" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:373 #: C/index.docbook:373 msgid "Like for variables, several target names are commonly defined:" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:378 #: C/index.docbook:378 msgid "all" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:379 #: C/index.docbook:379 msgid "Do everything" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:382 #: C/index.docbook:382 msgid "check" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:383 #: C/index.docbook:383 msgid "Perform some self test after building the program" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:386 #: C/index.docbook:386 msgid "clean" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:387 #: C/index.docbook:387 msgid "Delete all files created by make" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:390 #: C/index.docbook:390 msgid "distclean" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:391 #: C/index.docbook:391 msgid "Delete more files than clean, could delete the Makefile itself" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:394 #: C/index.docbook:394 msgid "dist" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:395 #: C/index.docbook:395 msgid "Create a distribution package, a compressed tarball by example" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:398 #: C/index.docbook:398 msgid "install" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:399 #: C/index.docbook:399 msgid "Install target created by make, need to be run as root to install in system directories" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:403 #: C/index.docbook:403 msgid "uninstall" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:404 #: C/index.docbook:404 msgid "Remove files installed by make" msgstr "" #. (itstool) path: note/para #: C/index.docbook:408 #: C/index.docbook:408 msgid "Programs compiled from sources are installed by default in /usr/local. If you want to install (or uninstall) a program in such system directory, you normally need to log as root using su or sudo before running make install." msgstr "" #. (itstool) path: sect1/title #: C/index.docbook:417 #: C/index.docbook:706 #: C/index.docbook:1306 #: C/index.docbook:417 #: C/index.docbook:706 #: C/index.docbook:1306 msgid "Using Autotools" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:418 #: C/index.docbook:418 msgid "If you want to build your program on another system, using make only could be quite difficult. The C compiler could be different. Some common C functions could be missing, have another name, declared in a different header and so on. This can be handled by enabling difference piece of code in your sources using preprocessor directive #if, #ifdef and others. But the user will have to define himself all these tuning which is not easy as there is a lots of systems with a lots of variations." msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:427 #: C/index.docbook:427 msgid "Free softwares are mainly distributed as sources. It is crucial to be able to recompile them on various system without much technical knowledge. Autotools is designed to solve this and you probably have already use it using the magic combination \"./configure; make; make install\". You may have noticed that many files are involved in this build process; globally all that stuff seems very complicated. So what's happening when you compile such software ?" msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:438 #: C/index.docbook:438 msgid "Input files" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:439 #: C/index.docbook:439 msgid "An Autotools project comes at least with a configure script, named configure, and a makefile template named Makefile.in. There is normally, one Makefile.in in each directory of the project. There are several other files used by an Autotools project but they are not stricly necessary or are generated automatically." msgstr "" #. (itstool) path: tip/para #: C/index.docbook:449 #: C/index.docbook:449 msgid "If you look inside these files, you will see that they are quite complex. Do not worry, these files are generated by Autotools from other templates easier to write as explained in . For the moment, we do not care, we consider these files exist as it is the case when you get a source package." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:457 #: C/index.docbook:559 #: C/index.docbook:457 #: C/index.docbook:559 msgid "Configure" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:458 #: C/index.docbook:458 msgid "In fact, you don't need Autotools to build an autotools package, configure is a shell script running on the most basic shell: sh. It probes your system checking each characteristic and writes makefiles from the templates." msgstr "" #. (itstool) path: important/para #: C/index.docbook:466 #: C/index.docbook:466 msgid "In order to build a project using a library, you need more information about it, so additional files. For a library used in a C program, you need the corresponding header files. This has to be installed on your system and is typically found in a so called development package. By example for the library libxml2, there are two packages:" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:473 #: C/index.docbook:473 msgid "libxml2 necessary to run a program using it and installed automatically as a dependency of such program." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:478 #: C/index.docbook:478 msgid "libxml2-devel necessary to build a program using it. If you don't have it configure will display an error message." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:485 #: C/index.docbook:485 msgid "Configure process" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:488 #: C/index.docbook:488 msgctxt "_" msgid "external ref='figures/configure-process.png' md5='ab9bee38a1f4104bd289df6a9d74ffb7'" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:492 #: C/index.docbook:492 msgid "configure creates all files in the directory where it is called. This directory is the build directory. If you run it from the source directory, using ./configure, the build directory will be the same." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:498 #: C/index.docbook:498 msgid "configure accepts several options in the command line. They are used to install the files in different directories, to disable some parts of the project in order to get a smaller executable or if you haven't one needed library or force a value for some make variable (see ). You can get a list of them by running configure --help. Here is a list of the most common ones:" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:509 #: C/index.docbook:509 msgid "--help" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:510 #: C/index.docbook:510 msgid "List all available options" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:513 #: C/index.docbook:513 msgid "--host host" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:514 #: C/index.docbook:514 msgid "Compile to run on another system (cross compilation)" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:517 #: C/index.docbook:517 msgid "--prefix dir" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:518 #: C/index.docbook:518 msgid "Select the root directory for installing the project, default /usr/local" msgstr "" #. (itstool) path: note/para #: C/index.docbook:522 #: C/index.docbook:522 msgid "configure generates a few additional files which are less important. config.log is a log file useful when something goes wrong to get more details. config.status is another shell script, it can be run to restore the current configuration. config.h is a header file generated like Makefile from a template config.h.in if it exists." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:531 #: C/index.docbook:531 msgid "make" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:532 #: C/index.docbook:532 msgid "The makefiles generated by configure are quite complex but are standard makefiles. They define all standard targets needed by GNU standard." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:539 #: C/index.docbook:539 msgid "make or make all builds the program." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:542 #: C/index.docbook:542 msgid "make install installs the program." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:545 #: C/index.docbook:545 msgid "make distclean removes all files generated by configure, to let the project in the state it was when unpacking the distribution package." msgstr "" #. (itstool) path: sect1/title #: C/index.docbook:553 #: C/index.docbook:1055 #: C/index.docbook:1583 #: C/index.docbook:553 #: C/index.docbook:1055 #: C/index.docbook:1583 msgid "Using Anjuta" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:554 #: C/index.docbook:554 msgid "Now, we will see the Anjuta interface allowing you to run all these commands without using the command line." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:560 #: C/index.docbook:560 msgid "As Anjuta is using Autotools, the first step is similar, you need to run configure. Select Build Configure Project..., to get the following dialog:" msgstr "" #. (itstool) path: figure/title #: C/index.docbook:568 #: C/index.docbook:568 msgid "Configure dialog" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:572 #: C/index.docbook:572 msgctxt "_" msgid "external ref='figures/configure-dialog.png' md5='c8ca3d93f18c8b680edf018d0a90a254'" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:577 #: C/index.docbook:577 msgid "The Regenerate project checkbox will not be described now as it is related to project creation (see in )." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:581 #: C/index.docbook:581 msgid "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." msgstr "" #. (itstool) path: note/para #: C/index.docbook:588 #: C/index.docbook:588 msgid "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." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:594 #: C/index.docbook:594 msgid "The Build Directory field allow to select the directory used to build the project. It must be different for each configuration." msgstr "" #. (itstool) path: important/para #: C/index.docbook:599 #: C/index.docbook:599 msgid "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." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:606 #: C/index.docbook:606 msgid "The Configure Options field allow passing different options to the configure script." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:610 #: C/index.docbook:610 msgid "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." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:618 #: C/index.docbook:618 msgid "Menu items" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:619 #: C/index.docbook:619 msgid "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." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:630 #: C/index.docbook:630 msgid "BuildCompile" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:631 #: C/index.docbook:631 msgid "make current_file" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:634 #: C/index.docbook:634 msgid "BuildBuild" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:635 #: C/index.docbook:635 msgid "cd current_file_directory; make" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:638 #: C/index.docbook:638 msgid "BuildBuild Project" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:639 #: C/index.docbook:639 msgid "cd project_directory; make" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:642 #: C/index.docbook:642 msgid "BuildBuild Tarball" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:643 #: C/index.docbook:643 msgid "cd project_directory; make dist" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:646 #: C/index.docbook:646 msgid "BuildInstall" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:647 #: C/index.docbook:647 msgid "cd current_file_directory; make install" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:650 #: C/index.docbook:650 msgid "BuildInstall Project" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:651 #: C/index.docbook:651 msgid "cd project_directory; make install" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:654 #: C/index.docbook:654 msgid "BuildClean" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:655 #: C/index.docbook:655 msgid "cd current_file_directory; make clean" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:658 #: C/index.docbook:658 msgid "BuildClean Project" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:659 #: C/index.docbook:659 msgid "cd project_directory; make clean" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:662 #: C/index.docbook:662 msgid "BuildRemove Configuration" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:663 #: C/index.docbook:663 msgid "cd project_directory; make distclean" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:666 #: C/index.docbook:666 msgid "The last menu entry not described above ,Build Select Configuration, allows you to switch easily between different configurations and so between different build directories." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:674 #: C/index.docbook:674 msgid "Options" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:675 #: C/index.docbook:675 msgid "A few common build options are available in the preferences page that you can get by selecting Edit PreferencesBuild autotools ." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:682 #: C/index.docbook:682 msgid "Build preferences" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:686 #: C/index.docbook:686 msgctxt "_" msgid "external ref='figures/build_preferences.png' md5='684664b3114b36b3cc33d8b35f175e5d'" msgstr "" #. (itstool) path: chapter/title #: C/index.docbook:699 #: C/index.docbook:699 msgid "Creating a project" msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:700 #: C/index.docbook:700 msgid "This chapter explains how to create a new project. Like the previous, it starts with Autotools before looking at Anjuta." msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:707 #: C/index.docbook:707 msgid "In the first chapter, we have not really used the Autotools. It is not need to compile a project from the sources. But all files in the build process are not written by hand but generated from templates using Autotools." msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:712 #: C/index.docbook:712 msgid "Autotools is composed of several tools: aclocal, autoconf, automake and other that we will not see here, belonging to two packages: Automake and Autoconf." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:721 #: C/index.docbook:721 msgid "Autoconf is used to generate the configure script, from a template named configure.ac. The configure script will check all characteristics of the host system and generate the makefiles from Makefile.in templates." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:727 #: C/index.docbook:727 msgid "Automake is used to generate complete Makefile.in templates, following GNU standards from very simple Makefile.am templates." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:732 #: C/index.docbook:732 msgid "Autotools process" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:735 #: C/index.docbook:735 msgctxt "_" msgid "external ref='figures/autotools-process.png' md5='6141be893d6036796e47dc50bbaba82b'" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:739 #: C/index.docbook:739 msgid "Now let's see a minimal example to start grasping the relationships between the various files." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:744 #: C/index.docbook:744 msgid "Write sources" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:747 #: C/index.docbook:747 msgid "Create an empty directory called tut_prog and enter in it." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:750 #: C/index.docbook:750 msgid "In this new directory, create a new file named main.c containing:" msgstr "" #. (itstool) path: example/title #: C/index.docbook:755 #: C/index.docbook:755 msgid "main.c:" msgstr "" #. (itstool) path: example/programlisting #: C/index.docbook:756 #: C/index.docbook:756 #, no-wrap msgid "" "\n" "#include <stdio.h> \n" "\t\n" "int main()\n" "{\n" "\tprintf(\"Hello world!\\n\");\n" "\treturn 0;\n" "}" msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:767 #: C/index.docbook:767 msgid "Run Autoconf" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:770 #: C/index.docbook:770 msgid "Write the following in a file named configure.ac:" msgstr "" #. (itstool) path: example/title #: C/index.docbook:774 #: C/index.docbook:774 msgid "minimal configure.ac:" msgstr "" #. (itstool) path: example/programlisting #: C/index.docbook:775 #: C/index.docbook:775 #, no-wrap msgid "" "\n" "AC_INIT([Tutorial Program], 1.0)\n" "AM_INIT_AUTOMAKE\n" "AC_PROG_CC\n" "AC_CONFIG_FILES(Makefile)\n" "AC_OUTPUT" msgstr "" #. (itstool) path: note/para #: C/index.docbook:783 #: C/index.docbook:783 msgid "The configure template script could be named configure.in. It is the name used in older version (before 2001) of Autoconf. Nevertheless, it is recommended to use configure.ac because the .in extension is already used by files processed by configure and generated by Automake: Makefile.in and autoheader: config.h.in." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:792 #: C/index.docbook:792 msgid "AC_INIT, AM_INIT_AUTOMAKE, etc... are M4 macros. M4 is a macro expanding software used by Autotools; we don't need to know about it. When Autoconf will process this configure.in, the macros will be expanded and we will get a fresh huge configure script." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:801 #: C/index.docbook:801 msgid "AC_INIT" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:803 #: C/index.docbook:803 msgid "Is the first mandatory macro. We need to indicate the name of the project and its version." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:810 #: C/index.docbook:1194 #: C/index.docbook:810 #: C/index.docbook:1194 msgid "AM_INIT_AUTOMAKE" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:812 #: C/index.docbook:812 msgid "Initialize environment for Automake. It is needed in all projects using Automake." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:819 #: C/index.docbook:819 msgid "AC_PROG_CC" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:821 #: C/index.docbook:821 msgid "Determine the C compiler to use." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:827 #: C/index.docbook:827 msgid "AC_CONFIG_FILES" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:829 #: C/index.docbook:829 msgid "Create each file by copying the corresponding template file (with .in extension) and substituting the output variable values." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:836 #: C/index.docbook:1218 #: C/index.docbook:836 #: C/index.docbook:1218 msgid "AC_OUTPUT" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:838 #: C/index.docbook:838 msgid "Marks the end of the configure template." msgstr "" #. (itstool) path: note/para #: C/index.docbook:845 #: C/index.docbook:845 msgid "The use of some macros has changed between different versions of Autoconf:" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:848 #: C/index.docbook:848 msgid "The package name and version was defined as arguments of AM_INIT_AUTOMAKE instead of AC_INIT." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:852 #: C/index.docbook:852 msgid "AC_OUTPUT was getting the list of generated files instead of using the additional macro AC_CONFIG_FILES." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:857 #: C/index.docbook:857 msgid "Autoconf only knows its own macros but read additional ones in a file named aclocal.m4. These macros are used to extend Autoconf, it includes Automake macro (starting with AM_) and other third party macros. For instance, if you develop a library called foo, you might want to write an AC_CHECK_FOR_FOO macro so that developers using your library can check for its presence using Autoconf." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:866 #: C/index.docbook:866 msgid "aclocal scans configure.ac and create an aclocal.m4 file which contains the macros mentioned in configure.ac. aclocal is part of the Automake package and search by default in Automake macros and in a system path typically /usr/share/aclocal." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:876 #: C/index.docbook:876 msgid "Launch aclocal. It will create a new file named aclocal.m4 in the current directory." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:880 #: C/index.docbook:880 msgid "Launch autoconf. It will create the configure script configure." msgstr "" #. (itstool) path: tip/para #: C/index.docbook:885 #: C/index.docbook:885 msgid "On my system, I actually get an extra directory called autom4te.cache. That is for Autoconf internal purposes. You do not need to care about it." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:891 #: C/index.docbook:891 msgid "Run Automake" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:894 #: C/index.docbook:894 msgid "Write the following in a file named Makefile.am:" msgstr "" #. (itstool) path: example/title #: C/index.docbook:898 #: C/index.docbook:898 msgid "minimal Makefile.am:" msgstr "" #. (itstool) path: example/programlisting #: C/index.docbook:899 #: C/index.docbook:899 #, no-wrap msgid "" "\n" "bin_PROGRAMS = tut_prog\t\t\t\n" "tut_prog_SOURCES = main.c" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:903 #: C/index.docbook:903 msgid "In Makefile.am are the very essential data needed to build the project: the target program, called tut_prog, will be put in a $prefix/bin/ directory; to build it we need main.c. Note that we don't specify how that will be built: Automake will figure it out. We haven't even mentioned the compiler in this pre-makefile." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:910 #: C/index.docbook:910 msgid "Makefile.am will be processed by Automake; the result will be a Makefile.in. This Makefile.in is close to being a real makefile, but it contains variable names which will be replaced when the configure script will run, resulting in a real makefile (called Makefile). For instance, configure will write in the final Makefile what compiler to use (it is the compiler it found using the AC_PROG_CC macro)." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:921 #: C/index.docbook:921 msgid "Run the command automake --add-missing --foreign. It will create a new file named Makefile.in as expected. Moreover, due to the switch --add-missing you get a few links to scripts necessary for building the project: depcomp, install.sh and missing. The other option --foreign tells to Automake that you don't want to follow GNU standard and you don't need mandatory documentation files: INSTALL, NEWS, README, AUTHORS, ChangeLog and COPYING. I have used it here to keep the number of created file to a minimum but else it is a good idea to provide these files, you can start with empty files." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:937 #: C/index.docbook:937 msgid "Build project" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:940 #: C/index.docbook:940 msgid "Run now the new configure script: ./configure. You get the following output and it create the makefile for your program." msgstr "" #. (itstool) path: listitem/screen #: C/index.docbook:942 #: C/index.docbook:942 #, no-wrap msgid "" "\n" "checking for a BSD-compatible install... /usr/bin/install -c\n" "checking whether build environment is sane... yes\n" "checking for a thread-safe mkdir -p... /bin/mkdir -p\n" "checking for gawk... gawk\n" "checking whether make sets $(MAKE)... yes\n" "checking for gcc... gcc\n" "checking for C compiler default output file name... a.out\n" "checking whether the C compiler works... yes\n" "checking whether we are cross compiling... no\n" "checking for suffix of executables... \n" "checking for suffix of object files... o\n" "checking whether we are using the GNU C compiler... yes\n" "checking whether gcc accepts -g... yes\n" "checking for gcc option to accept ISO C89... none needed\n" "checking for style of include used by make... GNU\n" "checking dependency style of gcc... gcc3\n" "configure: creating ./config.status\n" "config.status: creating Makefile\n" "config.status: executing depfiles commands" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:964 #: C/index.docbook:964 msgid "Run now make, to build your program. You get the following output and a new tut_prog executable" msgstr "" #. (itstool) path: listitem/screen #: C/index.docbook:966 #: C/index.docbook:966 #, no-wrap msgid "" "\n" "gcc -DPACKAGE_NAME=\\\"Tutorial\\ Program\\\" -DPACKAGE_TARNAME=\\\"tutorial-program\\\" \\\n" " -DPACKAGE_VERSION=\\\"1.0\\\" -DPACKAGE_STRING=\\\"Tutorial\\ Program\\ 1.0\\\" \\\n" " -DPACKAGE_BUGREPORT=\\\"\\\" -DPACKAGE=\\\"tutorial-program\\\" -DVERSION=\\\"1.0\\\" \\\n" " -I. -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c\n" "main.c: In function ‘main’:\n" "main.c:5: warning: return type of ‘main’ is not ‘int’\n" "mv -f .deps/main.Tpo .deps/main.Po\n" "gcc -g -O2 -o tut_prog main.o" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:977 #: C/index.docbook:977 msgid "Now, if you can write in /usr/local/bin, run make install to install your program. Else you need to log as root before or use sudo and run sudo make install. You should get." msgstr "" #. (itstool) path: listitem/screen #: C/index.docbook:982 #: C/index.docbook:982 #, no-wrap msgid "" "\n" "make[1]: Entering directory `/home/seb/Projects/Tutorial'\n" "test -z \"/usr/local/bin\" || /bin/mkdir -p \"/usr/local/bin\"\n" " /usr/bin/install -c 'tut_prog' '/usr/local/bin/tut_prog'\n" "make[1]: Nothing to be done for `install-data-am'.\n" "make[1]: Leaving directory `/home/seb/Projects/Tutorial'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:988 #: C/index.docbook:988 msgid "Then, if /user/local/bin is in your path, you can run your program from everywhere." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:996 #: C/index.docbook:996 msgid "Clean project" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:999 #: C/index.docbook:999 msgid "The program is installed, so you can clean the build directory running make clean. It removes all object files and the program but not the makefiles." msgstr "" #. (itstool) path: listitem/screen #: C/index.docbook:1002 #: C/index.docbook:1002 #, no-wrap msgid "" "\n" "test -z \"tut_prog\" || rm -f tut_prog\n" "rm -f *.o" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1005 #: C/index.docbook:1005 msgid "You can still run the program installed in /user/local/bin." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1010 #: C/index.docbook:1010 msgid "To remove the installed program, run make uninstall. Like for the installation, you need to use have the writing right in the directory or use su or sudo." msgstr "" #. (itstool) path: listitem/screen #: C/index.docbook:1013 #: C/index.docbook:1013 #, no-wrap msgid "" "\n" "rm -f '/usr/local/bin/tut_prog'" msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1019 #: C/index.docbook:1019 msgid "Generate project" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1020 #: C/index.docbook:1020 msgid "Running aclocal, automake and autoconf one by one is fine for a tutorial to understand exactly what's happen. But, for a real work, it's a bit tedious especially because there are other tools those could be needed like autoheader, autopoint or libtoolize. After creating the project, the makefiles generated by configure should take care of regenerating configure and all Makefile.in. Anyway, this lets a room for improvement and there are even two responses to this:" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1034 #: C/index.docbook:1034 msgid "autoreconf" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1036 #: C/index.docbook:1036 msgid "It is another tool part of the Autoconf package which is running all scripts in the right order. To start a new project, you can just run autoreconf --install and it will call all necessary commands." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1043 #: C/index.docbook:1043 msgid "autogen.sh" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1045 #: C/index.docbook:1045 msgid "It is a script not part of Autotools, that it doing the same thing. There is one named gnome-autogen.sh which comes with GNOME common development package but other project can write their own ones." msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:1056 #: C/index.docbook:1056 msgid "Creating a project with Anjuta need just a few clicks but then we will take a look at the created files." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1061 #: C/index.docbook:1061 msgid "Create a new project" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1064 #: C/index.docbook:1064 msgid "Click on FileNew Project. The new project assistant appears." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1069 #: C/index.docbook:1069 msgid "Click on Forward. The project selection page appears:" msgstr "" #. (itstool) path: figure/title #: C/index.docbook:1071 #: C/index.docbook:1071 msgid "Project selection page" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:1075 #: C/index.docbook:1075 msgctxt "_" msgid "external ref='figures/new-project-select.png' md5='f79e2454e7ccaf52b1b1b06aa04a4956'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1082 #: C/index.docbook:1082 msgid "Select Generic (minimal) project in the C page." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1085 #: C/index.docbook:1121 #: C/index.docbook:1085 #: C/index.docbook:1121 msgid "Click on Forward." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:1087 #: C/index.docbook:1087 msgid "Project basic information page" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:1091 #: C/index.docbook:1091 msgctxt "_" msgid "external ref='figures/new-project-basic.png' md5='3e120013f61bdc811c7d3ace04201e33'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1096 #: C/index.docbook:1096 msgid "Change Project Name to tutprog, the project name should contains only alpha numeric characters or underscore. Fill the remaining field." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1103 #: C/index.docbook:1103 msgid "Click on Forward." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:1105 #: C/index.docbook:1105 msgid "Project options page" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:1109 #: C/index.docbook:1109 msgctxt "_" msgid "external ref='figures/new-project-options.png' md5='4d386a284c3a40676f50c6dd6208bb1b'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1114 #: C/index.docbook:1114 msgid "Click on Destination and create a new directory named tutprog for your new project. You need to avoid space in the directory name. Then, keep all other options to their default value to get a minimal project." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:1123 #: C/index.docbook:1123 msgid "Project summary page" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:1127 #: C/index.docbook:1127 msgctxt "_" msgid "external ref='figures/new-project-summary.png' md5='79bca5475883f9c43bf404df815eff58'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1132 #: C/index.docbook:1132 msgid "This is the final page of the assistant, check that everything is right." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1137 #: C/index.docbook:1137 msgid "Click on Forward. Anjuta will create all needed files and directories, in the message window, you will see the following:" msgstr "" #. (itstool) path: figure/title #: C/index.docbook:1141 #: C/index.docbook:1141 msgid "Project creation messages" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:1145 #: C/index.docbook:1145 msgctxt "_" msgid "external ref='figures/new-project-message.png' md5='073f1d0fae8d7ed17a86f946077a6c18'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1150 #: C/index.docbook:1150 msgid "Then, autogen.sh is called and run the configure script. Finally Anjuta open the new project. You can directly build the project, as the main source contains a few lines of C and configure has been run." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1160 #: C/index.docbook:1160 msgid "Looking at configure.ac" msgstr "" #. (itstool) path: example/title #: C/index.docbook:1162 #: C/index.docbook:1162 msgid "Anjuta minimal configure.ac:" msgstr "" #. (itstool) path: example/programlisting #: C/index.docbook:1163 #: C/index.docbook:1163 #, no-wrap msgid "" "\n" "dnl Process this file with autoconf to produce a configure script.\n" "dnl Created by Anjuta application wizard.\n" "\n" "AC_INIT(tutprog, 0.1)\n" "\n" "AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)\n" "AC_CONFIG_HEADERS([config.h])\n" "\n" "AC_PROG_CC\n" "\n" "AC_OUTPUT([\n" "Makefile\n" "])" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1178 #: C/index.docbook:1178 msgid "It is still quite simple with a bit more macros. Let's look at all unknown ones:" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1184 #: C/index.docbook:1184 msgid "dnl" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1186 #: C/index.docbook:1186 msgid "It is not a macros, just the marker to start a comment in M4, the language used to write configure.ac. It is like '#' is scripts or '//' in C++." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1196 #: C/index.docbook:1196 msgid "The AC_INIT macro uses the new form with package and version but AM_INIT_AUTOMAKE keeps the old one. It is not needed anymore." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1203 #: C/index.docbook:1203 msgid "AC_CONFIG_HEADERS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1205 #: C/index.docbook:1205 msgid "This tells Autoconf to pass all defines in a file named config.h instead of using several -Dxxxx flags on the command line (see ). It is easier when there are lots of them. A file named config.h.in is created automatically from the configure.ac using autoheader. Then config.h is created automatically like makefiles by configure. So it is painless for the developer." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1220 #: C/index.docbook:1220 msgid "This is the old form of the AC_OUTPUT, where you specify all output files instead of using AC_CONFIG_FILES." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1229 #: C/index.docbook:1229 msgid "Looking at Makefile.am" msgstr "" #. (itstool) path: example/title #: C/index.docbook:1231 #: C/index.docbook:1231 msgid "Anjuta minimal Makefile.am:" msgstr "" #. (itstool) path: example/programlisting #: C/index.docbook:1232 #: C/index.docbook:1232 #, no-wrap msgid "" "## Process this file with automake to produce Makefile.in\n" "## Created by Anjuta\n" "\n" "AM_CPPFLAGS = \\\n" " -DPACKAGE_DATA_DIR=\\\"\"$(datadir)\"\\\"\n" "\n" "AM_CFLAGS =\\\n" " -Wall\\\n" " -g\n" "\n" "bin_PROGRAMS = tutprog\n" "\n" "tutprog_SOURCES = \\\n" " main.c\n" "\n" "tutprog_LDFLAGS =\n" "\n" "tutprog_LDADD =" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1251 #: C/index.docbook:1251 msgid "Not much things in the Makefile.am neither:" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1256 #: C/index.docbook:1256 msgid "AM_CPPFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1258 #: C/index.docbook:1258 msgid "It is used to give additional flags to the C preprocessor. Here it defines an additional PACKAGE_DATA_DIR constant set by configure" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1266 #: C/index.docbook:1266 msgid "AM_CFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1268 #: C/index.docbook:1268 msgid "It defines some additional flags for the C compiler: all warning and add debugging information that we have already seen at the beginning of this tutorial (see )" msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1276 #: C/index.docbook:1276 msgid "tutprog_LDFLAGS" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1278 #: C/index.docbook:1278 msgid "It adds a places where you can put additional linker options for the tutprog program." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1285 #: C/index.docbook:1285 msgid "tutprog_LDADD" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1287 #: C/index.docbook:1287 msgid "It adds a places where you can put additional libraries for the tutprog program." msgstr "" #. (itstool) path: chapter/title #: C/index.docbook:1300 #: C/index.docbook:1300 msgid "Adding a library" msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:1301 #: C/index.docbook:1301 msgid "This chapter explains how to add a new library to a project. It starts with Autotools before looking at Anjuta." msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:1307 #: C/index.docbook:1307 msgid "Adding a new library in a autotools project could be more or less easy depending on how the library is packaged. To take an example, imagine that we want to read an xml file using libxml2 (see its homepage at www.xmlsoft.org)" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1315 #: C/index.docbook:1315 msgid "Open the old tutorial project and replace main.c by the following." msgstr "" #. (itstool) path: example/title #: C/index.docbook:1318 #: C/index.docbook:1595 #: C/index.docbook:1318 #: C/index.docbook:1595 msgid "main.c using libxml2:" msgstr "" #. (itstool) path: example/programlisting #: C/index.docbook:1319 #: C/index.docbook:1596 #: C/index.docbook:1319 #: C/index.docbook:1596 #, no-wrap msgid "" "\n" "#include <libxml/parser.h>\t\t\t\n" "#include <stdio.h>\n" "\t\t\t\n" "int main()\n" "{\t\t\t\t\n" "\txmlDocPtr doc; \n" "\tdoc = xmlParseFile (\"testfile.xml\");\n" "\n" "\tif (doc == NULL) {\n" "\t\tprintf (\"Document not parsed successfully. \\n\");\n" "\t\treturn -1;\n" "\t}\n" "\telse {\n" "\t\tprintf (\"Document parsed successfully.\\n\");\n" "\t\txmlFreeDoc(doc);\n" "\t\treturn 0;\n" "\t}\n" "}" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:1341 #: C/index.docbook:1341 msgid "Our goal is now to compile it and make it work correctly. For that purpose, we must tell GCC two things: where to find libxml/parser.h (that is to say, give GCC the right include path) and what library (i.e. shared object) it should link our project against. There are several ways to do that, I will start with the easiest." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1349 #: C/index.docbook:1589 #: C/index.docbook:1349 #: C/index.docbook:1589 msgid "With pkg-config" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1350 #: C/index.docbook:1350 msgid "pkg-config is tools for developers providing a unified interface for querying installed libraries with their version and all options needed to compile and link it. It comes with an Autoconf macro named PKG_CHECK_MODULES allowing to check the existence of the library and set all necessary flags." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1360 #: C/index.docbook:1495 #: C/index.docbook:1360 #: C/index.docbook:1495 msgid "Add the following line in configure.ac." msgstr "" #. (itstool) path: listitem/programlisting #: C/index.docbook:1361 #: C/index.docbook:1361 #, no-wrap msgid "" "PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.4)" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1362 #: C/index.docbook:1362 msgid "This macro will check the existence of libxml2 with a version higher or equal to 2.4 and create 2 variable XML_CFLAGS and XML_LIBS containing respectively, the flags for the C compiler and the linker. XML is an user defined name. libxml-2.0 is the name of the library. You can run pkg-config --list-all to get a list of all installed libraries." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1372 #: C/index.docbook:1505 #: C/index.docbook:1532 #: C/index.docbook:1372 #: C/index.docbook:1505 #: C/index.docbook:1532 msgid "Add the following lines in Makefile.am." msgstr "" #. (itstool) path: listitem/programlisting #: C/index.docbook:1373 #: C/index.docbook:1373 #, no-wrap msgid "" "tut_prog_CPPFLAGS = $(XML_CFLAGS)\n" "tut_prog_LDFLAGS= $(XML_LIBS)" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1375 #: C/index.docbook:1375 msgid "This will use the options found by configure when the macro PKG_CHECK_MODULES is executed for compiling your program." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1381 #: C/index.docbook:1381 msgid "That's all. You can run make again." msgstr "" #. (itstool) path: listitem/screen #: C/index.docbook:1382 #: C/index.docbook:1382 #, no-wrap msgid "" "\n" "cd . && /bin/sh /home/seb2008.1/Projects/tutprog/missing --run aclocal-1.10 \n" "cd . && /bin/sh /home/seb2008.1/Projects/tutprog/missing --run automake-1.10 --foreign \n" "cd . && /bin/sh /home/seb2008.1/Projects/tutprog/missing --run autoconf\n" "/bin/sh ./config.status --recheck\n" "running CONFIG_SHELL=/bin/sh /bin/sh ./configure --no-create --no-recursion\n" "checking for a BSD-compatible install... /usr/bin/install -c\n" "checking whether build environment is sane... yes\n" "checking for a thread-safe mkdir -p... /bin/mkdir -p\n" "checking for gawk... gawk\n" "checking whether make sets $(MAKE)... yes\n" "checking whether to enable maintainer-specific portions of Makefiles... yes\n" "checking for style of include used by make... GNU\n" "checking for gcc... gcc\n" "checking for C compiler default output file name... a.out\n" "checking whether the C compiler works... yes\n" "checking whether we are cross compiling... no\n" "checking for suffix of executables... \n" "checking for suffix of object files... o\n" "checking whether we are using the GNU C compiler... yes\n" "checking whether gcc accepts -g... yes\n" "checking for gcc option to accept ISO C89... none needed\n" "checking dependency style of gcc... gcc3\n" "checking for library containing strerror... none required\n" "checking for gcc... (cached) gcc\n" "checking whether we are using the GNU C compiler... (cached) yes\n" "checking whether gcc accepts -g... (cached) yes\n" "checking for gcc option to accept ISO C89... (cached) none needed\n" "checking dependency style of gcc... (cached) gcc3\n" "checking for gcc... (cached) gcc\n" "checking whether we are using the GNU C compiler... (cached) yes\n" "checking whether gcc accepts -g... (cached) yes\n" "checking for gcc option to accept ISO C89... (cached) none needed\n" "checking dependency style of gcc... (cached) gcc3\n" "checking how to run the C preprocessor... gcc -E\n" "checking for grep that handles long lines and -e... /bin/grep\n" "checking for egrep... /bin/grep -E\n" "checking for ANSI C header files... yes\n" "checking for pkg-config... /usr/bin/pkg-config\n" "checking pkg-config is at least version 0.9.0... yes\n" "checking for XML... yes\n" "configure: creating ./config.status\n" " /bin/sh ./config.status\n" "config.status: creating Makefile\n" "config.status: creating config.h\n" "config.status: config.h is unchanged\n" "config.status: executing depfiles commands\n" "cd . && /bin/sh /home/seb2008.1/Projects/tutprog/missing --run autoheader\n" "rm -f stamp-h1\n" "touch config.h.in\n" "cd . && /bin/sh ./config.status config.h\n" "config.status: creating config.h\n" "config.status: config.h is unchanged\n" "make all-am\n" "make[1]: Entering directory `/home/seb/Projects/tutprog'\n" "gcc -DHAVE_CONFIG_H -I. -DPACKAGE_DATA_DIR=\\\"\"/usr/local/share\"\\\" -I/usr/include/libxml2 \\\n" " -Wall -g -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c\n" "mv -f .deps/main.Tpo .deps/main.Po\n" "gcc -Wall -g -g -O2 -o tutprog main.o -lxml2 \n" "make[1]: Leaving directory `/home/seb/Projects/tutprog'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1442 #: C/index.docbook:1442 msgid "There is no need to rerun Autoconf or Automake because the Makefile generated by it already contains some rules to do it." msgstr "" #. (itstool) path: tip/para #: C/index.docbook:1450 #: C/index.docbook:1450 msgid "When installed, each library supporting pkg-config copy a small text file, with .pc extension, in a system directory; normally /usr/lib/pkgconfig. If you install a library from source it will be by default in /usr/local/lib/pkgconfig. You can ask pkg-config to search in this directory too, by defining the environment variable PKG_CONFIG_PATH=/usr/local/lib/pkgconfig." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1460 #: C/index.docbook:1460 msgid "With an Autoconf macro" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1467 #: C/index.docbook:1467 msgid "Check if the library author shipped a M4 macro, and use it if present. It is a text file named like the library with a .m4 extension often installed in /usr/share/aclocal." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1472 #: C/index.docbook:1472 msgid "If your library is a basic one, it might be checked by the standard Autoconf macros (see the list here)." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1478 #: C/index.docbook:1478 msgid "Perhaps the M4 macro you need has already be programmed by someone else. Look at the contributions here." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1482 #: C/index.docbook:1482 msgid "If all that fail, go deeper in M4, make your own macro, and donate it to the library's author!" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1461 #: C/index.docbook:1461 msgid "If the library does not support pkg-config: it does not appear in the list returned by pkg-config --list-all. You need a Autoconf macro: <_:itemizedlist-1/>" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1487 #: C/index.docbook:1487 msgid "When, you have this macro, you can copy it in /usr/share/aclocal, so aclocal will find it. Then, you just need to look in the macro file to see how to use it. libxml2 installs a macro named AM_PATH_XML2 which is in /usr/share/aclocal/libxml.m4." msgstr "" #. (itstool) path: listitem/programlisting #: C/index.docbook:1496 #: C/index.docbook:1496 #, no-wrap msgid "" "AM_PATH_XML2(2.4.0)" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1497 #: C/index.docbook:1497 msgid "This macro will check the existence of the library with a version higher or equal to 2.4 and create 2 variable XML_CPPFLAGS and XML_LIBS containing respectively, the flags for the C compiler and the linker. You get these information from the comments in the macro file." msgstr "" #. (itstool) path: listitem/programlisting #: C/index.docbook:1506 #: C/index.docbook:1506 #, no-wrap msgid "" "tut_prog_CPPFLAGS = $(XML_CPPFLAGS)\n" "tut_prog_LDFLAGS= $(XML_LIBS)" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1508 #: C/index.docbook:1508 msgid "This will use the options found by configure for compiling your program. Note that the macro defined XML_CPPFLAGS instead of XML_CFLAGS with pkg-config. Using CPPFLAGS makes more sense, because these flags are used by the C preprocessor, most of the time only to setup the path of the include files." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1516 #: C/index.docbook:1516 msgid "That's all. You can run make again. The generated Makefile is almost the same." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1522 #: C/index.docbook:1522 msgid "With hardcoded library path" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1523 #: C/index.docbook:1523 msgid "It is the approach one could naturally have: let's give GCC the stuff it needs directly ! On my system, libxml/parser.h is in /usr/include/libxml2, and the shared object is 'libxml.so', located in /usr/lib. (I will assume it's all the same for you)." msgstr "" #. (itstool) path: listitem/programlisting #: C/index.docbook:1533 #: C/index.docbook:1533 #, no-wrap msgid "" "tut_prog_CPPFLAGS = -I /usr/include/libxml2\n" "tut_prog_LDFLAGS= -lxml2" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1535 #: C/index.docbook:1535 msgid "There is no need to change configure.ac because you don't check anything and just assume that all host system will have the right library in the same place than you." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1542 #: C/index.docbook:1542 msgid "You can run make and it should work if you have the same system than me." msgstr "" #. (itstool) path: listitem/screen #: C/index.docbook:1544 #: C/index.docbook:1544 #, no-wrap msgid "" "\n" " cd . && /bin/sh /home/seb2008.1/Projects/tutprog/missing --run automake-1.10 --foreign Makefile\n" " cd . && /bin/sh ./config.status Makefile depfiles\n" "config.status: creating Makefile\n" "config.status: executing depfiles commands\n" "make all-am\n" "make[1]: Entering directory `/home/seb/Projects/tutprog'\n" "gcc -DHAVE_CONFIG_H -I. -DPACKAGE_DATA_DIR=\\\"\"/usr/local/share\"\\\" -I /usr/include/libxml2 \\\n" " -Wall -g -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c\n" "mv -f .deps/main.Tpo .deps/main.Po\n" "gcc -Wall -g -g -O2 -o tutprog main.o -lxml2 \n" "make[1]: Leaving directory `/home/seb/Projects/tutprog'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1564 #: C/index.docbook:1564 msgid "It is not portable to various linuxes: perhaps on other distribution the include path is different." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1568 #: C/index.docbook:1568 msgid "If the next versions of libxml have different paths, or different needed libraries, we will need to update the project." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1572 #: C/index.docbook:1572 msgid "We don't test whether the system of the packager/user has the library." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1576 #: C/index.docbook:1576 msgid "We cannot check the version of the libxml2 we use." msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1558 #: C/index.docbook:1558 msgid "I have described this here to show that it is possible to do simple thing using Autotools. But this approach has several drawbacks: <_:itemizedlist-1/>" msgstr "" #. (itstool) path: sect1/para #: C/index.docbook:1584 #: C/index.docbook:1584 msgid "With Anjuta adding a library supporting pkg-config can be almost done without the keyboard." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1592 #: C/index.docbook:1592 msgid "Open the file main.c of the Anjuta project created in the previous chapter. Replace it with the following text:" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1618 #: C/index.docbook:1618 msgid "Select Project PropertiesPackages, to get the package properties dialog." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1623 #: C/index.docbook:1623 msgid "Click on Add module button and Enter a name in the Module/Package column, \"XML\" by example." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1627 #: C/index.docbook:1627 msgid "Click on Add Package button that should be enabled now. You get the a dialog where you can select the library that you want to use. This dialog list all libraries supporting pkg-config. Select libxml-2.0. Then click on Add button." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1633 #: C/index.docbook:1633 msgid "The package properties dialog should look like the following:" msgstr "" #. (itstool) path: figure/title #: C/index.docbook:1637 #: C/index.docbook:1637 msgid "Project package properties dialog" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:1641 #: C/index.docbook:1641 msgctxt "_" msgid "external ref='figures/library-add-pkgconfig.png' md5='3ccc834696358394b215e27994b0f25e'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1646 #: C/index.docbook:1646 msgid "The module XML contains one library named libxml-2.0. You can define a minimum version required by clicking in the version column and writing >= 2.4. All this operation add the necessary lines in the file configure.ac." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1653 #: C/index.docbook:1653 msgid "Close the dialog and select Project Refresh. This should not be needed but is necessary with the current version of Anjuta. This bug has already been reported (#541694) and will be fixed soon" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1659 #: C/index.docbook:1659 msgid "In the project view, select the project target tutprog and click on right button to get a context menu and select Properties. You will get the target properties dialog." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1663 #: C/index.docbook:1663 msgid "This dialog will list all modules available in your project, just check the XML module. This will modify the file Makefile.am to use the right library." msgstr "" #. (itstool) path: figure/title #: C/index.docbook:1669 #: C/index.docbook:1669 msgid "Target properties dialog" msgstr "" #. (itstool) path: imageobject/imagedata #. This is a reference to an external file such as an image or video. When #. the file changes, the md5 hash will change to let you know you need to #. update your localized copy. The msgstr is not used at all. Set it to #. whatever you like once you have updated your copy of the file. #: C/index.docbook:1673 #: C/index.docbook:1673 msgctxt "_" msgid "external ref='figures/library-add-properties.png' md5='53095c1d9d784e3b71111b856ca3a97a'" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1680 #: C/index.docbook:1680 msgid "Click on Close and that's all. You can select Build Build to rebuild your project." msgstr "" #. (itstool) path: sect2/title #: C/index.docbook:1687 #: C/index.docbook:1687 msgid "Without pkg-config" msgstr "" #. (itstool) path: sect2/para #: C/index.docbook:1688 #: C/index.docbook:1688 msgid "Anjuta has no real support for library not using pkg-config. You need to edit the configure.ac directly to add all necessary macros. For passing flags to each target you can select the Advanced button in the target properties dialog." msgstr "" #. (itstool) path: chapter/title #: C/index.docbook:1701 #: C/index.docbook:1701 msgid "Resources" msgstr "" #. (itstool) path: chapter/para #: C/index.docbook:1702 #: C/index.docbook:1702 msgid "Here are some links to reference documents dealing with Autotools in general and Autoconf and Automake in particular." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1708 #: C/index.docbook:1708 msgid "English" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1713 #: C/index.docbook:1713 msgid "First, you can take a look at the Autoconf, Automake, Libtool, make and M4 manuals." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1728 #: C/index.docbook:1728 msgid "The Autobook explains in details how the Autotools work." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1733 #: C/index.docbook:1733 msgid "Amongst the various GNU development tools you are told about, here are Autoconf and Automake." msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1739 #: C/index.docbook:1739 msgid "Here and here are two other tutorials about Autotools." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1747 #: C/index.docbook:1747 msgid "French" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1748 #: C/index.docbook:1748 msgid " Here are some slides by a teacher from Ecole Nationale Supérieure des Télecoms about the Autotools." msgstr "" #. (itstool) path: varlistentry/term #: C/index.docbook:1754 #: C/index.docbook:1754 msgid "Japanese" msgstr "" #. (itstool) path: listitem/para #: C/index.docbook:1756 #: C/index.docbook:1756 msgid " A tutorial about Autoconf and Automake ." msgstr "" #. (itstool) path: tip/para #: C/index.docbook:1762 #: C/index.docbook:1762 msgid "This tutorial uses Autoconf 2.61 (November 2006) and Automake 1.10.1 (January 2008). Some of these documentations uses older versions. the syntaxes could have changed quite a bit. These old syntaxes usually still work and are used in old project. It is useful to know them but it is a bad idea to use them in a new project." msgstr ""