为iOS7编译PJSIP

时间:2013-12-04 07:00:42

标签: ios gcc xcode5 pjsip

我正在尝试在Mac 10.9上为iOS编译PJSIP2.1.0。(Xcode 5.0)。但是当我运行./configure-iphone时,我遇到了一些错误。

以下是错误,

configure-iphone: DEVPATH is not specified, using /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
configure-iphone: IPHONESDK is not specified, choosing iPhoneOS7.0.sdk
ls: /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/gcc/arm-apple-darwin*: No such file or directory
configure-iphone error: unable to find gcc for iPhoneOS7.0.sdk. If you think you have the right gcc, set the full path in CC environment variable.` 

有人可以帮助我吗?感谢

但是现在,我按照Compiling pjsip current trunk under iOS 5.0 GM Fails做了一些其他错误。

以下是错误

ailks-mbp:pjproject-2.1.0 ailk$ ./configure-iphone 
configure-iphone: DEVPATH is not specified, using    /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
configure-iphone: IPHONESDK is not specified, choosing iPhoneOS7.0.sdk
configure-iphone: CXX is not specified, using /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-g++-4.2
configure-iphone: calling ./aconfigure with env vars:
CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
CXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-g++-4.2
SDKPATH = /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
CFLAGS = -O2 -Wno-unused-label -DPJ_SDK_NAME="\"iPhoneOS7.0.sdk\""  -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
LDFLAGS = -O2  -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -framework AudioToolbox -framework Foundation
AR = /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool -static -o
RANLIB = echo ranlib
checking build system type... i386-apple-darwin13.0.0
checking host system type... arm-apple-darwin10
checking target system type... arm-apple-darwin10
checking for arm-apple-darwin10-gcc...   /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
checking whether the C compiler works... no
aconfigure: error: in `/Users/ailk/Documents/开源库/pjproject-2.1.0':
aconfigure: error: C compiler cannot create executables
See `config.log' for more details

以下是config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by pjproject aconfigure 2.x, which was
generated by GNU Autoconf 2.69.  Invocation command line was

$ ./aconfigure --host=arm-apple-darwin10 --disable-sdl

## --------- ##
## Platform. ##
## --------- ##

hostname = ailks-mbp.ailk.com
uname -m = x86_64
uname -r = 13.0.0
uname -s = Darwin
uname -v = Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-   2422.1.72~6/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu- 2422.1.72~6/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.  
4 processors are logically available. 
Processor type: i486 (Intel 80486)  
Processors active: 0 1 2 3 
Primary memory available: 4.00 gigabytes
Default processor set: 161 tasks, 771 threads, 4 processors
Load average: 2.13, Mach factor: 2.37
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin


## ----------- ##
## Core tests. ##
## ----------- ##

aconfigure:2355: checking build system type
aconfigure:2369: result: i386-apple-darwin13.0.0
aconfigure:2389: checking host system type
aconfigure:2402: result: arm-apple-darwin10
aconfigure:2422: checking target system type
aconfigure:2435: result: arm-apple-darwin10
aconfigure:2483: checking for arm-apple-darwin10-gcc
aconfigure:2510: result: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-   apple-darwin10-llvm-gcc-4.2
aconfigure:2779: checking for C compiler version
aconfigure:2788: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 --version >&5
./aconfigure: line 2790: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
aconfigure:2799: $? = 127
aconfigure:2788: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -v >&5
./aconfigure: line 2790: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
aconfigure:2799: $? = 127
aconfigure:2788: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -V >&5
./aconfigure: line 2790: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
aconfigure:2799: $? = 127
aconfigure:2788: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -qversion >&5
./aconfigure: line 2790: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2: No such file or directory
aconfigure:2799: $? = 127
aconfigure:2819: checking whether the C compiler works
aconfigure:2841: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple- darwin10-llvm-gcc-4.2 -O2 -Wno-unused-label -DPJ_SDK_NAME="\"iPhoneOS7.0.sdk\""  -isysroot  /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS 7.0.sdk  -O2  -isysroot    /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -framework AudioToolbox -framework Foundation conftest.c  >&5
./aconfigure: line 2843: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-   apple-darwin10-llvm-gcc-4.2: No such file or directory
aconfigure:2845: $? = 127
aconfigure:2883: result: no
aconfigure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "pjproject"
| #define PACKAGE_TARNAME "pjproject"
| #define PACKAGE_VERSION "2.x"
| #define PACKAGE_STRING "pjproject 2.x"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
aconfigure:2888: error: in `/Users/ailk/Documents/开源库/pjproject-2.1.0':
aconfigure:2890: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i386-apple-darwin13.0.0
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-    darwin10-llvm-gcc-4.2
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-O2 -Wno-unused-label -DPJ_SDK_NAME="\"iPhoneOS7.0.sdk\""  -    isysroot     /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=set
ac_cv_env_CPP_value='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2  -E -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk'
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=set
ac_cv_env_CXX_value=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-    darwin10-llvm-g++-4.2
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-O2  -isysroot     /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -framework AudioToolbox -framework Foundation'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-apple-darwin10
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=arm-apple-darwin10
ac_cv_prog_CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
ac_cv_target=arm-apple-darwin10

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool -static -o'
CC='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2'
CC_CFLAGS=''
CC_DEF=''
CC_INC=''
CC_OPTIMIZE=''
CC_OUT=''
CFLAGS='-O2 -Wno-unused-label -DPJ_SDK_NAME="\"iPhoneOS7.0.sdk\""  -isysroot     /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk'
CPP='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2  -E -isysroot     /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk'
CPPFLAGS=''
CXX='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-g++-4.2'
CXXFLAGS='-O2 -Wno-unused-label -DPJ_SDK_NAME="\"iPhoneOS7.0.sdk\""  -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk '
DEFS=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
LD=''
LDFLAGS='-O2  -isysroot     /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -framework AudioToolbox -framework Foundation'
LDOUT=''
LIBEXT2=''
LIBEXT=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='pjproject'
PACKAGE_STRING='pjproject 2.x'
PACKAGE_TARNAME='pjproject'
PACKAGE_URL=''
PACKAGE_VERSION='2.x'
PATH_SEPARATOR=':'
PKG_CONFIG=''
RANLIB='echo ranlib'
SAVED_PKG_CONFIG_PATH=''
SDL_CONFIG=''
SHELL='/bin/sh'
ac_build_mak_vars=''
ac_cross_compile=''
ac_ct_CC=''
ac_ct_CXX=''
ac_external_gsm=''
ac_external_pa=''
ac_external_speex=''
ac_ffmpeg_cflags=''
ac_ffmpeg_ldflags=''
ac_has_ffmpeg=''
ac_host=''
ac_ios_cflags=''
ac_linux_poll=''
ac_main_obj=''
ac_no_g711_codec=''
ac_no_g7221_codec=''
ac_no_g722_codec=''
ac_no_gsm_codec=''
ac_no_ilbc_codec=''
ac_no_l16_codec=''
ac_no_large_filter=''
ac_no_opencore_amrnb=''
ac_no_opencore_amrwb=''
ac_no_silk=''
ac_no_small_filter=''
ac_no_speex_aec=''
ac_no_speex_codec=''
ac_no_ssl=''
ac_os_objs=''
ac_pa_cflags=''
ac_pa_use_alsa=''
ac_pa_use_oss=''
ac_pjdir=''
ac_pjmedia_snd=''
ac_pjmedia_video=''
ac_pjmedia_video_has_ios=''
ac_pjmedia_video_has_qt=''
ac_qt_cflags=''
ac_resample_dll=''
ac_sdl_cflags=''
ac_sdl_ldflags=''
ac_shlib_suffix=''
ac_v4l2_cflags=''
ac_v4l2_ldflags=''
bindir='${exec_prefix}/bin'
build='i386-apple-darwin13.0.0'
build_alias=''
build_cpu='i386'
build_os='darwin13.0.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='arm-apple-darwin10'
host_alias='arm-apple-darwin10'
host_cpu='arm'
host_os='darwin10'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libcrypto_present=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libssl_present=''
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
opencore_amrnb_h_present=''
opencore_amrnb_present=''
opencore_amrwb_dec_h_present=''
opencore_amrwb_dec_present=''
opencore_amrwb_enc_h_present=''
opencore_amrwb_enc_present=''
openssl_h_present=''
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
silk_h_present=''
silk_present=''
sysconfdir='${prefix}/etc'
target='arm-apple-darwin10'
target_alias=''
target_cpu='arm'
target_os='darwin10'
target_vendor='apple'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "pjproject"
#define PACKAGE_TARNAME "pjproject"
#define PACKAGE_VERSION "2.x"
#define PACKAGE_STRING "pjproject 2.x"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

aconfigure: exit 77

感谢您的帮助。

5 个答案:

答案 0 :(得分:4)

几天前我在这个问题上挣扎......

入门指南here帮助了我,而post对此非常有帮助。

当我从入门指南下载库时,它将无法编译,直到我从上面提到的SO帖子中提供给svn存储库的链接库中

svn co http://svn.pjsip.org/repos/pjproject/trunk  pjproject

从那里拿到图书馆之后 我只是确保安装了命令行工具。你可以登入xcode - > prefrences - >下载而不仅仅是创建" config_site.h"像0xbeefdead在他的回答中指出的那样。 最后一件事是运行./configure-iphone,就是这样。

我正在运行osx 10.8.5 9(xcode 5),我的设备是4s。对于iPhone 5,请使用入门指南中提到的armv7s架构

希望这会有所帮助

答案 1 :(得分:2)

第1步: 正如文件所说。通过创建“config_site.h”添加以下行。如果您有问题,请参阅文档。

#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>

第2步: 在“configure-iphone”文件中添加以下行以编译

对于armv7s

ARCH =' - arch armv7s' CC = /应用/ Xcode.app /内容/开发者的/ usr /斌/ GCC

对于armv7

ARCH =' - arch armv7' CC = /应用/ Xcode.app /内容/开发者的/ usr /斌/ GCC

适用于模拟器

ARCH =' - arch i386' CC = /应用/ Xcode.app /内容/开发人员的/ usr / bin中/ GCC DEVPATH = /应用/ Xcode.app /内容/开发/平台/ iPhoneSimulator.platform / IPHONESDK = /应用/ Xcode.app /内容/开发/平台/ iPhoneSimulator.platform /开发商/软件开发工具包/ iPhoneSimulator7.0.sdk SDKPATH = /应用/ Xcode.app /内容/开发商/平台/ iPhoneSimulator.platform /开发商/软件开发工具包/ iPhoneSimulator7.0.sdk

我仍在努力为“armv6”打造。有什么建议 ?

我正在使用pjproject-2.1.0

答案 2 :(得分:1)

您的CC环境变量指向/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2,而且从config.log中,它不存在。

您应该检查您的AMR构建器路径并更新您的环境。

答案 3 :(得分:0)

试试这个

在终端运行“xcrun -find -sdk iphoneos gcc”并复制输出并放在CC之后,所以对于我的情况它是

export CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
export ARCH='-arch armv7s'
./configure-iphone

答案 4 :(得分:0)

对于模拟器,主要是0xbeefdead提到:

ARCH='-arch i386'
DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc
IPHONESDK=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
SDKPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk

添加“-miphoneos-version-min = 7.0”CFLAGS / LDFLAGS:

# Default CFLAGS if it's not specified
if test "$CFLAGS" = ""; then
  CFLAGS="-O2 -Wno-unused-label -miphoneos-version-min=7.0"
fi

# Default LDFLAGS if it's not specified
if test "$LDFLAGS" = ""; then
  LDFLAGS="-O2 -miphoneos-version-min=7.0"
fi