#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2018-12-08 14:49-0200\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: info/title #: book.translate.xml:32 msgid "FreeBSD Developers' Handbook" msgstr "" #. (itstool) path: info/author #: book.translate.xml:35 msgid "The FreeBSD Documentation Project" msgstr "" #. (itstool) path: info/pubdate #. (itstool) path: info/releaseinfo #: book.translate.xml:37 book.translate.xml:146 msgid "" "$FreeBSD: head/en_US.ISO8859-1/books/developers-handbook/book.xml 51938 2018-" "06-30 10:45:14Z eadler $" msgstr "" #. (itstool) path: info/copyright #: book.translate.xml:39 msgid "" "2000 2001 2002 2003 " "2004 2005 2006 2007 " "2008 2009 2010 2011 " "2012 2013 2014 2015 " "2016 2017 2018 The FreeBSD " "Documentation Project" msgstr "" #. (itstool) path: legalnotice/title #: book.translate.xml:64 msgid "Copyright" msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:66 msgid "" "Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, " "HTML, PDF, PostScript, RTF and so forth) with or without modification, are " "permitted provided that the following conditions are met:" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:73 msgid "" "Redistributions of source code (XML DocBook) must retain the above copyright " "notice, this list of conditions and the following disclaimer as the first " "lines of this file unmodified." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:79 msgid "" "Redistributions in compiled form (transformed to other DTDs, converted to " "PDF, PostScript, RTF and other formats) must reproduce the above copyright " "notice, this list of conditions and the following disclaimer in the " "documentation and/or other materials provided with the distribution." msgstr "" #. (itstool) path: important/para #: book.translate.xml:88 msgid "" "THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT \"AS " "IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, " "THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR " "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT " "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR " "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF " "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS " "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN " "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) " "ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF " "THE POSSIBILITY OF SUCH DAMAGE." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:105 msgid "FreeBSD is a registered trademark of the FreeBSD Foundation." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:107 msgid "" "Apple, AirPort, FireWire, iMac, iPhone, iPad, Mac, Macintosh, Mac OS, " "Quicktime, and TrueType are trademarks of Apple Inc., registered in the U.S. " "and other countries." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:112 msgid "" "IBM, AIX, OS/2, PowerPC, PS/2, S/390, and ThinkPad are trademarks of " "International Business Machines Corporation in the United States, other " "countries, or both." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:116 msgid "" "IEEE, POSIX, and 802 are registered trademarks of Institute of Electrical " "and Electronics Engineers, Inc. in the United States." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:119 msgid "" "Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium, " "and Xeon are trademarks or registered trademarks of Intel Corporation or its " "subsidiaries in the United States and other countries." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:123 msgid "Linux is a registered trademark of Linus Torvalds." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:125 msgid "" "Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media and Windows " "NT are either registered trademarks or trademarks of Microsoft Corporation " "in the United States and/or other countries." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:129 msgid "" "Motif, OSF/1, and UNIX are registered trademarks and IT DialTone and The " "Open Group are trademarks of The Open Group in the United States and other " "countries." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:133 msgid "" "Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, " "Netra, OpenJDK, Solaris, StarOffice, SunOS and VirtualBox are trademarks or " "registered trademarks of Sun Microsystems, Inc. in the United States and " "other countries." msgstr "" #. (itstool) path: legalnotice/para #: book.translate.xml:138 msgid "" "Many of the designations used by manufacturers and sellers to distinguish " "their products are claimed as trademarks. Where those designations appear in " "this document, and the FreeBSD Project was aware of the trademark claim, the " "designations have been followed by the or the ® symbol." msgstr "" #. (itstool) path: abstract/para #: book.translate.xml:149 msgid "" "Welcome to the Developers' Handbook. This manual is a work in " "progress and is the work of many individuals. Many sections do " "not yet exist and some of those that do exist need to be updated. If you are " "interested in helping with this project, send email to the FreeBSD " "documentation project mailing list." msgstr "" #. (itstool) path: abstract/para #: book.translate.xml:155 msgid "" "The latest version of this document is always available from the FreeBSD World Wide Web server. " "It may also be downloaded in a variety of formats and compression options " "from the FreeBSD " "FTP server or one of the numerous mirror sites." msgstr "" #. (itstool) path: part/title #: book.translate.xml:165 msgid "Basics" msgstr "" #. (itstool) path: info/title #. (itstool) path: sect1/title #: book.translate.xml:174 book.translate.xml:428 msgid "Introduction" msgstr "" #. (itstool) path: authorgroup/author #: book.translate.xml:176 book.translate.xml:2642 msgid "" "MurrayStokelyContributed by " msgstr "" #. (itstool) path: authorgroup/author #: book.translate.xml:177 msgid "" "JeroenRuigrok van der Werven" msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:183 msgid "Developing on FreeBSD" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:185 msgid "" "So here we are. System all installed and you are ready to start programming. " "But where to start? What does FreeBSD provide? What can it do for me, as a " "programmer?" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:189 msgid "" "These are some questions which this chapter tries to answer. Of course, " "programming has different levels of proficiency like any other trade. For " "some it is a hobby, for others it is their profession. The information in " "this chapter might be aimed toward the beginning programmer; indeed, it " "could serve useful for the programmer unfamiliar with the FreeBSD platform." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:198 msgid "The BSD Vision" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:200 msgid "" "To produce the best UNIX like " "operating system package possible, with due respect to the original software " "tools ideology as well as usability, performance and stability." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:207 msgid "Architectural Guidelines" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:209 msgid "Our ideology can be described by the following guidelines" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:215 msgid "" "Do not add new functionality unless an implementor cannot complete a real " "application without it." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:220 msgid "" "It is as important to decide what a system is not as to decide what it is. " "Do not serve all the world's needs; rather, make the system extensible so " "that additional needs can be met in an upwardly compatible fashion." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:228 msgid "" "The only thing worse than generalizing from one example is generalizing from " "no examples at all." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:233 msgid "" "If a problem is not completely understood, it is probably best to provide no " "solution at all." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:238 msgid "" "If you can get 90 percent of the desired effect for 10 percent of the work, " "use the simpler solution." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:243 msgid "Isolate complexity as much as possible." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:247 msgid "" "Provide mechanism, rather than policy. In particular, place user interface " "policy in the client's hands." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:252 msgid "From Scheifler & Gettys: \"X Window System\"" msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:256 msgid "The Layout of /usr/src" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:259 msgid "" "The complete source code to FreeBSD is available from our public repository. " "The source code is normally installed in /usr/src which " "contains the following subdirectories:" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:269 msgid "Directory" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:270 msgid "Description" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:276 msgid "bin/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:277 msgid "Source for files in /bin" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:282 msgid "cddl/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:283 msgid "Utilities covered by the Common Development and Distribution License" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:288 msgid "contrib/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:289 msgid "Source for files from contributed software." msgstr "" #. (itstool) path: row/entry #: book.translate.xml:294 msgid "crypto/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:295 msgid "Cryptographical sources" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:299 msgid "etc/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:300 msgid "Source for files in /etc" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:304 msgid "gnu/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:305 msgid "Utilities covered by the GNU Public License" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:310 msgid "include/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:311 msgid "Source for files in /usr/include" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:315 msgid "kerberos5/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:316 msgid "Source for Kerberos version 5" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:320 msgid "lib/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:321 msgid "Source for files in /usr/lib" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:325 msgid "libexec/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:326 msgid "Source for files in /usr/libexec" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:330 msgid "release/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:331 msgid "Files required to produce a FreeBSD release" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:336 msgid "rescue/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:337 msgid "Build system for the /rescue utilities" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:343 msgid "sbin/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:344 msgid "Source for files in /sbin" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:348 msgid "secure/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:349 msgid "Contributed cryptographic sources" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:353 msgid "share/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:354 msgid "Source for files in /usr/share" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:358 msgid "sys/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:359 msgid "Kernel source files" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:363 msgid "tests/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:364 msgid "The FreeBSD test suite" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:368 msgid "tools/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:369 msgid "Tools used for maintenance and testing of FreeBSD" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:374 msgid "usr.bin/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:375 msgid "Source for files in /usr/bin" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:379 msgid "usr.sbin/" msgstr "" #. (itstool) path: row/entry #: book.translate.xml:380 msgid "Source for files in /usr/sbin" msgstr "" #. (itstool) path: info/title #: book.translate.xml:396 msgid "Programming Tools" msgstr "" #. (itstool) path: authorgroup/author #: book.translate.xml:399 msgid "" " James Raynard Contributed by " msgstr "" #. (itstool) path: authorgroup/author #: book.translate.xml:406 msgid "" " Murray Stokely " msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:416 book.translate.xml:2648 book.translate.xml:4571 #: book.translate.xml:9138 msgid "Synopsis" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:418 msgid "" "This chapter is an introduction to using some of the programming tools " "supplied with FreeBSD, although much of it will be applicable to many other " "versions of UNIX. It does " "not attempt to describe coding in any detail. Most of " "the chapter assumes little or no previous programming knowledge, although it " "is hoped that most programmers will find something of value in it." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:430 msgid "" "FreeBSD offers an excellent development environment. Compilers for C and C++ " "and an assembler come with the basic system, not to mention classic " "UNIX tools such as sed and awk. If that is not enough, there are many " "more compilers and interpreters in the Ports collection. The following " "section, Introduction to Programming, lists some of the available options. FreeBSD is very compatible with " "standards such as POSIX and ANSI C, as well with its own BSD " "heritage, so it is possible to write applications that will compile and run " "with little or no modification on a wide range of platforms." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:443 msgid "" "However, all this power can be rather overwhelming at first if you have " "never written programs on a UNIX " "platform before. This document aims to help you get up and running, without " "getting too deeply into more advanced topics. The intention is that this " "document should give you enough of the basics to be able to make some sense " "of the documentation." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:450 msgid "" "Most of the document requires little or no knowledge of programming, " "although it does assume a basic competence with using UNIX and a willingness to learn!" msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:457 msgid "Introduction to Programming" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:459 msgid "" "A program is a set of instructions that tell the computer to do various " "things; sometimes the instruction it has to perform depends on what happened " "when it performed a previous instruction. This section gives an overview of " "the two main ways in which you can give these instructions, or " "commands as they are usually called. One way uses an " "interpreter, the other a compiler. As human languages are too difficult for a computer to " "understand in an unambiguous way, commands are usually written in one or " "other languages specially designed for the purpose." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:472 msgid "Interpreters" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:474 msgid "" "With an interpreter, the language comes as an environment, where you type in " "commands at a prompt and the environment executes them for you. For more " "complicated programs, you can type the commands into a file and get the " "interpreter to load the file and execute the commands in it. If anything " "goes wrong, many interpreters will drop you into a debugger to help you " "track down the problem." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:482 msgid "" "The advantage of this is that you can see the results of your commands " "immediately, and mistakes can be corrected readily. The biggest disadvantage " "comes when you want to share your programs with someone. They must have the " "same interpreter, or you must have some way of giving it to them, and they " "need to understand how to use it. Also users may not appreciate being thrown " "into a debugger if they press the wrong key! From a performance point of " "view, interpreters can use up a lot of memory, and generally do not generate " "code as efficiently as compilers." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:493 msgid "" "In my opinion, interpreted languages are the best way to start if you have " "not done any programming before. This kind of environment is typically found " "with languages like Lisp, Smalltalk, Perl and Basic. It could also be argued " "that the UNIX shell " "(sh, csh) is itself an interpreter, " "and many people do in fact write shell scripts to help with " "various housekeeping tasks on their machine. Indeed, part of " "the original UNIX philosophy was " "to provide lots of small utility programs that could be linked together in " "shell scripts to perform useful tasks." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:507 msgid "Interpreters Available with FreeBSD" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:509 msgid "" "Here is a list of interpreters that are available from the FreeBSD Ports " "Collection, with a brief discussion of some of the more popular interpreted " "languages." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:513 msgid "" "Instructions on how to get and install applications from the Ports " "Collection can be found in the Ports section of " "the handbook." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:519 msgid "BASIC" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:522 msgid "" "Short for Beginner's All-purpose Symbolic Instruction Code. Developed in the " "1950s for teaching University students to program and provided with every " "self-respecting personal computer in the 1980s, BASIC has " "been the first programming language for many programmers. It is also the " "foundation for Visual Basic." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:530 msgid "" "The Bywater Basic Interpreter can be found in the Ports Collection as " "lang/bwbasic and the Phil Cockroft's Basic Interpreter " "(formerly Rabbit Basic) is available as lang/pbasic." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:539 msgid "Lisp" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:542 msgid "" "A language that was developed in the late 1950s as an alternative to the " "number-crunching languages that were popular at the time. " "Instead of being based on numbers, Lisp is based on lists; in fact, the name " "is short for List Processing. It is very popular in " "AI (Artificial Intelligence) circles." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:550 msgid "" "Lisp is an extremely powerful and sophisticated language, but can be rather " "large and unwieldy." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:553 msgid "" "Various implementations of Lisp that can run on UNIX systems are available in the Ports " "Collection for FreeBSD. GNU Common Lisp can be found as lang/gcl. CLISP by Bruno Haible and Michael Stoll is available as " "lang/clisp. For CMUCL, which includes a highly-optimizing " "compiler too, or simpler Lisp implementations like SLisp, which implements " "most of the Common Lisp constructs in a few hundred lines of C code, " "lang/cmucl and lang/slisp are " "available respectively." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:569 msgid "Perl" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:572 msgid "" "Very popular with system administrators for writing scripts; also often used " "on World Wide Web servers for writing CGI scripts." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:576 msgid "" "Perl is available in the Ports Collection as lang/perl5.24 for all FreeBSD releases." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:583 msgid "Scheme" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:586 msgid "" "A dialect of Lisp that is rather more compact and cleaner than Common Lisp. " "Popular in Universities as it is simple enough to teach to undergraduates as " "a first language, while it has a high enough level of abstraction to be used " "in research work." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:592 msgid "" "Scheme is available from the Ports Collection as lang/elk " "for the Elk Scheme Interpreter. The MIT Scheme Interpreter can be found in " "lang/mit-scheme and the SCM Scheme Interpreter in " "lang/scm." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:603 msgid "Icon" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:606 msgid "" "Icon is a high-level language with extensive facilities for processing " "strings and structures. The version of Icon for FreeBSD can be found in the " "Ports Collection as lang/icon." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:615 msgid "Logo" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:618 msgid "" "Logo is a language that is easy to learn, and has been used as an " "introductory programming language in various courses. It is an excellent " "tool to work with when teaching programming to smaller age groups, as it " "makes creation of elaborate geometric shapes an easy task." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:625 msgid "" "The latest version of Logo for FreeBSD is available from the Ports " "Collection in lang/logo." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:632 msgid "Python" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:635 msgid "" "Python is an Object-Oriented, interpreted language. Its advocates argue that " "it is one of the best languages to start programming with, since it is " "relatively easy to start with, but is not limited in comparison to other " "popular interpreted languages that are used for the development of large, " "complex applications (Perl and Tcl are two other languages that are popular " "for such tasks)." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:644 msgid "" "The latest version of Python is available from the Ports Collection in " "lang/python." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:651 msgid "Ruby" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:654 msgid "" "Ruby is an interpreter, pure object-oriented programming language. It has " "become widely popular because of its easy to understand syntax, flexibility " "when writing code, and the ability to easily develop and maintain large, " "complex programs." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:660 msgid "" "Ruby is available from the Ports Collection as lang/ruby25." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:666 msgid "Tcl and Tk" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:669 msgid "" "Tcl is an embeddable, interpreted language, that has become widely used and " "became popular mostly because of its portability to many platforms. It can " "be used both for quickly writing small, prototype applications, or (when " "combined with Tk, a GUI toolkit) fully-fledged, featureful programs." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:676 msgid "" "Various versions of Tcl are available as ports for FreeBSD. The latest " "version, Tcl 8.5, can be found in lang/tcl87." msgstr "" #. (itstool) path: sect2/title #: book.translate.xml:685 msgid "Compilers" msgstr "" #. (itstool) path: footnote/para #: book.translate.xml:693 msgid "If you run it in the shell, you may get a core dump." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:687 msgid "" "Compilers are rather different. First of all, you write your code in a file " "(or files) using an editor. You then run the compiler and see if it accepts " "your program. If it did not compile, grit your teeth and go back to the " "editor; if it did compile and gave you a program, you can run it either at a " "shell command prompt or in a debugger to see if it works properly.<_:" "footnote-1/>" msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:696 msgid "" "Obviously, this is not quite as direct as using an interpreter. However it " "allows you to do a lot of things which are very difficult or even impossible " "with an interpreter, such as writing code which interacts closely with the " "operating system—or even writing your own operating system! It is also " "useful if you need to write very efficient code, as the compiler can take " "its time and optimize the code, which would not be acceptable in an " "interpreter. Moreover, distributing a program written for a compiler is " "usually more straightforward than one written for an interpreter—you can " "just give them a copy of the executable, assuming they have the same " "operating system as you." msgstr "" #. (itstool) path: sect2/para #: book.translate.xml:709 msgid "" "As the edit-compile-run-debug cycle is rather tedious when using separate " "programs, many commercial compiler makers have produced Integrated " "Development Environments (IDEs for short). FreeBSD does " "not include an IDE in the base system, but devel/kdevelop " "is available in the Ports Collection and many use Emacs for this purpose. Using Emacs as an " "IDE is discussed in ." msgstr "" #. (itstool) path: sect1/title #: book.translate.xml:723 msgid "Compiling with cc" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:725 msgid "" "This section deals with the gcc and " "clang compilers for C and C++, since they come " "with the FreeBSD base system. Starting with FreeBSD 10.X clang is installed as cc. The details of producing a " "program with an interpreter vary considerably between interpreters, and are " "usually well covered in the documentation and on-line help for the " "interpreter." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:734 msgid "" "Once you have written your masterpiece, the next step is to convert it into " "something that will (hopefully!) run on FreeBSD. This usually involves " "several steps, each of which is done by a separate program." msgstr "" #. (itstool) path: step/para #: book.translate.xml:741 msgid "" "Pre-process your source code to remove comments and do other tricks like " "expanding macros in C." msgstr "" #. (itstool) path: step/para #: book.translate.xml:746 msgid "" "Check the syntax of your code to see if you have obeyed the rules of the " "language. If you have not, it will complain!" msgstr "" #. (itstool) path: step/para #: book.translate.xml:752 msgid "" "Convert the source code into assembly language—this is very close to machine " "code, but still understandable by humans. Allegedly." msgstr "" #. (itstool) path: step/para #: book.translate.xml:758 msgid "" "Convert the assembly language into machine code—yep, we are talking bits and " "bytes, ones and zeros here." msgstr "" #. (itstool) path: step/para #: book.translate.xml:764 msgid "" "Check that you have used things like functions and global variables in a " "consistent way. For example, if you have called a non-existent function, it " "will complain." msgstr "" #. (itstool) path: step/para #: book.translate.xml:771 msgid "" "If you are trying to produce an executable from several source code files, " "work out how to fit them all together." msgstr "" #. (itstool) path: step/para #: book.translate.xml:777 msgid "" "Work out how to produce something that the system's run-time loader will be " "able to load into memory and run." msgstr "" #. (itstool) path: step/para #: book.translate.xml:783 msgid "Finally, write the executable on the filesystem." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:787 msgid "" "The word compiling is often used to refer to just " "steps 1 to 4—the others are referred to as linking. " "Sometimes step 1 is referred to as pre-processing and " "steps 3-4 as assembling." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:793 msgid "" "Fortunately, almost all this detail is hidden from you, as cc is a front end that manages calling all these programs with the " "right arguments for you; simply typing" msgstr "" #. (itstool) path: sect1/screen #: book.translate.xml:798 #, no-wrap msgid "% cc foobar.c" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:800 msgid "" "will cause foobar.c to be compiled by all the steps " "above. If you have more than one file to compile, just do something like" msgstr "" #. (itstool) path: sect1/screen #: book.translate.xml:804 #, no-wrap msgid "% cc foo.c bar.c" msgstr "" #. (itstool) path: footnote/para #: book.translate.xml:810 msgid "" "In case you did not know, a binary sort is an efficient way of sorting " "things into order and a bubble sort is not." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:806 msgid "" "Note that the syntax checking is just that—checking the syntax. It will not " "check for any logical mistakes you may have made, like putting the program " "into an infinite loop, or using a bubble sort when you meant to use a binary " "sort.<_:footnote-1/>" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:814 msgid "" "There are lots and lots of options for cc, which are all " "in the manual page. Here are a few of the most important ones, with examples " "of how to use them." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:821 msgid "" msgstr "" #. (itstool) path: footnote/para #: book.translate.xml:828 msgid "The reasons for this are buried in the mists of history." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:826 msgid "" "The output name of the file. If you do not use this option, cc will produce an executable called a.out.<_:" "footnote-1/>" msgstr "" #. (itstool) path: informalexample/screen #: book.translate.xml:833 #, no-wrap msgid "" "% cc foobar.c " "executable is a.out\n" "% cc -o foobar foobar.c " "executable is foobar" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:840 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:843 msgid "" "Just compile the file, do not link it. Useful for toy programs where you " "just want to check the syntax, or if you are using a Makefile." msgstr "" #. (itstool) path: informalexample/screen #: book.translate.xml:848 #, no-wrap msgid "% cc -c foobar.c" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:851 msgid "" "This will produce an object file (not an executable) " "called foobar.o. This can be linked together with other " "object files into an executable." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:860 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:863 msgid "" "Create a debug version of the executable. This makes the compiler put " "information into the executable about which line of which source file " "corresponds to which function call. A debugger can use this information to " "show the source code as you step through the program, which is " "very useful; the disadvantage is that all this extra " "information makes the program much bigger. Normally, you compile with " " while you are developing a program and then compile a " "release version without when you are " "satisfied it works properly." msgstr "" #. (itstool) path: informalexample/screen #: book.translate.xml:877 #, no-wrap msgid "% cc -g foobar.c" msgstr "" #. (itstool) path: footnote/para #: book.translate.xml:884 msgid "" "Note, we did not use the flag to specify the executable " "name, so we will get an executable called a.out. " "Producing a debug version called foobar is left as an " "exercise for the reader!" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:880 msgid "This will produce a debug version of the program. <_:footnote-1/>" msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:894 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:897 msgid "" "Create an optimized version of the executable. The compiler performs various " "clever tricks to try to produce an executable that runs faster than normal. " "You can add a number after the to specify a higher level " "of optimization, but this often exposes bugs in the compiler's optimizer." msgstr "" #. (itstool) path: informalexample/screen #: book.translate.xml:905 #, no-wrap msgid "% cc -O -o foobar foobar.c" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:908 msgid "This will produce an optimized version of foobar." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:914 msgid "" "The following three flags will force cc to check that " "your code complies to the relevant international standard, often referred to " "as the ANSI standard, though strictly speaking it is an " "ISO standard." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:922 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:925 msgid "" "Enable all the warnings which the authors of cc believe " "are worthwhile. Despite the name, it will not enable all the warnings " "cc is capable of." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:933 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:936 msgid "" "Turn off most, but not all, of the non-ANSI C features " "provided by cc. Despite the name, it does not guarantee " "strictly that your code will comply to the standard." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:945 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:948 msgid "" "Turn off all cc's non-ANSI C features." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:955 msgid "" "Without these flags, cc will allow you to use some of its " "non-standard extensions to the standard. Some of these are very useful, but " "will not work with other compilers—in fact, one of the main aims of the " "standard is to allow people to write code that will work with any compiler " "on any system. This is known as portable code." msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:963 msgid "" "Generally, you should try to make your code as portable as possible, as " "otherwise you may have to completely rewrite the program later to get it to " "work somewhere else—and who knows what you may be using in a few years time?" msgstr "" #. (itstool) path: informalexample/screen #: book.translate.xml:969 #, no-wrap msgid "" "% cc -Wall -ansi -pedantic -o foobar foobar.c" msgstr "" #. (itstool) path: sect1/para #: book.translate.xml:972 msgid "" "This will produce an executable foobar after checking " "foobar.c for standard compliance." msgstr "" #. (itstool) path: varlistentry/term #: book.translate.xml:978 msgid "" msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:981 msgid "Specify a function library to be used at link time." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:984 msgid "" "The most common example of this is when compiling a program that uses some " "of the mathematical functions in C. Unlike most other platforms, these are " "in a separate library from the standard C one and you have to tell the " "compiler to add it." msgstr "" #. (itstool) path: listitem/para #: book.translate.xml:990 msgid "" "The rule is that if the library is called " "libsomething.a, you give " "cc the argument . For example, the math library is libm.a, so you give cc the argument