Build and Install libusb-1.0.20 for LTIB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Build and Install libusb-1.0.20 for LTIB

2,523 Views
shivakumarwanta
Contributor I

Hi all,

 
       I want to build and install the libusb-1.0.20 for Freescale Linux LTIB package. 
Please give the necessary details to achieve the same. I've been trying to do the same,
but did not success. Below are the steps I followed to build the libusb for LTIB:
1. Add the libusb-1.0.20 package to LTIB package folder i.e. /opt/Freescale/Pkgs.
2. Update the libusb spec file from the location dist/lfs-5.1/libusb/libusb.spec
     Spec file is updated to have correct version, remove the previous patch sources,
     and remove previous patch commands for libusb-1.0.8
3. Run the LTIB command to prepare the package
    ./ltib -p prep libusb
4. Build the LTIB command to build the libusb package for ltib.
   ./ltib -p scbuild libusb.
      At this command I am not able to build the libusb for ltib. Below is the error I am getting :
jzp6tm:~/LTIB$ ./ltib -m scbuild -p libusb
 
Processing: libusb
====================
Build path taken because: directory build, build key set, no prebuilt rpm, 
 
rpmbuild --dbpath /mnt/freescale/ltib_git/ltib/rootfs//var/lib/rpm --target arm --define '_unpackaged_files_terminate_build 0' --define '_target_cpu arm' --define '__strip strip' --define '_topdir /mnt/freescale/ltib_git/ltib/rpm' --define '_prefix /usr' --define '_tmppath /mnt/freescale/ltib_git/ltib/tmp' --define '_rpmdir /mnt/freescale/ltib_git/ltib/rpm/RPMS'  --define '_mandir /usr/share/man' --define '_sysconfdir /etc' --define '_localstatedir /var' -bc --short-circuit  /mnt/freescale/ltib_git/ltib/dist/lfs-5.1/libusb/libusb.spec
Building target platforms: arm
Building for target arm
Executing(%build): /bin/sh -e /mnt/freescale/ltib_git/ltib/tmp/rpm-tmp.49088
+ umask 022
+ cd /mnt/freescale/ltib_git/ltib/rpm/BUILD
+ cd libusb-1.0.20
+ ENDIAN=little
+ conf_opts=ac_cv_c_bigendian=no
+ ./configure --prefix=/usr --host=armv7-unknown-linux --build=i686-pc-linux-gnu --disable-build-docs ac_cv_c_bigendian=no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for armv7-unknown-linux-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for armv7-unknown-linux-gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... armv7-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... ld
checking if the linker (ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for armv7-unknown-linux-dumpbin... no
checking for armv7-unknown-linux-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to armv7-unknown-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for ld option to reload object files... -r
checking for armv7-unknown-linux-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for armv7-unknown-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for armv7-unknown-linux-ar... ar
checking for archiver @FILE support... @
checking for armv7-unknown-linux-strip... strip
checking for armv7-unknown-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from gcc object... ok
checking for sysroot... no
checking for armv7-unknown-linux-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for armv7-unknown-linux-windres... no
checking for windres... no
checking for inline... inline
checking operating system... Linux
checking for library containing clock_gettime... -lrt
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for udev_new in -ludev... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/timerfd.h usability... yes
checking sys/timerfd.h presence... yes
checking for sys/timerfd.h... yes
checking whether TFD_NONBLOCK is declared... yes
checking whether to use timerfd for timing... yes
checking for struct timespec... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for syslog... yes
checking for sigaction... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for gettimeofday... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking whether CC supports -std=gnu99... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libusb-1.0.pc
config.status: creating Makefile
config.status: creating libusb/Makefile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating doc/doxygen.cfg
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
+ make
make  all-recursive
make[1]: Entering directory `/mnt/freescale/ltib_git/ltib/rpm/BUILD/libusb-1.0.20'
Making all in libusb
make[2]: Entering directory `/mnt/freescale/ltib_git/ltib/rpm/BUILD/libusb-1.0.20/libusb'
  CC       libusb_1_0_la-core.lo
  CC       libusb_1_0_la-descriptor.lo
  CC       libusb_1_0_la-io.lo
  CC       libusb_1_0_la-strerror.lo
make[3]: Entering directory `/mnt/freescale/ltib_git/ltib/rpm/BUILD/libusb-1.0.20/libusb'
  CC       libusb_1_0_la-sync.lo
  CC       libusb_1_0_la-hotplug.lo
  CC       libusb_1_0_la-core.lo
  CC       os/libusb_1_0_la-threads_posix.lo
  CC       os/libusb_1_0_la-linux_usbfs.lo
  CC       os/libusb_1_0_la-poll_posix.lo
  CC       os/libusb_1_0_la-linux_udev.lo
  CC       libusb_1_0_la-descriptor.lo
  CC       libusb_1_0_la-io.lo
  CC       os/libusb_1_0_la-linux_usbfs.lo
  CC       os/libusb_1_0_la-poll_posix.lo
  CC       os/libusb_1_0_la-linux_udev.lo
mv: cannot stat `os/libusb_1_0_la-linux_usbfs.loT': No such file or directory
  CCLD     libusb-1.0.la
mv: cannot stat `os/.deps/libusb_1_0_la-linux_usbfs.Tpo': No such file or directory
make[3]: *** [os/libusb_1_0_la-linux_usbfs.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/mnt/freescale/ltib_git/ltib/rpm/BUILD/libusb-1.0.20/libusb'
make[2]: *** [all-recursive] Error 1
make[2]: *** Waiting for unfinished jobs....
libtool: link: warning: library `/mnt/freescale/ltib_git/ltib/rootfs/usr/lib/libudev.la' was moved.
make[2]: Leaving directory `/mnt/freescale/ltib_git/ltib/rpm/BUILD/libusb-1.0.20/libusb'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/freescale/ltib_git/ltib/rpm/BUILD/libusb-1.0.20'
make: *** [all] Error 2
error: Bad exit status from /mnt/freescale/ltib_git/ltib/tmp/rpm-tmp.49088 (%build)
 
 
RPM build errors:
    Bad exit status from /mnt/freescale/ltib_git/ltib/tmp/rpm-tmp.49088 (%build)
Build time for libusb: 4 seconds
 
Failed building libusb
 
 
f_scbuild() returned an error, exiting
traceback:
 main:613
 
Exiting on error or interrupt
 
Please help to build the libusb-1.0.20. Please find the attached libusb package for your reference.
Thanks and regards,
Shivakumar  VW

Original Attachment has been moved to: libusb-1.0.20.tar.bz2

Tags (2)
0 Kudos
3 Replies

1,462 Views
shivakumarwanta
Contributor I

Hi igorpakykov,

   Thanks for the link. But that did not solve my problem. Now, I am trying to configure the build environment by setting the compiler path to LTIB toolchain and trying to build the libusb package separately. Below is the command used to configure the libusb package. 

./configure CC=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 --host=arm-linux prefix=/home/user/libusb

But i am getting configure error as libudev.h file not found. But I can see libudev.h file present in LTIB/rootfs/usr/include folder. Below is the entire configure command output.

jzp6tm:~/Desktop/libusb-1.0.20$ ./configure CC=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 --host=arm-linux prefix=/home/user/libusb
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for arm-linux-gcc... /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 accepts -g... yes
checking for /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 option to accept ISO C89... none needed
checking whether /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2... /mnt/freescale/bsp_git/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/arm-fsl-linux-gnueabi/bin/ld
checking if the linker (/mnt/freescale/bsp_git/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/arm-fsl-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-linux-dumpbin... no
checking for arm-linux-link... no
checking for dumpbin... no
checking for link... link -dump
configure: WARNING: using cross tools not prefixed with host triplet
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /mnt/freescale/bsp_git/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/arm-fsl-linux-gnueabi/bin/ld option to reload object files... -r
checking for arm-linux-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for arm-linux-strip... strip
checking for arm-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 object... ok
checking for sysroot... no
checking for arm-linux-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 supports -fno-rtti -fno-exceptions... no
checking for /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 option to produce PIC... -fPIC -DPIC
checking if /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 PIC flag -fPIC -DPIC works... yes
checking if /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 static flag -static works... yes
checking if /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 supports -c -o file.o... yes
checking if /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 supports -c -o file.o... (cached) yes
checking whether the /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc-4.6.2 linker (/mnt/freescale/bsp_git/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/arm-fsl-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for arm-linux-windres... no
checking for windres... no
checking for inline... inline
checking operating system... Linux
checking for library containing clock_gettime... -lrt
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
configure: error: "udev support requested but libudev not installed"

Though libudev is present in LTIB package, I am seeing this error. Please help to resolve this. 

Alternatively, is there libusb package with hotplug support. Presently, the ltib I am using has libusb-1.0.8 package and it doesn't support hotplug. Please provide libusb package with hotplug support if it exists. Else, please help to resolve the above error and assist in building libusb for LTIB.

0 Kudos

1,462 Views
igorpadykov
NXP Employee
NXP Employee

Hi

unfortunately ltib has not support for libusb, also it is considered

as outdated, so for its support may be recommedned to apply to NXP Professional Services:

http://www.nxp.com/support/nxp-professional-services:PROFESSIONAL-SERVICE
Pro-Support contact www.nxp.com/prosupport

Best regards
igor

0 Kudos

1,462 Views
igorpadykov
NXP Employee
NXP Employee

Hi Shivakumar

please check below link where this problem seems was solved

Problems building with ltib: hal and libusb? 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos