Skip to content

Commit 65d3013

Browse files
committed
Merge pull request #51 from andyque/add-curl-header-patch
finish curl different arch header file patch
2 parents 838fd61 + 7e8b002 commit 65d3013

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

build/build.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,24 @@ do
444444
echo $src_directory
445445
destination_header_path=$cfg_platform_name/$original_arch_name/include/$library_include_folder_name
446446

447-
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
448-
destination_header_path=$cfg_platform_name/include/$library_include_folder_name
449-
fi
450447

451448
if [ -d "$src_directory" ];then
452449
cp -r $src_directory/* $destination_header_path
453450
else
454451
cp $src_directory $destination_header_path
455452
fi
453+
454+
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
455+
if [ "${lib}" = "curl" ];then
456+
if [ "${arch}" = "i386" ]; then
457+
mv $destination_header_path/curlbuild.h $destination_header_path/curlbuild-32.h
458+
fi
459+
460+
if [ "${arch}" = "x86_64" ]; then
461+
mv $destination_header_path/curlbuild.h $destination_header_path/curlbuild-64.h
462+
fi
463+
fi
464+
fi
456465
fi
457466

458467

@@ -485,9 +494,19 @@ do
485494

486495
done
487496

497+
# patch 32bit & 64bit header files for CURL
498+
# now only iOS platform need to patch
499+
if [ $cfg_platform_name = "ios" ];then
500+
if [ -d "${cfg_platform_name}/include/curl" ];then
501+
cp -r ${cfg_platform_name}/i386/include/curl/ ${cfg_platform_name}/include/curl
502+
cp -r ${cfg_platform_name}/x86_64/include/curl/ ${cfg_platform_name}/include/curl
503+
cp ../contrib/src/curl/curlbuild.h ${cfg_platform_name}/include/curl
504+
fi
505+
fi
506+
488507
# do some cleanup work
489508
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
490-
build_arches=("arm64" "armv7" "armv7s" "i386" "x86_64")
509+
build_arches=$cfg_all_supported_arches
491510
for arch in ${build_arches[@]}
492511
do
493512
rm -rf $cfg_platform_name/$arch

contrib/src/curl/curlbuild.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#if defined(__LP64__) && __LP64__
2+
#include"curlbuild-64.h"
3+
#else
4+
#include"curlbuild-32.h"
5+
#endif

0 commit comments

Comments
 (0)