summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-11-24 10:03:37 +0000
committerrillig <rillig@pkgsrc.org>2005-11-24 10:03:37 +0000
commit2330f610f920b52395d0816ecdbf28d8ede3b68a (patch)
tree349aee2dae694f9eb6b0b7c6788bd22a62ee93f6
parent428d5674d5c4f5624f5c5862dce6c16961d8eee4 (diff)
downloadpkgsrc-2330f610f920b52395d0816ecdbf28d8ede3b68a.tar.gz
Fixed the wording in the "CPP defines" section. Added more examples of
predefined CPP macros for some platforms.
-rw-r--r--doc/guide/files/fixes.xml34
1 files changed, 24 insertions, 10 deletions
diff --git a/doc/guide/files/fixes.xml b/doc/guide/files/fixes.xml
index e651f0e9774..8499f00add5 100644
--- a/doc/guide/files/fixes.xml
+++ b/doc/guide/files/fixes.xml
@@ -1,4 +1,4 @@
-<!-- $NetBSD: fixes.xml,v 1.40 2005/11/21 09:33:39 rillig Exp $ -->
+<!-- $NetBSD: fixes.xml,v 1.41 2005/11/24 10:03:37 rillig Exp $ -->
<chapter id="fixes"> <?dbhtml filename="fixes.html"?>
<title>Making your package work</title>
@@ -816,18 +816,19 @@
or <varname>#if defined(FOO)</varname>. Among these macros are
usually ones that describe the target CPU and operating system.
Depending of which of the macros are defined, you can write code
- that uses features unique to a specific platform. The best way to
- handle these differences is to use the GNU autotools (automake,
- autoconf, etc.) to check for specific features (like the existence
- of a header file, a function or a library).</para>
+ that uses features unique to a specific platform. Generally you
+ should rather use the GNU autotools (automake, autoconf, etc.) to
+ check for specific features (like the existence of a header file,
+ a function or a library), but sometimes this is not possible or
+ desired.</para>
- <para>If that is not possible you can use the predefined macros
+ <para>In that case you can use the predefined macros
below to configure your code to the platform it runs on. Almost
every operating system, hardware architecture and compiler has its
own macro. For example, if the macros <varname>__GNUC__</varname>,
<varname>__i386__</varname> and <varname>__NetBSD__</varname> are
- all defined, you know that you are using NetBSD on an Intel CPU,
- and your compiler is GCC.</para>
+ all defined, you know that you are using NetBSD on an i386
+ compatible CPU, and your compiler is GCC.</para>
<sect3 id="fixes-build-cpp-opsys">
<title>CPP defines for operating systems</title>
@@ -889,15 +890,28 @@
instead.</para>
<variablelist>
- <varlistentry><term>SunPro 5.7 + Solaris 8 + SPARC</term>
- <listitem><para>__SVR4, __sparc, __sun, __unix, sparc, sun,
+ <varlistentry><term>GCC 3.3.3 + SuSE Linux 9.1 + i386</term>
+ <listitem><para>__ELF__, __gnu_linux__, __i386, _i386__,
+ __linux, __linux__, __unix, __unix__, i386, linux,
unix.</para></listitem></varlistentry>
+ <varlistentry><term>GCC 2.95 + NetBSD 1.6.2 + i386</term>
+ <listitem><para>__ELF__, __NetBSD__, __i386, _i386__,
+ i386.</para></listitem></varlistentry>
+
+ <varlistentry><term>GCC 3.3.3 + NetBSD 2.0 + i386</term>
+ <listitem><para>__ELF__, __NetBSD__, __i386, _i386__,
+ i386.</para></listitem></varlistentry>
+
<varlistentry><term>GCC 4 + Solaris 8 + SPARC</term>
<listitem><para>__ELF__, __sparc, __sparc__, __sun, __sun__,
__SVR4, __svr4__, __unix, __unix__, sparc, sun,
unix.</para></listitem></varlistentry>
+ <varlistentry><term>SunPro 5.7 + Solaris 8 + SPARC</term>
+ <listitem><para>__SVR4, __sparc, __sun, __unix, sparc, sun,
+ unix.</para></listitem></varlistentry>
+
</variablelist>
</sect2>