• 关于

    short_tags

    的搜索结果

回答

一.移植Curl工具到Android环境步骤1.修改cURL源码下的mk文件。源码下面的Android.mk文件最后生成的是静态库libcurl.a,做如下修改(编译成动态库)。LOCAL_PRELINK_MODULE := false LOCAL_MODULE:= libcurl LOCAL_MODULE_TAGS := optional Copy the licence to a place where Android will find it. Actually, this doesn't quite work because the build system searches for NOTICE files before it gets to this point, so it will only be seen on subsequent builds. ALL_PREBUILT += $(LOCAL_PATH)/NOTICE $(LOCAL_PATH)/NOTICE: $(LOCAL_PATH)/COPYING | $(ACP) $(copy-file-to-target) include $(BUILD_STATIC_LIBRARY) include $(BUILD_SHARED_LIBRARY) 2.配置编译环境(cd 到Android.mk同一目录,直接在控制台输入下列代码或者把下面代码弄成sh脚本执行)红色部分根据自己源码情况ANDROID_HOME=/home/zhoulc/android/ && \ NDK_HOME=/home/zhoulc/android/ndk && \ PATH="$ANDROID_HOME/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH" \ ./configure --host=arm-linux CC=arm-eabi-gcc --with-random=/dev/urandom \ CPPFLAGS="-I$NDK_HOME/platforms/android-8/arch-arm/usr/include \ -I $ANDROID_HOME/external/curl/include/ \ -I $ANDROID_HOME/external/curl/3rd/include \ -I $ANDROID_HOME/external/curl \ -I $ANDROID_HOME/out/target/product/generic/obj/STATIC_LIBRARIES/libcurl_intermediates \ -I $ANDROID_HOME/dalvik/libnativehelper/include/nativehelper \ -I $ANDROID_HOME/system/core/include \ -I $ANDROID_HOME/hardware/libhardware/include \ -I $ANDROID_HOME/hardware/libhardware_legacy/include \ -I $ANDROID_HOME/hardware/ril/include \ -I $ANDROID_HOME/dalvik/libnativehelper/include \ -I $ANDROID_HOME/frameworks/base/include \ -I $ANDROID_HOME/frameworks/base/opengl/include \ -I $ANDROID_HOME/frameworks/base/native/include \ -I $ANDROID_HOME/external/skia/include \ -I $ANDROID_HOME/out/target/product/generic/obj/include \ -I $ANDROID_HOME/bionic/libc/arch-arm/include \ -I $ANDROID_HOME/bionic/libc/include \ -I $ANDROID_HOME/bionic/libstdc++/include \ -I $ANDROID_HOME/bionic/libc/kernel/common \ -I $ANDROID_HOME/bionic/libc/kernel/arch-arm \ -I $ANDROID_HOME/bionic/libm/include \ -I $ANDROID_HOME/bionic/libm/include/arch/arm \ -I $ANDROID_HOME/bionic/libthread_db/include \ -include $ANDROID_HOME/system/core/include/arch/linux-arm/AndroidConfig.h \ -I $ANDROID_HOME/system/core/include/arch/linux-arm/ \ -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -DNDEBUG -DHAVE_CONFIG_H" \ CFLAGS="-fno-exceptions -Wno-multichar -msoft-float -fpic -ffunction-sections \ -funwind-tables -fstack-protector -Wa,--noexecstack -Werror=format-security \ -fno-short-enums -march=armv5te -mtune=xscale -Wno-psabi -mthumb-interwork \ -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith \ -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point \ -g -Wstrict-aliasing=2 -finline-functions -fno-inline-functions-called-once \ -fgcse-after-reload -frerun-cse-after-loop -frename-registers -UDEBUG \ -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \ -Wpointer-arith -Wwrite-strings -Wunused -Winline -Wnested-externs \ -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal \ -Wno-multichar -Wsign-compare -Wno-format-nonliteral -Wendif-labels \ -Wstrict-prototypes -Wdeclaration-after-statement -Wno-system-headers" \ LIBS="-nostdlib -Bdynamic -Wl,-T,$ANDROID_HOME/build/core/armelf.x \ -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc \ -L$ANDROID_HOME/out/target/product/generic/obj/lib -Wl,-z,noexecstack \ -Wl,-rpath-link=$ANDROID_HOME/out/target/product/generic/obj/lib \ -lc -llog -lcutils -lstdc++ \ -Wl,--no-undefined $ANDROID_HOME/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/libgcc.a \ $ANDROID_HOME/out/target/product/generic/obj/lib/crtend_android.o \ -lm $ANDROID_HOME/out/target/product/generic/obj/lib/crtbegin_dynamic.o \ -L$ANDROID_HOME/external/curl/3rd/libs"3.编译libcurl.so库cd进入android/external/curl源码目录 mm-》编译生成libcurl.so库 4.编写测试case 以及Android.mk文件并生成可执行文件新建一个测试案例curl_test.cpp include "curl/curl.h" include ; int main() { CURL *curl; CURLcode res; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://www.baidu.com/"); res = curl_easy_perform(curl); if (0!=res) { printf("curl error: %d\n", res); } curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; }在同一目录下写一个Android.mk文件生成curl_test可执行文件 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_C_INCLUDES += \ $(TOP)/external/curl/include/ \ LOCAL_SRC_FILES:= curl_test.cpp No shared libraries. No static libraries. LOCAL_SHARED_LIBRARIES := libcurl LOCAL_MODULE_TAGS := optional LOCAL_MODULE := curl_test include $(BUILD_EXECUTABLE) 生成可执行文件:curl_test 4.运行查看测试结果运行测试case:curl_test 5.(补充)移植libcurl到android4.0,修改两个地方1)把生成的路径改一下,一般默认为out/target/product/generic下面,我们根据系统不同(根据lunch选择不同,最终生成的路径不一样)改为系统的全局变量, 把$ANDROID_HOME/out/target/product/generic替换成$ANDROID_PRODUCT_OUT。 ANDROID_HOME_CURL=../../ && \ NDK_HOME_CURL=../../prebuilt/ndk && \ PATH="$ANDROID_HOME_CURL/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH" \ ./configure --host=arm-linux CC=gcc --with-random=/dev/urandom \ CPPFLAGS="-I$NDK_HOME_CURL/platforms/android-8/arch-arm/usr/include \ -I $ANDROID_HOME_CURL/external/curl/include/ \ -I $ANDROID_HOME_CURL/external/curl/3rd/include \ -I $ANDROID_HOME_CURL/external/curl \ -I $ANDROID_HOME_CURL/out/target/product/generic/obj/STATIC_LIBRARIES/libcurl_intermediates \ -I $ANDROID_HOME_CURL/dalvik/libnativehelper/include/nativehelper \ -I $ANDROID_HOME_CURL/system/core/include \ -I $ANDROID_HOME_CURL/hardware/libhardware/include \ -I $ANDROID_HOME_CURL/hardware/libhardware_legacy/include \ -I $ANDROID_HOME_CURL/hardware/ril/include \ -I $ANDROID_HOME_CURL/dalvik/libnativehelper/include \ -I $ANDROID_HOME_CURL/frameworks/base/include \ -I $ANDROID_HOME_CURL/frameworks/base/opengl/include \ -I $ANDROID_HOME_CURL/frameworks/base/native/include \ -I $ANDROID_HOME_CURL/external/skia/include \ -I $ANDROID_HOME_CURL/out/target/product/generic/obj/include \ -I $ANDROID_HOME_CURL/bionic/libc/arch-arm/include \ -I $ANDROID_HOME_CURL/bionic/libc/include \ -I $ANDROID_HOME_CURL/bionic/libstdc++/include \ -I $ANDROID_HOME_CURL/bionic/libc/kernel/common \ -I $ANDROID_HOME_CURL/bionic/libc/kernel/arch-arm \ -I $ANDROID_HOME_CURL/bionic/libm/include \ -I $ANDROID_HOME_CURL/bionic/libm/include/arch/arm \ -I $ANDROID_HOME_CURL/bionic/libthread_db/include \ -include $ANDROID_HOME_CURL/system/core/include/arch/linux-arm/AndroidConfig.h \ -I $ANDROID_HOME_CURL/system/core/include/arch/linux-arm/ \ -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DNDEBUG -DNDEBUG -DHAVE_CONFIG_H" \ CFLAGS="-fno-exceptions -Wno-multichar -msoft-float -fpic -ffunction-sections \ -funwind-tables -fstack-protector -Wa,--noexecstack -Werror=format-security \ -fno-short-enums -march=armv5te -mtune=xscale -Wno-psabi -mthumb-interwork \ -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith \ -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point \ -g -Wstrict-aliasing=2 -finline-functions -fno-inline-functions-called-once \ -fgcse-after-reload -frerun-cse-after-loop -frename-registers -UDEBUG \ -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \ -Wpointer-arith -Wwrite-strings -Wunused -Winline -Wnested-externs \ -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal \ -Wno-multichar -Wsign-compare -Wno-format-nonliteral -Wendif-labels \ -Wstrict-prototypes -Wdeclaration-after-statement -Wno-system-headers" \ LIBS="-nostdlib -Bdynamic -Wl,-T,$ANDROID_HOME_CURL/build/core/armelf.x \ -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc \ -L$ANDROID_PRODUCT_OUT/obj/lib -Wl,-z,noexecstack \ -Wl,-rpath-link=$ANDROID_PRODUCT_OUT/obj/lib \ -lc -llog -lcutils -lstdc++ \ -Wl,--no-undefined $ANDROID_HOME_CURL/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/libgcc.a \ $ANDROID_PRODUCT_OUT/obj/lib/crtend_android.o \ -lm $ANDROID_PRODUCT_OUT/obj/lib/crtbegin_dynamic.o \ -L$ANDROID_HOME_CURL/external/curl/3rd/libs"2)修改Android.mk ALL_PREBUILT += $(LOCAL_PATH)/NOTICE $(LOCAL_PATH)/NOTICE: $(LOCAL_PATH)/COPYING | $(ACP) $(copy-file-to-target) 把关于ALL_PREBUILT模块全部注释调

hiekay 2019-12-02 01:43:15 0 浏览量 回答数 0

问题

Django -在文章的HTML中创建相关的图像

kun坤 2019-12-25 09:34:04 0 浏览量 回答数 0

问题

修改了php.ini各种重启依旧无效:配置报错 

kun坤 2020-06-04 10:23:30 4 浏览量 回答数 1

阿里云高校特惠,助力学生创业梦!0元体验,快速入门云计算!

学生动手场景应用,快速了解并掌握云服务器的各种新奇玩法!

回答

您需要修改php.ini中short_tags的配置项

西秦说云 2019-12-02 01:43:37 0 浏览量 回答数 0

问题

APACHE+PHP vs NGINX+PHP 性能评测(译文)

enj0y 2019-12-01 20:22:13 25498 浏览量 回答数 6

问题

8 个很有用的 jQuery 技巧报错

kun坤 2020-06-03 13:09:52 4 浏览量 回答数 1
阿里云大学 云服务器ECS com域名 网站域名whois查询 开发者平台 小程序定制 小程序开发 国内短信套餐包 开发者技术与产品 云数据库 图像识别 开发者问答 阿里云建站 阿里云备案 云市场 万网 阿里云帮助文档 免费套餐 开发者工具 企业信息查询 小程序开发制作 视频内容分析 企业网站制作 视频集锦 代理记账服务 2020阿里巴巴研发效能峰会 企业建站模板 云效成长地图 高端建站 阿里云双十一主会场 阿里云双十一新人会场 1024程序员加油包 阿里云双十一拼团会场 场景化解决方案 阿里云双十一直播大厅