ホームページ > データベース > mysql チュートリアル > 在MAC 10.5.5 上 编译给 iPhoneOS2

在MAC 10.5.5 上 编译给 iPhoneOS2

WBOY
リリース: 2016-06-07 15:26:17
オリジナル
1144 人が閲覧しました

Compilation guide for pjsip on iPhone OS 2.X. Introduction This article describes the steps to generate pjsip on Mac OS X 10.5.5 Details Get pjsip source code Get PjSIP from subversion repository: svn checkout http : //svn.pjsip.org/repos/

Compilation guide for pjsip on iPhone OS 2.X.

Introduction

This article describes the steps to generate pjsip on Mac OS X 10.5.5

Details

Get pjsip source code

Get PjSIP from subversion repository:

<span><span>svn checkout http</span>
<span>:</span>
<span>//svn.pjsip.org/repos/pjproject/trunk pjproject</span>
</span>
ログイン後にコピー

Modify some files

aconfigure.ac

In aconfigure.ac file add the lines below displayed with '+'. Of course copy without '+' ;-)

<span><span> </span>
<span>if</span>
<span> test </span>
<span>"$enable_sound"</span>

<span>=</span>

<span>"no"</span>
<span>;</span>

<span>then</span>
</span>
<span><br>
<span>   </span>
</span>
<span><span>true</span>
<span>;</span>
</span>
<span><br>
<span> </span>
</span>
<span><span>else</span>
</span>
<span><br>
<span>  </span>
</span>
<span><span>case</span>
<span> $target </span>
<span>in</span>
</span>
<span><br>
</span>
<span><span>+</span>
<span>   arm</span>
<span>-</span>
<span>apple</span>
<span>-</span>
<span>darwin</span>
<span>*)</span>
</span>
<span><br>
</span>
<span><span>+</span>
<span>        LIBS</span>
<span>=</span>
<span>"$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox"</span>
</span>
<span><br>
</span>
<span><span>+</span>
<span>        ac_pjmedia_snd</span>
<span>=</span>
</span>
<span><span>iphone<br>
</span>
<span>+</span>
<span>        AC_MSG_RESULT</span>
<span>([</span>
<span>Checking</span>
<span> sound device backend</span>
<span>...</span>

<span>AudioQueue</span>
<span>])</span>
</span>
<span><br>
</span>
<span><span>+</span>
<span>        </span>
<span>;;</span>
</span>
<span><br>
<span>   </span>
</span>
<span><span>*</span>
<span>darwin</span>
<span>*)</span>
</span>
<span><br>
<span>        LIBS</span>
</span>
<span><span>=</span>
<span>"$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox"</span>
</span>
<span><br>
<span>        </span>
</span>
<span><span>if</span>
<span> test </span>
<span>"`uname -r`"</span>

<span>=</span>

<span>"6.8"</span>
<span>;</span>

<span>then</span>
</span>

ログイン後にコピー

build/rules.mak

In rules.mak modify, remove lines with '-' and add lines with '+':

<span><span> $</span>
<span>(</span>
<span>LIB</span>
<span>):</span>
<span> $</span>
<span>(</span>
<span>OBJDIRS</span>
<span>)</span>
<span> $</span>
<span>(</span>
<span>OBJS</span>
<span>)</span>
<span> $</span>
<span>(</span>
<span>$</span>
<span>(</span>
<span>APP</span>
<span>)</span>
<span>_EXTRA_DEP</span>
<span>)</span>
</span>
<span><br>
<span>        </span>
</span>
<span><span>if</span>
<span> test </span>
<span>!</span>

<span>-</span>
<span>d $</span>
<span>(</span>
<span>LIBDIR</span>
<span>);</span>

<span>then</span>
<span> $</span>
<span>(</span>
<span>subst </span>
<span>@@,</span>
<span>$</span>
<span>(</span>
<span>subst </span>
<span>/,</span>
<span>$</span>
<span>(</span>
<span>HOST_PSEP</span>
<span>),</span>
<span>$</span>
<span>(</span>
<span>LIBDIR</span>
<span>)),</span>
<span>$</span>
<span>(</span>
<span>HOST_MKDIR</span>
<span>));</span>

<span>fi</span>
</span>
<span><br>
</span>
<span><span>-</span>
<span>       $</span>
<span>(</span>
<span>AR</span>
<span>)</span>
<span> $</span>
<span>(</span>
<span>LIB</span>
<span>)</span>
<span> $</span>
<span>(</span>
<span>OBJS</span>
<span>)</span>
</span>
<span><br>
</span>
<span><span>-</span>
<span>       $</span>
<span>(</span>
<span>RANLIB</span>
<span>)</span>
<span> $</span>
<span>(</span>
<span>LIB</span>
<span>)</span>
</span>
<span><br>
</span>
<span><span>+</span>
<span>       $</span>
<span>(</span>
<span>RANLIB</span>
<span>)</span>

<span>-</span>
<span>static</span>

<span>-</span>
<span>o $</span>
<span>(</span>
<span>LIB</span>
<span>)</span>
<span> $</span>
<span>(</span>
<span>OBJS</span>
<span>)</span>
</span>

ログイン後にコピー

pjlib/include/pj/compat/os_darwinos.h

In os_darwinos.h find and comment the following lines :

<span><span>/*<br>
 * Socket related<br>
 */</span>
</span>
<span><br>
</span>
<span><span>//typedef int socklen_t;</span>
</span>

ログイン後にコピー

Without this, you will get an error when you will compile, because socklen_t is redefined.

pjlib/include/pj/config_site.h

It can be necessary to define some macro. For example :

<span><span>#undef PJ_HAS_FLOATING_POINT</span>
</span>
<span><br>
</span>
<span><span>#define PJ_HAS_FLOATING_POINT   1</span>
</span>
<span><br>
<br>
</span>
<span><span>/* SRTP has not been ported to iPhone yet */</span>
</span>
<span><br>
</span>
<span><span>#   undef PJMEDIA_HAS_SRTP</span>
</span>
<span><br>
</span>
<span><span>#   define PJMEDIA_HAS_SRTP             0</span>
</span>
<span><br>
<br>
</span>
<span><span>/* Disable some codecs for now */</span>
</span>
<span><br>
</span>
<span><span>#   define PJMEDIA_HAS_GSM_CODEC        1</span>
</span>
<span><br>
</span>
<span><span>#   define PJMEDIA_HAS_L16_CODEC        0</span>
</span>
<span><br>
</span>
<span><span>#   define PJMEDIA_HAS_ILBC_CODEC       0</span>
</span>
<span><br>
</span>
<span><span>#   define PJMEDIA_HAS_SPEEX_CODEC      0</span>
</span>
<span><br>
</span>
<span><span>#   define PJMEDIA_HAS_G722_CODEC       0</span>
</span>

ログイン後にコピー

pjmedia/build/os-auto.mak.in

In os-auto.mak.in , add the line with '+'

<span><span> </span>
<span>#   - ds:              Win32 DirectSound (dsound.c)</span>
</span>
<span><br>
</span>
<span><span>+</span>
<span>#   - iphone:       iPhone AudioQueue (iphonesound.c)</span>
</span>
<span><br>
<span> </span>
</span>
<span><span>#   - null:            Null sound device (nullsound.c)</span>
</span>

ログイン後にコピー

Add the line below, for example between "Win 32 Direct Sound" and " Null Sound Device"

<span><span>#</span>
</span>
<span><br>
</span>
<span><span># iPod/iPhone</span>
</span>
<span><br>
</span>
<span><span>#</span>
</span>
<span><br>
<span>ifeq </span>
</span>
<span><span>(</span>
<span>$</span>
<span>(</span>
<span>AC_PJMEDIA_SND</span>
<span>),</span>
<span>iphone</span>
<span>)</span>
</span>
<span><br>
</span>
<span><span>export</span>
<span> SOUND_OBJS </span>
<span>=</span>
<span> iphonesound</span>
<span>.</span>
</span>
<span><span>o<br>
</span>
<span>export</span>
<span> CFLAGS </span>
<span>+=</span>

<span>-</span>
<span>DPJMEDIA_SOUND_IMPLEMENTATION</span>
<span>=</span>
</span>
<span><span>PJMEDIA_SOUND_IPHONE_SOUND<br>
endif<br>
</span>
</span>

ログイン後にコピー

We have defined a new target for sound device.

pjmedia/include/pjmedia/config.h

in config.h add the lines below with '+':

<span><span> </span>
<span>/** Constant for Win32 MME sound backend. */</span>
</span>
<span><br>
<span> </span>
</span>
<span><span>#define PJMEDIA_SOUND_WIN32_MME_SOUND      3</span>
</span>
<span><br>
<br>
</span>
<span><span>+</span>
<span>/** Constant for AudioQueue sound backend. */</span>
</span>
<span><br>
</span>
<span><span>+</span>
<span>#define PJMEDIA_SOUND_IPHONE_SOUND            4</span>
</span>

ログイン後にコピー

pjmedia/src/pjmedia

For the moment I didn't upload iphonesound.c so we need to compile with null_sound.

Configuration

Generate configuration script

<span><span>autoconf aconfigure</span>
<span>.</span>
<span>ac </span>
<span>></span>
<span> aconfigure</span>
</span>

ログイン後にコピー

Compilation

iPhone SDK doesn't provide some programs without version number, so we create symbolic link. We should test before create link, but we are very lazy. Copy the lines below in file with name like compile.sh in the root of pjsip.

<span><span>#!/bin/sh</span>
</span>
<span><br>
<br>
</span>
<span><span>export</span>
<span> DEV</span>
<span>=</span>
<span>/Developer/</span>
<span>Platforms</span>
<span>/</span>
<span>iPhoneOS</span>
<span>.</span>
<span>platform</span>
<span>/</span>
<span>Developer</span>
</span>
<span><br>
</span>
<span><span>export</span>
<span> SDK</span>
<span>=</span>
<span>$</span>
<span>{</span>
<span>DEV</span>
<span>}/</span>
<span>SDKs</span>
<span>/</span>
<span>iPhoneOS2</span>
<span>.</span>
<span>1.sdk</span>
</span>
<span><br>
<br>
<span>pushd $</span>
</span>
<span><span>{</span>
<span>DEV</span>
<span>}/</span>
<span>usr</span>
<span>/</span>
</span>
<span><span>bin<br>
ln </span>
<span>-</span>
<span>s arm</span>
<span>-</span>
<span>apple</span>
<span>-</span>
<span>darwin9</span>
<span>-</span>
<span>gcc</span>
<span>-</span>
<span>4.0</span>
<span>.</span>
<span>1</span>
<span> arm</span>
<span>-</span>
<span>apple</span>
<span>-</span>
<span>darwin9</span>
<span>-</span>
</span>
<span><span>gcc<br>
ln </span>
<span>-</span>
<span>s arm</span>
<span>-</span>
<span>apple</span>
<span>-</span>
<span>darwin9</span>
<span>-</span>
<span>g</span>
<span>++-</span>
<span>4.0</span>
<span>.</span>
<span>1</span>
<span> arm</span>
<span>-</span>
<span>apple</span>
<span>-</span>
<span>darwin9</span>
<span>-</span>
<span>g</span>
<span>++</span>
</span>
<span><br>
<span>ln </span>
</span>
<span><span>-</span>
<span>s ranlib arm</span>
<span>-</span>
<span>apple</span>
<span>-</span>
<span>darwin9</span>
<span>-</span>
</span>
<span><span>ranlib<br>
popd<br>
<br>
</span>
<span>export</span>
<span> PATH</span>
<span>=</span>
<span>$</span>
<span>{</span>
<span>DEV</span>
<span>}/</span>
<span>usr</span>
<span>/</span>
<span>bin</span>
<span>:</span>
<span>$</span>
<span>{</span>
<span>PATH</span>
<span>}</span>
</span>
<span><br>
<br>
</span>
<span><span>export</span>
<span> CFLAGS</span>
<span>=</span>
<span>"-O2 -arch armv6 -isysroot ${SDK}"</span>
</span>
<span><br>
<br>
</span>
<span><span>export</span>
<span> LDFLAGS</span>
<span>=</span>
<span>"-O2 -arch armv6 -isysroot ${SDK}"</span>
</span>
<span><br>
<br>
</span>
<span><span>export</span>
<span> CPP</span>
<span>=</span>
<span>"${DEV}/usr/bin/cpp"</span>
</span>
<span><br>
<br>
</span>
<span><span>./</span>
<span>aconfigure </span>
<span>--</span>
<span>host</span>
<span>=</span>
<span>arm</span>
<span>-</span>
<span>apple</span>
<span>-</span>
<span>darwin9 </span>
<span>--</span>
<span>disable</span>
<span>-</span>
<span>speex</span>
<span>-</span>
<span>aec </span>
<span>/</span>
</span>
<span><br>
<span>   </span>
</span>
<span><span>--</span>
<span>disable</span>
<span>-</span>
<span>speex</span>
<span>-</span>
<span>codec </span>
<span>--</span>
<span>disable</span>
<span>-</span>
<span>l16</span>
<span>-</span>
<span>codec </span>
<span>--</span>
<span>disable</span>
<span>-</span>
<span>g722</span>
<span>-</span>
<span>codec </span>
<span>/</span>
</span>
<span><br>
<span>   </span>
</span>
<span><span>--</span>
<span>disable</span>
<span>-</span>
<span>ilbc</span>
<span>-</span>
<span>codec </span>
<span>--</span>
<span>disable</span>
<span>-</span>
<span>ssl </span>
<span>--</span>
<span>disable</span>
<span>-</span>
</span>
<span><span>sound<br>
<br>
make dep<br>
make</span>
</span>

ログイン後にコピー

We must not forget to change access right to allow execution. We can run compile.sh after some minutes pjsip is compiled.

 

Siphon Compilation

Getting siphon source code

Get Siphon from subversion repository:

<span><span>svn checkout http</span>
<span>:</span>
<span>//siphon.googlecode.com/svn/trunk/ siphon-read-only</span>
</span>

ログイン後にコピー

Installation pjsip

Create directory to install pjsip in Siphon:

<span><span>mkdir </span>
<span>-</span>
<span>p pjsip</span>
<span>/</span>
</span>
<span><span>include<br>
mkdir </span>
<span>-</span>
<span>p pjsip</span>
<span>/</span>
<span>lib</span>
</span>

ログイン後にコピー

Put these pjsip include directories in the pjsip/include path:

  • pjlib/include
  • pjlib-util/include
  • pjmedia/include
  • pjnath/include
  • pjsip/include

Put these pjsip library directories in the pjsip/lib path:

  • pjlib/lib
  • pjlib-util/lib
  • pjmedia/lib
  • pjnath/lib
  • pjsip/lib
  • third_party/lib

Compilation

<span><span>pushd settings<br>
make<br>
popd<br>
pushd src<br>
make<br>
popd</span>
</span>

ログイン後にコピー

For installation read the Manual .

 

ManualInstallation  

Manual installation instructions.

Manual Installation

The preferred method of installing Siphon is through the AppTapp Installer . However, if you are unable to or prefer not to use the Installer, you can follow the steps below to install Siphon manually.

NOTE: Siphon requires firmware version 1.1.X.

Manual Installation after compilation

  • Compile Siphon.

The three directories are in 'dist' directory.

  • Copy Siphon.app into /Applications or /Widgets on your device. You may see some error messages during this process, are there are several symbolic links in here that the Installer source would normally deal with. You can safely ignore these errors as we will copy the files manually.
  • Copy SiphonSettings.bundle into /System/Library/PreferenceBundles/SiphonSettings.bundle on your device.
  • Copy SpringBoard.app into /System/Library/CoreServices/SpringBoard.app on your device.

Manual Installation after download

  • Download the last version on this page .
  • Unzip downloaded file in /Applications or /Widgets on your device. You may see some error messages during this process, are there are several symbolic links in here that the Installer source would normally deal with. You can safely ignore these errors as we will copy the files manually.
  • Copy SiphonSettings.bundle into /System/Library/PreferenceBundles/SiphonSettings.bundle on your device.
  • Copy SpringBoard.app into /System/Library/CoreServices/SpringBoard.app on your device.

Last operations

Next, run the following command to complete the installation:

<span><span>/Applications/</span>
<span>Siphon</span>
<span>.</span>
<span>app</span>
<span>/</span>
<span>Siphon</span>

<span>--</span>
<span>installPrefBundle</span>
</span>

ログイン後にコピー

Finally, restart the SpringBoard:

<span><span>killall </span>
<span>SpringBoard</span>
</span>

ログイン後にコピー
関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート