Skip to content

Commit

Permalink
Merge pull request #51 from andyque/add-curl-header-patch
Browse files Browse the repository at this point in the history
finish curl different arch header file patch
  • Loading branch information
zilongshanren committed Mar 23, 2015
2 parents 838fd61 + 7e8b002 commit 65d3013
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
27 changes: 23 additions & 4 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,24 @@ do
echo $src_directory
destination_header_path=$cfg_platform_name/$original_arch_name/include/$library_include_folder_name

if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
destination_header_path=$cfg_platform_name/include/$library_include_folder_name
fi

if [ -d "$src_directory" ];then
cp -r $src_directory/* $destination_header_path
else
cp $src_directory $destination_header_path
fi

if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
if [ "${lib}" = "curl" ];then
if [ "${arch}" = "i386" ]; then
mv $destination_header_path/curlbuild.h $destination_header_path/curlbuild-32.h
fi

if [ "${arch}" = "x86_64" ]; then
mv $destination_header_path/curlbuild.h $destination_header_path/curlbuild-64.h
fi
fi
fi
fi


Expand Down Expand Up @@ -485,9 +494,19 @@ do

done

# patch 32bit & 64bit header files for CURL
# now only iOS platform need to patch
if [ $cfg_platform_name = "ios" ];then
if [ -d "${cfg_platform_name}/include/curl" ];then
cp -r ${cfg_platform_name}/i386/include/curl/ ${cfg_platform_name}/include/curl
cp -r ${cfg_platform_name}/x86_64/include/curl/ ${cfg_platform_name}/include/curl
cp ../contrib/src/curl/curlbuild.h ${cfg_platform_name}/include/curl
fi
fi

# do some cleanup work
if [ $cfg_platform_name = "ios" ] || [ $cfg_platform_name = "mac" ];then
build_arches=("arm64" "armv7" "armv7s" "i386" "x86_64")
build_arches=$cfg_all_supported_arches
for arch in ${build_arches[@]}
do
rm -rf $cfg_platform_name/$arch
Expand Down
5 changes: 5 additions & 0 deletions contrib/src/curl/curlbuild.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#if defined(__LP64__) && __LP64__
#include"curlbuild-64.h"
#else
#include"curlbuild-32.h"
#endif

0 comments on commit 65d3013

Please sign in to comment.