snipt

Ctrl+h for KB shortcuts

Bash

compile php extension on Mac Pro 64-bit OS X Leopard

sudo su
cd /SourceCache/php-5.2.6/ext/APC/
phpize
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure --target=x86_64
make
make install

cd /usr/lib/php/extensions/no-debug-non-zts-20060613/
sh-3.2# file apc.so 
apc.so: Mach-O universal binary with 4 architectures
apc.so (for architecture ppc7400):	Mach-O bundle ppc
apc.so (for architecture ppc64):	Mach-O 64-bit bundle ppc64
apc.so (for architecture i386):	Mach-O bundle i386
apc.so (for architecture x86_64):	Mach-O 64-bit bundle x86_64
https://snippets.siftie.com/embed/518d902384ec51b20e8b4a8c3a4285cc/
/raw/518d902384ec51b20e8b4a8c3a4285cc/
518d902384ec51b20e8b4a8c3a4285cc
bash
Bash
14
2019-03-19T18:43:04
True
False
False
/api/public/snipt/914/
compile-php-extension-on-mac-pro-64-bit-os-x-leopard
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a> <a href="#L-12">12</a> <a href="#L-13">13</a> <a href="#L-14">14</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>sudo su </span><span id="L-2"><a name="L-2"></a><span class="nb">cd</span> /SourceCache/php-5.2.6/ext/APC/ </span><span id="L-3"><a name="L-3"></a>phpize </span><span id="L-4"><a name="L-4"></a><span class="nv">MACOSX_DEPLOYMENT_TARGET</span><span class="o">=</span>10.5 <span class="nv">CFLAGS</span><span class="o">=</span><span class="s2">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp&quot;</span> <span class="nv">CCFLAGS</span><span class="o">=</span><span class="s2">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&quot;</span> <span class="nv">CXXFLAGS</span><span class="o">=</span><span class="s2">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe&quot;</span> <span class="nv">LDFLAGS</span><span class="o">=</span><span class="s2">&quot;-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load&quot;</span> ./configure --target<span class="o">=</span>x86_64 </span><span id="L-5"><a name="L-5"></a>make </span><span id="L-6"><a name="L-6"></a>make install </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a><span class="nb">cd</span> /usr/lib/php/extensions/no-debug-non-zts-20060613/ </span><span id="L-9"><a name="L-9"></a>sh-3.2# file apc.so </span><span id="L-10"><a name="L-10"></a>apc.so: Mach-O universal binary with <span class="m">4</span> architectures </span><span id="L-11"><a name="L-11"></a>apc.so <span class="o">(</span><span class="k">for</span> architecture ppc7400<span class="o">)</span>: Mach-O bundle ppc </span><span id="L-12"><a name="L-12"></a>apc.so <span class="o">(</span><span class="k">for</span> architecture ppc64<span class="o">)</span>: Mach-O 64-bit bundle ppc64 </span><span id="L-13"><a name="L-13"></a>apc.so <span class="o">(</span><span class="k">for</span> architecture i386<span class="o">)</span>: Mach-O bundle i386 </span><span id="L-14"><a name="L-14"></a>apc.so <span class="o">(</span><span class="k">for</span> architecture x86_64<span class="o">)</span>: Mach-O 64-bit bundle x86_64 </span></pre></div> </td></tr></table>
"os x", apache, bash, php