Compile freetype-2.4.9 with MinGW-w64/Cygwin

ぐ巨炮叔叔 提交于 2019-12-12 05:17:40

问题


I'm trying to build x86_64 (64-bit code) version of the freetype-2.4.9 with native MinGW-w64 compiler in Cygwin environment. The configure runs fine but the makefile fails.

Jarmo@UltraJATmachine /cygdrive/y/tools/cppkirjastot
$ cd freetype-2.4.9/

Jarmo@UltraJATmachine /cygdrive/y/tools/cppkirjastot
$ PATH=/cygdrive/y/Tools/Compilers/mingw64/bin:$PATH

Jarmo@UltraJATmachine /cygdrive/y/tools/cppkirjastot/freetype-2.4.9
$ ./configure --build=i686-pc-mingw32 --disable-shared

FreeType build system -- automatic system detection

The following settings are used:

  platform                    unix
  compiler                    cc
  configuration directory     .//builds/unix
  configuration rules         .//builds/unix/unix.mk

If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).

cd builds/unix; ./configure  '--build=i686-pc-mingw32'
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
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 how to run the C preprocessor... gcc -E
checking for rm... rm -f
checking for rmdir... rmdir
checking for a BSD-compatible install... /usr/bin/install -c
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -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 fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking size of int... 4
checking size of long... 4
checking whether cpp computation of bit length in ftconfig.in works... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... no
checking for memcpy... yes
checking for memmove... yes
checking for gzsetparams in -lz... no
checking for BZ2_bzDecompress in -lbz2... no
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... y:/tools/compilers/mingw64/x86_64-w64-mingw32/bi
/ld.exe
checking if the linker (y:/tools/compilers/mingw64/x86_64-w64-mingw32/bin/ld.ex
) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /cygdrive/y/Tools/Compil
rs/mingw64/bin/nm -B
checking the name lister (/cygdrive/y/Tools/Compilers/mingw64/bin/nm -B) interf
ce... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 8192
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-mingw32 file names to i686-pc-mingw32 format...
func_convert_file_msys_to_w32
checking how to convert i686-pc-mingw32 file names to toolchain format... func_
onvert_file_msys_to_w32
checking for y:/tools/compilers/mingw64/x86_64-w64-mingw32/bin/ld.exe option to
reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import
^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_im
lib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /cygdrive/y/Tools/Compilers/mingw64/bin/nm -B output
rom gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... no
checking for as... as
checking for dlltool... (cached) dlltool
checking for objdump... (cached) objdump
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -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 (y:/tools/compilers/mingw64/x86_64-w64-mingw32/
in/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... cygwin warning:
  MS-DOS style path detected: y:/tools/compilers/mingw64/bin/../lib/gcc/x86_64-
64-mingw32/4.4.7//../lib64\x0D
  Preferred POSIX equivalent is: /cygdrive/y/tools/compilers/mingw64/lib/gcc/x8
_64-w64-mingw32/lib64\x0D
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Win32 ld.exe
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
configure: creating ./config.status
config.status: creating unix-cc.mk
config.status: creating unix-def.mk
config.status: creating freetype-config
config.status: creating freetype2.pc
config.status: creating ftconfig.h
config.status: executing libtool commands
make: Kohteelle "unix" ei tarvitse tehdä mitään.

Jarmo@UltraJATmachine /cygdrive/y/tools/cppkirjastot/freetype-2.4.9
$ mingw32-make
config.mk:36: /cygdrive/y/tools/cppkirjastot/freetype-2.4.9/builds/freetype.mk:
No such file or directory
config.mk:57: /cygdrive/y/tools/cppkirjastot/freetype-2.4.9/builds/unix/install
mk: No such file or directory
builds/toplevel.mk:169: /cygdrive/y/tools/cppkirjastot/freetype-2.4.9/builds/mo
ules.mk: No such file or directory
mingw32-make: *** No rule to make target `/cygdrive/y/tools/cppkirjastot/freety
e-2.4.9/builds/modules.mk'.  Stop.

I have tried to find reason why the makefile fails and it seems to be unable to include sub-makefiles. The problem remains if I just run the makefile without cygwin using only mingw32-make and cmd.exe.

Problem compiling freetype2 with MinGW/MSYS is very similiar to my problem, but does not answer to it. What should I do?


回答1:


Was able to build freetype-2.4.9 using mingw64 compiler and the following commands:

$ make setup gcc
$ make

FreeType build system -- automatic system detection

The following settings are used:

  platformÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿwin32
  compilerÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgcc
  configuration directoryÿÿÿÿÿÿ.\builds\win32
  configuration rulesÿÿÿÿÿÿÿÿÿÿ.\builds\win32\w32-gcc.mk

If this does not correspond to your system or settings please remove the file
'config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type 'make' again to build the library.
or 'make refdoc' to build the API reference (the latter needs python).

make: *** No rule to make target `gcc'.  Stop.
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -o objs/ftsystem.o src/base
/ftsystem.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -o objs/ftdebug.o src/base/
ftdebug.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -o objs/ftinit.o src/base/f
tinit.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftbase
.o ./src/base/ftbase.c
In file included from ./src/base/ftbase.c:35:0:
./src/base/ftobjs.c: In function 'FT_CMap_Done':
./src/base/ftutil.c:103:17: warning: assuming signed overflow does not occur whe
n assuming that (X - c) > X is always false [-Wstrict-overflow]
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftbbox
.o src/base/ftbbox.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftbdf.
o src/base/ftbdf.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftbitm
ap.o src/base/ftbitmap.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftcid.
o src/base/ftcid.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftfsty
pe.o src/base/ftfstype.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftgasp
.o src/base/ftgasp.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftglyp
h.o src/base/ftglyph.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftgxva
l.o src/base/ftgxval.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftlcdf
il.o src/base/ftlcdfil.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftmm.o
 src/base/ftmm.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftotva
l.o src/base/ftotval.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftpate
nt.o src/base/ftpatent.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftpfr.
o src/base/ftpfr.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftstro
ke.o src/base/ftstroke.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftsynt
h.o src/base/ftsynth.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/fttype
1.o src/base/fttype1.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftwinf
nt.o src/base/ftwinfnt.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/base -o objs/ftxf86
.o src/base/ftxf86.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/truetype -o objs/tr
uetype.o ./src/truetype/truetype.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/type1 -o objs/type1
.o ./src/type1/type1.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/cff -o objs/cff.o .
/src/cff/cff.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/cid -o objs/type1ci
d.o ./src/cid/type1cid.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/pfr -o objs/pfr.o .
/src/pfr/pfr.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/type42 -o objs/type
42.o ./src/type42/type42.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/winfonts -o objs/wi
nfnt.o ./src/winfonts/winfnt.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/pcf -o objs/pcf.o .
/src/pcf/pcf.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/bdf -o objs/bdf.o .
/src/bdf/bdf.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/sfnt -o objs/sfnt.o
 ./src/sfnt/sfnt.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/autofit -o objs/aut
ofit.o ./src/autofit/autofit.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/pshinter -o objs/ps
hinter.o ./src/pshinter/pshinter.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/raster -o objs/rast
er.o ./src/raster/raster.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/smooth -o objs/smoo
th.o ./src/smooth/smooth.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/cache -o objs/ftcac
he.o ./src/cache/ftcache.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/gzip -o objs/ftgzip
.o ./src/gzip/ftgzip.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/lzw -o objs/ftlzw.o
 ./src/lzw/ftlzw.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -o objs/ftbzip2.o ./src/bzi
p2/ftbzip2.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/psaux -o objs/psaux
.o ./src/psaux/psaux.c
gcc -ansi -pedantic  -I./objs -I./builds/win32 -I./include -c -g -O3 -Wall -DFT2
_BUILD_LIBRARY -DFT_CONFIG_MODULES_H="<ftmodule.h>"  -I./src/psnames -o objs/psn
ames.o ./src/psnames/psmodule.c
gcc -o .\objs\apinames.exe .\src\tools\apinames.c
.\objs\apinames.exe -oobjs/freetype.def -dfreetype.dll -w ./include/freetype/ttn
ameid.h ./include/freetype/ftimage.h ./include/freetype/fttrigon.h ./include/fre
etype/fterrdef.h ./include/freetype/ttunpat.h ./include/freetype/tttags.h ./incl
ude/freetype/ftsnames.h ./include/freetype/ftgasp.h ./include/freetype/ftmoderr.
h ./include/freetype/ftxf86.h ./include/freetype/ftadvanc.h ./include/freetype/f
tmm.h ./include/freetype/ftbbox.h ./include/freetype/ftotval.h ./include/freetyp
e/fttypes.h ./include/freetype/freetype.h ./include/freetype/ftmac.h ./include/f
reetype/ftwinfnt.h ./include/freetype/ftgzip.h ./include/freetype/ftgxval.h ./in
clude/freetype/ftcache.h ./include/freetype/ftbdf.h ./include/freetype/ftchapter
s.h ./include/freetype/ftincrem.h ./include/freetype/ftlist.h ./include/freetype
/ftbzip2.h ./include/freetype/ftlzw.h ./include/freetype/ftrender.h ./include/fr
eetype/ftsizes.h ./include/freetype/ftpfr.h ./include/freetype/ftlcdfil.h ./incl
ude/freetype/ftsynth.h ./include/freetype/ftoutln.h ./include/freetype/ftsystem.
h ./include/freetype/ftmodapi.h ./include/freetype/ftbitmap.h ./include/freetype
/ftglyph.h ./include/freetype/fterrors.h ./include/freetype/t1tables.h ./include
/freetype/ftstroke.h ./include/freetype/ftcid.h ./include/freetype/tttables.h
del .\objs\freetype.a 2> nul
ar -r objs/freetype.a  ./objs/ftsystem.o ./objs/ftdebug.o ./objs/ftinit.o ./objs
/ftbase.o ./objs/ftbbox.o ./objs/ftbdf.o ./objs/ftbitmap.o ./objs/ftcid.o ./objs
/ftfstype.o ./objs/ftgasp.o ./objs/ftglyph.o ./objs/ftgxval.o ./objs/ftlcdfil.o
./objs/ftmm.o ./objs/ftotval.o ./objs/ftpatent.o ./objs/ftpfr.o ./objs/ftstroke.
o ./objs/ftsynth.o ./objs/fttype1.o ./objs/ftwinfnt.o ./objs/ftxf86.o ./objs/tru
etype.o ./objs/type1.o ./objs/cff.o ./objs/type1cid.o ./objs/pfr.o ./objs/type42
.o ./objs/winfnt.o ./objs/pcf.o ./objs/bdf.o ./objs/sfnt.o ./objs/autofit.o ./ob
js/pshinter.o ./objs/raster.o ./objs/smooth.o ./objs/ftcache.o ./objs/ftgzip.o .
/objs/ftlzw.o ./objs/ftbzip2.o ./objs/psaux.o ./objs/psnames.o
ar: creating objs/freetype.a



回答2:


Freetype is fairly easy to cross-compile. For 64-bit MinGW, do the following:

  1. Install the mingw64-x86_64-gcc-core, mingw64-x86_64-headers and mingw64-x86_64-runtime packages with setup.exe, plus all indicated dependencies.
  2. Run ./configure --host=x86_64-w64-mingw32 followed by other configure options.
  3. Run make to compile.


来源:https://stackoverflow.com/questions/9928356/compile-freetype-2-4-9-with-mingw-w64-cygwin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!