curl and libcurl : howto

674 views
Skip to first unread message

ColletJb

unread,
Jun 21, 2010, 2:27:12 PM6/21/10
to android-ndk
Hi,

Some months ago, I used to compile curl for Android. Unfortunately, I
didn't kept those files.

Now, I need this library again but I'm no longer able to compile it
with ndk-r4 :(

To do that, I have created an empty android sdk project and a "jni"
repertory containing curl sources with its Android.mk .

This is what i get:

MagicCookie:project jb$ ndk-build
Android NDK: Trying to define local module 'curl' in /Users/jb/
Documents/workspace/curljni/project/jni/Android.mk.
Android NDK: But this module was already defined by /Users/jb/
Documents/workspace/curljni/project/jni/Android.mk.
/Users/jb/Documents/android/android-ndk-r4/build/core/build-
executable.mk:33: *** Android NDK: Aborting. . Stop.

Can someone help me ?

Thank you

ColletJb

unread,
Jun 22, 2010, 7:26:40 AM6/22/10
to android-ndk
Help please...

This thing is crucial for my thesis :(... I need it compiled in an
archive or else...

Thanks for your help.

Onur Cinar

unread,
Jun 22, 2010, 12:26:23 PM6/22/10
to andro...@googlegroups.com

Hi,

It is hard to guess by looking at the logs, so if you can post your Android.mk(s) to the list it will be easier to troubleshoot.

Regards,

-onur


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


---
www.zdo.com

ColletJb

unread,
Jun 23, 2010, 4:58:49 AM6/23/10
to android-ndk
Thanks for your answer...

I have actually used the Android.mk provided by the last version of
curl.

here is its content :

LOCAL_PATH:= $(call my-dir)

common_CFLAGS := -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 -DHAVE_CONFIG_H

#########################
# Build the libcurl library

include $(CLEAR_VARS)
include $(LOCAL_PATH)/lib/Makefile.inc
CURL_HEADERS := \
curlbuild.h \
curl.h \
curlrules.h \
curlver.h \
easy.h \
mprintf.h \
multi.h \
stdcheaders.h \
typecheck-gcc.h \
types.h

LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/
LOCAL_CFLAGS += $(common_CFLAGS)

LOCAL_COPY_HEADERS_TO := libcurl/curl
LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS))

LOCAL_MODULE:= libcurl

include $(BUILD_STATIC_LIBRARY)


#########################
# Build the curl binary

include $(CLEAR_VARS)
include $(LOCAL_PATH)/src/Makefile.inc
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_SOURCES))

LOCAL_MODULE := curl
LOCAL_STATIC_LIBRARIES := libcurl
LOCAL_SYSTEM_SHARED_LIBRARIES := libc

LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib

# This will also need to include $(CURLX_ONES) in order to correctly
build
# a dynamic library
LOCAL_CFLAGS += $(common_CFLAGS)

include $(BUILD_EXECUTABLE)
> > android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
> > .

ColletJb

unread,
Jun 23, 2010, 10:16:32 AM6/23/10
to android-ndk
I ve also tried to compile it using the Android source tree. (curl
copied into external/curl)

But I could not configured it because the ndk cannot generate an
executable file :(

Help please :( I need this library...
Reply all
Reply to author
Forward
0 new messages