-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathporting-guide.html
More file actions
139 lines (137 loc) · 8.24 KB
/
porting-guide.html
File metadata and controls
139 lines (137 loc) · 8.24 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JACK-AUDIO-CONNECTION-KIT: Porting JACK</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JACK-AUDIO-CONNECTION-KIT
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">Porting JACK </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The <a class="el" href="index.html">JACK Audio Connection Kit</a> is designed to be portable to any system supporting the relevant POSIX and C language standards. It currently works with GNU/Linux and Mac OS X on several different processor architectures. This document describes the steps needed to port JACK to another platform, and the methods used to provide portability.</p>
<ul>
<li><a class="el" href="porting-guide.html#portrequirements">Requirements</a></li>
<li><a class="el" href="porting-guide.html#portoverview">Overview</a></li>
<li><a class="el" href="porting-guide.html#portopsys">Operating System Dependencies</a></li>
<li>portcpu</li>
<li><a class="el" href="porting-guide.html#portissues">Issues Not Addressed</a></li>
</ul>
<h1><a class="anchor" id="portrequirements"></a>
Requirements</h1>
<ul>
<li>Each platform should build directly from CVS or from a tarball using the GNU <code></code>./configure tools. Platform-specific toolsets can by used for development, but the GNU tools should at least work for basic distribution and configuration.</li>
<li>For long-term maintainability we want to minimize the use of conditional compilation in source files.</li>
<li>We should provide generic versions of all system-dependent headers, so platforms need only provide those they modify.</li>
<li>In some cases, operating system-specific information must be able to override processor-specific data.</li>
</ul>
<h1><a class="anchor" id="portoverview"></a>
Overview</h1>
<p>JACK relies on two types of platform-specific headers:</p>
<ul>
<li><a class="el" href="porting-guide.html#portopsys">Operating System Dependencies</a></li>
<li>portcpu</li>
</ul>
<p>OS-specific headers take precedence over CPU-specific headers.</p>
<p>The JACK <code>configure.host</code> script and its system-dependent header directories were adapted from the <code>libstdc++-v3</code> component of the GNU Compiler Collective, <a href="http://gcc.gnu.org">http://gcc.gnu.org</a>.</p>
<h1><a class="anchor" id="portlang"></a>
C Language Dependencies</h1>
<p>JACK is written to conform with C99, as defined in International Standard ISO/IEC 9899:1999. Because many existing compilers do not fully support this standard, some new features should be avoided for portablility reasons. For example, variables should not be declared in the middle of a compound statement, because many compilers still cannot handle that language extension.</p>
<h1><a class="anchor" id="portopsys"></a>
Operating System Dependencies</h1>
<p>JACK is written for a POSIX environment compliant with IEEE Std 1003.1-2001, ISO/IEC 9945:2003, including the POSIX Threads Extension (1003.1c-1995) and the Realtime and Realtime Threads feature groups. When some needed POSIX feature is missing on a platform, the preferred solution is to provide a substitute, as with the <code>fakepoll.c</code> implementation for Mac OS X.</p>
<p>Whenever possible, OS dependencies should be auto-detected by <code>configure</code>. Sometimes they can be isolated in OS-specific header files, found in subdirectories of <code>config/os</code> and referenced with a <code><sysdeps/xxx.h></code> name.</p>
<p>If conditional compilation must be used in mainline platform-independent code, avoid using the system name. Instead, <code>#define</code> a descriptive name in <code><config.h></code>, and test it like this:</p>
<div class="fragment"><div class="line">\#ifdef JACK_USE_MACH_THREADS</div>
<div class="line"> allocate_mach_serverport(engine, client);</div>
<div class="line"> client->running = FALSE;</div>
<div class="line">\#endif</div>
</div><!-- fragment --><p>Be sure to place any generic implementation alternative in the <code>#else</code> or use an <code>#ifndef</code>, so no other code needs to know your conditional labels.</p>
<h1><a class="anchor" id="portissues"></a>
Issues Not Addressed</h1>
<ul>
<li>Cross-compilation has not been tested, or even thought through in much detail. The <em>host</em> is the system on which JACK will run. This may differ from the <em>build</em> system doing the compilation. These are selected using the standard <code></code>./configure options <code>–host</code> and <code>–build</code>. Usually, <code></code>./config.guess can print the appropriate canonical name for any system on which it runs.</li>
<li>Platform-specific build tools like Apple's Project Builder are not well-supported. </li>
</ul>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>