From 7defe94fc507e977cedb62d76c9c3d975c716e30 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Wed, 13 Feb 2013 16:53:50 +0100 Subject: [PATCH] Add libupnp dependency for Android --- .gitmodules | 3 + Makefile | 3 +- default.properties | 2 +- jni/Android.mk | 5 + jni/Application.mk | 5 + submodules/externals/build/libupnp/Android.mk | 70 ++++++ .../externals/build/libupnp/inc/autoconfig.h | 202 ++++++++++++++++++ .../externals/build/libupnp/inc/upnpconfig.h | 136 ++++++++++++ submodules/externals/build/libxml2/Android.mk | 1 + submodules/externals/libupnp | 1 + submodules/linphone | 2 +- 11 files changed, 427 insertions(+), 3 deletions(-) create mode 100644 submodules/externals/build/libupnp/Android.mk create mode 100644 submodules/externals/build/libupnp/inc/autoconfig.h create mode 100644 submodules/externals/build/libupnp/inc/upnpconfig.h create mode 160000 submodules/externals/libupnp diff --git a/.gitmodules b/.gitmodules index 1067b54f5..9f5ce1d81 100644 --- a/.gitmodules +++ b/.gitmodules @@ -61,3 +61,6 @@ [submodule "submodules/externals/libxml2"] path = submodules/externals/libxml2 url = git://git.gnome.org/libxml2 +[submodule "submodules/externals/libupnp"] + path = submodules/externals/libupnp + url = git://git.code.sf.net/p/pupnp/code diff --git a/Makefile b/Makefile index e557ad0b6..77dd23225 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ LINPHONE_VERSION=$(shell cd submodules/linphone && git describe) LINPHONE_ANDROID_DEBUG_VERSION=$(shell git describe) ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | grep android | tail -n1) +BUILD_UPNP=1 BUILD_REMOTE_PROVISIONING=1 BUILD_X264=1 BUILD_AMRNB=full # 0, light or full @@ -88,7 +89,7 @@ prepare-mediastreamer2: prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-srtp prepare-mediastreamer2 generate-libs: - $(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_REMOTE_PROVISIONING=$(BUILD_REMOTE_PROVISIONING) BUILD_X264=$(BUILD_X264) BUILD_AMRNB=$(BUILD_AMRNB) BUILD_AMRWB=$(BUILD_AMRWB) BUILD_GPLV3_ZRTP=$(BUILD_GPLV3_ZRTP) BUILD_SILK=$(BUILD_SILK) BUILD_G729=$(BUILD_G729) BUILD_TUNNEL=$(BUILD_TUNNEL) BUILD_WEBRTC_AECM=$(BUILD_WEBRTC_AECM) BUILD_FOR_X86=$(BUILD_FOR_X86) USE_JAVAH=$(USE_JAVAH) -j$(NUMCPUS) + $(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_UPNP=$(BUILD_UPNP) BUILD_REMOTE_PROVISIONING=$(BUILD_REMOTE_PROVISIONING) BUILD_X264=$(BUILD_X264) BUILD_AMRNB=$(BUILD_AMRNB) BUILD_AMRWB=$(BUILD_AMRWB) BUILD_GPLV3_ZRTP=$(BUILD_GPLV3_ZRTP) BUILD_SILK=$(BUILD_SILK) BUILD_G729=$(BUILD_G729) BUILD_TUNNEL=$(BUILD_TUNNEL) BUILD_WEBRTC_AECM=$(BUILD_WEBRTC_AECM) BUILD_FOR_X86=$(BUILD_FOR_X86) USE_JAVAH=$(USE_JAVAH) -j$(NUMCPUS) update-project: $(SDK_PATH)/android update project --path . --target $(ANDROID_MOST_RECENT_TARGET) diff --git a/default.properties b/default.properties index a4c4c0dea..98c20fc6d 100644 --- a/default.properties +++ b/default.properties @@ -1 +1 @@ -version.name=1.2.2.2-822-gfedf522 +version.name=2.0.3-1-20-gea897fb diff --git a/jni/Android.mk b/jni/Android.mk index 5b86fbfa3..fe46137de 100755 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -36,6 +36,11 @@ SRTP_C_INCLUDE= \ endif #endif +#libupnp +ifeq ($(BUILD_UPNP),1) +include $(linphone-root-dir)/submodules/externals/build/libupnp/Android.mk +endif + #libxml2 ifeq ($(BUILD_REMOTE_PROVISIONING),1) include $(linphone-root-dir)/submodules/externals/build/libxml2/Android.mk diff --git a/jni/Application.mk b/jni/Application.mk index 44edcd6af..1d68d962d 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -2,6 +2,11 @@ APP_PROJECT_PATH := $(call my-dir)/../ APP_MODULES :=libspeex libgsm libortp libosip2 libeXosip2 libmediastreamer2 liblinphone liblinphonenoneon libneon APP_STL := stlport_static +#uPnp +ifeq ($(BUILD_UPNP),1) +APP_MODULES += libupnp +endif + #remote provisioning ifeq ($(BUILD_REMOTE_PROVISIONING),1) APP_MODULES += libxml2 libxml2lpc liblpc2xml diff --git a/submodules/externals/build/libupnp/Android.mk b/submodules/externals/build/libupnp/Android.mk new file mode 100644 index 000000000..2fd7f77d0 --- /dev/null +++ b/submodules/externals/build/libupnp/Android.mk @@ -0,0 +1,70 @@ +LOCAL_PATH:= $(call my-dir)/../../libupnp +include $(CLEAR_VARS) + +# We need to build this for both the device (as a shared library) +# and the host (as a static library for tools to use). + + +LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/../build/libupnp/inc \ + $(LOCAL_PATH)/upnp/inc \ + $(LOCAL_PATH)/upnp/src/inc \ + $(LOCAL_PATH)/threadutil/inc \ + $(LOCAL_PATH)/ixml/inc \ + $(LOCAL_PATH)/ixml/src/inc \ + +LOCAL_SRC_FILES := \ + upnp/src/ssdp/ssdp_device.c \ + upnp/src/ssdp/ssdp_server.c \ + upnp/src/ssdp/ssdp_ctrlpt.c \ + upnp/src/genlib/service_table/service_table.c \ + upnp/src/genlib/util/upnp_timeout.c \ + upnp/src/genlib/util/membuffer.c \ + upnp/src/genlib/util/strintmap.c \ + upnp/src/genlib/util/util.c \ + upnp/src/genlib/net/uri/uri.c \ + upnp/src/genlib/net/http/httpreadwrite.c \ + upnp/src/genlib/net/http/statcodes.c \ + upnp/src/genlib/net/http/httpparser.c \ + upnp/src/genlib/net/http/webserver.c \ + upnp/src/genlib/net/http/parsetools.c \ + upnp/src/genlib/net/sock.c \ + upnp/src/genlib/miniserver/miniserver.c \ + upnp/src/genlib/client_table/client_table.c \ + upnp/src/api/upnptools.c \ + upnp/src/api/UpnpString.c \ + upnp/src/api/upnpapi.c \ + upnp/src/api/upnpdebug.c \ + upnp/src/uuid/sysdep.c \ + upnp/src/uuid/uuid.c \ + upnp/src/uuid/md5.c \ + upnp/src/soap/soap_device.c \ + upnp/src/soap/soap_ctrlpt.c \ + upnp/src/soap/soap_common.c \ + upnp/src/win_dll.c \ + upnp/src/inet_pton.c \ + upnp/src/urlconfig/urlconfig.c \ + upnp/src/gena/gena_callback2.c \ + upnp/src/gena/gena_ctrlpt.c \ + upnp/src/gena/gena_device.c \ + threadutil/src/FreeList.c \ + threadutil/src/LinkedList.c \ + threadutil/src/ThreadPool.c \ + threadutil/src/TimerThread.c \ + ixml/src/ixmldebug.c \ + ixml/src/node.c \ + ixml/src/ixmlmembuf.c \ + ixml/src/attr.c \ + ixml/src/ixmlparser.c \ + ixml/src/element.c \ + ixml/src/nodeList.c \ + ixml/src/ixml.c \ + ixml/src/document.c \ + ixml/src/namedNodeMap.c \ + +LOCAL_C_FLAGS += -DPTHREAD_MUTEX_RECURSIVE=PTHREAD_MUTEX_RECURSIVE + +LOCAL_MODULE:= libupnp + +include $(BUILD_STATIC_LIBRARY) + diff --git a/submodules/externals/build/libupnp/inc/autoconfig.h b/submodules/externals/build/libupnp/inc/autoconfig.h new file mode 100644 index 000000000..77f5b4617 --- /dev/null +++ b/submodules/externals/build/libupnp/inc/autoconfig.h @@ -0,0 +1,202 @@ +/* autoconfig.h. Generated from autoconfig.h.in by configure. */ +/* autoconfig.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 to compile debug code */ +/* #undef DEBUG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Defines if strndup is available on your system */ +#define HAVE_STRNDUP 1 + +/* Defines if strnlen is available on your system */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 to prevent compilation of assert() */ +#define NDEBUG 1 + +/* Define to 1 to prevent some debug code */ +#define NO_DEBUG 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "libupnp" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mroberto@users.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libupnp" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libupnp 1.6.17" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libupnp" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.6.17" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* see upnpconfig.h */ +#define UPNP_ENABLE_BLOCKING_TCP_CONNECTIONS 1 + +/* see upnpconfig.h */ +/* #undef UPNP_ENABLE_IPV6 */ + +/* see upnpconfig.h */ +#define UPNP_ENABLE_NOTIFICATION_REORDERING 1 + +/* see upnpconfig.h */ +/* #undef UPNP_ENABLE_UNSPECIFIED_SERVER */ + +/* see upnpconfig.h */ +#define UPNP_HAVE_CLIENT 1 + +/* see upnpconfig.h */ +/* #undef UPNP_HAVE_DEBUG */ + +/* see upnpconfig.h */ +#define UPNP_HAVE_DEVICE 1 + +/* see upnpconfig.h */ +#define UPNP_HAVE_GENA 1 + +/* see upnpconfig.h */ +#define UPNP_HAVE_OPTSSDP 1 + +/* see upnpconfig.h */ +#define UPNP_HAVE_SOAP 1 + +/* see upnpconfig.h */ +#define UPNP_HAVE_SSDP 1 + +/* see upnpconfig.h */ +#define UPNP_HAVE_TOOLS 1 + +/* see upnpconfig.h */ +#define UPNP_HAVE_WEBSERVER 1 + +/* Do not use pthread_rwlock_t */ +/* #undef UPNP_USE_RWLOCK */ + +/* see upnpconfig.h */ +#define UPNP_VERSION_MAJOR 1 + +/* see upnpconfig.h */ +#define UPNP_VERSION_MINOR 6 + +/* see upnpconfig.h */ +#define UPNP_VERSION_PATCH 17 + +/* see upnpconfig.h */ +#define UPNP_VERSION_STRING "1.6.17" + +/* Version number of package */ +#define VERSION "1.6.17" + +/* File Offset size */ +#define _FILE_OFFSET_BITS 64 + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Large files support */ +#define _LARGE_FILE_SOURCE /**/ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Type for storing the length of struct sockaddr */ +/* #undef socklen_t */ diff --git a/submodules/externals/build/libupnp/inc/upnpconfig.h b/submodules/externals/build/libupnp/inc/upnpconfig.h new file mode 100644 index 000000000..f20255704 --- /dev/null +++ b/submodules/externals/build/libupnp/inc/upnpconfig.h @@ -0,0 +1,136 @@ +/* upnp/inc/upnpconfig.h. Generated from upnpconfig.h.in by configure. */ +/* -*- C -*- */ +/******************************************************************************* + * + * Copyright (c) 2006 Rémi Turboult + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ******************************************************************************/ + +#ifndef UPNP_CONFIG_H +#define UPNP_CONFIG_H + + +/*************************************************************************** + * Library version + ***************************************************************************/ + +/** The library version (string) e.g. "1.3.0" */ +#define UPNP_VERSION_STRING "1.6.17" + +/** Major version of the library */ +#define UPNP_VERSION_MAJOR 1 + +/** Minor version of the library */ +#define UPNP_VERSION_MINOR 6 + +/** Patch version of the library */ +#define UPNP_VERSION_PATCH 17 + +/** The library version (numeric) e.g. 10300 means version 1.3.0 */ +#define UPNP_VERSION \ + ((UPNP_VERSION_MAJOR * 100 + UPNP_VERSION_MINOR) * 100 + UPNP_VERSION_PATCH) + + + +/*************************************************************************** + * Large file support + ***************************************************************************/ + +/** File Offset size */ +#define _FILE_OFFSET_BITS 64 + +/** Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/** Large files support */ +#define _LARGE_FILE_SOURCE /**/ + +/*************************************************************************** + * Library optional features + ***************************************************************************/ + +/* + * The following defines can be tested in order to know which + * optional features have been included in the installed library. + */ + + +/** Defined to 1 if the library has been compiled with DEBUG enabled + * (i.e. configure --enable-debug) : file is available */ +/* #undef UPNP_HAVE_DEBUG */ + + +/** Defined to 1 if the library has been compiled with client API enabled + * (i.e. configure --enable-client) */ +#define UPNP_HAVE_CLIENT 1 + + +/** Defined to 1 if the library has been compiled with device API enabled + * (i.e. configure --enable-device) */ +/* #undef UPNP_HAVE_DEVICE */ + + +/** Defined to 1 if the library has been compiled with integrated web server + * (i.e. configure --enable-webserver --enable-device) */ +/* #undef UPNP_HAVE_WEBSERVER */ + + +/** Defined to 1 if the library has been compiled with the SSDP part enabled + * (i.e. configure --enable-ssdp) */ +#define UPNP_HAVE_SSDP 1 + + +/** Defined to 1 if the library has been compiled with optional SSDP headers + * support (i.e. configure --enable-optssdp) */ +#define UPNP_HAVE_OPTSSDP 1 + + +/** Defined to 1 if the library has been compiled with the SOAP part enabled + * (i.e. configure --enable-soap) */ +#define UPNP_HAVE_SOAP 1 + + +/** Defined to 1 if the library has been compiled with the GENA part enabled + * (i.e. configure --enable-gena) */ +#define UPNP_HAVE_GENA 1 + + +/** Defined to 1 if the library has been compiled with helper API + * (i.e. configure --enable-tools) : file is available */ +#define UPNP_HAVE_TOOLS 1 + +/** Defined to 1 if the library has been compiled with ipv6 support + * (i.e. configure --enable-ipv6) */ +/* #undef UPNP_ENABLE_IPV6 */ + +/** Defined to 1 if the library has been compiled with unspecified SERVER + * header (i.e. configure --enable-unspecified_server) */ +/* #undef UPNP_ENABLE_UNSPECIFIED_SERVER */ + +#endif /* UPNP_CONFIG_H */ + diff --git a/submodules/externals/build/libxml2/Android.mk b/submodules/externals/build/libxml2/Android.mk index 98ea6d108..cb8329c97 100644 --- a/submodules/externals/build/libxml2/Android.mk +++ b/submodules/externals/build/libxml2/Android.mk @@ -1,4 +1,5 @@ LOCAL_PATH:= $(call my-dir)/../../libxml2 +include $(CLEAR_VARS) # We need to build this for both the device (as a shared library) # and the host (as a static library for tools to use). diff --git a/submodules/externals/libupnp b/submodules/externals/libupnp new file mode 160000 index 000000000..d0b16d056 --- /dev/null +++ b/submodules/externals/libupnp @@ -0,0 +1 @@ +Subproject commit d0b16d056e0f681a2bc6bd70859303b4bba521dc diff --git a/submodules/linphone b/submodules/linphone index ee6366003..04fef5fcc 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit ee6366003f803184830617e21e3bb709c9f09a8c +Subproject commit 04fef5fcca637a601025b01a62843f1423ff0d96