Skip to content

Commit 2dd31c1

Browse files
committed
Merge remote-tracking branch 'upstream/development' into host_based_connection_pool
2 parents 943c4d8 + e8b3509 commit 2dd31c1

38 files changed

+1670
-140
lines changed

Build_android/boost-for-android-x86.patch

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,52 +13,50 @@ index 40453f7..7ffc050 100755
1313
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1414
+ TOOLSET=clang-androidR8e
1515
+ ;;
16-
+ "10e-rc4 (64-bit)")
16+
+ "10e-rc4 (64-bit)"|"10e (64-bit)")
1717
+ TOOLCHAIN=llvm-3.6
1818
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1919
+ TOOLSET=clang-androidR8e
2020
;;
2121
*)
2222
echo "Undefined or not supported Android NDK version!"
23-
@@ -392,6 +397,7 @@ echo "Building boost for android"
23+
@@ -391,6 +396,7 @@ echo "Building boost for android"
24+
export AndroidBinariesPath=`dirname $CXXPATH`
2425
export PATH=$AndroidBinariesPath:$PATH
2526
export AndroidNDKRoot
27+
+ export PlatformOS
2628
export NO_BZIP2=1
27-
+ export ICONV_PATH="`pwd`/../../libiconv/x86"
28-
29+
2930
cxxflags=""
30-
for flag in $CXXFLAGS; do cxxflags="$cxxflags cxxflags=$flag"; done
31-
@@ -404,8 +410,12 @@ echo "Building boost for android"
32-
threading=multi \
31+
@@ -405,7 +411,7 @@ echo "Building boost for android"
3332
--layout=versioned \
3433
--prefix="./../$BUILD_DIR/" \
35-
+ boost.locale.posix=off \
36-
+ boost.locale.std=on \
37-
+ boost.locale.iconv=on \
38-
+ boost.locale.icu=off \
3934
$LIBRARIES \
4035
- install 2>&1 \
4136
+ release debug install 2>&1 \
4237
|| { dump "ERROR: Failed to build boost for android!" ; exit 1 ; }
4338
} | tee -a $PROGDIR/build.log
4439

4540
diff --git a/configs/user-config-boost-1_55_0.jam b/configs/user-config-boost-1_55_0.jam
46-
index 666d4c8..762753e 100644
41+
index 666d4c8..4cd3441 100644
4742
--- a/configs/user-config-boost-1_55_0.jam
4843
+++ b/configs/user-config-boost-1_55_0.jam
49-
@@ -41,91 +41,44 @@ import os ;
44+
@@ -39,93 +39,47 @@
45+
46+
import os ;
5047
local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ;
48+
+local PlatformOS = [ os.environ PlatformOS ] ;
5149

5250
# --------------------------------------------------------------------
5351
-# Is same for 8b, 8c and 8d
5452
-using gcc : androidR8b
5553
+using clang : androidR8e
5654
:
5755
-arm-linux-androideabi-g++
58-
+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/linux-x86_64/bin/clang++
56+
+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/$(PlatformOS)-x86_64/bin/clang++
5957
:
6058
-<archiver>arm-linux-androideabi-ar
61-
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/linux-x86_64"
59+
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/$(PlatformOS)-x86_64"
6260
<compileflags>-fexceptions
6361
<compileflags>-frtti
6462
<compileflags>-fpic
@@ -94,11 +92,11 @@ index 666d4c8..762753e 100644
9492
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/include
9593
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include
9694
+<linkflags>--target=i686-none-linux-android
97-
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/linux-x86_64"
95+
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/x86-4.8/prebuilt/$(PlatformOS)-x86_64"
9896
+<linkflags>--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-x86
9997
# @Moss - Above are the 'oficial' android flags
10098
-<architecture>arm
101-
+#<architecture>i686
99+
+<architecture>i686
102100
<compileflags>-fvisibility=hidden
103101
<compileflags>-fvisibility-inlines-hidden
104102
<compileflags>-fdata-sections

Build_android/boost-for-android.patch

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,25 @@ index 40453f7..ad78ddf 100755
1313
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1414
+ TOOLSET=clang-androidR8e
1515
+ ;;
16-
+ "10e-rc4 (64-bit)")
16+
+ "10e-rc4 (64-bit)"|"10e (64-bit)")
1717
+ TOOLCHAIN=llvm-3.6
1818
+ CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
1919
+ TOOLSET=clang-androidR8e
2020
;;
2121
*)
2222
echo "Undefined or not supported Android NDK version!"
23-
@@ -392,6 +397,7 @@ echo "Building boost for android"
23+
@@ -391,6 +396,7 @@ echo "Building boost for android"
24+
export AndroidBinariesPath=`dirname $CXXPATH`
2425
export PATH=$AndroidBinariesPath:$PATH
2526
export AndroidNDKRoot
27+
+ export PlatformOS
2628
export NO_BZIP2=1
27-
+ export ICONV_PATH="`pwd`/../../libiconv/armeabi-v7a"
28-
29+
2930
cxxflags=""
30-
for flag in $CXXFLAGS; do cxxflags="$cxxflags cxxflags=$flag"; done
31-
@@ -404,8 +410,12 @@ echo "Building boost for android"
31+
@@ -405,7 +411,7 @@ echo "Building boost for android"
3232
threading=multi \
3333
--layout=versioned \
3434
--prefix="./../$BUILD_DIR/" \
35-
+ boost.locale.posix=off \
36-
+ boost.locale.std=on \
37-
+ boost.locale.iconv=on \
38-
+ boost.locale.icu=off \
3935
$LIBRARIES \
4036
- install 2>&1 \
4137
+ release debug install 2>&1 \
@@ -46,19 +42,22 @@ diff --git a/configs/user-config-boost-1_55_0.jam b/configs/user-config-boost-1_
4642
index 666d4c8..df597f6 100644
4743
--- a/configs/user-config-boost-1_55_0.jam
4844
+++ b/configs/user-config-boost-1_55_0.jam
49-
@@ -41,82 +41,41 @@ import os ;
45+
@@ -39,84 +39,44 @@
46+
47+
import os ;
5048
local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ;
51-
49+
+local PlatformOS = [ os.environ PlatformOS ] ;
50+
5251
# --------------------------------------------------------------------
5352
-# Is same for 8b, 8c and 8d
5453
-using gcc : androidR8b
5554
+using clang : androidR8e
5655
:
5756
-arm-linux-androideabi-g++
58-
+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/linux-x86_64/bin/clang++
57+
+$(AndroidNDKRoot)/toolchains/llvm-3.6/prebuilt/$(PlatformOS)-x86_64/bin/clang++
5958
:
6059
-<archiver>arm-linux-androideabi-ar
61-
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64"
60+
+<compileflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/$(PlatformOS)-x86_64"
6261
<compileflags>-fexceptions
6362
<compileflags>-frtti
6463
<compileflags>-fpic
@@ -138,7 +137,7 @@ index 666d4c8..df597f6 100644
138137
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/include
139138
+<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/include
140139
+<linkflags>--target=armv7-none-linux-androideabi
141-
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64"
140+
+<linkflags>--gcc-toolchain="$(AndroidNDKRoot)/toolchains/arm-linux-androideabi-4.8/prebuilt/$(PlatformOS)-x86_64"
142141
+<linkflags>--sysroot=$(AndroidNDKRoot)/platforms/android-9/arch-arm
143142
# @Moss - Above are the 'oficial' android flags
144143
<architecture>arm

Build_android/configure.sh

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ set -e
3434
# Parse args
3535
# -----------------
3636

37-
DO_LIBICONV=1
3837
DO_BOOST=1
3938
DO_OPENSSL=1
4039
DO_CPPRESTSDK=1
4140

4241
function usage {
43-
echo "Usage: $0 [--skip-boost] [--skip-openssl] [--skip-libiconv] [--skip-cpprestsdk] [-h] [--ndk <android-ndk>]"
42+
echo "Usage: $0 [--skip-boost] [--skip-openssl] [--skip-cpprestsdk] [-h] [--ndk <android-ndk>]"
4443
echo ""
4544
echo " --skip-boost Skip fetching and compiling boost"
4645
echo " --skip-openssl Skip fetching and compiling openssl"
47-
echo " --skip-libiconv Skip fetching and compiling libiconv"
4846
echo " --skip-cpprestsdk Skip compiling cpprestsdk"
4947
echo " -h,--help,-? Display this information"
5048
echo " --ndk <android-ndk> If specified, overrides the ANDROID_NDK environment variable"
@@ -59,9 +57,6 @@ do
5957
"--skip-openssl")
6058
DO_OPENSSL=0
6159
;;
62-
"--skip-libiconv")
63-
DO_LIBICONV=0
64-
;;
6560
"--skip-cpprestsdk")
6661
DO_CPPRESTSDK=0
6762
;;
@@ -131,40 +126,6 @@ then
131126
)
132127
fi
133128

134-
# --------
135-
# libiconv
136-
# --------
137-
138-
# This steps are based on the blog post
139-
# http://danilogiulianelli.blogspot.com/2012/12/how-to-cross-compile-libiconv-for.html
140-
if [ "${DO_LIBICONV}" == "1" ]
141-
then
142-
(
143-
if [ ! -e "libiconv-1.13.1.tar.gz" ]
144-
then
145-
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
146-
fi
147-
rm -rf libiconv
148-
mkdir libiconv
149-
cd libiconv
150-
tar xzf ../libiconv-1.13.1.tar.gz
151-
patch -b -p0 < "$DIR/libiconv/libiconv.patch"
152-
cd libiconv-1.13.1
153-
./configure
154-
cp -r "$DIR/libiconv/jni" ..
155-
cd ../jni
156-
"${NDK_DIR}/ndk-build" || exit 1
157-
cd ..
158-
mkdir -p armeabi-v7a/include
159-
mkdir -p armeabi-v7a/lib
160-
mkdir -p x86/include
161-
mkdir -p x86/lib
162-
cp libiconv-1.13.1/include/iconv.h armeabi-v7a/include/
163-
cp libiconv-1.13.1/include/iconv.h x86/include/
164-
cp obj/local/x86/libiconv.a x86/lib/
165-
cp obj/local/armeabi-v7a/libiconv.a armeabi-v7a/lib/
166-
)
167-
fi
168129

169130
# -----
170131
# Boost
@@ -187,7 +148,8 @@ then
187148
git apply "$DIR/boost-for-android.patch"
188149
touch cpprestsdk.patched.stamp
189150
fi
190-
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=locale,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
151+
152+
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
191153
)
192154

193155
(
@@ -204,7 +166,8 @@ then
204166
ln -s ../Boost-for-Android/boost_1_55_0.tar.bz2 .
205167
touch cpprestsdk.patched.stamp
206168
fi
207-
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=locale,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
169+
170+
PATH="$PATH:$NDK_DIR" ./build-android.sh --boost=1.55.0 --with-libraries=atomic,random,date_time,filesystem,system,thread,chrono "${NDK_DIR}" || exit 1
208171
)
209172
)
210173
fi

Build_android/openssl/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ setenv-android.sh:
1616

1717
setenv-android-x86.sh: setenv-android.sh
1818
cp setenv-android.sh setenv-android-x86.sh.tmp
19-
sed -i 's/_ANDROID_EABI="arm-linux-androideabi-4.8"/_ANDROID_EABI="x86-4.8"/g' setenv-android-x86.sh.tmp
20-
sed -i 's/_ANDROID_ARCH=arch-arm/_ANDROID_ARCH=arch-x86/g' setenv-android-x86.sh.tmp
19+
sed -i -e 's/_ANDROID_EABI="arm-linux-androideabi-4.8"/_ANDROID_EABI="x86-4.8"/g' setenv-android-x86.sh.tmp
20+
sed -i -e 's/_ANDROID_ARCH=arch-arm/_ANDROID_ARCH=arch-x86/g' setenv-android-x86.sh.tmp
2121
mv setenv-android-x86.sh.tmp setenv-android-x86.sh
2222

2323
$(OPENSSL_VER).tar.gz:

CONTRIBUTORS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ thomasschaub
4343

4444
Trimble
4545
Tim Boundy (gigaplex)
46+
47+
Rami Abughazaleh (icnocop)

Release/include/cpprest/asyncrt_utils.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ namespace conversions
197197
return print_string(val, std::locale());
198198
}
199199

200+
inline utility::string_t print_string(const utility::string_t &val)
201+
{
202+
return val;
203+
}
204+
200205
template <typename Target>
201206
Target scan_string(const utility::string_t &str, const std::locale &loc)
202207
{
@@ -216,6 +221,11 @@ namespace conversions
216221
{
217222
return scan_string<Target>(str, std::locale());
218223
}
224+
225+
inline utility::string_t scan_string(const utility::string_t &str)
226+
{
227+
return str;
228+
}
219229
}
220230

221231
namespace details

Release/include/cpprest/base_uri.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ namespace web {
223223
/// </summary>
224224
uri() { m_uri = _XPLATSTR("/");};
225225

226+
/// <summary>
227+
/// Creates a URI from the given URI components.
228+
/// </summary>
229+
/// <param name="components">A URI components object to create the URI instance.</param>
230+
_ASYNCRTIMP uri(const details::uri_components &components);
231+
226232
/// <summary>
227233
/// Creates a URI from the given encoded string. This will throw an exception if the string
228234
/// does not contain a valid URI. Use uri::validate if processing user-input.

Release/include/cpprest/http_headers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class http_headers
159159
{
160160
if (has(name))
161161
{
162-
m_headers[name] = m_headers[name].append(_XPLATSTR(", ") + utility::conversions::print_string(value));
162+
m_headers[name].append(_XPLATSTR(", ")).append(utility::conversions::print_string(value));
163163
}
164164
else
165165
{

0 commit comments

Comments
 (0)