Commit 8ef2b8cf authored by Erwan Croze's avatar Erwan Croze

[Switch submodule branch] Merge remote-tracking branch origin/master into dev_screensharing

parents b22609c3 14d34295
...@@ -78,3 +78,14 @@ ...@@ -78,3 +78,14 @@
[submodule "submodules/cunit"] [submodule "submodules/cunit"]
path = submodules/cunit path = submodules/cunit
url = git://git.linphone.org/cunit.git url = git://git.linphone.org/cunit.git
[submodule "submodules/externals/v4l-utils"]
path = submodules/externals/v4l-utils
url = git://linuxtv.org/v4l-utils.git
[submodule "submodules/externals/libxml2"]
path = submodules/externals/libxml2
url = git://git.linphone.org/libxml2
ignore = dirty
[submodule "submodules/externals/zlib"]
path = submodules/externals/zlib
url = git://git.linphone.org/zlib
ignore = dirty
...@@ -22,13 +22,11 @@ ...@@ -22,13 +22,11 @@
# #
############################################################################ ############################################################################
import argparse
import os import os
import platform import platform
import sys import sys
from logging import error, warning, info, INFO, basicConfig from logging import error, warning, info
from subprocess import Popen from subprocess import Popen
from distutils.spawn import find_executable
sys.dont_write_bytecode = True sys.dont_write_bytecode = True
sys.path.insert(0, 'submodules/cmake-builder') sys.path.insert(0, 'submodules/cmake-builder')
try: try:
...@@ -40,86 +38,116 @@ except Exception as e: ...@@ -40,86 +38,116 @@ except Exception as e:
exit(1) exit(1)
class DesktopTarget(prepare.Target): class DesktopTarget(prepare.Target):
def __init__(self, use_group="NO"): def __init__(self, group_builders=False):
prepare.Target.__init__(self, '') prepare.Target.__init__(self, 'desktop')
current_path = os.path.dirname(os.path.realpath(__file__)) current_path = os.path.dirname(os.path.realpath(__file__))
if platform.system() == 'Windows':
current_path = current_path.replace('\\', '/')
self.config_file = 'configs/config-desktop.cmake' self.config_file = 'configs/config-desktop.cmake'
if platform.system() == 'Windows': self.output = 'OUTPUT/' + self.name
self.generator = 'Visual Studio 12 2013' self.external_source_path = os.path.join(current_path, 'submodules')
self.additional_args = [
'-DCMAKE_INSTALL_MESSAGE=LAZY',
'-DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=' + current_path + '/submodules',
'-DLINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS=' + use_group
]
class PythonTarget(prepare.Target): class PythonTarget(prepare.Target):
def __init__(self): def __init__(self):
prepare.Target.__init__(self, '') prepare.Target.__init__(self, 'python')
current_path = os.path.dirname(os.path.realpath(__file__)) current_path = os.path.dirname(os.path.realpath(__file__))
if platform.system() == 'Windows':
current_path = current_path.replace('\\', '/')
self.config_file = 'configs/config-python.cmake' self.config_file = 'configs/config-python.cmake'
if platform.system() == 'Windows': self.output = 'OUTPUT/' + self.name
self.generator = 'Visual Studio 9 2008' self.external_source_path = os.path.join(current_path, 'submodules')
self.additional_args = [
'-DCMAKE_INSTALL_MESSAGE=LAZY',
'-DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=' + current_path + '/submodules',
'-DLINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS=YES'
]
class PythonRaspberryTarget(prepare.Target): class PythonRaspberryTarget(prepare.Target):
def __init__(self): def __init__(self):
prepare.Target.__init__(self, '') prepare.Target.__init__(self, 'python-raspberry')
current_path = os.path.dirname(os.path.realpath(__file__)) current_path = os.path.dirname(os.path.realpath(__file__))
self.required_build_platforms = ['Linux'] self.required_build_platforms = ['Linux']
self.config_file = 'configs/config-python-raspberry.cmake' self.config_file = 'configs/config-python-raspberry.cmake'
self.toolchain_file = 'toolchains/toolchain-raspberry.cmake' self.toolchain_file = 'toolchains/toolchain-raspberry.cmake'
self.additional_args = [ self.output = 'OUTPUT/' + self.name
'-DCMAKE_INSTALL_MESSAGE=LAZY', self.external_source_path = os.path.join(current_path, 'submodules')
'-DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=' + current_path + '/submodules',
'-DLINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS=YES'
]
desktop_targets = {
'desktop': DesktopTarget(),
def check_is_installed(binary, prog='it', warn=True): 'python': PythonTarget(),
if not find_executable(binary): 'python-raspberry': PythonRaspberryTarget()
if warn: }
error("Could not find {}. Please install {}.".format(binary, prog))
return False class DesktopPreparator(prepare.Preparator):
return True
def __init__(self, targets=desktop_targets, default_targets=['desktop']):
prepare.Preparator.__init__(self, targets, default_targets)
def check_tools(): self.veryclean = True
ret = 0 self.argparser.add_argument('-ac', '--all-codecs', help="Enable all codecs, including the non-free ones", action='store_true')
self.argparser.add_argument('-sys', '--use-system-dependencies', help="Find dependencies on the system.", action='store_true')
# at least FFmpeg requires no whitespace in sources path... self.argparser.add_argument('-p', '--package', help="Build an installation package (only on Mac OSX and Windows).", action='store_true')
if " " in os.path.dirname(os.path.realpath(__file__)):
error("Invalid location: path should not contain any spaces.") def parse_args(self):
ret = 1 prepare.Preparator.parse_args(self)
ret |= not check_is_installed('cmake') if self.args.use_system_dependencies:
self.additional_args += ["-DLINPHONE_BUILDER_USE_SYSTEM_DEPENDENCIES=YES"]
if not os.path.isdir("submodules/linphone/mediastreamer2/src") or not os.path.isdir("submodules/linphone/oRTP/src"):
error("Missing some git submodules. Did you run:\n\tgit submodule update --init --recursive") if self.args.all_codecs:
ret = 1 self.additional_args += ["-DENABLE_GPL_THIRD_PARTIES=YES"]
self.additional_args += ["-DENABLE_NON_FREE_CODECS=YES"]
self.additional_args += ["-DENABLE_AMRNB=YES"]
self.additional_args += ["-DENABLE_AMRWB=YES"]
self.additional_args += ["-DENABLE_G729=YES"]
self.additional_args += ["-DENABLE_GSM=YES"]
self.additional_args += ["-DENABLE_ILBC=YES"]
self.additional_args += ["-DENABLE_ISAC=YES"]
self.additional_args += ["-DENABLE_OPUS=YES"]
self.additional_args += ["-DENABLE_SILK=YES"]
self.additional_args += ["-DENABLE_SPEEX=YES"]
self.additional_args += ["-DENABLE_FFMPEG=YES"]
self.additional_args += ["-DENABLE_H263=YES"]
self.additional_args += ["-DENABLE_H263P=YES"]
self.additional_args += ["-DENABLE_MPEG4=YES"]
self.additional_args += ["-DENABLE_OPENH264=YES"]
self.additional_args += ["-DENABLE_VPX=YES"]
self.additional_args += ["-DENABLE_X264=NO"]
if self.args.package:
self.additional_args += ["-DENABLE_PACKAGING=YES"]
self.additional_args += ["-DCMAKE_SKIP_INSTALL_RPATH=YES"]
self.additional_args += ["-DENABLE_RELATIVE_PREFIX=YES"]
def clean(self):
prepare.Preparator.clean(self)
if os.path.isfile('Makefile'):
os.remove('Makefile')
if os.path.isdir('WORK') and not os.listdir('WORK'):
os.rmdir('WORK')
if os.path.isdir('OUTPUT') and not os.listdir('OUTPUT'):
os.rmdir('OUTPUT')
def generate_makefile(self, generator):
targets = self.args.target
targets_str = ""
for target in targets:
targets_str += """
{target}: {target}-build
{target}-build:
\t{generator} WORK/{target}/cmake
\t@echo "Done"
""".format(target=target, generator=generator)
makefile = """
targets={targets}
return ret .PHONY: all
all: build
def generate_makefile(generator): build: $(addsuffix -build, $(targets))
makefile = """
.PHONY: all
all: {targets_str}
\t{generator} WORK/cmake
pull-transifex: pull-transifex:
\t$(MAKE) -C linphone pull-transifex \t$(MAKE) -C linphone pull-transifex
...@@ -135,139 +163,22 @@ help: help-prepare-options ...@@ -135,139 +163,22 @@ help: help-prepare-options
\t@echo "" \t@echo ""
\t@echo "(please read the README.md file first)" \t@echo "(please read the README.md file first)"
\t@echo "" \t@echo ""
\t@echo "Available targets:" \t@echo "Available targets: {targets}"
\t@echo ""
\t@echo " * all, build : normal build"
\t@echo "" \t@echo ""
""".format(options=' '.join(sys.argv), generator=generator) """.format(targets=' '.join(targets), targets_str=targets_str, options=' '.join(sys.argv), generator=generator)
f = open('Makefile', 'w') f = open('Makefile', 'w')
f.write(makefile) f.write(makefile)
f.close() f.close()
def main(argv=None):
basicConfig(format="%(levelname)s: %(message)s", level=INFO)
if argv is None:
argv = sys.argv
argparser = argparse.ArgumentParser(
description="Prepare build of Linphone and its dependencies.")
argparser.add_argument(
'-ac', '--all-codecs', help="Enable all codecs, including the non-free ones", action='store_true')
argparser.add_argument(
'-c', '--clean', help="Clean a previous build instead of preparing a build.", action='store_true')
argparser.add_argument(
'-C', '--veryclean', help="Clean a previous build instead of preparing a build (also deleting the install prefix).",
action='store_true')
argparser.add_argument(
'-d', '--debug', help="Prepare a debug build, eg. add debug symbols and use no optimizations.", action='store_true')
argparser.add_argument(
'-f', '--force', help="Force preparation, even if working directory already exist.", action='store_true')
argparser.add_argument(
'-G', '--generator', help="CMake build system generator (default: let CMake choose, use cmake -h to get the complete list).",
default="Unix Makefiles", dest='generator')
argparser.add_argument(
'-L', '--list-cmake-variables', help="List non-advanced CMake cache variables.", action='store_true', dest='list_cmake_variables')
argparser.add_argument(
'-sys', '--use-system-dependencies', help="Find dependencies on the system.", action='store_true')
argparser.add_argument(
'-p', '--package', help="Build an installation package (only on Mac OSX and Windows).", action='store_true')
argparser.add_argument(
'--python', help="Build Python module instead of desktop application.", action='store_true')
argparser.add_argument(
'--python-raspberry', help="Build Python module for raspberry pi instead of desktop application.", action='store_true')
argparser.add_argument(
'-t', '--tunnel', help="Enable Tunnel.", action='store_true')
args, additional_args = argparser.parse_known_args()
if args.use_system_dependencies:
additional_args += ["-DLINPHONE_BUILDER_USE_SYSTEM_DEPENDENCIES=YES"]
if args.all_codecs:
additional_args += ["-DENABLE_GPL_THIRD_PARTIES=YES"]
additional_args += ["-DENABLE_NON_FREE_CODECS=YES"]
additional_args += ["-DENABLE_AMRNB=YES"]
additional_args += ["-DENABLE_AMRWB=YES"]
additional_args += ["-DENABLE_G729=YES"]
additional_args += ["-DENABLE_GSM=YES"]
additional_args += ["-DENABLE_ILBC=YES"]
additional_args += ["-DENABLE_ISAC=YES"]
additional_args += ["-DENABLE_OPUS=YES"]
additional_args += ["-DENABLE_SILK=YES"]
additional_args += ["-DENABLE_SPEEX=YES"]
additional_args += ["-DENABLE_FFMPEG=YES"]
additional_args += ["-DENABLE_H263=YES"]
additional_args += ["-DENABLE_H263P=YES"]
additional_args += ["-DENABLE_MPEG4=YES"]
additional_args += ["-DENABLE_OPENH264=YES"]
additional_args += ["-DENABLE_VPX=YES"]
additional_args += ["-DENABLE_X264=NO"]
if args.package:
additional_args += ["-DENABLE_PACKAGING=YES"]
additional_args += ["-DCMAKE_SKIP_INSTALL_RPATH=YES"]
additional_args += ["-DENABLE_RELATIVE_PREFIX=YES"]
if check_tools() != 0:
return 1
if args.tunnel or os.path.isdir("submodules/tunnel"):
if not os.path.isdir("submodules/tunnel"):
info("Tunnel wanted but not found yet, trying to clone it...") def main():
p = Popen("git clone gitosis@git.linphone.org:tunnel.git submodules/tunnel".split(" ")) preparator = DesktopPreparator()
p.wait() preparator.parse_args()
if p.returncode != 0: if preparator.check_tools() != 0:
error("Could not clone tunnel. Please see http://www.belledonne-communications.com/voiptunnel.html") preparator.show_missing_dependencies()
return 1 return 1
info("Tunnel enabled.") return preparator.run()
additional_args += ["-DENABLE_TUNNEL=YES"]
# install_git_hook()
target = None
if args.python:
target = PythonTarget()
elif args.python_raspberry:
target = PythonRaspberryTarget()
else:
# for simple Makefile / ninja builds, we do not want to use grouped feature
# to ease development by having each project separated from each other
ungrouped_generators = [ "Unix Makefiles", "Ninja" ]
use_group = "YES" if args.package or not any(generator in args.generator for generator in ungrouped_generators) else "NO"
target = DesktopTarget(use_group=use_group)
target.generator = args.generator
if args.clean or args.veryclean:
if args.veryclean:
target.veryclean()
else:
target.clean()
if os.path.isfile('Makefile'):
os.remove('Makefile')
else:
retcode = prepare.run(target, args.debug, False, args.list_cmake_variables, args.force, additional_args)
if retcode != 0:
if retcode == 51:
Popen("make help-prepare-options".split(" "))
retcode = 0
return retcode
# only generated makefile if we are using Ninja or Makefile
if target.generator.endswith('Ninja'):
if not check_is_installed("ninja", "it"):
return 1
generate_makefile('ninja -C')
info("You can now run 'make' to build.")
elif target.generator.endswith("Unix Makefiles"):
generate_makefile('$(MAKE) -C')
info("You can now run 'make' to build.")
elif target.generator == "Xcode":
info("You can now open Xcode project with: open WORK/cmake/Project.xcodeproj")
else:
warning("Not generating meta-makefile for generator {}.".format(target.generator))
return 0
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(main()) sys.exit(main())
cmake-builder @ fb685095
Subproject commit 40596b7f37385ddddea2090cd4666781a60fef30 Subproject commit fb685095b41d077edc86ccceb0435f29be753955
libxml2 @ c943f708
Subproject commit c943f708f1853de4eb15e5a94cf0b35d108da87a
############################################################################
# CMakeLists.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
cmake_minimum_required(VERSION 2.6)
project(SQLITE3 C)
option(ENABLE_STATIC "Build static library (default is shared library)." OFF)
set(SOURCE_FILES sqlite3.c)
if(WIN32)
list(APPEND SOURCE_FILES sqlite3.def)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_definitions(
-DSQLITE_OS_WINRT=1
-DSQLITE_WIN32_FILEMAPPING_API=1
-DSQLITE_OMIT_LOAD_EXTENSION
)
endif()
if(ENABLE_STATIC)
add_library(sqlite3 STATIC ${SOURCE_FILES})
else()
add_library(sqlite3 SHARED ${SOURCE_FILES})
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/sqlite3.pdb
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
endif()
endif()
install(TARGETS sqlite3
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
file(GLOB HEADER_FILES "*.h")
install(FILES ${HEADER_FILES}
DESTINATION include
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
v4l-utils @ 92995faa
Subproject commit 92995faa431fdd247d55b982898a70aa3a339874
zlib @ 91eb77a7
Subproject commit 91eb77a7c5bfe7b4cc6b722aa96548d7143a9936
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment