0

最近,我尝试为 Android 编译 vlc 并遇到了这个错误。

我的操作系统:OS X El Capitan。

下面附上我的编译日志:

Last login: Sat May  7 17:48:07 on ttys000
wedonedeiMac:~ wedone$ cd /Volumes/D/vlc_source_code/Android
wedonedeiMac:Android wedone$ ./compile.sh
VLC source found`
Configuring`
ABI:        armeabi-v7a
API:        android-9
SYSROOT:    /Volumes/D/android/android-ndk/platforms/android-9/arch-arm
PATH:       /Volumes/D/android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Volumes/D/android/android-sdk/tools:/Volumes/D/android/android-sdk/platform-tools:/Volumes/D/android/android-ndk`
CFLAGS:            -g -O2 -fstrict-aliasing -funsafe-math-optimizations -mlong-calls`
EXTRA_CFLAGS:      -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include`
Building tools
You are ready to build VLC and its contribs
Building the contribs
Generating EGL pkg-config file
Generating GLESv2 pkg-config file
-n Guessing build system... 
x86_64-apple-darwin15.4.0
Creating configuration file... config.mak
Bootstrap completed.

Run "make" to start compilation.

Other targets:
 * make install      same as "make"
 * make prebuilt     fetch and install prebuilt binaries
 * make list         list packages
 * make fetch        fetch required source tarballs
 * make fetch-all    fetch all source tarballs
 * make distclean    clean everything and undo bootstrap
 * make mostlyclean  clean everything except source tarballs
 * make clean        clean everything
 * make package      prepare prebuilt packages
make: Nothing to be done for `fetch'.
make: `.gettext' is up to date.
mkdir -p -- /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/share/aclocal && cd vncclient && autoreconf -fiv -I/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/share/aclocal
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/share/aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /Volumes/D/vlc_source_code/Android/vlc/extras/tools/build/bin/autoconf --include=/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/share/aclocal --force
autoreconf: running: /Volumes/D/vlc_source_code/Android/vlc/extras/tools/build/bin/autoheader --include=/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/share/aclocal --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
cd vncclient && CC="arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm" CXX="arm-linux-androideabi-g++ --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm" LD="arm-linux-androideabi-ld" AR="arm-linux-androideabi-ar" CCAS="arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm -c" RANLIB="arm-linux-androideabi-ranlib" STRIP="arm-linux-androideabi-strip" PATH="/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/bin:/Volumes/D/vlc_source_code/Android/vlc/extras/tools/build/bin:/Volumes/D/vlc_source_code/Android/vlc/extras/tools/build/bin:/Volumes/D/android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Volumes/D/android/android-sdk/tools:/Volumes/D/android/android-sdk/platform-tools:/Volumes/D/android/android-ndk:/Volumes/D/vlc_source_code/Android/vlc/contrib/contrib-android-arm-linux-androideabi/../arm-linux-androideabi/bin" CPPFLAGS=" -g -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/include" CFLAGS=" -g -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/include -g" CXXFLAGS=" -g -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include -I/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/include  -g" LDFLAGS=" -L/Volumes/D/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a -lgnustl_static -L/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib" ./configure --prefix="/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi" --datarootdir="/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/share" --includedir="/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/include" --libdir="/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib" --build="x86_64-apple-darwin15.4.0" --host="arm-linux-androideabi" --target="arm-linux-androideabi" --program-prefix="" --enable-static --disable-shared --disable-dependency-tracking --with-pic --without-libva
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm
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 arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm accepts -g... yes
checking for arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm option to accept ISO C89... none needed
checking whether arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm... none
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-apple-darwin15.4.0
checking host system type... arm-unknown-linux-androideabi
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm... arm-linux-androideabi-ld
checking if the linker (arm-linux-androideabi-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /Volumes/D/android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm -B
checking the name lister (/Volumes/D/android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin15.4.0 file names to arm-unknown-linux-androideabi format... func_convert_file_noop
checking how to convert x86_64-apple-darwin15.4.0 file names to toolchain format... func_convert_file_noop
checking for arm-linux-androideabi-ld option to reload object files... -r
checking for arm-linux-androideabi-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-androideabi-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-androideabi-ar... arm-linux-androideabi-ar
checking for archiver @FILE support... @
checking for arm-linux-androideabi-strip... (cached) arm-linux-androideabi-strip
checking for arm-linux-androideabi-ranlib... arm-linux-androideabi-ranlib
checking command to parse /Volumes/D/android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm -B output from arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm object... ok
checking for sysroot... no
checking for arm-linux-androideabi-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm -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 arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm supports -fno-rtti -fno-exceptions... no
checking for arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm option to produce PIC... -fPIC -DPIC
checking if arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm PIC flag -fPIC -DPIC works... yes
checking if arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm static flag -static works... yes
checking if arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm supports -c -o file.o... yes
checking if arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm supports -c -o file.o... (cached) yes
checking whether the arm-linux-androideabi-gcc --sysroot=/Volumes/D/android/android-ndk/platforms/android-9/arch-arm linker (arm-linux-androideabi-ld) supports shared libraries... yes
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... no
checking whether to build static libraries... yes
checking for ar... /usr/bin/ar
checking for __b64_ntop... yes
checking thenonexistentheader.h usability... no
checking thenonexistentheader.h presence... no
checking for thenonexistentheader.h... no
checking for crypt... no
checking for crypt in -lcrypt... no
checking for RAND_file_name in -lcrypto... no
checking for SSL_library_init in -lssl... no
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking for jpeg_CreateCompress in libjpeg... yes
checking whether JPEG library is libjpeg-turbo... no
configure: WARNING:
==========================================================================
*** The libjpeg library you are building against is not libjpeg-turbo.
Performance will be reduced.  You can obtain libjpeg-turbo from:
https://sourceforge.net/projects/libjpeg-turbo/files/ ***
==========================================================================

checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for png_create_write_struct in -lpng... no
configure: WARNING:
==========================================================================
*** The libpng compression library was not found. ***
This may lead to reduced performance, especially over slow links.
If libpng is in a non-standard location use --with-png=DIR to
indicate the header file is in DIR/include/png.h and the library
in DIR/lib/libpng.a.  A copy of libpng may be obtained from:
http://www.libpng.org/pub/png/libpng.html
==========================================================================

checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for deflate in -lz... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_mutex_lock in -lpthread... no
checking for pthread_mutex_lock in -lpthread... (cached) no
checking for __thread... yes
checking for arm-linux-androideabi-pkg-config... no
checking for pkg-config... /Volumes/D/vlc_source_code/Android/vlc/extras/tools/build/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking for GTK... no
checking for arm-linux-androideabi-libgcrypt-config... no
checking for libgcrypt-config... /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/bin/libgcrypt-config
checking for LIBGCRYPT - version >= 1.4.0... yes (1.6.4)
checking for GNUTLS... yes
checking for getaddrinfo... yes
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/endian.h usability... yes
checking sys/endian.h presence... yes
checking for sys/endian.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking ws2tcpip.h usability... no
checking ws2tcpip.h presence... no
checking for ws2tcpip.h... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for socklen_t... yes
checking for stdint types... stdint.h (shortcircuit)
make use of stdint.h in rfb/rfbint.h (assuming C99 compatible system)
checking for in_addr_t... 
checking for working memcmp... no
checking whether lstat correctly handles trailing slash... no
checking whether stat accepts an empty string... yes
checking for strftime... yes
checking for vprintf... yes
checking for _doprnt... no
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... cross
configure: WARNING: result yes guessed because of cross compilation
checking for working vfork... (cached) yes
checking for gethostbyname in -lnsl... no
checking for socket in -lsocket... no
checking for ftime... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for gettimeofday... yes
checking for inet_ntoa... yes
checking for memmove... yes
checking for memset... yes
checking for mmap... yes
checking for mkfifo... no
checking for select... yes
checking for socket... yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... yes
checking for strerror... yes
checking for strstr... yes
checking for shmget in -lcygipc... no
checking ApplicationServices/ApplicationServices.h usability... no
checking ApplicationServices/ApplicationServices.h presence... no
checking for ApplicationServices/ApplicationServices.h... no
checking android/api-level.h usability... yes
checking android/api-level.h presence... yes
checking for android/api-level.h... yes
checking for rpm sources path... NOT-FOUND
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libvncserver.pc
config.status: creating libvncclient.pc
config.status: creating libvncserver/Makefile
config.status: creating examples/Makefile
config.status: creating examples/android/Makefile
config.status: creating webclients/Makefile
config.status: creating webclients/java-applet/Makefile
config.status: creating webclients/java-applet/ssl/Makefile
config.status: creating libvncclient/Makefile
config.status: creating client_examples/Makefile
config.status: creating test/Makefile
config.status: creating libvncserver-config
config.status: creating LibVNCServer.spec
config.status: creating rfbconfig.h
config.status: rfbconfig.h is unchanged
config.status: executing rfb/rfbconfig.h commands
config.status: creating rfb/rfbconfig.h - prefix LIBVNCSERVER for rfbconfig.h defines
config.status: rfb/rfbconfig.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing rfb/rfbint.h commands
config.status: creating rfb/rfbint.h : _LIBVNCSERVER_RFB_RFBINT_H
config.status: rfb/rfbint.h is unchanged
config.status: executing chmod-libvncserver-config commands
cd vncclient && /Applications/Xcode.app/Contents/Developer/usr/bin/make -C libvncclient install
make[2]: Nothing to be done for `install-data-am'.
 .././install-sh -c -d '/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libvncclient.la '/Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib'
libtool: install: /usr/bin/install -c .libs/libvncclient.lai /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib/libvncclient.la
libtool: install: /usr/bin/install -c .libs/libvncclient.a /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib/libvncclient.a
libtool: install: chmod 644 /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib/libvncclient.a
libtool: install: arm-linux-androideabi-ranlib /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib/libvncclient.a
arm-linux-androideabi-ranlib: /Volumes/D/vlc_source_code/Android/vlc/contrib/arm-linux-androideabi/lib/libvncclient.a: Malformed archive
make[2]: *** [install-libLTLIBRARIES] Error 1
make[1]: *** [install-am] Error 2
make: *** [.vncclient] Error 2
contribs: make failed
wedonedeiMac:Android wedone$
4

2 回答 2

0

我在mac上编译vlc-android时遇到了同样的问题,经过几个小时的工作,我通过以下修改成功构建了apk文件。我希望它对您有用,并且任何其他人都面临过同样的问题。

diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 037d680..53eb59e 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -85,7 +85,9 @@ ifdef HAVE_WIN32
        cd $< && $(RANLIB) "$(PREFIX)/lib/liblua.a"
 endif
 ifdef HAVE_CROSS_COMPILE
+ cd $</src && mv Makefile Makefile.new && mv Makefile.orig Makefile
        cd $</src && $(MAKE) clean && $(MAKE) liblua.a && ranlib liblua.a && $(MAKE) luac
        cp $</src/luac $(PREFIX)/bin
+ cd $</src && mv Makefile Makefile.orig && mv Makefile.new Makefile
 endif
        touch $@
diff --git a/contrib/src/vncclient/rules.mak b/contrib/src/vncclient/rules.mak
index 1915f5c..a4e23b3 100644
--- a/contrib/src/vncclient/rules.mak
+++ b/contrib/src/vncclient/rules.mak
@@ -31,7 +31,7 @@ DEPS_vncclient = gcrypt $(DEPS_gcrypt) jpeg $(DEPS_jpeg) png $(DEPS_png) gnutls

 .vncclient: vncclient
        $(RECONF)
-   cd $< && $(HOSTVARS) ./configure $(HOSTCONF) --without-libva
+ cd $< && $(HOSTVARS) ac_cv_path_AR="$(AR)" ./configure $(HOSTCONF) --without-libva
        cd $< && $(MAKE) -C libvncclient install
        cd $< && $(MAKE) install-data
        touch $@
diff --git a/share/Makefile.am b/share/Makefile.am
index 3ed638a..de5188c 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -4,8 +4,10 @@ EXTRA_DIST =

 appdatadir = $(datadir)/applications
 if !HAVE_WIN32
+if !HAVE_ANDROID
 appdata_DATA = vlc.desktop
 endif
+endif
 EXTRA_DIST += vlc.desktop.in vlc.desktop.mimetypes
 CLEANFILES += $(appdata_DATA)
于 2016-05-20T17:05:50.060 回答
0

我认为 vncclient 对于 vlc 来说不是必需的,所以我放弃了 vncclient 模块。

路径:…/vlcandroid/vlc/contrib/src/vncclient rules.mak

$(RECONF)
cd $< && $(HOSTVARS) ac_cv_path_AR="$(AR)" ./configure $(HOSTCONF) --without-libva
#cd $< && $(MAKE) -C libvncclient install
#cd $< && $(MAKE) install-data
touch $@

路径:…/vlcandroid/vlc/share

生成文件.am

appdatadir = $(datadir)/applications
if !HAVE_WIN32
if !HAVE_DARWIN
#appdata_DATA = vlc.desktop
endif
endif
EXTRA_DIST += vlc.desktop.in vlc.desktop.mimetypes
CLEANFILES += $(appdata_DATA)

然后你可以继续编译你的项目。

于 2016-08-29T08:12:16.303 回答