Porting libusb to android

6,101 views
Skip to first unread message

Martial Britto

unread,
Mar 26, 2012, 4:56:27 AM3/26/12
to android-...@googlegroups.com
i have successfully done every step given in the following link
http://android.serverbox.ch/?p=151

Yet on executing the following command
mmm -j4 external/libusb1.0.3

i get the following error
make: *** No rule to make target `out/host/linux-x86/bin/acp', needed by `out/debug/host/linux-x86/pr/sim/symbols/system/lib/libusb.so'.  Stop.

Kindly help me.

also suggest me the choosecombo actions. i.e. what options to select.








Ying Wang

unread,
Mar 26, 2012, 1:54:40 PM3/26/12
to android-...@googlegroups.com
mmm (or mm) works only in incremental build, i.e. you already have all the its dependency ready in the out dir.
In your case to avoid a full build, I'd suggest to use the "make showcommands <module_name>" command,
where <module_name> is what LOCAL_MODULE  in your Android.mk.










--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

mark gross

unread,
Mar 26, 2012, 4:43:13 PM3/26/12
to android-...@googlegroups.com
sounds like you have build dependency on ACP you need to add to your
Android.mk for libusb (I bet you have a lot of other ones waiting
behind this one too, perhaps adding libc or something similar as a
dependency to your module in your Android.mk will smooth things out a
bit.)

--mark

--
create interesting things.

ruZZ

unread,
Mar 27, 2012, 11:57:01 AM3/27/12
to android-...@googlegroups.com
do you want a libusb.so for android? I've got a built one here. message me. Try first with my Android.mk:


**************
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

#LOCAL_ARM_MODE := arm

LOCAL_SRC_FILES:= \
libusb/core.c \
libusb/descriptor.c \
libusb/io.c \
libusb/sync.c \
libusb/os/linux_usbfs.c


LOCAL_C_INCLUDES += $(LOCAL_PATH)/android \
$(LOCAL_PATH)/libusb \
$(LOCAL_PATH)/libusb/os 

LOCAL_CFLAGS += -W -Wall
LOCAL_CFLAGS += -fPIC -DPIC


ifeq ($(TARGET_BUILD_TYPE),release)
LOCAL_CFLAGS += -O2
endif

LOCAL_MODULE:= libusb
LOCAL_MODULE_TAGS := optional
LOCAL_PRELINK_MODULE := false 
include $(BUILD_SHARED_LIBRARY)


***********

Ying Wang

unread,
Nov 6, 2012, 12:49:14 PM11/6/12
to android-...@googlegroups.com
Don't use mm/mmm for the first build.
You have to build all the dependency for the first time build:
$ make libusb <or any other module names>

On Mon, Nov 5, 2012 at 8:54 PM, Dream <ruchika...@gmail.com> wrote:
This is my error :
ODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Pegasus.ogg:system/media/audio/ringtones/Pegasus.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Perseus.ogg:system/media/audio/ringtones/Perseus.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Pyxis.ogg:system/media/audio/ringtones/Pyxis.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Rigel.ogg:system/media/audio/ringtones/Rigel.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Scarabaeus.ogg:system/media/audio/ringtones/Scarabaeus.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Sceptrum.ogg:system/media/audio/ringtones/Sceptrum.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Solarium.ogg:system/media/audio/ringtones/Solarium.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Themos.ogg:system/media/audio/ringtones/Themos.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/UrsaMinor.ogg:system/media/audio/ringtones/UrsaMinor.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Zeta.ogg:system/media/audio/ringtones/Zeta.ogg ignored.
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
make: Entering directory `/home/dreamlocal/JB_DEV'

make: *** No rule to make target `out/debug/target/product/generic/obj/SHARED_LIBRARIES/libc_intermediates/export_includes', needed by `out/debug/target/product/generic/obj/SHARED_LIBRARIES/libusb_intermediates/import_includes'.  Stop.
make: Leaving directory `/home/dreamlocal/JB_DEV'


I would like to be able to build my own library.
I followed the steps in the link http://android.serverbox.ch/?p=151 but took your libusb android.mk

Thank you

On Monday, October 15, 2012 5:13:42 AM UTC-5, vineet pant wrote:
Hello,
        I have been getting the same error and i have tried a lot of options to resolve this error but i haven't got any solution..Please tell me the solution if you have resolved it

Warm Regards,
Vineet pant

Yaros Come

unread,
Feb 27, 2014, 11:43:10 AM2/27/14
to android-...@googlegroups.com
Same problem, don't know how to solve it.


On Monday, March 26, 2012 10:56:27 AM UTC+2, Martial Britto wrote:

Ruchika Kharwar

unread,
Feb 27, 2014, 1:06:05 PM2/27/14
to android-...@googlegroups.com

In the User space ..
source build/envsetup.sh
lunch <— choose the right option.

$ sudo apt-get install libtool automake autoconf
In folder external/libusb-1.0.3/
$ ./autogen.sh
$ ./configure –disable-timerfd ## This makes config.h

My Android.mk file


LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
core.c \
descriptor.c \
io.c \
sync.c \
os/linux_usbfs.c \
os/threads_posix.c \

LOCAL_C_INCLUDES += \
external/libusb-1.0.3/ \
external/libusb-1.0.3/libusb/ \
external/libusb-1.0.3/libusb/os

LOCAL_CFLAGS += -DLIBUSB_DESCRIBE=""

LOCAL_MODULE:= libusb
LOCAL_MODULE_TAGS:= debug


LOCAL_PRELINK_MODULE:= false
include $(BUILD_SHARED_LIBRARY)

Inside external/libusb-1.0.3/libusb :

$ mm

For lsusb:
Android.mk
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_SRC_FILES:= lsusb.c
LOCAL_MODULE := lsusb
LOCAL_C_INCLUDES += external/libusb-1.0.3/
LOCAL_C_INCLUDES += external/libusb-1.0.3/libusb/
LOCAL_SHARED_LIBRARIES := libc libusb
LOCAL_MODULE_TAGS := debug
include $(BUILD_EXECUTABLE)



--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en
 
---
You received this message because you are subscribed to a topic in the Google Groups "Android Building" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-building/jk2iyiI8n2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages