prepare.py: add --tunnel option and fix dummy libraries

This commit is contained in:
Gautier Pelloux-Prayer 2015-08-06 14:08:54 +02:00
parent 793d80b3d6
commit 61929cb27a
9 changed files with 48 additions and 47 deletions

2
.gitignore vendored
View file

@ -12,3 +12,5 @@ WORK
Makefile
OUTPUT
git-clang-format.diff
submodules/tunnel
submodules/binaries/dummy-*.a

View file

@ -10,7 +10,7 @@
045B5CB318D72E9A0088350C /* libbzrtp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 045B5CB218D72E9A0088350C /* libbzrtp.a */; };
152F22341B15E83B008C0621 /* libilbcrfc3951.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 152F22331B15E83B008C0621 /* libilbcrfc3951.a */; };
152F22361B15E889008C0621 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 152F22351B15E889008C0621 /* libxml2.dylib */; };
1560821F18EEF26100765332 /* libmsopenh264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1560821E18EEF26100765332 /* libmsopenh264.a */; };
1560821F18EEF26100765332 /* libmsopenh264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1560821E18EEF26100765332 /* libmsopenh264.a */; settings = {ATTRIBUTES = (Weak, ); }; };
1599105316F746B2007BF52B /* route_bluetooth_off_default_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 1599104316F746B2007BF52B /* route_bluetooth_off_default_landscape.png */; };
1599105516F746B2007BF52B /* route_bluetooth_off_disabled_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 1599104416F746B2007BF52B /* route_bluetooth_off_disabled_landscape.png */; };
1599105716F746B2007BF52B /* route_bluetooth_off_over_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 1599104516F746B2007BF52B /* route_bluetooth_off_over_landscape.png */; };
@ -162,7 +162,6 @@
639CEB031A1DF4EB004DE38F /* UICompositeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB051A1DF4EB004DE38F /* UICompositeViewController.xib */; };
639CEB061A1DF4F1004DE38F /* UIChatRoomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB081A1DF4F1004DE38F /* UIChatRoomCell.xib */; };
639CEB091A1DF4FA004DE38F /* UIChatCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB0B1A1DF4FA004DE38F /* UIChatCell.xib */; };
63A4280A1B26F576000DAB93 /* libSKP_SILK_SDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 226183AA1472527D0037138E /* libSKP_SILK_SDK.a */; };
63B81A0C1B57DA33009604A6 /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = 63B81A031B57DA33009604A6 /* LICENSE.txt */; };
63B81A0D1B57DA33009604A6 /* TPKeyboardAvoidingCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B81A051B57DA33009604A6 /* TPKeyboardAvoidingCollectionView.m */; };
63B81A0E1B57DA33009604A6 /* TPKeyboardAvoidingScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B81A071B57DA33009604A6 /* TPKeyboardAvoidingScrollView.m */; };
@ -172,6 +171,9 @@
63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */; };
63D2680F1B174A5E00A2CC11 /* numpad_one_voicemail_default.png in Resources */ = {isa = PBXBuildFile; fileRef = 63D2680D1B174A5E00A2CC11 /* numpad_one_voicemail_default.png */; };
63D268101B174A5E00A2CC11 /* numpad_one_voicemail_over.png in Resources */ = {isa = PBXBuildFile; fileRef = 63D2680E1B174A5E00A2CC11 /* numpad_one_voicemail_over.png */; };
63D7215D1B7394D200D70E65 /* libtunnel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D30BF33216A427BC00AF0026 /* libtunnel.a */; settings = {ATTRIBUTES = (Weak, ); }; };
63D7216C1B73973D00D70E65 /* libx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AA8AFB13D7125500B30535 /* libx264.a */; settings = {ATTRIBUTES = (Weak, ); }; };
63D7216D1B73975900D70E65 /* libmsx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AA8AFC13D7125500B30535 /* libmsx264.a */; settings = {ATTRIBUTES = (Weak, ); }; };
63E59A3F1ADE70D900646FB3 /* InAppProductsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E59A3E1ADE70D900646FB3 /* InAppProductsManager.m */; };
63FB30351A680E73008CA393 /* UIRoundedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63FB30341A680E73008CA393 /* UIRoundedImageView.m */; };
70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; };
@ -963,7 +965,6 @@
22276E8213C73D3100210156 /* libswscale.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswscale.a; path = "liblinphone-sdk/apple-darwin/lib/libswscale.a"; sourceTree = "<group>"; };
22276E8613C73D8A00210156 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
22276E8813C73DC000210156 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
223148E31178A08200637D6A /* libilbc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libilbc.a; path = "liblinphone-sdk/apple-darwin/lib/libilbc.a"; sourceTree = "<group>"; };
223148E51178A09900637D6A /* libmsilbc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsilbc.a; path = "liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsilbc.a"; sourceTree = "<group>"; };
2234C8E715EE2F7F00E18E83 /* chat_message_delivered.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_message_delivered.png; path = Resources/chat_message_delivered.png; sourceTree = "<group>"; };
2234C8E815EE2F7F00E18E83 /* chat_message_not_delivered.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_message_not_delivered.png; path = Resources/chat_message_not_delivered.png; sourceTree = "<group>"; };
@ -1879,7 +1880,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
63A4280A1B26F576000DAB93 /* libSKP_SILK_SDK.a in Frameworks */,
63D7216D1B73975900D70E65 /* libmsx264.a in Frameworks */,
63D7215D1B7394D200D70E65 /* libtunnel.a in Frameworks */,
63D7216C1B73973D00D70E65 /* libx264.a in Frameworks */,
152F22361B15E889008C0621 /* libxml2.dylib in Frameworks */,
152F22341B15E83B008C0621 /* libilbcrfc3951.a in Frameworks */,
F0B026F31AA710AF00FF49F7 /* libiconv.dylib in Frameworks */,

View file

@ -153,31 +153,31 @@ def extract_libs_list():
return list(set(l))
def check_installed(binary, prog=None, warn=True):
def check_is_installed(binary, prog=None, warn=True):
if not find_executable(binary):
if warn:
print("Could not find {}. Please install {}.".format(binary, prog))
return 1
return 0
return False
return True
def check_tools():
ret = 0
reterr = 0
if " " in os.path.dirname(os.path.realpath(__file__)):
print("Invalid location: linphone-iphone path should not contain any spaces.")
ret = 1
reterr = 1
for prog in ["autoconf", "automake", "pkg-config", "doxygen", "java", "nasm", "cmake", "wget", "yasm", "optipng"]:
ret |= check_installed(prog, "it")
ret |= check_installed("ginstall", "coreutils")
ret |= check_installed("intltoolize", "intltool")
ret |= check_installed("convert", "imagemagick")
reterr |= not check_is_installed(prog, "it")
reterr |= not check_is_installed("ginstall", "coreutils")
reterr |= not check_is_installed("intltoolize", "intltool")
reterr |= not check_is_installed("convert", "imagemagick")
if not check_installed("libtoolize", warn=False):
if check_installed("glibtoolize", "libtool"):
if check_is_installed("libtoolize", warn=False):
if not check_is_installed("glibtoolize", "libtool"):
glibtoolize_path = find_executable(glibtoolize)
ret = 1
reterr = 1
error = "Please do a symbolic link from glibtoolize to libtoolize: 'ln -s {} ${}'."
print(error.format(glibtoolize_path, glibtoolize_path.replace("glibtoolize", "libtoolize")))
@ -188,10 +188,10 @@ def check_tools():
if p.returncode != 0:
print(p.returncode)
print("Please install Java JDK (not just JRE).")
ret = 1
reterr = 1
# needed by x264
check_installed("gas-preprocessor.pl", """it:
check_is_installed("gas-preprocessor.pl", """it:
wget --no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl
chmod +x gas-preprocessor.pl
sudo mv gas-preprocessor.pl /usr/local/bin/""")
@ -200,28 +200,28 @@ def check_tools():
if "fatal: unrecognised output format" in nasm_output:
print(
"Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is set correctly.")
ret = 1
reterr = 1
if not os.path.isdir("submodules/linphone/mediastreamer2") or not os.path.isdir("submodules/linphone/oRTP"):
print("Missing some git submodules. Did you run 'git submodule update --init --recursive'?")
ret = 1
reterr = 1
p = Popen("xcrun --sdk iphoneos --show-sdk-path".split(" "), stdout=devnull, stderr=devnull)
p.wait()
if p.returncode != 0:
print("iOS SDK not found, please install Xcode from AppStore or equivalent.")
ret = 1
reterr = 1
else:
sdk_platform_path = Popen("xcrun --sdk iphonesimulator --show-sdk-platform-path".split(" "), stdout=PIPE, stderr=devnull).stdout.read()[:-1]
sdk_strings_path = "{}/{}".format(sdk_platform_path, "Developer/usr/bin/strings")
if not os.path.isfile(sdk_strings_path):
strings_path = find_executable("strings")
print("strings binary missing, please run 'sudo ln -s {} {}'.".format(strings_path, sdk_strings_path))
ret = 1
reterr = 1
if ret == 1:
if reterr == 1:
print("Failed to detect required tools, aborting.")
return ret
return reterr
def install_git_hook():
@ -467,6 +467,8 @@ def main(argv=None):
'-G' '--generator', help="CMake build system generator (default: Unix Makefiles).", default='Unix Makefiles', choices=['Unix Makefiles', 'Ninja'])
argparser.add_argument(
'-L', '--list-cmake-variables', help="List non-advanced CMake cache variables.", action='store_true', dest='list_cmake_variables')
argparser.add_argument(
'-t', '--tunnel', help="Enable Tunnel.", action='store_true')
argparser.add_argument('platform', nargs='*', action=PlatformListAction, default=[
'x86_64', 'devices'], help="The platform to build for (default is 'x86_64 devices'). Space separated architectures in list: {0}.".format(', '.join([repr(platform) for platform in platforms])))
@ -475,10 +477,6 @@ def main(argv=None):
if args.debug_verbose:
additional_args += ["-DENABLE_DEBUG_LOGS=YES"]
if os.path.isdir("submodules/tunnel"):
print("Enabling tunnel")
additional_args += ["-DENABLE_TUNNEL=YES"]
if check_tools() != 0:
return 1
@ -486,12 +484,21 @@ def main(argv=None):
additional_args += ["-G", args.G__generator]
if args.G__generator == 'Ninja':
if check_installed("ninja", "it") != 0:
if not check_is_installed("ninja", "it"):
return 1
generator = 'ninja -C'
else:
generator = '$(MAKE) -C'
if args.tunnel:
if not os.path.isdir("submodules/tunnel"):
print("Tunnel enabled but not found, trying to clone it...")
if check_is_installed("git", "it", True):
Popen("git clone gitosis@git.linphone.org:tunnel.git submodules/tunnel".split(" ")).wait()
additional_args += ["-DENABLE_TUNNEL=YES"]
else:
return 1
selected_platforms = []
for platform in args.platform:
if platform == 'all':

View file

@ -1,6 +1 @@
//regenerate libdummy.a using:
// for arch in arm64 armv7 i386 x86_64; do
// clang -c dummy.c -o dummy-$arch.a -arch $arch
// done
// lipo -create -output libdummy.a dummy-*.a
void dummy_does_nothing() {}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,17 +1,11 @@
Notes:
This directory is here because some of our dependencies compile incorrecly
(or not at all) with the compilers that Apple ships with its newer Xcode versions.
This directory is here because XCode cannot handle optional static libraries linking so we must stub some library, tunnel for instance.
You'll find here the reasons why certain libs are furnished pre-compiled.
You can regenerate dummy.c (which is an empty file...) using:
Additionaly, the libdummy.a is an empty library created to stub the tunnel extension.
= Libvpx =
Binary version compiled with XCode 5.0, with the patch suggested here for
garbage video fix: https://code.google.com/p/webm/issues/detail?id=603#c45
Compiles OK on XCode 5.1 but results in a crash in-app.
Bug is here: https://code.google.com/p/webm/issues/detail?id=737
for arch in arm64 armv7 i386 x86_64; do
clang -c dummy.c -o dummy-$arch.a -arch $arch
done
lipo -create -output libdummy.a dummy-*.a