Changed meson cross to meson native, fixed nothing but is for the better

This commit is contained in:
Zeckmathederg 2024-05-23 10:11:13 -06:00
parent 80bd8a3e88
commit 780ed6ec66
5 changed files with 10 additions and 88 deletions

View File

@ -20,6 +20,6 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="needml.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="achievingml.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgconf.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mesoncross.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mesonnative.xml"/>
</chapter>

View File

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="mesoncross" xreflabel="Meson Cross Toolchain File">
<?dbhtml filename="mesoncross.html"?>
<title>Meson Cross Toolchain File</title>
<para>
Most applications that rely on the <application>Meson</application>
build system have decent support for cross compilation, ie. compiling
32-bit binaries on a 64-bit system. It can be as easy as setting the
<envar>CC</envar>, <envar>CXX</envar>, and <envar>PKG_CONFIG_PATH
</envar> variables before using the <userinput>meson setup ..
</userinput> command to compile 32-bit binaries on a 64-bit system.
However, some projects are more complicated for many different
reasons, leading to the necessity of a <application>Meson
</application> cross toolchain file. It specifies the compilers,
options that should be invoked, the <application>pkg-conf</application>
binary (or rather symlink that uses a certain personality file) to use,
<command>llvm-config</command> to use, etc. This isn't required for
<xref linkend="steam"/> unless you want to install Mesa's NVK driver,
which isn't in the book at the moment. It is needed for Gstreamer which
is a recommended dependency of <xref linkend="wine"/>.
</para>
<para>
The instructions below will show how to create and use the file if
necessary.
</para>
<sect2 role="installation">
<title>Creating the Cross Toolchain File</title>
<para>
Create the following toolchain file by running the following
commands as the <systemitem class="username">root</systemitem>
user:
</para>
<screen role="root"><userinput>mkdir -v /usr/share/meson/cross
cat &gt; /usr/share/meson/cross/lib32 &lt;&lt; "EOF"
<literal>[binaries]
c = ['gcc', '-m32']
cpp = ['g++', '-m32']
rust = ['rustc', '--target', 'i686-unknown-linux-gnu']
pkg-config = 'i686-pc-linux-gnu-pkg-config'
cups-config = 'cups-config'
llvm-config = 'llvm-config32'
strip = 'strip'
[built-in options]
libdir = 'lib32'
[host_machine]
system = 'linux'
subsystem = 'linux'
kernel = 'linux'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'</literal>
EOF</userinput></screen>
</sect2>
<sect2>
<title>How to Use the File</title>
<para>
Instead of setting environment variables before invoking
<userinput>meson setup ..</userinput>, you can simply do:
</para>
<screen><userinput>meson setup .. --cross-file lib32 &lt;other-options&gt;</userinput></screen>
</sect2>
</sect1>

View File

@ -117,7 +117,7 @@
<xref linkend="rust"/>, <xref linkend="cbindgen"/>, and
<xref linkend="rust-bindgen"/> (required for NVK),
<xref linkend="mesoncross"/> (required for multilib lib32-NVK),
<xref linkend="mesonnative"/> (required for multilib lib32-NVK),
Wayland-Protocols (required for
KDE Plasma,
@ -385,7 +385,7 @@ ldconfig</userinput></screen>
</para>
<screen><userinput>meson setup \
--cross-file lib32 \
--native-file x86 \
--prefix=$XORG_PREFIX \
--libdir=$XORG_PREFIX/lib32 \
--buildtype=release \

View File

@ -265,6 +265,8 @@ ln -svfn rustc-&rust-version; /opt/rustc</userinput></screen>
change-id = 121754
[llvm]
targets = "X86"
# When using system llvm prefer shared libraries
link-shared = true
@ -317,8 +319,10 @@ llvm-config = "/usr/bin/llvm-config"
[target.i686-unknown-linux-gnu]
#Uncomment the following line if x86/i686 is the native architecture.
#llvm-config = "/usr/bin/llvm-config"
#Uncomment the following line if you are doing multilib.
#llvm-config = "/usr/bin/llvm-config32"</literal>
#Uncomment the following lines if you are doing multilib.
#llvm-config = "/usr/bin/llvm-config32"
#linker = ["/usr/bin/gcc", "-m32"]</literal>
EOF</userinput></screen>
<note>

View File

@ -83,7 +83,7 @@
recommended dependencies. If you are on multilib and want a 32-bit or WoW64
build, you must install 32-bit variants of the dependencies if they provide
a library, and when compiling gstreamer, use the cross file from
<xref linkend="mesoncross"/>. Do this this for the Base and
<xref linkend="mesonnative"/>. Do this this for the Base and
Good plugins as well),
OSMesa from <xref linkend="mesa"/> (compiled using the <parameter>
-Dosmesa=true</parameter> option),