Fontconfig 2.12.91 compilation error on MingW

Reino Wijnsma <[email protected]>
Newsgroups gmane.comp.fonts.fontconfig
Message-ID <[email protected]>
Hello,

I've read https://lists.freedesktop.org/archives/fontconfig/2017-December/006107.html, but my issue is different.

I'm compiling Fontconfig with the help of forked script of https://github.com/rdp/ffmpeg-windows-build-helpers (which uses Cygwin, MingW, GCC) to build FFmpeg in the end.
I've just released another FFmpeg build, but still with Fontconfig 2.12.6, because I got a compilation error with v2.12.91.

Let me first say that I only compile what's really necessary:

build_fontconfig() {
  download_and_unpack_file https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.91.tar.bz2
  cd fontconfig-2.12.91
    if [[ ! -f Makefile.in.bak ]]; then # Library only.
      sed -i.bak "/^SUBDIRS/s/fc.*/src/;464,465d;/^install-data-am/s/:.*/: install-pkgconfigDATA/;/\tinstall-xmlDATA$/d" Makefile.in
    fi
    export UUID_CFLAGS="-I/usr/include"
    export UUID_LIBS="-luuid" # 'configure' somehow only looks at '$PKG_CONFIG --exists --print-errors "uuid"'.
    generic_configure "--enable-iconv --enable-libxml2 --disable-docs --with-libiconv" # Use Libxml2 instead of Expat.
    do_make_and_make_install
    unset UUID_CFLAGS
    unset UUID_LIBS
  cd ..
} # freetype, libxml >= 2.6, itstool (cygwin), [iconv, dlfcn]

- I'm leaving out all the '/fc-*/'-dirs and I'm only compiling SUBDIRS = fontconfig src. This way I'm not even getting the '/fc-cache.exe/'-error, but I might if I would build normally, I don't know.
- I had to install Cygwin's "itstool". Apparently that has become a prerequisite with this latest version.
- Another prerequisite seems to be libuuid. Cygwin already installed it for me, but Fontconfig's '/configure/' doesn't search for it.

Then the compilation error, beginning at '/src/fcatomic.c/':

[...]
  CC       fcatomic.lo
In file included from /usr/include/errno.h:9:0,
                 from fcint.h:39,
                 from fcatomic.c:50:
/usr/include/sys/errno.h:14:0: warning: "errno" redefined
 #define errno (*__errno())

In file included from /cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/lib/gcc/i686-w64-mingw32/7.2.0/include/stddef.h:1:0,
                 from /usr/include/stdlib.h:16,
                 from fcint.h:34,
                 from fcatomic.c:50:
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/stddef.h:19:0: note: this is the location of the previous definition
 #define errno (*_errno())

In file included from fcint.h:37:0,
                 from fcatomic.c:50:
/usr/include/ctype.h:40:12: error: expected ';', ',' or ')' before numeric constant
 #define _X 0100
            ^
In file included from fcatomic.c:58:0:
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/direct.h:57:17: error: conflicting types for 'getcwd'
   char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
                 ^~~~~~
In file included from /usr/include/stdlib.h:11:0,
                 from fcint.h:34,
                 from fcatomic.c:50:
/usr/include/sys/unistd.h:96:16: note: previous declaration of 'getcwd' was here
 char *  _EXFUN(getcwd, (char *__buf, size_t __size ));
                ^
/usr/include/_ansi.h:65:30: note: in definition of macro '_EXFUN'
 #define _EXFUN(name, proto)  name proto
                              ^~~~
In file included from fcatomic.c:58:0:
/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include/direct.h:59:15: error: conflicting types for 'mkdir'
   int __cdecl mkdir(const char *_Path) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
               ^~~~~
In file included from /usr/include/stdlib.h:11:0,
                 from fcint.h:34,
                 from fcatomic.c:50:
/usr/include/sys/stat.h:150:12: note: previous declaration of 'mkdir' was here
 int _EXFUN(mkdir,( const char *_path, mode_t __mode ));
            ^
/usr/include/_ansi.h:65:30: note: in definition of macro '_EXFUN'
 #define _EXFUN(name, proto)  name proto
                              ^~~~
make[3]: *** [Makefile:667: fcatomic.lo] Error 1
make[3]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/fontconfig-2.12.91/src'
make[2]: *** [Makefile:531: all] Error 2
make[2]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/fontconfig-2.12.91/src'
make[1]: *** [Makefile:605: all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/m/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/fontconfig-2.12.91'
make: *** [Makefile:489: all] Error 2

And that's the reason why I stick to v2.12.6 for the moment. I hope this helps.

-- Reino

_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.