diff --git a/.gitignore b/.gitignore index 85a6aed1d..2bbd7b4c4 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,6 @@ Linphone.app *.dmg tester/linphone*.log tester/linphone_log.txt +.tx/linphone-gtk.linphonedesktopin/ +po/linphone.pot +.tx/linphone-gtk.audio-assistantdesktopin/ diff --git a/.tx/config b/.tx/config new file mode 100644 index 000000000..0b35698f1 --- /dev/null +++ b/.tx/config @@ -0,0 +1,20 @@ +[main] +host = https://www.transifex.com +minimum_perc = 1 + +[linphone-gtk.linphonepot] +file_filter = po/.po +source_file = po/linphone.pot +source_lang = en +type = PO + +[linphone-gtk.linphonedesktopin] +source_file = share/linphone.desktop.in +source_lang = en +type = DESKTOP + +[linphone-gtk.audio-assistantdesktopin] +source_file = share/audio-assistant.desktop.in +source_lang = en +type = DESKTOP + diff --git a/CMakeLists.txt b/CMakeLists.txt index 4311101fd..f1664f68d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,8 @@ set(LINPHONE_MICRO_VERSION "0") set(LINPHONE_VERSION "${LINPHONE_MAJOR_VERSION}.${LINPHONE_MINOR_VERSION}.${LINPHONE_MICRO_VERSION}") set(LINPHONE_SO_VERSION "6") +set(LINPHONE_ALL_LANGS "cs de es fr he hu it ja nb_NO nl pl pt_BR ru sr sv zh_CN zh_TW") + include(CMakeDependentOption) @@ -39,9 +41,9 @@ option(ENABLE_DATE "Use build date in internal version number." NO) option(ENABLE_GTK_UI "Turn on or off compilation of gtk interface." YES) option(ENABLE_LDAP "Enable LDAP support." NO) option(ENABLE_MSG_STORAGE "Turn on compilation of message storage." YES) -option(ENABLE_NOTIFY "Enable libnotify support." YES) +cmake_dependent_option(ENABLE_NOTIFY "Enable libnotify support." YES "ENABLE_GTK_UI" NO) option(ENABLE_RELATIVE_PREFIX "Find resources relatively to the installation directory." NO) -option(ENABLE_TOOLS "Turn on or off compilation of console interface" YES) +option(ENABLE_TOOLS "Turn on or off compilation of tools." YES) option(ENABLE_TUNNEL "Turn on compilation of tunnel support." NO) option(ENABLE_TUTORIALS "Enable compilation of tutorials." YES) option(ENABLE_UNIT_TESTS "Enable compilation of unit tests." YES) @@ -50,24 +52,56 @@ option(ENABLE_VIDEO "Build with video support." YES) cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENABLE_GTK_UI" NO) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_PREFIX_PATH}/share/cmake/Modules) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/share/cmake/Modules") include(CheckIncludeFile) +include(CheckSymbolExists) if(MSVC) - list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_PREFIX_PATH}/include/MSVC) + list(APPEND CMAKE_REQUIRED_INCLUDES "${CMAKE_PREFIX_PATH}/include/MSVC") endif() find_package(BelleSIP REQUIRED) find_package(MS2 REQUIRED) find_package(XML2 REQUIRED) +if(ENABLE_UNIT_TESTS) + find_package(CUnit) + if(CUNIT_FOUND) + cmake_push_check_state(RESET) + list(APPEND CMAKE_REQUIRED_INCLUDES ${CUNIT_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${CUNIT_LIBRARIES}) + check_symbol_exists("CU_get_suite" "CUnit/CUnit.h" HAVE_CU_GET_SUITE) + check_symbol_exists("CU_curses_run_tests" "CUnit/CUnit.h" HAVE_CU_CURSES) + cmake_pop_check_state() + else() + message(WARNING "Could not find the cunit library!") + set(ENABLE_UNIT_TESTS OFF CACHE BOOL "Enable compilation of unit tests." FORCE) + endif() +endif() if(ENABLE_TUNNEL) find_package(Tunnel) if(NOT TUNNEL_FOUND) message(WARNING "Could not find the tunnel library!") - set(ENABLE_TUNNEL OFF CACHE BOOL "Enable tunnel support" FORCE) + set(ENABLE_TUNNEL OFF CACHE BOOL "Enable tunnel support." FORCE) endif() endif() +if(ENABLE_MSG_STORAGE) + find_package(Sqlite3) + if(NOT SQLITE3_FOUND) + message(FATAL_ERROR "Could not find the sqlite3 library!") + endif() +endif() +if(ENABLE_NOTIFY) + find_package(Notify) + if(NOTIFY_FOUND) + set(HAVE_NOTIFY4 1) + else() + message(WARNING "Could not find the notify library!") + set(ENABLE_NOTIFY OFF CACHE BOOL "Enable libnotify support." FORCE) + endif() +endif() +find_package(Gettext) include_directories( @@ -79,6 +113,10 @@ include_directories( ${MS2_INCLUDE_DIRS} ${XML2_INCLUDE_DIRS} ) +if(SQLITE3_FOUND) + include_directories(${SQLITE3_INCLUDE_DIRS}) + add_definitions("-DMSG_STORAGE_ENABLED") +endif() if(ENABLE_TUNNEL) include_directories(${TUNNEL_INCLUDE_DIRS}) endif() @@ -87,7 +125,29 @@ if(MSVC) include_directories(${CMAKE_PREFIX_PATH}/include/MSVC) endif() +add_definitions("-DIN_LINPHONE") + +if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") +else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wuninitialized -Wdeclaration-after-statement -fno-strict-aliasing -Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wuninitialized -Werror") + if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -Wno-array-bounds") + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -Wno-array-bounds") + endif() + if(APPLE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unknown-warning-option -Wno-tautological-compare -Wno-unused-function") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unknown-warning-option -Wno-tautological-compare -Wno-unused-function") + endif() +endif() + + +set(GETTEXT_PACKAGE "linphone") if(ENABLE_RELATIVE_PREFIX) set(LINPHONE_DATA_DIR ".") else() @@ -97,19 +157,36 @@ set(LINPHONE_PLUGINS_DIR "${LINPHONE_DATA_DIR}/lib/liblinphone/plugins") set(PACKAGE_LOCALE_DIR "${LINPHONE_DATA_DIR}/share/locale") set(PACKAGE_DATA_DIR "${LINPHONE_DATA_DIR}/share") set(PACKAGE_SOUND_DIR "${LINPHONE_DATA_DIR}/share/sounds/linphone") +set(PACKAGE_RING_DIR "${PACKAGE_SOUND_DIR}/rings") +set(PACKAGE_FREEDESKTOP_DIR "${PACKAGE_DATA_DIR}/applications") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/config.h PROPERTIES GENERATED ON) add_definitions(-DHAVE_CONFIG_H) -add_subdirectory(coreapi) -add_subdirectory(share) -if(ENABLE_TOOLS) - add_subdirectory(tools) +if(ENABLE_VIDEO) + add_definitions(-DVIDEO_ENABLED) endif() -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/FindLinphone.cmake +add_subdirectory(coreapi) +add_subdirectory(share) +if(ENABLE_GTK_UI) + add_subdirectory(gtk) + add_subdirectory(pixmaps) + add_subdirectory(po) +endif() +if(ENABLE_TOOLS) + add_subdirectory(tools) +endif() +if(ENABLE_UNIT_TESTS) + add_subdirectory(tester) +endif() + + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLinphone.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindLinphone.cmake) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FindLinphone.cmake DESTINATION share/cmake/Modules PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) diff --git a/Makefile.am b/Makefile.am index dd66874b2..2fd425a0d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -205,7 +205,8 @@ MACAPPZIP=$(PACKAGE)-$(VERSION).app.zip MACAPPDMG=$(PACKAGE)-$(VERSION).dmg BUNDLEPREFIX=./ BUNDLEDIR=$(BUNDLEPREFIX)$(MACAPPNAME) - +#a path prefix where additional libs can be cherry-picked by the bundler. +LINPHONE_ADDITIONAL_DEPENDENCIES_PREFIX=/usr/local bundle: rm -rf $(INSTALLDIR) @@ -215,6 +216,7 @@ bundle: LINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \ LIBLINPHONE_INSTALL_PREFIX=$(INSTALLDIR_WITH_PREFIX) \ MS2_PLUGINS_INSTALL_PREFIX=$(prefix) \ + LINPHONE_ADDITIONAL_DEPENDENCIES_PREFIX=$(LINPHONE_ADDITIONAL_DEPENDENCIES_PREFIX) \ gtk-mac-bundler $(PACKAGE_BUNDLE_FILE) printf "[Pango]\nModuleFiles=./etc/pango/pango.modules\n" \ > $(BUNDLEDIR)/Contents/Resources/etc/pango/pangorc diff --git a/README.macos.md b/README.macos.md index 6dd8b4625..cfe0a40a9 100644 --- a/README.macos.md +++ b/README.macos.md @@ -42,18 +42,9 @@ In order to enable generation of bundle for multiple MacOS version and 32 bit pr # readline is required from linphonec.c otherwise compilation will fail brew link readline --force - # then you have to install antlr3 from a tap. - wget https://gist.githubusercontent.com/Gui13/f5cf103f50d34c28c7be/raw/f50242f5e0c3a6d25ed7fca1462bce3a7b738971/antlr3.rb - mv antlr3.rb /usr/local/Library/Formula/ - brew install antlr3 - - brew tap marekjelen/gtk - brew install gtk+-quartz - - # gtk-mac-integration is not available in main repository or Brew yet. - wget https://gist.github.com/Gui13/cdcad37faa6b8ffa0588/raw/bf2277d45e261ad48ae1344c4c97f2684974ed87/gtk-mac-integration.rb - mv gtk-mac-integration.rb /usr/local/Library/Formula/ - brew install gtk-mac-integration + # then you have to install some dependencies from a tap. + brew tap Gui13/linphone + brew install antlr3.2 libantlr3.4c mattintosh4/gtk-mac-integration/gtk-mac-integration ### Building Linphone @@ -121,10 +112,7 @@ The libvpx build isn't able to produce dual architecture files. To workaround th If you got the source code from git, run `./autogen.sh` first. Then or otherwise, : - # HomeBrew - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/opt/local --disable-x11 --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict --with-readline=/usr/local && make - # MacPorts - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/opt/local --disable-x11 --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict --with-readline=/opt/local && make + PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/opt/local --disable-x11 --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict && make * Install on the system diff --git a/build/android/liblinphone_tester.mk b/build/android/liblinphone_tester.mk index 430f203be..ee2018621 100644 --- a/build/android/liblinphone_tester.mk +++ b/build/android/liblinphone_tester.mk @@ -17,7 +17,8 @@ common_SRC_FILES := \ log_collection_tester.c \ transport_tester.c \ player_tester.c \ - dtmf_tester.c + dtmf_tester.c \ + accountmanager.c common_C_INCLUDES += \ $(LOCAL_PATH) \ diff --git a/build/macos/environment.sh b/build/macos/environment.sh index 3b9ff16af..b466fecc4 100644 --- a/build/macos/environment.sh +++ b/build/macos/environment.sh @@ -1,4 +1,5 @@ -export EXTRA_ARGS="--workdir $bundle_res" +#export EXTRA_ARGS="--workdir $bundle_res" +export LINPHONE_WORKDIR="$bundle_res" export GIO_EXTRA_MODULES="$bundle_lib/gio/modules" export PANGO_LIBDIR="$bundle_lib" export PANGO_SYSCONFDIR="$bundle_etc" diff --git a/build/macos/linphone.bundle b/build/macos/linphone.bundle index 8896fa7d3..7a5906e9e 100644 --- a/build/macos/linphone.bundle +++ b/build/macos/linphone.bundle @@ -16,7 +16,7 @@ ${env:LINPHONE_INSTALL_PREFIX} ${env:MS2_PLUGINS_INSTALL_PREFIX} - /usr/local + ${env:LINPHONE_ADDITIONAL_DEPENDENCIES_PREFIX}