12
12
# shown. Now, from the external/curl/ directory, run curl's normal configure
13
13
# command with flags that match what Android itself uses. This will mean
14
14
# putting the compiler directory into the PATH, putting the -I, -isystem and
15
# -D options into CPPFLAGS, putting the -m, -f, -O and -nostdlib options into
16
# CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the path
17
# to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o. Remember
18
# that the paths must be absolute since you will not be running configure from
19
# the same directory as the Android make. The normal cross-compiler options
15
# -D options into CPPFLAGS, putting the -W, -m, -f, -O and -nostdlib options
16
# into CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the
17
# path to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o.
18
# Remember that the paths must be absolute since you will not be running
19
# configure from the same directory as the Android make. The normal
20
# cross-compiler options must also be set. Note that the -c, -o, -MD and
21
# similar flags must not be set.
23
# To see all the LIBS options, you'll need to do the "showcommands" trick on an
24
# executable that's already buildable and watch what flags Android uses to link
25
# it (dhcpcd is a good choice to watch). You'll also want to add -L options to
26
# LIBS that point to the out/.../obj/lib/ and out/.../obj/system/lib/
27
# directories so that additional libraries can be found and used by curl.
22
29
# The end result will be a configure command that looks something like this
23
# (the environment variable A is set to the Android root path):
30
# (the environment variable A is set to the Android root path which makes the
25
33
# A=`realpath ../..` && \
26
34
# PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/bin:$PATH" \
27
35
# ./configure --host=arm-linux CC=arm-eabi-gcc \
28
36
# CPPFLAGS="-I $A/system/core/include ..." \
29
37
# CFLAGS="-nostdlib -fno-exceptions -Wno-multichar ..." \
30
# LIB="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
31
# /interwork/libgcc.a ..." \
38
# LIBS="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
39
# /interwork/libgcc.a ..."
33
41
# Finally, copy the file COPYING to NOTICE so that the curl license gets put
34
# into the right place (see the note about this below).
42
# into the right place (but see the note about this below).
39
47
LOCAL_PATH:= $(call my-dir)
91
99
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
93
# This will also need to include $(CURLX_ONES) in order to correctly link
94
# against a dynamic library
101
# This may also need to include $(CURLX_ONES) in order to correctly link
102
# if libcurl is changed to be built as a dynamic library
95
103
LOCAL_CFLAGS += $(common_CFLAGS)
97
105
include $(BUILD_EXECUTABLE)