Squashed 'libtgvoip/' changes from fc13464..6e7384d

6e7384d Debug stats
a58c5fb Fixed build with TGVOIP_NO_DSP
1b699b3 p2p improvements
be5f739 Merge pull request #73 from bakatrouble/public
5efda7a Fix ARM Linux builds

git-subtree-dir: libtgvoip
git-subtree-split: 6e7384d5a8ddf01cc159392a69a49d816434282c
This commit is contained in:
infactum 2019-02-14 12:27:45 +05:00
parent c76b0a3f0c
commit 0b8cd430a2
14 changed files with 876 additions and 461 deletions

View File

@ -16,6 +16,7 @@
#include "VoIPServerConfig.h"
#include <string.h>
#include <stdio.h>
#include <math.h>
using namespace tgvoip;
@ -144,6 +145,7 @@ void EchoCanceller::Enable(bool enabled){
}
void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoice){
#ifndef TGVOIP_NO_DSP
if(!isOn || (!enableAEC && !enableAGC && !enableNS)){
return;
}
@ -165,6 +167,7 @@ void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoi
hasVoice=hasVoice || apm->voice_detection()->stream_has_voice();
}
memcpy(inOut+480, audioFrame->data(), 480*2);
#endif
}
void EchoCanceller::SetAECStrength(int strength){
@ -182,7 +185,9 @@ void EchoCanceller::SetAECStrength(int strength){
void EchoCanceller::SetVoiceDetectionEnabled(bool enabled){
enableVAD=enabled;
#ifndef TGVOIP_NO_DSP
apm->voice_detection()->Enable(enabled);
#endif
}
using namespace tgvoip::effects;

View File

@ -365,9 +365,7 @@ SRC += \
./webrtc_dsp/common_audio/vad/webrtc_vad.c \
./webrtc_dsp/common_audio/vad/vad_filterbank.c \
./webrtc_dsp/common_audio/vad/vad_core.c \
./webrtc_dsp/common_audio/vad/vad_gmm.c \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
./webrtc_dsp/common_audio/vad/vad_gmm.c
if TARGET_OS_OSX
CFLAGS += -DWEBRTC_MAC
@ -395,7 +393,7 @@ endif
if TARGET_CPU_ARM
SRC += \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \
webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.S
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S
if TARGET_CPU_ARMV7
CFLAGS += -mfpu=neon -mfloat-abi=hard
CCASFLAGS += -mfpu=neon -mfloat-abi=hard
@ -409,6 +407,10 @@ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.c \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc
# webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12_armv7.S
endif
else
SRC += \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
endif
# headers

View File

@ -392,9 +392,7 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/webrtc_vad.c \
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_filterbank.c \
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_core.c \
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_gmm.c \
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_gmm.c
@ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__append_11 = -DWEBRTC_MAC
@ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__append_12 = \
@ -415,7 +413,7 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@am__append_18 = \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.S
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__append_19 = -mfpu=neon -mfloat-abi=hard
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__append_20 = -mfpu=neon -mfloat-abi=hard
@ -429,9 +427,13 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc
# webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12_armv7.S
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@am__append_22 = \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
# headers
@ENABLE_DSP_TRUE@am__append_22 = \
@ENABLE_DSP_TRUE@am__append_23 = \
@ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/field_trial.h \
@ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/cpu_features_wrapper.h \
@ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/asm_defines.h \
@ -751,7 +753,7 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/vad/vad_sp.h \
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/vad/vad_filterbank.h
@ENABLE_DSP_FALSE@am__append_23 = -DTGVOIP_NO_DSP
@ENABLE_DSP_FALSE@am__append_24 = -DTGVOIP_NO_DSP
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@ -1076,15 +1078,13 @@ am__libtgvoip_la_SOURCES_DIST = VoIPController.cpp Buffers.cpp \
./webrtc_dsp/common_audio/vad/vad_filterbank.c \
./webrtc_dsp/common_audio/vad/vad_core.c \
./webrtc_dsp/common_audio/vad/vad_gmm.c \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c \
webrtc_dsp/rtc_base/logging_mac.mm \
webrtc_dsp/rtc_base/logging_mac.h \
webrtc_dsp/modules/audio_processing/aec/aec_core_sse2.cc \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_sse2.cc \
audio/AudioIOCallback.cpp \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \
webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.S \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S \
webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.c \
webrtc_dsp/common_audio/signal_processing/downsample_fast_neon.c \
webrtc_dsp/common_audio/signal_processing/min_max_operations_neon.c \
@ -1092,6 +1092,8 @@ am__libtgvoip_la_SOURCES_DIST = VoIPController.cpp Buffers.cpp \
webrtc_dsp/modules/audio_processing/aecm/aecm_core_neon.cc \
webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.c \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c \
webrtc_dsp/system_wrappers/include/field_trial.h \
webrtc_dsp/system_wrappers/include/cpu_features_wrapper.h \
webrtc_dsp/system_wrappers/include/asm_defines.h \
@ -1696,15 +1698,13 @@ am__dirstamp = $(am__leading_dot)dirstamp
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/webrtc_vad.lo \
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_filterbank.lo \
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_core.lo \
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_gmm.lo \
@ENABLE_DSP_TRUE@ webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo \
@ENABLE_DSP_TRUE@ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_gmm.lo
@ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__objects_5 = webrtc_dsp/rtc_base/logging_mac.lo
@ENABLE_DSP_TRUE@@TARGET_CPU_X86_TRUE@am__objects_6 = webrtc_dsp/modules/audio_processing/aec/aec_core_sse2.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_X86_TRUE@ webrtc_dsp/modules/audio_processing/utility/ooura_fft_sse2.lo
@ENABLE_AUDIO_CALLBACK_TRUE@@ENABLE_DSP_TRUE@am__objects_7 = audio/AudioIOCallback.lo
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@am__objects_8 = webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.lo
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.lo
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__objects_9 = webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/downsample_fast_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/min_max_operations_neon.lo \
@ -1712,8 +1712,10 @@ am__dirstamp = $(am__leading_dot)dirstamp
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/aecm/aecm_core_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.lo
am__objects_10 =
am__objects_11 = VoIPController.lo Buffers.lo CongestionControl.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@am__objects_10 = webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo
am__objects_11 =
am__objects_12 = VoIPController.lo Buffers.lo CongestionControl.lo \
EchoCanceller.lo JitterBuffer.lo logging.lo MediaStreamItf.lo \
MessageThread.lo NetworkSocket.lo OpusDecoder.lo \
OpusEncoder.lo PacketReassembler.lo VoIPGroupController.lo \
@ -1723,10 +1725,11 @@ am__objects_11 = VoIPController.lo Buffers.lo CongestionControl.lo \
video/VideoRenderer.lo json11.lo $(am__objects_1) \
$(am__objects_2) $(am__objects_3) $(am__objects_4) \
$(am__objects_5) $(am__objects_6) $(am__objects_7) \
$(am__objects_8) $(am__objects_9) $(am__objects_10)
am__objects_12 = $(am__objects_10) $(am__objects_10) $(am__objects_10) \
$(am__objects_10)
am_libtgvoip_la_OBJECTS = $(am__objects_11) $(am__objects_12)
$(am__objects_8) $(am__objects_9) $(am__objects_10) \
$(am__objects_11)
am__objects_13 = $(am__objects_11) $(am__objects_11) $(am__objects_11) \
$(am__objects_11)
am_libtgvoip_la_OBJECTS = $(am__objects_12) $(am__objects_13)
libtgvoip_la_OBJECTS = $(am_libtgvoip_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@ -2043,8 +2046,8 @@ am__depfiles_remade = ./$(DEPDIR)/Buffers.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo \
webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo \
webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo \
webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo \
@ -2198,7 +2201,7 @@ CCASFLAGS = @CCASFLAGS@ $(am__append_9) $(am__append_20)
CCDEPMODE = @CCDEPMODE@
CFLAGS = -Wall -DHAVE_CONFIG_H -Wno-unknown-pragmas $(am__append_8) \
$(am__append_11) $(am__append_13) $(am__append_15) \
$(am__append_19) $(am__append_23)
$(am__append_19) $(am__append_24)
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
@ -2324,7 +2327,8 @@ SRC = VoIPController.cpp Buffers.cpp CongestionControl.cpp \
video/VideoRenderer.cpp json11.cpp $(am__append_1) \
$(am__append_4) $(am__append_6) $(am__append_10) \
$(am__append_12) $(am__append_14) $(am__append_16) \
$(am__append_18) $(am__append_21) $(am__append_22)
$(am__append_18) $(am__append_21) $(am__append_22) \
$(am__append_23)
TGVOIP_HDRS = VoIPController.h Buffers.h BlockingQueue.h \
PrivateDefines.h CongestionControl.h EchoCanceller.h \
JitterBuffer.h logging.h threading.h MediaStreamItf.h \
@ -3434,17 +3438,6 @@ webrtc_dsp/common_audio/vad/$(DEPDIR)/$(am__dirstamp):
./webrtc_dsp/common_audio/vad/vad_gmm.lo: \
webrtc_dsp/common_audio/vad/$(am__dirstamp) \
webrtc_dsp/common_audio/vad/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp):
@$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor
@: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)
@: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo: webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp) \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/rtc_base/logging_mac.lo: \
webrtc_dsp/rtc_base/$(am__dirstamp) \
webrtc_dsp/rtc_base/$(DEPDIR)/$(am__dirstamp)
@ -3459,9 +3452,14 @@ audio/AudioIOCallback.lo: audio/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp):
@$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor
@: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)
@: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.lo: webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp) \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
@ -3483,6 +3481,11 @@ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.lo: \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.lo: \
webrtc_dsp/modules/audio_processing/utility/$(am__dirstamp) \
webrtc_dsp/modules/audio_processing/utility/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo: webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp) \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
libtgvoip.la: $(libtgvoip_la_OBJECTS) $(libtgvoip_la_DEPENDENCIES) $(EXTRA_libtgvoip_la_DEPENDENCIES)
$(AM_V_OBJCXXLD)$(OBJCXXLINK) -rpath $(libdir) $(libtgvoip_la_OBJECTS) $(libtgvoip_la_LIBADD) $(LIBS)
@ -3885,8 +3888,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo@am__quote@ # am--include-marker
@ -4748,8 +4751,8 @@ distclean: distclean-am
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo
-rm -f webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo
@ -5106,8 +5109,8 @@ maintainer-clean: maintainer-clean-am
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo
-rm -f webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo

View File

@ -158,6 +158,15 @@ std::string IPv4Address::ToString() const{
#endif
}
bool IPv4Address::PrefixMatches(const unsigned int prefix, const NetworkAddress &other) const{
const IPv4Address* v4=dynamic_cast<const IPv4Address*>(&other);
if(v4){
uint32_t mask=0xFFFFFFFF << (32-prefix);
return (address & mask) == (v4->address & mask);
}
return false;
}
/*sockaddr &IPv4Address::ToSockAddr(uint16_t port){
sockaddr_in sa;
sa.sin_family=AF_INET;
@ -198,6 +207,10 @@ std::string IPv6Address::ToString() const{
#endif
}
bool IPv6Address::PrefixMatches(const unsigned int prefix, const NetworkAddress &other) const{
return false;
}
bool IPv6Address::IsEmpty() const{
const uint64_t* a=reinterpret_cast<const uint64_t*>(address);
return a[0]==0LL && a[1]==0LL;

View File

@ -31,6 +31,7 @@ namespace tgvoip {
bool operator!=(const NetworkAddress& other) const;
virtual ~NetworkAddress()=default;
virtual bool IsEmpty() const =0;
virtual bool PrefixMatches(const unsigned int prefix, const NetworkAddress& other) const =0;
};
class IPv4Address : public NetworkAddress{
@ -41,6 +42,11 @@ namespace tgvoip {
virtual std::string ToString() const override;
uint32_t GetAddress() const;
virtual bool IsEmpty() const override;
virtual bool PrefixMatches(const unsigned int prefix, const NetworkAddress& other) const override;
static const IPv4Address Broadcast(){
return IPv4Address(0xFFFFFFFF);
}
private:
uint32_t address;
};
@ -53,6 +59,7 @@ namespace tgvoip {
virtual std::string ToString() const override;
const uint8_t* GetAddress() const;
virtual bool IsEmpty() const override;
virtual bool PrefixMatches(const unsigned int prefix, const NetworkAddress& other) const override;
private:
uint8_t address[16];
};

View File

@ -40,6 +40,9 @@ public:
void SetVadMode(bool vad);
void AddAudioEffect(effects::AudioEffect* effect);
void RemoveAudioEffect(effects::AudioEffect* effect);
int GetComplexity(){
return complexity;
}
private:
static size_t Callback(unsigned char* data, size_t len, void* param);

View File

@ -26,7 +26,7 @@
#define IS_MOBILE_NETWORK(x) (x==NET_TYPE_GPRS || x==NET_TYPE_EDGE || x==NET_TYPE_3G || x==NET_TYPE_HSPA || x==NET_TYPE_LTE || x==NET_TYPE_OTHER_MOBILE)
#define PROTOCOL_NAME 0x50567247 // "GrVP" in little endian (reversed here)
#define PROTOCOL_VERSION 8
#define PROTOCOL_VERSION 9
#define MIN_PROTOCOL_VERSION 3
#define STREAM_DATA_FLAG_LEN16 0x40

View File

@ -26,6 +26,7 @@
#include <exception>
#include <stdexcept>
#include <algorithm>
#include <sstream>
#include <inttypes.h>
#include <float.h>
@ -282,17 +283,17 @@ VoIPController::~VoIPController(){
delete echoCanceller;
}
delete conctl;
if(tgvoipLogFile){
FILE* log=tgvoipLogFile;
tgvoipLogFile=NULL;
fclose(log);
}
if(statsDump)
fclose(statsDump);
if(resolvedProxyAddress)
delete resolvedProxyAddress;
delete selectCanceller;
LOGD("Left VoIPController::~VoIPController");
if(tgvoipLogFile){
FILE* log=tgvoipLogFile;
tgvoipLogFile=NULL;
fclose(log);
}
}
void VoIPController::Stop(){
@ -435,6 +436,7 @@ void VoIPController::SetNetworkType(int type){
activeNetItfName=itfName;
if(isFirstChange)
return;
wasNetworkHandover=true;
if(currentEndpoint){
const Endpoint& _currentEndpoint=endpoints.at(currentEndpoint);
const Endpoint& _preferredRelay=endpoints.at(preferredRelay);
@ -453,8 +455,8 @@ void VoIPController::SetNetworkType(int type){
}
}else if(endpoint.type==Endpoint::Type::TCP_RELAY && endpoint.socket){
endpoint.socket->Close();
delete endpoint.socket;
endpoint.socket=NULL;
//delete endpoint.socket;
//endpoint.socket=NULL;
}
//if(endpoint->type==Endpoint::Type::UDP_P2P_INET){
endpoint.averageRTT=0;
@ -650,10 +652,6 @@ void VoIPController::GetStats(TrafficStats *stats){
}
string VoIPController::GetDebugLog(){
vector<json11::Json> lpkts;
for(DebugLoggedPacket& lpkt:debugLoggedPackets){
lpkts.push_back(json11::Json::array{lpkt.timestamp, lpkt.seq, lpkt.length});
}
map<string, json11::Json> network{
{"type", NetworkTypeToString(networkType)}
};
@ -665,6 +663,23 @@ string VoIPController::GetDebugLog(){
network["mcc"]=carrier.mcc;
network["mnc"]=carrier.mnc;
}
}else if(networkType==NET_TYPE_WIFI){
#ifdef __ANDROID__
jni::DoWithJNI([&](JNIEnv* env){
jmethodID getWifiInfoMethod=env->GetStaticMethodID(jniUtilitiesClass, "getWifiInfo", "()[I");
jintArray res=static_cast<jintArray>(env->CallStaticObjectMethod(jniUtilitiesClass, getWifiInfoMethod));
if(res){
jint* wifiInfo=env->GetIntArrayElements(res, NULL);
network["rssi"]=wifiInfo[0];
network["link_speed"]=wifiInfo[1];
env->ReleaseIntArrayElements(res, wifiInfo, JNI_ABORT);
}
});
#endif
}
/*vector<json11::Json> lpkts;
for(DebugLoggedPacket& lpkt:debugLoggedPackets){
lpkts.push_back(json11::Json::array{lpkt.timestamp, lpkt.seq, lpkt.length});
}
return json11::Json(json11::Json::object{
{"log_type", "out_packet_stats"},
@ -677,6 +692,50 @@ string VoIPController::GetDebugLog(){
}},
{"call_duration", GetCurrentTime()-connectionInitTime},
{"out_packet_stats", lpkts}
}).dump();*/
string p2pType="none";
Endpoint& cur=endpoints[currentEndpoint];
if(cur.type==Endpoint::Type::UDP_P2P_INET)
p2pType=cur.IsIPv6Only() ? "inet6" : "inet";
else if(cur.type==Endpoint::Type::UDP_P2P_LAN)
p2pType="lan";
vector<string> problems;
if(lastError==ERROR_TIMEOUT)
problems.push_back("timeout");
if(wasReconnecting)
problems.push_back("reconnecting");
if(wasExtraEC)
problems.push_back("extra_ec");
if(wasEncoderLaggy)
problems.push_back("encoder_lag");
if(!wasEstablished)
problems.push_back("not_inited");
if(wasNetworkHandover)
problems.push_back("network_handover");
ostringstream prefRelay;
prefRelay << preferredRelay;
return json11::Json(json11::Json::object{
{"log_type", "call_stats"},
{"libtgvoip_version", LIBTGVOIP_VERSION},
{"network", network},
{"protocol_version", std::min(peerVersion, PROTOCOL_VERSION)},
{"udp_avail", udpConnectivityState==UDP_AVAILABLE},
{"tcp_used", useTCP},
{"relay_rtt", (int)(endpoints[preferredRelay].averageRTT*1000.0)},
{"p2p_type", p2pType},
{"rtt", (int)(endpoints[currentEndpoint].averageRTT*1000.0)},
{"packet_stats", json11::Json::object{
{"out", (int)seq},
{"in", (int)packetsReceived},
{"lost_out", (int)conctl->GetSendLossCount()},
{"lost_in", (int)recvLossCount}
}},
{"problems", problems},
{"pref_relay", prefRelay.str()}
}).dump();
}
@ -869,7 +928,8 @@ vector<uint8_t> VoIPController::GetPersistentState(){
{"tcp", proxySupportsTCP}
}});
}
const char* jstr=Json(obj).dump().c_str();
string _jstr=Json(obj).dump();
const char* jstr=_jstr.c_str();
return vector<uint8_t>(jstr, jstr+strlen(jstr));
}
@ -1598,6 +1658,15 @@ void VoIPController::RunRecvThread(){
}
}
}
if(!srcEndpointID && packet.protocol==PROTO_UDP){
try{
Endpoint &p2p=GetEndpointByType(Endpoint::Type::UDP_P2P_INET);
if(p2p.rtts[0]==0.0 && p2p.address.PrefixMatches(24, *packet.address)){
LOGD("Packet source matches p2p endpoint partially: %s:%u", packet.address->ToString().c_str(), packet.port);
srcEndpointID=p2p.id;
}
}catch(out_of_range& ex){}
}
}else{
IPv6Address *src6=dynamic_cast<IPv6Address *>(packet.address);
if(src6){
@ -1668,16 +1737,20 @@ bool VoIPController::WasOutgoingPacketAcknowledged(uint32_t seq){
}
void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcEndpoint){
unsigned char* buffer=packet.data;
unsigned char *buffer=packet.data;
size_t len=packet.length;
BufferInputStream in(buffer, (size_t)len);
if(memcmp(buffer, srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY ? (void*)srcEndpoint.peerTag : (void*)callID, 16)!=0){
LOGW("Received packet has wrong peerTag");
return;
BufferInputStream in(buffer, (size_t) len);
bool hasPeerTag=false;
if(peerVersion<9 || srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY){
if(memcmp(buffer, srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY ? (void *) srcEndpoint.peerTag : (void *) callID, 16)!=0){
LOGW("Received packet has wrong peerTag");
return;
}
in.Seek(16);
hasPeerTag=true;
}
in.Seek(16);
if(in.Remaining()>=16 && (srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY)
&& *reinterpret_cast<uint64_t*>(buffer+16)==0xFFFFFFFFFFFFFFFFLL && *reinterpret_cast<uint32_t*>(buffer+24)==0xFFFFFFFF){
&& *reinterpret_cast<uint64_t *>(buffer+16)==0xFFFFFFFFFFFFFFFFLL && *reinterpret_cast<uint32_t *>(buffer+24)==0xFFFFFFFF){
// relay special request response
in.Seek(16+12);
uint32_t tlid=(uint32_t) in.ReadInt32();
@ -1690,7 +1763,7 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
in.ReadBytes(myIP, 16);
int32_t myPort=in.ReadInt32();
//udpConnectivityState=UDP_AVAILABLE;
LOGV("Received UDP ping reply from %s:%d: date=%d, queryID=%ld, my IP=%s, my port=%d", srcEndpoint.address.ToString().c_str(), srcEndpoint.port, date, (long int)queryID, IPv4Address(*reinterpret_cast<uint32_t*>(myIP+12)).ToString().c_str(), myPort);
LOGV("Received UDP ping reply from %s:%d: date=%d, queryID=%ld, my IP=%s, my port=%d", srcEndpoint.address.ToString().c_str(), srcEndpoint.port, date, (long int) queryID, IPv4Address(*reinterpret_cast<uint32_t *>(myIP+12)).ToString().c_str(), myPort);
srcEndpoint.udpPongCount++;
if(srcEndpoint.IsIPv6Only() && !didSendIPv6Endpoint){
IPv6Address realAddr(myIP);
@ -1709,15 +1782,15 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
}
}
}else if(tlid==TLID_UDP_REFLECTOR_PEER_INFO){
if(waitingForRelayPeerInfo && in.Remaining()>=16){
if(in.Remaining()>=16){
MutexGuard _m(endpointsMutex);
uint32_t myAddr=(uint32_t) in.ReadInt32();
uint32_t myPort=(uint32_t) in.ReadInt32();
uint32_t peerAddr=(uint32_t) in.ReadInt32();
uint32_t peerPort=(uint32_t) in.ReadInt32();
constexpr int64_t p2pID=(int64_t)(FOURCC('P','2','P','4')) << 32;
constexpr int64_t lanID=(int64_t)(FOURCC('L','A','N','4')) << 32;
constexpr int64_t p2pID=(int64_t) (FOURCC('P', '2', 'P', '4')) << 32;
constexpr int64_t lanID=(int64_t) (FOURCC('L', 'A', 'N', '4')) << 32;
if(currentEndpoint==p2pID || currentEndpoint==lanID)
currentEndpoint=preferredRelay;
@ -1727,25 +1800,27 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
IPv4Address _peerAddr(peerAddr);
IPv6Address emptyV6(string("::0"));
unsigned char peerTag[16];
Endpoint p2p(p2pID, (uint16_t) peerPort, _peerAddr, emptyV6, Endpoint::Type::UDP_P2P_INET, peerTag);
endpoints[p2pID]=p2p;
LOGW("Received reflector peer info, my=%s:%u, peer=%s:%u", IPv4Address(myAddr).ToString().c_str(), myPort, IPv4Address(peerAddr).ToString().c_str(), peerPort);
if(myAddr==peerAddr){
LOGW("Detected LAN");
IPv4Address lanAddr(0);
udpSocket->GetLocalInterfaceInfo(&lanAddr, NULL);
if(waitingForRelayPeerInfo){
Endpoint p2p(p2pID, (uint16_t) peerPort, _peerAddr, emptyV6, Endpoint::Type::UDP_P2P_INET, peerTag);
endpoints[p2pID]=p2p;
if(myAddr==peerAddr){
LOGW("Detected LAN");
IPv4Address lanAddr(0);
udpSocket->GetLocalInterfaceInfo(&lanAddr, NULL);
BufferOutputStream pkt(8);
pkt.WriteInt32(lanAddr.GetAddress());
pkt.WriteInt32(udpSocket->GetLocalPort());
if(peerVersion<6){
SendPacketReliably(PKT_LAN_ENDPOINT, pkt.GetBuffer(), pkt.GetLength(), 0.5, 10);
}else{
Buffer buf(move(pkt));
SendExtra(buf, EXTRA_TYPE_LAN_ENDPOINT);
BufferOutputStream pkt(8);
pkt.WriteInt32(lanAddr.GetAddress());
pkt.WriteInt32(udpSocket->GetLocalPort());
if(peerVersion<6){
SendPacketReliably(PKT_LAN_ENDPOINT, pkt.GetBuffer(), pkt.GetLength(), 0.5, 10);
}else{
Buffer buf(move(pkt));
SendExtra(buf, EXTRA_TYPE_LAN_ENDPOINT);
}
}
waitingForRelayPeerInfo=false;
}
waitingForRelayPeerInfo=false;
}
}else{
LOGV("Received relay response with unknown tl id: 0x%08X", tlid);
@ -1775,7 +1850,7 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
unsigned char sha[SHA1_LENGTH];
uint32_t _len=(uint32_t) _in.ReadInt32();
if(_len>_in.Remaining())
_len=(uint32_t)_in.Remaining();
_len=(uint32_t) _in.Remaining();
crypto.sha1((uint8_t *) (aesOut), (size_t) (_len+4), sha);
if(memcmp(msgHash, sha+(SHA1_LENGTH-16), 16)!=0){
LOGW("Received packet has wrong hash after decryption");
@ -1790,7 +1865,8 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
}
if(useMTProto2 || retryWith2){
in.Seek(16); // peer tag
if(hasPeerTag)
in.Seek(16); // peer tag
unsigned char fingerprint[8], msgKey[16];
if(!shortFormat){
@ -1833,11 +1909,11 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
innerLen=(uint32_t) (shortFormat ? in.ReadInt16() : in.ReadInt32());
if(innerLen>decryptedLen-sizeSize){
LOGW("Received packet has wrong inner length (%d with total of %u)", (int)innerLen, (unsigned int)decryptedLen);
LOGW("Received packet has wrong inner length (%d with total of %u)", (int) innerLen, (unsigned int) decryptedLen);
return;
}
if(decryptedLen-innerLen<(shortFormat ? 16 : 12)){
LOGW("Received packet has too little padding (%u)", (unsigned int)(decryptedLen-innerLen));
LOGW("Received packet has too little padding (%u)", (unsigned int) (decryptedLen-innerLen));
return;
}
memcpy(buffer, decrypted+(shortFormat ? 2 : 4), innerLen);
@ -1855,6 +1931,17 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
SetState(STATE_ESTABLISHED);
}
if(srcEndpoint.type==Endpoint::Type::UDP_P2P_INET && !srcEndpoint.IsIPv6Only()){
if(srcEndpoint.port!=packet.port || srcEndpoint.address!=*packet.address){
IPv4Address *v4=dynamic_cast<IPv4Address *>(packet.address);
if(v4){
LOGI("Incoming packet was decrypted successfully, changing P2P endpoint to %s:%u", packet.address->ToString().c_str(), packet.port);
srcEndpoint.address=*v4;
srcEndpoint.port=packet.port;
}
}
}
/*decryptedAudioBlock random_id:long random_bytes:string flags:# voice_call_id:flags.2?int128 in_seq_no:flags.4?int out_seq_no:flags.4?int
* recent_received_mask:flags.5?int proto:flags.3?int extra:flags.1?string raw_data:flags.0?string = DecryptedAudioBlock
simpleAudioBlock random_id:long random_bytes:string raw_data:string = DecryptedAudioBlock;
@ -2556,6 +2643,7 @@ void VoIPController::ProcessExtraData(Buffer &data){
endpoints[lanID]=lan;
}else if(type==EXTRA_TYPE_NETWORK_CHANGED){
LOGI("Peer network changed");
wasNetworkHandover=true;
const Endpoint& _currentEndpoint=endpoints.at(currentEndpoint);
if(_currentEndpoint.type!=Endpoint::Type::UDP_RELAY && _currentEndpoint.type!=Endpoint::Type::TCP_RELAY)
currentEndpoint=preferredRelay;
@ -2695,7 +2783,7 @@ void VoIPController::SendPacket(unsigned char *data, size_t len, Endpoint& ep, P
BufferOutputStream out(len+128);
if(ep.type==Endpoint::Type::UDP_RELAY || ep.type==Endpoint::Type::TCP_RELAY)
out.WriteBytes((unsigned char*)ep.peerTag, 16);
else
else if(peerVersion<9)
out.WriteBytes(callID, 16);
if(len>0){
if(useMTProto2){
@ -3502,6 +3590,7 @@ void VoIPController::UpdateCongestion(){
LOGW("Enabling extra EC");
if(needRateFlags & NEED_RATE_FLAG_SHITTY_INTERNET_MODE)
needRate=true;
wasExtraEC=true;
}
}
@ -3541,6 +3630,8 @@ void VoIPController::UpdateCongestion(){
encoder->SetSecondaryEncoderEnabled(false);
LOGW("Disabling extra EC");
}
if(!wasEncoderLaggy && encoder->GetComplexity()<10)
wasEncoderLaggy=true;
}
}
@ -3570,6 +3661,7 @@ void VoIPController::UpdateAudioBitrate(){
SetState(STATE_RECONNECTING);
if(needRateFlags & NEED_RATE_FLAG_RECONNECTING)
needRate=true;
wasReconnecting=true;
ResetUdpAvailability();
}

View File

@ -751,7 +751,13 @@ namespace tgvoip{
std::vector<SentVideoFrame> sentVideoFrames;
Mutex sentVideoFramesMutex;
bool videoKeyframeRequested=false;
/*** debug report problems ***/
bool wasReconnecting=false;
bool wasExtraEC=false;
bool wasEncoderLaggy=false;
bool wasNetworkHandover=false;
/*** persistable state values ***/
bool proxySupportsUDP=true;
bool proxySupportsTCP=true;

119
aclocal.m4 vendored
View File

@ -22,7 +22,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
# Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@ -241,8 +241,8 @@ esac
ofile=libtool
can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
# All known linkers require a '.a' archive for static linking (except MSVC and
# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@ -1056,8 +1056,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
$AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
$AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
@ -1507,9 +1507,22 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
: ${AR_FLAGS=cru}
_LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
# higher priority because thats what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
lt_ar_flags=$AR_FLAGS
_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
[Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no
@ -2221,26 +2234,35 @@ m4_defun([_LT_CMD_STRIPLIB],
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
if test -z "$STRIP"; then
AC_MSG_RESULT([no])
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP"; then
if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
case $host_os in
darwin*)
# FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
else
;;
freebsd*)
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no])
;;
esac
;;
esac
fi
fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1])
@ -2579,8 +2601,8 @@ m4_if([$1], [],[
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
*,cl* | *,icl*)
# Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@ -2636,7 +2658,7 @@ m4_if([$1], [],[
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@ -4024,7 +4046,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
@ -4933,7 +4955,7 @@ m4_if([$1], [CXX], [
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@ -4941,7 +4963,7 @@ m4_if([$1], [CXX], [
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
cl*)
cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
@ -4998,15 +5020,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
@ -5170,6 +5192,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
interix[[3-9]]*)
@ -5387,7 +5410,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@ -5570,12 +5593,12 @@ _LT_EOF
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
cl* | icl*)
# Native MSVC or ICC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
@ -5616,7 +5639,7 @@ _LT_EOF
fi'
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
@ -5875,6 +5898,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
osf3*)
@ -6641,8 +6665,8 @@ if test yes != "$_lt_caught_CXX_error"; then
cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl*)
# Native MSVC
,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@ -6740,6 +6764,7 @@ if test yes != "$_lt_caught_CXX_error"; then
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;;
dgux*)
@ -8370,7 +8395,7 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
@ -8802,7 +8827,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience],
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
# Copyright (C) 2004-2005, 2007-2008, 2011-2018 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
@ -8927,7 +8952,7 @@ m4_define([lt_dict_filter],
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Copyright (C) 2004, 2011-2018 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@ -8936,22 +8961,22 @@ m4_define([lt_dict_filter],
# @configure_input@
# serial 4179 ltversion.m4
# serial 4221 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.6])
m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce])
m4_define([LT_PACKAGE_REVISION], [2.4.6.42])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6'
macro_revision='2.4.6'
[macro_version='2.4.6.42-b88ce'
macro_revision='2.4.6.42'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
# Copyright (C) 2004-2005, 2007, 2009, 2011-2018 Free Software
# Foundation, Inc.
# Written by Scott James Remnant, 2004.
#

123
configure vendored
View File

@ -3270,8 +3270,8 @@ esac
macro_version='2.4.6'
macro_revision='2.4.6'
macro_version='2.4.6.42-b88ce'
macro_revision='2.4.6.42'
@ -5973,13 +5973,29 @@ esac
fi
: ${AR=ar}
: ${AR_FLAGS=cru}
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
# higher priority because thats what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
lt_ar_flags=$AR_FLAGS
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
@ -6428,7 +6444,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
@ -7697,8 +7713,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
echo "$AR cru libconftest.a conftest.o" >&5
$AR cru libconftest.a conftest.o 2>&5
echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5
$AR $AR_FLAGS libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
@ -8361,8 +8377,8 @@ esac
ofile=libtool
can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
# All known linkers require a '.a' archive for static linking (except MSVC and
# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@ -9285,15 +9301,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
@ -9457,6 +9473,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
interix[3-9]*)
@ -9674,7 +9691,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@ -9941,12 +9958,12 @@ fi
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
cl* | icl*)
# Native MSVC or ICC
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
always_export_symbols=yes
@ -9987,7 +10004,7 @@ fi
fi'
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
@ -10311,6 +10328,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes
file_list_spec='@'
;;
osf3*)
@ -11018,8 +11036,8 @@ cygwin* | mingw* | pw32* | cegcc*)
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
*,cl* | *,icl*)
# Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@ -11075,7 +11093,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@ -12254,30 +12272,41 @@ striplib=
old_striplib=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
$as_echo_n "checking whether stripping libraries is possible... " >&6; }
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
if test -z "$STRIP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP"; then
if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
case $host_os in
darwin*)
# FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
;;
freebsd*)
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
;;
esac
;;
esac
fi
fi
@ -13464,8 +13493,8 @@ fi
cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in
,cl* | no,cl*)
# Native MSVC
,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec_CXX=' '
@ -13595,6 +13624,7 @@ fi
emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes_CXX=yes
file_list_spec_CXX='@'
;;
dgux*)
@ -15030,7 +15060,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@ -15038,7 +15068,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
cl*)
cl* | icl*)
exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
@ -15400,8 +15430,8 @@ cygwin* | mingw* | pw32* | cegcc*)
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
*,cl* | *,icl*)
# Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@ -15457,7 +15487,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;;
*)
# Assume MSVC wrapper
# Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@ -19370,6 +19400,7 @@ want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
@ -19552,7 +19583,6 @@ want_nocaseglob \
DLLTOOL \
sharedlib_from_linklib_cmd \
AR \
AR_FLAGS \
archiver_list_spec \
STRIP \
RANLIB \
@ -20561,8 +20591,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
# The archiver.
AR=$lt_AR
# Flags to create an archive (by configure).
lt_ar_flags=$lt_ar_flags
# Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS
AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"}
# How to feed a file listing to the archiver.
archiver_list_spec=$lt_archiver_list_spec

View File

@ -58,9 +58,10 @@ static void dump(NullStruct, string &out) {
static void dump(double value, string &out) {
if (std::isfinite(value)) {
char buf[32];
snprintf(buf, sizeof buf, "%.17g", value);
out += buf;
std::ostringstream stm;
stm.imbue(std::locale("C"));
stm << value;
out += stm.str();
} else {
out += "null";
}

770
ltmain.sh

File diff suppressed because it is too large Load Diff

View File

@ -48,6 +48,9 @@ NetworkSocketPosix::NetworkSocketPosix(NetworkProtocol protocol) : NetworkSocket
}
NetworkSocketPosix::~NetworkSocketPosix(){
if(fd>=0){
Close();
}
if(tcpConnectedAddress)
delete tcpConnectedAddress;
if(pendingOutgoingPacket)
@ -139,9 +142,9 @@ void NetworkSocketPosix::Send(NetworkPacket *packet){
addr.sin6_family=AF_INET6;
}
addr.sin6_port=htons(packet->port);
res=sendto(fd, packet->data, packet->length, 0, (const sockaddr *) &addr, sizeof(addr));
res=(int)sendto(fd, packet->data, packet->length, 0, (const sockaddr *) &addr, sizeof(addr));
}else{
res=send(fd, packet->data, packet->length, 0);
res=(int)send(fd, packet->data, packet->length, 0);
}
if(res<=0){
if(errno==EAGAIN || errno==EWOULDBLOCK){
@ -220,7 +223,7 @@ void NetworkSocketPosix::Receive(NetworkPacket *packet){
packet->protocol=PROTO_UDP;
packet->port=ntohs(srcAddr.sin6_port);
}else if(protocol==PROTO_TCP){
int res=recv(fd, packet->data, packet->length, 0);
int res=(int)recv(fd, packet->data, packet->length, 0);
if(res<=0){
LOGE("Error receiving from TCP socket: %d / %s", errno, strerror(errno));
failed=true;
@ -341,7 +344,7 @@ void NetworkSocketPosix::Connect(const NetworkAddress *address, uint16_t port){
timeout.tv_sec=60;
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
fcntl(fd, F_SETFL, O_NONBLOCK);
int res=connect(fd, (const sockaddr*) addr, addrLen);
int res=(int)connect(fd, (const sockaddr*) addr, (socklen_t)addrLen);
if(res!=0 && errno!=EINVAL && errno!=EINPROGRESS){
LOGW("error connecting TCP socket to %s:%u: %d / %s; %d / %s", address->ToString().c_str(), port, res, strerror(res), errno, strerror(errno));
close(fd);