File: ligcc-howto.html

package info (click to toggle)
listaller 0.5.9-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,096 kB
  • ctags: 1,611
  • sloc: xml: 11,195; ansic: 2,298; sh: 1,648; perl: 1,452; cpp: 1,289; java: 157; makefile: 134; cs: 48; python: 24
file content (49 lines) | stat: -rw-r--r-- 8,978 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>3.2.2. How to use ligcc?</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Listaller-Listaller-0.5.8-en-US-1-0" /><link rel="home" href="index.html" title="Listaller" /><link rel="up" href="sect-Listaller-App-Development-Ligcc.html" title="3.2. The Ligcc tools" /><link rel="prev" href="sect-Listaller-App-Development-Ligcc.html" title="3.2. The Ligcc tools" /><link rel="next" href="sect-Listaller-App-Development-RelayTool.html" title="3.3. Relaytool" /></head><body><p id="title"><a class="left" href="http://listaller.tenstral.net"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://listaller.tenstral.net/docs"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Listaller-App-Development-Ligcc.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="sect-Listaller-App-Development-RelayTool.html"><strong>Next</strong></a></li></ul><div class="section" id="ligcc-howto"><div class="titlepage"><div><div><h3 class="title" id="ligcc-howto">3.2.2. How to use ligcc?</h3></div></div></div><div class="para">
			Use ligcc just like how you use gcc:
		</div><div class="example"><h6>Example 3.1. Using ligcc</h6><div class="example-contents"><pre class="screen">
				[earth@sun] ligcc foo.c -o foo
				[earth@sun] lig++ bar.cpp -o bar
</pre></div></div><br class="example-break" /><div class="para">
			Recommended way:
		</div><pre class="programlisting">
<span class="perl_Reserved">export</span> <span class="perl_Others">CC=</span>ligcc
<span class="perl_Others">export</span> <span class="perl_Others">CXX=</span>lig++
./configure
<span class="perl_BString">make</span>
</pre><div class="para">
			or
		</div><pre class="programlisting"><span class="perl_BString">make</span> <span class="perl_Others">CC=</span>ligcc <span class="perl_Others">CXX=</span>lig++</pre><div class="para">
			There are several environment variables that change ligcc's behavior:
		</div><div class="variablelist"><h6>ligcc environment variables</h6><dl><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_PATH</code></span></dt><dd><div class="para">
						Use this as the include dir for the ligcc headers. Default value: <code class="filename">$PREFIX/include/libuild</code> (where <code class="filename">$PREFIX</code> is the prefix in which libuild is installed)
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_CC</code></span></dt><dd><div class="para">
						Use the specified C compiler. Default value: <code class="command">gcc</code>
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_CXX1</code></span></dt><dd><div class="para">
						Use the specified C++ compiler. Default value: <code class="command">g++</code>
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_STATIC_X</code></span></dt><dd><div class="para">
						If set to 1, then libuild will statically link some X extension libraries.
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_BOGUS_DEPS</code></span></dt><dd><div class="para">
						Specify a list of whitespace-seperated bogus library dependencies (like: X11 ICE png). These libraries will not be linked against. This option is useful if you want to specify bogus dependencies manually because the automatic bogus dependency stripper doesn't work correctly for your project (see below).
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_DISABLE_BOGUS_DETECTOR</code></span></dt><dd><div class="para">
						If set to 1, disables the automatic bogus dependency stripper. This is useful when linking to libraries don't have correct <code class="literal">DT_NEEDED</code> entries, like GTK 1.2. GTK 1.2 uses <code class="filename">libX11.so</code> internally, but it's not linked with <strong class="userinput"><code>-lX11</code></strong>. Instead, <code class="command">gtk-config –libs</code> returns <strong class="userinput"><code>-lgtk -lX11</code></strong> or something. If your app doesn't use xlib internally, then our bogus dependency stripper will strip the <strong class="userinput"><code>-lX11</code></strong> argument. Linking will then fail.
					</div><div class="para">
						The built-in bogus dependency stripper is not used if you have a recent version of binutils, which supports <code class="command">ld –as-needed</code> (it'll use binutil's native support for bogus dependency stripping instead). So you should get use a recent version of binutils if your ld doesn't already support that argument.
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_NOT_BOGUS</code></span></dt><dd><div class="para">
						If you want to use the automatic bogus dependency dectector anyway (using <code class="command">ld –asneeded</code>), then you can specify a list of dependencies here that are not bogus with this environment variable. Example:
					</div><pre class="programlisting"><span class="perl_Reserved">export</span> <span class="perl_Others">LIBUILD_NOT_BOGUS=</span><span class="perl_String">"X11 ICE png"</span></pre></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_STATIC</code></span></dt><dd><div class="para">
						Specify a list of whitespace-seperated libraries to statically link to (like: <strong class="userinput"><code>popt z</code></strong>). You can also explicitly specify a filename to the static library. Examples:
					</div><pre class="programlisting">
<span class="perl_Reserved">export</span> <span class="perl_Others">LIBUILD_STATIC=</span><span class="perl_String">"popt z"</span>
<span class="perl_Others">export</span> <span class="perl_Others">LIBUILD_STATIC=</span><span class="perl_String">"popt=/usr/lib/libpopt.a"</span>
</pre></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_STATIC_LIBGCC</code></span></dt><dd><div class="para">
						If set to 1, link all binaries with <strong class="userinput"><code>-static-libgcc</code></strong>. See the gcc.metainfo.page for more info about this option.
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_PROJECTNAME</code></span></dt><dd><div class="para">
						If non-empty, ligcc will add <code class="filename">$ORIGIN/../lib/$LIBUILD_PROJECTNAME</code> to the library search path.
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_INCLUDE</code></span></dt><dd><div class="para">
						Prepend the specified directory to the compiler's header search path. The compiler will search this directory first, before searching any other directory. This is useful in combination with the older GTK headers package. You can specify multiple directories, seperated by a <strong class="userinput"><code>:</code></strong>, just like the <code class="filename">$PATH</code> environment variable. If the order of the -I flags is important for your application, you can replace paths by using <strong class="userinput"><code>/old/path=/new/path</code></strong>.
					</div></dd><dt class="varlistentry"><span class="term"><code class="literal">LIBUILD_RESOLVE_LIBPATH</code></span></dt><dd><div class="para">
						A space-seperated list of (Perl) regular expressions which specify the libraries whose path must be resolved into absolute paths.
					</div><div class="para">
						Internally, ligcc reorders the linking arguments that are to be passed to gcc (for various reasons). This can cause problems when linking certain static libraries (for example, static WxWidgets libraries). But that can be worked around by using full path names for static libraries (e.g. turning <strong class="userinput"><code>-lfoo</code></strong> parameters into <code class="filename">/usr/lib/full-path-to/foo.a</code>).
					</div></dd></dl></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="sect-Listaller-App-Development-Ligcc.html"><strong>Prev</strong>3.2. The Ligcc tools</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="sect-Listaller-App-Development-RelayTool.html"><strong>Next</strong>3.3. Relaytool</a></li></ul></body></html>