Hello,

My program needs libusb-1.0 to work. I recompiled libusb-1.0 using the sdk
and modifying the libusb-0.1 present in the sdk.
I put my libusb-1.0.so in /mnt/flash/lib.

I also compiled my program linking libusb-1.0, but when I execute my
program, it doesn't find libusb!
I tried in /var/lib but still doesn't work...

Where do I put the library?

I would appreciate your help regarding that issue.

Claudio Ingaglio
____________
libusb Makefile

# Makefile.in generated by automake 1.10.2 from Makefile.am.
# libusb/Makefile.  Generated from Makefile.in by configure.

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

#----------------------------------------------------
# Based on CapeFox Library Makefile v1.05
# www.capefox.com
# Jono Woodhouse
#----------------------------------------------------

AXIS_USABLE_LIBS = GLIBC UCLIBC
include $(AXIS_TOP_DIR)/tools/build/Rules.axis

# -------------- Setup: soname, real name and linker name
LIB_SN = libusb-1.0.3.so.4
LIB_RN = libusb-1.0.3.so
LIB_LN = libusb-1.0.so

# -------------- Setup: Object files (Space separated list)
OBJS = core.o descriptor.o io.o sync.o linux_usbfs.o

# -------------- Setup: Object files for install process (Space separated
list)
INCS = libusbi.h linux_usbfs.h libusb.h

# -------------- Setup: Library Files (uncomment if your library links to
other libraries)
LDLIBS += -lrt
## can also use -lother
#LDFLAGS += -Wl,-R/lib -Wl,-L$(prefix)/lib

# -------------- Setup: Foxboard Settings
# Tip: To use ssh without having to type a password type the next line on
your linux machine (only once)
# ssh-keygen -t rsa            (Don't use a PassPhrase)
# Then every time you flash the foxboard use the following:
# cat ~/.ssh/id_rsa.pub | ssh -l root 192.168.2.90 "cat -
>>.ssh/authorized_keys"
FOXIP=192.168.0.80
FOXINSTDIR = /mnt/flash/lib/
FOXUSER=root

# -----------------------
INSTDIR = $(prefix)/lib/
INCDIR = $(prefix)/include/
INSTMODE = 0777
INCMODE  = 0666
INSTOWNER = root
INSTGROUP = root

LDFLAGS += -Wl,-soname,$(LIB_SN)
CFLAGS += -I.
CC += -fpic
CC += -shared
# -----------------------

all: $(LIB_SN)

$(LIB_SN): $(OBJS)
    @echo "------------------------------------------------------"
    @echo Compiling $^ [into] $@
    @echo "------------------------------------------------------"
    $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
    $(STRIP) $@

install: $(LIB_SN)
    @echo "------------------------------------------------------"
    @echo Installing $(LIB_SN) into $(INSTDIR)
    @echo "------------------------------------------------------"
    $(INSTALL) -d $(INSTDIR)
    $(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(LIB_SN)
$(INSTDIR)
    $(INSTALL) -d $(INCDIR)
    $(INSTALL) -m $(INCMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(INCS)
$(INCDIR)
    ln -sf $(LIB_SN) $(INSTDIR)$(LIB_RN)
    ln -sf $(LIB_SN) $(INSTDIR)$(LIB_LN)

fox:    $(LIB_SN)
    @echo "------------------------------------------------------"
    @echo Copying $(LIB_SN) to Foxboard $(FOXIP):$(FOXINSTDIR)
    @echo "------------------------------------------------------"
    scp $(LIB_SN) $(FOXUSER)@$(FOXIP):$(FOXINSTDIR)

foxlib: $(LIB_SN)
    @echo "------------------------------------------------------"
    @echo Configuring $(LIB_SN) on Foxboard $(FOXIP):$(FOXINSTDIR)
    @echo "------------------------------------------------------"
    scp $(LIB_SN) $(FOXUSER)@$(FOXIP):$(FOXINSTDIR)
    ssh $(FOXUSER)@$(FOXIP) ln -sf $(LIB_SN) $(FOXINSTDIR)$(LIB_RN)
    ssh $(FOXUSER)@$(FOXIP) ln -sf $(LIB_SN) $(FOXINSTDIR)$(LIB_LN)
    ssh $(FOXUSER)@$(FOXIP) ls -al $(FOXINSTDIR)$(LIB_SN)
$(FOXINSTDIR)$(LIB_RN) $(FOXINSTDIR)$(LIB_LN)

foxlibtest: $(LIB_SN)
    @echo "------------------------------------------------------"
    @echo Configuring $(LIB_SN) on Foxboard $(FOXIP):$(FOXINSTDIR)
    @echo "------------------------------------------------------"
    @echo scp $(LIB_SN) $(FOXUSER)@$(FOXIP):$(FOXINSTDIR)
    @echo $(FOXUSER)@$(FOXIP) ln -sf $(LIB_SN) $(FOXINSTDIR)$(LIB_RN)
    @echo $(FOXUSER)@$(FOXIP) ln -sf $(LIB_SN) $(FOXINSTDIR)$(LIB_LN)
    @echo $(FOXUSER)@$(FOXIP) ls -al $(FOXINSTDIR)$(LIB_SN)
$(FOXINSTDIR)$(LIB_RN) $(FOXINSTDIR)$(LIB_LN)

clean:
    @echo "------------------------------------------------------"
    @echo Clean: Removing all generated files for $(LIB_SN)
    @echo "------------------------------------------------------"
    rm -f $(LIB_SN) *.o core

Reply via email to