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

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

问题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"

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

  1. appium1.4+华为8.0执行自动化脚本,报启动session失败,原因是unicode_ime_apk\Uni codeIME-debug.apk在手机上已存在,再次安装失败,导致启动session失败,解决办法:换高版本的appium

    最开始做Android自动化测试时,通过执行脚本发现报,已安装UnicodeIME-debug.apk,再次安装失败,当时觉得这个apk对我来说没用,就把D:\Program Files (x86)\ ...

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

    运行自动化脚本,手机自动安装 settings.apk和unclock.apk,执行脚本时提示安装UnicodeIME-debug.apk失败,怎么关掉自动安装? 这3个apk的目录分别是: D:\P ...

  3. java+selenium自动化脚本编写

    实训项目:创盟后台管理,页面自动化脚本编写 使用工具:java+selenium 1)java+selenium环境搭建文档 2)创盟项目后台管理系统链接 java+selenium环境搭建 一.Se ...

  4. 自动化脚本中click()或sendKeys()没有反应

    前提: 排除xpath引用错误或元素的xpath每次都不同的情形. 问题描述 自动化脚本中click()方法和sendKeys()方法报错, 返回异常InvocationTargetException ...

  5. appium-desktop录制脚本二次开发,生成我司自动化脚本

    目的 通过对appium-desktop脚本录制功能进行二次开发,使录制的java脚本符合我司自动化框架要求. 实现步骤 1.增加元素名称的输入框 由于ATK(我司自动化测试框架)脚本中元素是以“ap ...

  6. Jenkins构建自动化脚本执行无界面解决方法

    场景: jenkins构建selenium自动化用例的时候,会有jenkins自带服务后台运行自动化脚本,可无界面运行IE.Chrome.Firefox. 然而运行IE浏览器时候(IE比较特殊),Je ...

  7. 【Zabbix】Zabbix-agent自动化脚本

    zabbix-agent自动化脚本 作用:批量部署zabbix-agent.用于上百台虚拟机都可以被Zabbix监控. 脚本名:inst-agent.sh #!/bin/bash echo " ...

  8. PHP学习日记 Windows配置PHP+Nginx+自动化脚本

    Windows配置PHP+Nginx+自动化脚本 安装与配置 PHP 下载PHP:传送门 选择合适的版本下载 尽量选Thread Safe 配置PHP: 解压后在文件夹中找到php.ini-devel ...

  9. python_selenium之第一个自动化脚本

    python_selenium之第一个自动化脚本 上一节介绍了xpath的使用,接下来完成第一个自动化脚本 一.步骤: 1. 这里使用火狐浏览器,首先打开火狐浏览器 2. 使浏览器窗口最大化 3.输入 ...

随机推荐

  1. 曾经很长时间不会写的两个SQL语句(group by,having)

    1.统计各部门的平均工资,平均资金(要求同时显示出部门名称,部门编号,部门总人数) SQL)),) 部门平均工资,)),) 部门平均资金 FROM EMP E RIGHT JOIN DEPT D ON ...

  2. [Python学习笔记][第六章Python面向对象程序设计]

    1月29日学习内容 Python面向对象程序设计 类的定义与使用 类定义语法 使用class关键词 class Car: def infor(self): print("This is ca ...

  3. Silverlight Application 无法调用js的方法

    今天下午做项目的时候遇到了这个错误 找了很多原因没找出,在蛋疼之际找出了问题, Silverlight调js方法的时候 js方法里面不能出现一点问题,如果有一点问题就会报这个错误.

  4. MVC 数据列表显示插件大全

    Jgrid 官网示例: http://www.trirand.net/demo/aspnet/mvc/jqgrid/ Code Project示例: http://www.codeproject.co ...

  5. 2014年1月9日 Oracle常见授权与权限回收[转]

    1.GRANT 赋于权限 常用的系统权限集合有以下三个: CONNECT(基本的连接), RESOURCE(程序开发), DBA(数据库管理) 常用的数据对象权限有以下五个: ALL ON 数据对象名 ...

  6. C# 操作系统防火墙

    很多时候,我们的程序是通过网络通信(如TCP或者UDP协议+端口),而将制作好的程序安装包给客户用时,发现会出现不能通信的现象(或者在这台电脑是可以的,却在另一台不可以),原因是防火墙阻止了,需要添加 ...

  7. c++ 指针的简单用法

    对于指针,其实只需要明白几点就可以. 1.指针,是一个数值为地址的变量,这里尤其注意,指针变量的值是地址!就是例如40002这种像门牌号的地址值,其实就是内存中的一个编号. 2.&,该符号的意 ...

  8. boost vc编译

    0.下载:http://www.boost.org/ 1.编译b2.exe,bjam.exe. 双击根目录下面的bootstrap.bat文件,生成b2.exe,bjam.exe(或者使用vs的命令行 ...

  9. git configuration

    git的配置文件由section名和变量名组成: [user] name = abc emial = example.com []里面的user就是section名,section只能由字母,数字,- ...

  10. project euler 16:Power digit sum

    >>> sum([int(i) for i in str(2**1000)]) 1366 >>>