使用zeranoe的自动化脚本mingw-w64-build-3.6.4在ubutun14.04_64bit上交叉编译ffmpeg 2.5

编译期间,碰到的两个大问题,是环境变量设置问题.

先列出执行脚本是碰到的两个问题,后面给出解决方法并记录执行的命令步骤.

问题1: 编译binutils 2.5出错

------------------------------
错误信息:
make[4]: 正在进入目录 `/home/shakin/work/build_for_windows/pkgs/binutils/build/i686-w64-mingw32/gas‘
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT app.o -MD -MP -MF .deps/app.Tpo -c -o app.o ../../../source/binutils-2.24/gas/app.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT as.o -MD -MP -MF .deps/as.Tpo -c -o as.o ../../../source/binutils-2.24/gas/as.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT atof-generic.o -MD -MP -MF .deps/atof-generic.Tpo -c -o atof-generic.o ../../../source/binutils-2.24/gas/atof-generic.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT compress-debug.o -MD -MP -MF .deps/compress-debug.Tpo -c -o compress-debug.o ../../../source/binutils-2.24/gas/compress-debug.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT cond.o -MD -MP -MF .deps/cond.Tpo -c -o cond.o ../../../source/binutils-2.24/gas/cond.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT depend.o -MD -MP -MF .deps/depend.Tpo -c -o depend.o ../../../source/binutils-2.24/gas/depend.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT dwarf2dbg.o -MD -MP -MF .deps/dwarf2dbg.Tpo -c -o dwarf2dbg.o ../../../source/binutils-2.24/gas/dwarf2dbg.c
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT dw2gencfi.o -MD -MP -MF .deps/dw2gencfi.Tpo -c -o dw2gencfi.o ../../../source/binutils-2.24/gas/dw2gencfi.c
mv -f .deps/compress-debug.Tpo .deps/compress-debug.Po
gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.24/gas -I. -I../../../source/binutils-2.24/gas -I../bfd -I../../../source/binutils-2.24/gas/config -I../../../source/binutils-2.24/gas/../include -I../../../source/binutils-2.24/gas/.. -I../../../source/binutils-2.24/gas/../bfd -DLOCALEDIR="\"/home/shakin/work/build_for_windows/mingw-w64-i686/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT ecoff.o -MD -MP -MF .deps/ecoff.Tpo -c -o ecoff.o ../../../source/binutils-2.24/gas/ecoff.c
../../../source/binutils-2.24/gas/as.c: In function ‘print_version_id’:
../../../source/binutils-2.24/gas/as.c:224:14: error: ‘TARGET_ALIAS’ undeclared (first use in this function)
VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
^
../../../source/binutils-2.24/gas/as.c:224:14: note: each undeclared identifier is reported only once for each function it appears in
../../../source/binutils-2.24/gas/as.c: In function ‘parse_args’:
../../../source/binutils-2.24/gas/as.c:635:5: error: ‘TARGET_ALIAS’ undeclared (first use in this function)
TARGET_ALIAS);
^
../../../source/binutils-2.24/gas/as.c:649:44: error: ‘TARGET_CANONICAL’ undeclared (first use in this function)
fprintf (stderr, _("canonical = %s\n"), TARGET_CANONICAL);
^
../../../source/binutils-2.24/gas/as.c:650:43: error: ‘TARGET_CPU’ undeclared (first use in this function)
fprintf (stderr, _("cpu-type = %s\n"), TARGET_CPU);
^
make[4]: *** [as.o] 错误 1

-------------------------------

问题2: 编译gcc 4.9.1 出错

------------------------------
错误信息

perl ../../source/gcc-4.9.1/gcc/../contrib/texi2pod.pl ../../source/gcc-4.9.1/gcc/doc/include/gpl_v3.texi > gpl.pod
echo "@set BUGURL @uref{http://gcc.gnu.org/bugs.html}" >> gcc-vers.texiT; \
mv -f gcc-vers.texiT gcc-vers.texi
echo timestamp > s-mlib
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/build -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include \
-o build/genhooks.o ../../source/gcc-4.9.1/gcc/genhooks.c
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/build -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include \
-o build/genchecksum.o ../../source/gcc-4.9.1/gcc/genchecksum.c
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/build -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include \
-o build/genenums.o ../../source/gcc-4.9.1/gcc/genenums.c
In file included from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:0:
../../source/gcc-4.9.1/gcc/system.h:506:34: error: declaration of C function ‘const char* strsignal(int)’ conflicts with
extern const char *strsignal (int);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
/usr/include/string.h:564:14: error: previous declaration ‘char* strsignal(int)’ here
extern char *strsignal (int __sig) __THROW;
^
g++ -c -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/lib/gcc/\" -DSTANDARD_LIBEXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/libexec/gcc/\" -DDEFAULT_TARGET_VERSION=\"4.9.1\" -DDEFAULT_TARGET_MACHINE=\"i686-w64-mingw32\" -DSTANDARD_BINDIR_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DCONFIGURE_SPECS="\"\"" -DTARGET_MACHINE=\"i686-w64-mingw32\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DPERSONALITY=\"nm\" -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/. -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/gmp/gmp-6.0.0a-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpfr/mpfr-3.1.2-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpc/mpc-1.0.2-x86_64/include -I../../source/gcc-4.9.1/gcc/../libdecnumber -I../../source/gcc-4.9.1/gcc/../libdecnumber/bid -I../libdecnumber -I../../source/gcc-4.9.1/gcc/../libbacktrace -DCLOOG_INT_GMP -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/cloog/cloog-0.18.1-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/isl/isl-0.12.2-x86_64/include -o gcc-nm.o -MT gcc-nm.o -MMD -MP -MF ./.deps/gcc-nm.TPo gcc-nm.c
g++ -c -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/lib/gcc/\" -DSTANDARD_LIBEXEC_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/libexec/gcc/\" -DDEFAULT_TARGET_VERSION=\"4.9.1\" -DDEFAULT_TARGET_MACHINE=\"i686-w64-mingw32\" -DSTANDARD_BINDIR_PREFIX=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DCONFIGURE_SPECS="\"\"" -DTARGET_MACHINE=\"i686-w64-mingw32\" -DTARGET_SYSTEM_ROOT=\"/home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686\" -DTARGET_SYSTEM_ROOT_RELOCATABLE -DPERSONALITY=\"ranlib\" -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../source/gcc-4.9.1/gcc -I../../source/gcc-4.9.1/gcc/. -I../../source/gcc-4.9.1/gcc/../include -I../../source/gcc-4.9.1/gcc/../libcpp/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/gmp/gmp-6.0.0a-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpfr/mpfr-3.1.2-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/mpc/mpc-1.0.2-x86_64/include -I../../source/gcc-4.9.1/gcc/../libdecnumber -I../../source/gcc-4.9.1/gcc/../libdecnumber/bid -I../libdecnumber -I../../source/gcc-4.9.1/gcc/../libbacktrace -DCLOOG_INT_GMP -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/cloog/cloog-0.18.1-x86_64/include -I/home/shakin/work/build_ffmpeg_for_windows/pkgs/isl/isl-0.12.2-x86_64/include -o gcc-ranlib.o -MT gcc-ranlib.o -MMD -MP -MF ./.deps/gcc-ranlib.TPo gcc-ranlib.c
In file included from ../../source/gcc-4.9.1/gcc/../include/hashtab.h:40:0,
from ../../source/gcc-4.9.1/gcc/../include/filenames.h:29,
from ../../source/gcc-4.9.1/gcc/system.h:630,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
../../source/gcc-4.9.1/gcc/../include/ansidecl.h:171:64: error: new declaration ‘char* basename(const char*)’
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
^
../../source/gcc-4.9.1/gcc/../include/libiberty.h:110:64: note: in expansion of macro ‘ATTRIBUTE_NONNULL’
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
/usr/include/string.h:601:26: error: ambiguates old declaration ‘const char* basename(const char*)’
extern "C++" const char *basename (const char *__filename)
^
In file included from ../../source/gcc-4.9.1/gcc/system.h:1064:0,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int clz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:244:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int ctz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:258:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int floor_log2(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:295:10: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT - 1 - clz_hwi (x);
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long int sext_hwi(long int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:328:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long unsigned int zext_hwi(long unsigned int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:342:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
../../source/gcc-4.9.1/gcc/gcc-ar.c: In function ‘int main(int, char**)’:
../../source/gcc-4.9.1/gcc/gcc-ar.c:139:39: error: ‘LTOPLUGINSONAME’ was not declared in this scope
plugin = find_a_file (&target_path, LTOPLUGINSONAME, R_OK);
^
In file included from ../../source/gcc-4.9.1/gcc/errors.c:29:0:
../../source/gcc-4.9.1/gcc/system.h:506:34: error: declaration of C function ‘const char* strsignal(int)’ conflicts with
extern const char *strsignal (int);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
/usr/include/string.h:564:14: error: previous declaration ‘char* strsignal(int)’ here
extern char *strsignal (int __sig) __THROW;
^
../../source/gcc-4.9.1/gcc/gcc-ar.c:189:35: error: call of overloaded ‘strsignal(int&)’ is ambiguous
exe_name, sig, strsignal (sig),
^
../../source/gcc-4.9.1/gcc/gcc-ar.c:189:35: note: candidates are:
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:
/usr/include/string.h:564:14: note: char* strsignal(int)
extern char *strsignal (int __sig) __THROW;
^
In file included from ../../source/gcc-4.9.1/gcc/gcc-ar.c:22:0:
../../source/gcc-4.9.1/gcc/system.h:506:20: note: const char* strsignal(int)
extern const char *strsignal (int);
^
make[1]: *** [gcc-ar.o] 错误 1
make[1]: *** 正在等待未完成的任务....
In file included from ../../source/gcc-4.9.1/gcc/../include/hashtab.h:40:0,
from ../../source/gcc-4.9.1/gcc/../include/filenames.h:29,
from ../../source/gcc-4.9.1/gcc/system.h:630,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
../../source/gcc-4.9.1/gcc/../include/ansidecl.h:171:64: error: new declaration ‘char* basename(const char*)’
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
^
../../source/gcc-4.9.1/gcc/../include/libiberty.h:110:64: note: in expansion of macro ‘ATTRIBUTE_NONNULL’
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
^
In file included from /usr/include/c++/4.8/cstring:42:0,
from ../../source/gcc-4.9.1/gcc/system.h:205,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
/usr/include/string.h:601:26: error: ambiguates old declaration ‘const char* basename(const char*)’
extern "C++" const char *basename (const char *__filename)
^
In file included from ../../source/gcc-4.9.1/gcc/system.h:1064:0,
from ../../source/gcc-4.9.1/gcc/errors.c:29:
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int clz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:244:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int ctz_hwi(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:258:12: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT;
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘int floor_log2(long unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:295:10: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
return HOST_BITS_PER_WIDE_INT - 1 - clz_hwi (x);
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long int sext_hwi(long int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:328:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
../../source/gcc-4.9.1/gcc/hwint.h: In function ‘long unsigned int zext_hwi(long unsigned int, unsigned int)’:
../../source/gcc-4.9.1/gcc/hwint.h:16:30: error: ‘CHAR_BIT’ was not declared in this scope
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
^
../../source/gcc-4.9.1/gcc/hwint.h:60:35: note: in expansion of macro ‘HOST_BITS_PER_LONG’
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
^
../../source/gcc-4.9.1/gcc/hwint.h:342:15: note: in expansion of macro ‘HOST_BITS_PER_WIDE_INT’
if (prec == HOST_BITS_PER_WIDE_INT)
^
make[1]: *** [errors.o] 错误 1
../../source/gcc-4.9.1/gcc/genhooks.c: In function ‘void emit_documentation(const char*)’:
../../source/gcc-4.9.1/gcc/genhooks.c:140:31: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf (f, "%999s", buf);
^
../../source/gcc-4.9.1/gcc/genhooks.c:131:3: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
while (fscanf (f, "%*[^@]"), buf[0] = ‘\0‘,
^
../../source/gcc-4.9.1/gcc/genhooks.c:193:34: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf (f, "%5[^ \n]", buf);
^
../../source/gcc-4.9.1/gcc/genhooks.c:199:31: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
fscanf (f, "%999s", buf);
^
/bin/bash ../../source/gcc-4.9.1/gcc/../move-if-change tmp-optionlist optionlist
echo timestamp > s-options
make[1]:正在离开目录 `/home/shakin/work/build_ffmpeg_for_windows/pkgs/gcc/build/gcc‘
make: *** [all-gcc] 错误 2
-------------------------------

碰到上面两个问题,请尝试一下以下方法,个人亲试:

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE
如果在/etc/profile 或者 ~/.bashrc中设置了ccache的话,也暂时去掉ccache的设置.

【编译32bit】 注意 一些路径要换成自己本机的路径

准备工作:

脚本获取:wget http://zeranoe.com/scripts/mingw_w64_build/mingw-w64-build-3.6.4 ,然后修改权限

ubuntu14.04情况下,执行:sudo apt-get install pax cvs flex bison texinfo

执行:bash ./mingw-w64-build-3.6.4 --build-type=multi --default-configure --disable-shared --enable-gendef

(1)ln -s "/usr/bin/pkg-config" /home/shakin/work/build_ffmpeg_for_windows/mingw-w64-i686/bin/i686-w64-mingw32-pkg-config
 (2)编译 x264
./configure --enable-static --enable-win32thread --host=i686-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --cross-prefix=i686-w64-mingw32-
 (3)编译libfdk_aac
./configure --host=i686-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --enable-static --disable-shared

其他的外插件略,需要安装的官网也有详细步骤.

(4)编译ffmpeg
./configure --disable-static --enable-shared --enable-version3 --enable-gpl --enable-nonfree --disable-pthreads --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-libfdk-aac --enable-libx264 --enable-zlib --enable-cross-compile --target-os=mingw32 --arch=x86 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules/ffmpeg --cross-prefix=i686-w64-mingw32- --extra-cflags="-I/home/shakin/work/build_ffmpeg_for_windows/dist/modules/include" --extra-ldflags="-L/home/shakin/work/build_ffmpeg_for_windows/dist/modules/lib"

编译的 exe和 dll文件,就在/home/shakin/work/build_ffmpeg_for_windows/dist/modules/ffmpeg 路径下,另外,编译成64位版时,libx264,libfdk_aac等也要相应的变成64bit,

编译 x264
./configure --enable-static --enable-win32thread --host=x86_64-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --cross-prefix=x86_64-w64-mingw32-
 编译libfdk_aac
./configure --host=x86_64-w64-mingw32 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules --enable-static --disable-shared

编译ffmpeg

./configure --disable-static --enable-shared --enable-version3 --enable-gpl --enable-nonfree --disable-pthreads --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-libfdk-aac --enable-libx264 --enable-zlib --enable-cross-compile --target-os=mingw32 --arch=x86 --prefix=/home/shakin/work/build_ffmpeg_for_windows/dist/modules/ffmpeg --cross-prefix=x86_64-w64-mingw32- --extra-cflags="-I/home/shakin/work/build_ffmpeg_for_windows/dist/modules/include" --extra-ldflags="-L/home/shakin/work/build_ffmpeg_for_windows/dist/modules/lib"

时间: 2024-10-13 02:36:57

使用zeranoe的自动化脚本mingw-w64-build-3.6.4在ubutun14.04_64bit上交叉编译ffmpeg 2.5的相关文章

安卓8.0真机运行appium1.4遇到的问题:运行自动化脚本,手机自动安装 settings.apk和unclock.apk,执行脚本时提示安装UnicodeIME-debug.apk失败,怎么关掉自动安装?

运行自动化脚本,手机自动安装 settings.apk和unclock.apk,执行脚本时提示安装UnicodeIME-debug.apk失败,怎么关掉自动安装? 这3个apk的目录分别是: D:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk D:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk D:\Program Files (

Linux 多网卡Bond自动化脚本

现状: 目前一台物理机4个网卡,em1-em2-em3-em4,需要实现1.2网卡绑定,3.4网卡绑定,模式为主备.即:一个网卡处于活动状态 ,一个处于备份状态,所有流量都在主链路上处理.当活动网卡down掉时,启用备份的网卡 附:linux有七种网卡绑定模式:0. round robin,1.active-backup,2.load balancing (xor),  3.fault-tolerance (broadcast), 4.lacp,  5.transmit load balanci

Resurrectio-capserjs的自动化脚本录制工具

[根据github上的文档说明整理] Phantom下的任何操作都可以录制 Resurrectio是一个Chrome插件,他可以记录浏览器的操作,并转化成对应的casperjs脚本 Resurrectio使用最简和装饰性的选择器,所以记录的步骤能在布局和设计变化时保持有效 当CasperJS执行JavaScript,录制步骤不限于html交互,js执行的精确步骤也能够被完整记录 Resurrectio也提供了一个方法去生成截屏,在你的测试场景里,并且能够导出注视和截屏在重构后的方法里(意思是这个

Selenium+C#自动化脚本开发学习

Selenium+C#自动化脚本开发知识学习 1:Selenium中对浏览器的操作 首先生成一个Web对象 IWebDriver driver = new FirefoxDriver(); //打开指定的URL地址 driver.Navigate().GoToUrl(@"http://12.99.102.196:9080/corporbank/logon_pro.html"); //关闭浏览器 Driver.quit(); 网银浏览器兼容性测试过程中,关闭浏览器后会有对话框,此问题解决

我的第一个自动化脚本(python)----百度搜索

这是一个纯小白胡说八道的个人总结,如果有人看到什么不对的,欢迎批评指正 博客园开通了很久,一直不知道该怎么去写,总觉得自己要写的东西都是别人已经写过的,我再去写就是在重复之前人所说,今天去面试和面试姐姐聊到这个问题的时候,我才真正的意识到写博客的意义,其实博客只要是写出来对自己有帮助,管其他人怎么看呢,就算百度搜索出来好多一样的那又怎么样呢,博客是写给自己的,如果能因此帮助别人少走一些弯路又何乐而不为呢 接下来就来我实现这个自动化脚本经历的过程,首先要在火狐浏览器安装selenium IDE:其

关于自动化脚本黑盒话的进度

在很久之前就想将自动化脚本编程黑盒化,让黑盒来编制自动化case 这样,我就可以有更多时间去面对以及完善我的自动化测试框架,毕竟总是在一个地方徘徊,终难有出路. 今天excel终于搞定了 ,未来关联方法的参数,在庆祝抗战70周年时,我还在努力ing... 好了,废话不多少,给大家看看我的关联函数吧, =IF(COUNTIF(基础数据!$A$2:$A$40,$G2)>0,VLOOKUP($G2,基础数据!$A$2:$D$39,2,FALSE),IF(COUNTIF(基础数据!$E$2:$E$40,

【转】jenkins上配置robotframeworkride自动化脚本任务

jenkins上配置robotframeworkride自动化脚本任务 编写好的自动化脚本,集成在jenkins上进行自动运行于监控,这里采用分布式构建,在一台slave上进行任务构建与自动化脚本的运行. 步骤: 1.创建jenkins任务 选择创建一个自由风格的任务 2.选择执行自动化脚本的slave机.(slave节点的配置参考) 图1 图2 etl-Suite.txt是自动化脚本 图3 Hi All, </br> <font color="#0B610B" si

自动化脚本中运到的一些简单算法

背景简介 在写一个自动化脚本时,要模拟发送网络请求,其中网络请求包含hid.md5.机器是64位还是32位等众多情况,而且这些因子还是不确定的,产品和开发可能会随时更改,这里我们就想通过自动化脚本根据这些因子全排列地自动去生成Case. 这里就怎么写个扩展性较好的生成全排列Case的代码,做下简单分享,具体前因后果请关注另外一篇文章(待发). 问题分析 现在假设就下面这三个case hid md5 64位/32位 123 abc 32 456 cde 64 现在又三个因子,每个因子2种情况,全排

自动化脚本安装ngnix项目

思路:自动化脚本安装ngnix项目 1,判断本地yum 源安装情况. 2,判断与安装ngnix的依赖包 gcc gcc-c++ pcre-devel    openssl-devel 3,判断 /root/下,是否有/ngnix-make 目录来存放nginx-1.10.2.tar.gz 如没有则需要创建,被下载ngnix安装源码包到该目录下. 4,正常编译安装ngnix 以及相关配置情况. 脚本代码如下: #! /bin/bash #author:小伟 #安装本地yum源 umount /de