| 1 |
# MODIFIED |
| 2 |
|
| 3 |
this is a modified version of macports-legacy-support which removes APSL-licensed files. |
| 4 |
|
| 5 |
# MacPorts Support for Legacy OSX Versions |
| 6 |
|
| 7 |
Installs wrapper headers and library functions that add common |
| 8 |
functions missing in various older OSX releases to bring them |
| 9 |
approximately up to current expected standards. |
| 10 |
|
| 11 |
Three different libraries are provided |
| 12 |
|
| 13 |
- libMacportsLegacySupport.a - A static library with the missing functions for the given OS. |
| 14 |
- libMacportsLegacySupport.dylib - A dynamic library with the missing functions for the given OS. |
| 15 |
- libMacportsLegacySystem.B.dylib - Similar to libMacportsLegacySupport.dylib but in addition re-exports the symbols from libSystem.B.dylib. |
| 16 |
|
| 17 |
To use this library within [MacPorts](https://github.com/macports) |
| 18 |
add the `legacysupport` PortGroup to the Portfile. This will add the |
| 19 |
required include paths and libraries to allow the library to do it's |
| 20 |
magic with most build systems. |
| 21 |
|
| 22 |
Wrapped headers and replaced functions are: |
| 23 |
|
| 24 |
<table> |
| 25 |
<tr> |
| 26 |
<th>Header File</th> |
| 27 |
<th>Feature</th> |
| 28 |
<th>Max Version Needing Feature</th> |
| 29 |
</tr> |
| 30 |
<tr> |
| 31 |
<td><code>assert.h</code></td> |
| 32 |
<td>Adds C11 <code>static_assert</code> definition</td> |
| 33 |
<td>OSX10.10</td> |
| 34 |
</tr> |
| 35 |
<tr> |
| 36 |
<td><code>cmath</code></td> |
| 37 |
<td>Adds the same functions as those provided by the herein <code>math.h</code>, |
| 38 |
in namespace <code>std::</code>.</td> |
| 39 |
<td>see <code>math.h</code></td> |
| 40 |
</tr> |
| 41 |
<tr> |
| 42 |
<td><code>copyfile.h</code></td> |
| 43 |
<td>Wraps <code>copyfile_state_get</code> to support <code>COPYFILE_STATE_COPIED</code></td> |
| 44 |
<td>OSX10.5</td> |
| 45 |
</tr> |
| 46 |
<tr> |
| 47 |
<td><code>dirent.h</code></td> |
| 48 |
<td>Adds <code>fdopendir</code> function. |
| 49 |
<td>OSX10.9</td> |
| 50 |
</tr> |
| 51 |
<tr> |
| 52 |
<td><code>os/lock.h</code></td> |
| 53 |
<td>Adds <code>os_unfair_lock_lock</code>, <code>os_unfair_lock_trylock</code>, and <code>os_unfair_lock_unlock</code> functions</td> |
| 54 |
<td>OSX10.11</td> |
| 55 |
</tr> |
| 56 |
<tr> |
| 57 |
<td><code>math.h</code></td> |
| 58 |
<td>Adds declaration of various <code>long long</code> methods (OSX10.6) and <code>__sincos</code> (macOS10.8)</td> |
| 59 |
<td>OSX10.6(8), GCC 8</td> |
| 60 |
</tr> |
| 61 |
<tr> |
| 62 |
<td><code>netdb.h</code></td> |
| 63 |
<td>Adds declaration of <code>AI_NUMERICSERV</code></td> |
| 64 |
<td>OSX10.5</td> |
| 65 |
</tr> |
| 66 |
<tr> |
| 67 |
<td rowspan="2"><code>pthread.h</code></td> |
| 68 |
<td>Adds <code>PTHREAD_RWLOCK_INITIALIZER</code></td> |
| 69 |
<td>OSX10.4</td> |
| 70 |
</tr> |
| 71 |
<tr> |
| 72 |
<td>Adds <code>pthread_setname_np</code> function</td> |
| 73 |
<td>OSX10.5</td> |
| 74 |
</tr> |
| 75 |
<tr> |
| 76 |
<td><code>stdio.h</code></td> |
| 77 |
<td>Adds <code>dprintf</code>, <code>getline</code>, <code>getdelim</code>, |
| 78 |
<code>open_memstream</code>, and <code>fmemopen</code> functions</td> |
| 79 |
<td>OSX10.6, OSX10.12 (open_memstream)</td> |
| 80 |
</tr> |
| 81 |
<tr> |
| 82 |
<td rowspan="2"><code>stdlib.h</code></td> |
| 83 |
<td>Adds <code>posix_memalign</code> functional replacement, and wraps <code>realpath</code> |
| 84 |
to accept a <code>NULL</code> buffer argument</td> |
| 85 |
<td>OSX10.5</td> |
| 86 |
</tr> |
| 87 |
<tr> |
| 88 |
<td>Adds <code>arc4random_uniform</code> and <code>arc4random_buf</code> functions</td> |
| 89 |
<td>OSX10.6</td> |
| 90 |
</tr> |
| 91 |
<tr> |
| 92 |
<td><code>string.h</code></td> |
| 93 |
<td>Adds <code>stpncpy</code>, <code>strnlen</code>, <code>strndup</code> and <code>memmem</code> functions</td> |
| 94 |
<td>OSX10.6</td> |
| 95 |
</tr> |
| 96 |
<tr> |
| 97 |
<td><code>strings.h</code></td> |
| 98 |
<td>Adds <code>fls,flsl,ffsl</code>(OSX10.4) and <code>flsll,ffsll</code>(macOS10.8) functions</td> |
| 99 |
<td>OSX10.4(8)</td> |
| 100 |
</tr> |
| 101 |
<tr> |
| 102 |
<td><code>time.h</code></td> |
| 103 |
<td>Adds functions <code>clock_gettime</code>(macOS10.11) and <code>timespec_get</code>(macOS10.14). Defines <code>TIME_UTC</code> (macOS10.14). Declares <code>asctime_r</code>, <code>ctime_r</code>, <code>gmtime_r</code>, and <code>localtime_r</code> functions that are otherwise hidden in the presence of <code>_ANSI_SOURCE</code>, <code>_POSIX_C_SOURCE</code>, or <code>_XOPEN_SOURCE</code> (OSX10.4)</td> |
| 104 |
<td>OSX10.4(11,14)</td> |
| 105 |
</tr> |
| 106 |
<tr> |
| 107 |
<td><code>wchar.h</code></td> |
| 108 |
<td>Adds <code>wcsdup</code>, <code>wcsnlen</code>, <code>wcpcpy</code>, |
| 109 |
<code>wcpncpy</code>, <code>wcscasecmp</code>, and <code>wcsncasecmp</code> |
| 110 |
functions</td> |
| 111 |
<td>OSX10.6</td> |
| 112 |
</tr> |
| 113 |
<tr> |
| 114 |
<td><code>mach/machine.h</code></td> |
| 115 |
<td>Adds missing machine definitions</td> |
| 116 |
<td>OSX10.13</td> |
| 117 |
</tr> |
| 118 |
<tr> |
| 119 |
<td><code>net/if.h</code></td> |
| 120 |
<td>Adds include <code>sys/socket.h</code>, expected on current macOS systems</td> |
| 121 |
<td>OSX10.8</td> |
| 122 |
</tr> |
| 123 |
<tr> |
| 124 |
<td><code>xlocale/_wchar.h</code></td> |
| 125 |
<td>Adds <code>wcscasecmp_l</code>, <code>wcsncasecmp_l</code> functions</td> |
| 126 |
<td>OSX10.6</td> |
| 127 |
</tr> |
| 128 |
<tr> |
| 129 |
<td><code>sys/aio.h</code></td> |
| 130 |
<td>Adjusts includes and defines to match SDK 10.5+</td> |
| 131 |
<td>OSX10.4</td> |
| 132 |
</tr> |
| 133 |
<tr> |
| 134 |
<td rowspan="2"><code>sys/fcntl.h</code></td> |
| 135 |
<td>Adds missing <code>O_CLOEXEC</code>, <code>AT_FDCWD</code>, <code>AT_EACCESS</code>, |
| 136 |
<code>AT_SYMLINK_NOFOLLOW</code>, <code>AT_SYMLINK_FOLLOW</code>, and |
| 137 |
<code>AT_REMOVEDIR</code> definitions</td> |
| 138 |
<td>as required (?)</td> |
| 139 |
</tr> |
| 140 |
<tr> |
| 141 |
<td>Adds <code>openat</code> function</td> |
| 142 |
<td>OSX10.9</td> |
| 143 |
</tr> |
| 144 |
<tr> |
| 145 |
<td><code>sys/fsgetpath.h</code></td> |
| 146 |
<td>Adds missing <code>utimensat</code>, <code>fsgetpath</code> and <code>setattrlistat</code> functions</td> |
| 147 |
<td>OSX10.12</td> |
| 148 |
</tr> |
| 149 |
<tr> |
| 150 |
<td><code>sys/mman.h</code></td> |
| 151 |
<td>Adds missing <code>MAP_ANONYMOUS</code> definition</td> |
| 152 |
<td>OSX10.10</td> |
| 153 |
</tr> |
| 154 |
<tr> |
| 155 |
<td><code>sys/stdio.h</code></td> |
| 156 |
<td>Adds <code>renameat</code> function</td> |
| 157 |
<td>OSX10.9</td> |
| 158 |
</tr> |
| 159 |
<tr> |
| 160 |
<td rowspan="2"><code>sys/stat.h</code></td> |
| 161 |
<td>Adds <code>fchmodat</code>, <code>fstatat</code>, <code>fstatat64</code> (if required, and on 10.5+), |
| 162 |
and <code>mkdirat</code> functions</td> |
| 163 |
<td>OSX10.9</td> |
| 164 |
</tr> |
| 165 |
<tr> |
| 166 |
<td>Adds <code>lchmod</code> function</td> |
| 167 |
<td>OSX10.4</td> |
| 168 |
</tr> |
| 169 |
<tr> |
| 170 |
<td><code>sys/random.h</code></td> |
| 171 |
<td>Adds <code>getentropy</code> function</td> |
| 172 |
<td>OSX10.11</td> |
| 173 |
</tr> |
| 174 |
<tr> |
| 175 |
<td><code>sys/socket.h</code></td> |
| 176 |
<td>Corrects <code>CMSG_DATA</code> definition</td> |
| 177 |
<td>OSX10.5</td> |
| 178 |
</tr> |
| 179 |
<tr> |
| 180 |
<td><code>sys/time.h</code></td> |
| 181 |
<td>Adds <code>lutimes</code> function</td> |
| 182 |
<td>OSX10.4</td> |
| 183 |
</tr> |
| 184 |
<tr> |
| 185 |
<td><code>sys/types.h</code></td> |
| 186 |
<td>Adds definitions for <code>u_char</code>, <code>u_short</code>, <code>u_int</code>, <code>u_long</code>, <code>ushort</code>, and <code>uint</code> types that can be exposed via <code>_DARWIN_C_SOURCE</code></td> |
| 187 |
<td>OSX10.4</td> |
| 188 |
</tr> |
| 189 |
<tr> |
| 190 |
<td rowspan="3"><code>sys/unistd.h</code></td> |
| 191 |
<td>Adds <code>getattrlistat</code>, <code>readlinkat</code>, <code>faccessat</code>, |
| 192 |
<code>fchownat</code>, <code>linkat</code>, <code>symlinkat</code>, |
| 193 |
and <code>unlinkat</code> functions</td> |
| 194 |
<td>OSX10.9</td> |
| 195 |
</tr> |
| 196 |
<tr> |
| 197 |
<td>Wraps <code>sysconf</code> to support <code>_SC_NPROCESSORS_CONF</code> and |
| 198 |
<code>_SC_NPROCESSORS_ONLN</code></td> |
| 199 |
<td>OSX10.4</td> |
| 200 |
</tr> |
| 201 |
<tr> |
| 202 |
<td>Wraps <code>sysconf</code> to support <code>_SC_PHYS_PAGES</code></td> |
| 203 |
<td>OSX10.10</td> |
| 204 |
</tr> |
| 205 |
<tr> |
| 206 |
<td><code>uuid/uuid.h</code></td> |
| 207 |
<td>Adds typedef of <code>uuid_string_t</code></td> |
| 208 |
<td>OSX10.5</td> |
| 209 |
</tr> |
| 210 |
<tr> |
| 211 |
<td><code>CoreFoundation/CoreFoundation.h</code></td> |
| 212 |
<td>Adds <code>CFPropertyListCreateWithStream</code> function</td> |
| 213 |
<td>OSX10.5</td> |
| 214 |
</tr> |
| 215 |
<tr> |
| 216 |
<td><code>OpenGL/gliDispatch.h</code></td> |
| 217 |
<td>Wraps <code>gliDispatch.h</code> to prevent including |
| 218 |
<code>glext.h</code> and thereby match behaviour of newer systems.</td> |
| 219 |
<td>OSX10.6</td> |
| 220 |
</tr> |
| 221 |
<tr> |
| 222 |
<td><code>TargetConditionals.h</code></td> |
| 223 |
<td>Adds definitions for <code>TARGET_CPU_ARM</code>, <code>TARGET_CPU_ARM64</code>, |
| 224 |
<code>TARGET_OS_SIMULATOR</code>, <code>TARGET_OS_IOS</code>, <code>TARGET_OS_TV</code>, |
| 225 |
<code>TARGET_OS_WATCH</code> and <code>TARGET_OS_OSX</code> if needed.</td> |
| 226 |
<td>OSX10.10</td> |
| 227 |
</tr> |
| 228 |
<tr> |
| 229 |
<td><code>-</code></td> |
| 230 |
<td>Adds <code>__bzero</code> library symbol</td> |
| 231 |
<td>OSX10.5</td> |
| 232 |
</tr> |
| 233 |
<tr> |
| 234 |
<td><code>-</code></td> |
| 235 |
<td>Adds <code>_dirfd</code> library symbol</td> |
| 236 |
<td>OSX10.7</td> |
| 237 |
</tr> |
| 238 |
<tr> |
| 239 |
<td><code>-</code></td> |
| 240 |
<td>Adds <code>_fstatat$INODE64</code> library symbol</td> |
| 241 |
<td>OSX10.9</td> |
| 242 |
</tr> |
| 243 |
</table> |
| 244 |
|
| 245 |
For information on building this library outside MacPorts, see BUILDING.txt. |