2015-02-04 10 views
0

다음과 같이 libusb를 공유 라이브러리로 빌드하려고합니다.libusb를 공유 라이브러리로 컴파일하는 방법은 무엇입니까?

다음 두 단계가 있습니다. 1. 2.를 구성하십시오.

나는 "--enable-공유는"그것은이

구성

./configure CC=/mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc --host=arm-linux --enable-udev=no --enable-shared 
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... gawk 
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... /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-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 /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc accepts -g... yes 
checking for /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc option to accept ISO C89... none needed 
checking whether /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc understands -c and -o together... yes 
checking for style of include used by make... GNU 
checking dependency style of /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc... gcc3 
checking build system type... x86_64-unknown-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 /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc... /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/bin/ld 
checking if the linker (/mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/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 x86_64-unknown-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop 
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop 
checking for /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/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 /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc 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... /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-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 /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc supports -fno-rtti -fno-exceptions... no 
checking for /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc option to produce PIC... -fPIC -DPIC 
checking if /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc PIC flag -fPIC -DPIC works... yes 
checking if /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc static flag -static works... yes 
checking if /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc supports -c -o file.o... yes 
checking if /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc supports -c -o file.o... (cached) yes 
checking whether the /mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc linker (/mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/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... none required 
checking asm/types.h usability... yes 
checking asm/types.h presence... yes 
checking for asm/types.h... yes 
checking sys/socket.h usability... yes 
checking sys/socket.h presence... yes 
checking for sys/socket.h... yes 
checking for linux/netlink.h... yes 
checking for linux/filter.h... 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 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: config.h is unchanged 
config.status: executing depfiles commands 
config.status: executing libtool commands 

make CC=/mnt/store/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-gcc 
make all-recursive 
make[1]: Entering directory `/mnt/store/build-without-sdk/libusb-1.0.19' 
Making all in libusb 
make[2]: Entering directory `/mnt/store/build-without-sdk/libusb-1.0.19/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 
    CC  libusb_1_0_la-sync.lo 
    CC  libusb_1_0_la-hotplug.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_netlink.lo 
    CCLD  libusb-1.0.la 
make[2]: Leaving directory `/mnt/store/build-without- sdk/libusb-1.0.19/libusb' 


Making all in doc 
make[2]: Entering directory `/mnt/store/build-without-sdk/libusb-1.0.19/doc' 
make[2]: Nothing to be done for `all'. 
make[2]: Leaving directory `/mnt/store/build-without-sdk/libusb-1.0.19/doc' 
make[2]: Entering directory `/mnt/store/build-without-sdk/libusb-1.0.19' 
make[2]: Leaving directory `/mnt/storebuild-without-sdk/libusb-1.0.19' 
make[1]: Leaving directory `/mnt/store/build-without-sdk/libusb-1.0.19' 

확인 .so 파일 공유가 생성됩니다 가정 스크립트를 구성하지만 libusb를을 찾을 수 없습니다 통과 -1.0.so

+0

출력에 make를 추가하고 질문을 구성 할 수 있습니까? 없으면 이것은 단지 추측 일뿐입니다. –

+0

여기 출력은 –

+0

입니다. 흠, 여전히 수수께끼 같아요. '깨끗하게해라. make '(make 호출에서'CC' 변수의 명시 적 설정 생략) 도움이 될까요? 그렇지 않다면 나는 약간의 아이디어가 없습니다. configure 출력은 config.h가 변경되지 않았 음을 나타냅니다. 필자는 autotools로 가장 멋진 (끔찍한) 것을 보았습니다. 그래서 깨끗한 빌드 디렉토리로 시작하는 것이 좋습니다. –

답변

2

.so 파일은 libusb/.libs/에 내장되어 있습니다.빌드 로그를 보면 그다지 분명하지 않습니다.

+0

추가 정보를 추가 하시려면 질문에 편집 링크를 사용하십시오. 답변 게시 버튼은 질문에 대한 완전한 대답을 위해서만 사용되어야합니다. –

+0

그러나 이것은 질문에 대한 대답입니다. –

+0

괜찮습니다. - 당신은 당신의 대답을 받아 들일 수 있습니다. 아마도 [정보] (http://www.gnu.org/software/libtool/manual/libtool.html#Creating-object-files)를 추가하기 만하면됩니다. –