⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.10
Server IP:
157.245.101.34
Server:
Linux skvinfotech-website 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
libglib2.0-doc
/
glib
/
View File Name :
glib-building.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Compiling the GLib package: GLib Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="GLib Reference Manual"> <link rel="up" href="glib.html" title="GLib Overview"> <link rel="prev" href="glib.html" title="GLib Overview"> <link rel="next" href="glib-cross-compiling.html" title="Cross-compiling the GLib package"> <meta name="generator" content="GTK-Doc V1.32 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"></td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="glib.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="glib.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="glib-cross-compiling.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="glib-building"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle">Compiling the GLib package</span></h2> <p>Compiling the GLib Package — How to compile GLib itself</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="building"></a><h2>Building the Library on UNIX</h2> <p> On UNIX, GLib uses the standard <span class="application">Meson</span> build system. The normal sequence for compiling and installing the GLib library is thus: </p> <div class="literallayout"><p><br> <strong class="userinput"><code>meson _build</code></strong><br> <strong class="userinput"><code>ninja -C _build</code></strong><br> <strong class="userinput"><code>ninja -C _build install</code></strong><br> </p></div> <p> On FreeBSD: </p> <div class="literallayout"><p><br> <strong class="userinput"><code>env CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib -Wl,--disable-new-dtags" meson -Dxattr=false -Dinstalled_tests=true -Diconv=external -Db_lundef=false _build</code></strong><br> <strong class="userinput"><code>ninja -C _build</code></strong><br> </p></div> <p> </p> <p> The standard options provided by <span class="application">Meson</span> may be passed to the <span class="command"><strong>meson</strong></span> command. Please see the <span class="application">Meson</span> documentation or run <span class="command"><strong>meson configure --help</strong></span> for information about the standard options. </p> <p> GLib is compiled with <a class="ulink" href="https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fstrict-aliasing" target="_top">strict aliasing</a> disabled. It is strongly recommended that this is not re-enabled by overriding the compiler flags, as GLib has not been tested with strict aliasing and cannot be guaranteed to work. </p> <p> The GTK+ documentation contains <a class="ulink" href="https://developer.gnome.org/gtk3/stable/gtk-building.html" target="_top">further details</a> about the build process and ways to influence it. </p> </div> <div class="refsect1"> <a name="dependencies"></a><h2>Dependencies</h2> <p> Before you can compile the GLib library, you need to have various other tools and libraries installed on your system. If you are building from a release archive, you will need <a class="ulink" href="https://wiki.gnome.org/Projects/GLib/CompilerRequirements" target="_top">a compliant C toolchain</a>, <span class="application">Meson</span>, and <span class="application">pkg-config</span>; the requirements are the same when building from a Git repository clone of GLib. </p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> <a class="ulink" href="https://www.freedesktop.org/wiki/Software/pkg-config/" target="_top">pkg-config</a> is a tool for tracking the compilation flags needed for libraries that are used by the GLib library. (For each library, a small <code class="literal">.pc</code> text file is installed in a standard location that contains the compilation flags needed for that library along with version number information). </p></li></ul></div> <p> A UNIX build of GLib requires that the system implements at least the original 1990 version of POSIX. Beyond this, it depends on a number of other libraries. </p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> <p> The <a class="ulink" href="http://www.gnu.org/software/libiconv/" target="_top">GNU libiconv library</a> is needed to build GLib if your system doesn't have the <code class="function">iconv()</code> function for doing conversion between character encodings. Most modern systems should have <code class="function">iconv()</code>, however many older systems lack an <code class="function">iconv()</code> implementation. On such systems, you must install the libiconv library. This can be found at: <a class="ulink" href="http://www.gnu.org/software/libiconv" target="_top">http://www.gnu.org/software/libiconv</a>. </p> <p> If your system has an <code class="function">iconv()</code> implementation but you want to use libiconv instead, you can pass the <code class="option">-Diconv=gnu</code> option to <span class="command"><strong>meson</strong></span>. This forces libiconv to be used. </p> <p> Note that if you have libiconv installed in your default include search path (for instance, in <code class="filename">/usr/local/</code>), but don't enable it, you will get an error while compiling GLib because the <code class="filename">iconv.h</code> that libiconv installs hides the system iconv. </p> <p> If you are using the native iconv implementation on Solaris instead of libiconv, you'll need to make sure that you have the converters between locale encodings and UTF-8 installed. At a minimum you'll need the SUNWuiu8 package. You probably should also install the SUNWciu8, SUNWhiu8, SUNWjiu8, and SUNWkiu8 packages. </p> <p> The native iconv on Compaq Tru64 doesn't contain support for UTF-8, so you'll need to use GNU libiconv instead. (When using GNU libiconv for GLib, you'll need to use GNU libiconv for GNU gettext as well.) This probably applies to related operating systems as well. </p> </li> <li class="listitem"><p> Python 3.5 or newer is required. Your system Python must conform to <a class="ulink" href="https://www.python.org/dev/peps/pep-0394/" target="_top">PEP 394 </a> For FreeBSD, this means that the <code class="literal">lang/python3</code> port must be installed. </p></li> <li class="listitem"><p> The libintl library from the <a class="ulink" href="http://www.gnu.org/software/gettext" target="_top">GNU gettext package</a> is needed if your system doesn't have the <code class="function">gettext()</code> functionality for handling message translation databases. </p></li> <li class="listitem"><p> A thread implementation is needed. The thread support in GLib can be based upon POSIX threads or win32 threads. </p></li> <li class="listitem"><p> GRegex uses the <a class="ulink" href="http://www.pcre.org/" target="_top">PCRE library</a> for regular expression matching. The default is to use the system version of PCRE, to reduce the chances of security fixes going out of sync. GLib additionally provides an internal copy of PCRE in case the system version is too old, or does not support UTF-8; the internal copy is patched to use GLib for memory management and to share the same Unicode tables. </p></li> <li class="listitem"><p> The optional extended attribute support in GIO requires the <code class="function">getxattr()</code> family of functions that may be provided by the C library or by the standalone libattr library. To build GLib without extended attribute support, use the <code class="option">-Dxattr=false</code> option. </p></li> <li class="listitem"><p> The optional SELinux support in GIO requires libselinux. To build GLib without SELinux support, use the <code class="option">-Dselinux=disabled</code> option. </p></li> <li class="listitem"><p> The optional support for DTrace requires the <code class="filename">sys/sdt.h</code> header, which is provided by SystemTap on Linux. To build GLib without DTrace, use the <code class="option">-Ddtrace=false</code> option. </p></li> <li class="listitem"><p> The optional support for <a class="ulink" href="http://sourceware.org/systemtap/" target="_top">SystemTap</a> can be disabled with the <code class="option">-Dsystemtap=false</code> option. Additionally, you can control the location where GLib installs the SystemTap probes, using the <code class="option">-Dtapset_install_dir=DIR</code> option. </p></li> </ul></div> </div> <div class="refsect1"> <a name="extra-configuration-options"></a><h2>Extra Configuration Options</h2> <p> In addition to the normal options, these additional ones are supported when configuring the GLib library: </p> <p><b><code class="option">--buildtype</code>. </b> This is a standard <span class="application">Meson</span> option which specifies how much debugging and optimization to enable. If the build type starts with <code class="literal">debug</code>, <code class="literal">G_ENABLE_DEBUG</code> will be defined and GLib will be built with additional debug code enabled. </p> <p><b><code class="option">-Dforce_posix_threads=true</code>. </b> Normally, <span class="application">Meson</span> should be able to work out the correct thread implementation to use. This option forces POSIX threads to be used even if the platform provides another threading API (for example, on Windows). </p> <p><b><code class="option">-Dinternal_pcre=true</code>. </b> Normally, GLib will be configured to use the system-supplied PCRE library if it is suitable, falling back to an internal version otherwise. If this option is specified, the internal version will always be used. Using the internal PCRE is the preferred solution if: </p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p> your system has strict resource constraints; the system-supplied PCRE has a separated copy of the tables used for Unicode handling, whereas the internal copy shares the Unicode tables used by GLib. </p></li> <li class="listitem"><p> your system has PCRE built without some needed features, such as UTF-8 and Unicode support. </p></li> <li class="listitem"><p> you are planning to use both GRegex and PCRE API at the same time, either directly or indirectly through a dependency; PCRE uses some global variables for memory management and other features, and if both GLib and PCRE try to access them at the same time, this could lead to undefined behavior. </p></li> </ul></div> <p> </p> <p><b><code class="option">-Dbsymbolic_functions=false</code> and <code class="option">-Dbsymbolic_functions=true</code>. </b> By default, GLib uses the <code class="option">-Bsymbolic-functions</code> linker flag to avoid intra-library PLT jumps. A side-effect of this is that it is no longer possible to override internal uses of GLib functions with <code class="envar">LD_PRELOAD</code>. Therefore, it may make sense to turn this feature off in some situations. The <code class="option">-Dbsymbolic_functions=false</code> option allows to do that. </p> <p><b><code class="option">-Dgtk_doc=false</code> and <code class="option">-Dgtk_doc=true</code>. </b> By default, GLib will detect whether the <span class="application">gtk-doc</span> package is installed. If it is, then it will use it to extract and build the documentation for the GLib library. These options can be used to explicitly control whether <span class="application">gtk-doc</span> should be used or not. If it is not used, the distributed, pre-generated HTML files will be installed instead of building them on your machine. </p> <p><b><code class="option">-Dman=false</code> and <code class="option">-Dman=true</code>. </b> By default, GLib will detect whether <span class="application">xsltproc</span> and the necessary DocBook stylesheets are installed. If they are, then it will use them to rebuild the included man pages from the XML sources. These options can be used to explicitly control whether man pages should be rebuilt used or not. The distribution includes pre-generated man pages. </p> <p><b><code class="option">-Dxattr=false</code> and <code class="option">-Dxattr=true</code>. </b> By default, GLib will detect whether the <code class="function">getxattr()</code> family of functions is available. If it is, then extended attribute support will be included in GIO. These options can be used to explicitly control whether extended attribute support should be included or not. <code class="function">getxattr()</code> and friends can be provided by glibc or by the standalone libattr library. </p> <p><b><code class="option">-Dselinux=auto</code>, <code class="option">-Dselinux=enabled</code> or <code class="option">-Dselinux=disabled</code>. </b> By default, GLib will detect if libselinux is available and include SELinux support in GIO if it is. These options can be used to explicitly control whether SELinux support should be included. </p> <p><b><code class="option">-Ddtrace=false</code> and <code class="option">-Ddtrace=true</code>. </b> By default, GLib will detect if DTrace support is available, and use it. These options can be used to explicitly control whether DTrace support is compiled into GLib. </p> <p><b><code class="option">-Dsystemtap=false</code> and <code class="option">-Dsystemtap=true</code>. </b> This option requires DTrace support. If it is available, then GLib will also check for the presence of SystemTap. </p> <p><b><code class="option">-Db_coverage=true</code> and <code class="option">-Db_coverage=false</code>. </b> Enable the generation of coverage reports for the GLib tests. This requires the lcov frontend to gcov from the <a class="ulink" href="http://ltp.sourceforge.net" target="_top">Linux Test Project</a>. To generate a coverage report, use <span class="command"><strong>ninja coverage-html</strong></span>. The report is placed in the <code class="filename">meson-logs</code> directory. </p> <p><b><code class="option">-Druntime_libdir=RELPATH</code>. </b> Allows specifying a relative path to where to install the runtime libraries (meaning library files used for running, not developing, GLib applications). This can be used in operating system setups where programs using GLib needs to run before e.g. <code class="filename">/usr</code> is mounted. For example, if <code class="varname">LIBDIR</code> is <code class="filename">/usr/lib</code> and <code class="filename">../../lib</code> is passed to <code class="option">-Druntime_libdir</code> then the runtime libraries are installed into <code class="filename">/lib</code> rather than <code class="filename">/usr/lib</code>. </p> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.32</div> </body> </html>