0

I'm trying to port libisofs to Windows. My environment is MSYS2 with mingw-w64-i686 toolchain installed.

I've used gnulib for missing headers with gnulib-tool --import command:

$ ../gnulib/gnulib-tool --import fnmatch

I've done all steps in instruction:

Don't forget to
  - add "lib/Makefile" to AC_CONFIG_FILES in ./configure.ac,
  - mention "lib" in SUBDIRS in Makefile.am,
  - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am,
  - mention "m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am,
  - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
  - invoke gl_INIT in ./configure.ac.

Altough, there was no AC_PROG_CC in configure.ac, so I've added gl_EARLY after AM_PROG_CC_C_O And there was no SUBDIRS variable in Makefile.am so I've added it manually at the bottom, as so:

SUBDIRS = lib

All configurations I've made as so:

autoreconf -i
automake --add-missing
autoconf
./configure

After running make I recieve error:

hard-locale.c:19:10: fatal error: config.h: No such file or directory
 #include <config.h>

As I understand that file must be created by ./configure, but I don't understand why compiler doesn't find it.

configure.ac: https://pastebin.com/JbWRqjEv
Makefile.am: https://pastebin.com/V6ZBq8Vd
All outputs: https://pastebin.com/WFu5aJU7

PASAf
  • 115
  • 1
  • 7
  • Please provide a [mcve] *in the question itself*. Links to external documents do not suffice. I suspect that a minimal top-level `configure.ac` will be sufficient, actually, but it's not really complete without a corresponding minimal top-level `Makefile.am`. – John Bollinger Jan 22 '18 at 15:51

1 Answers1

0

Gnulib assumes that your configure.ac file contains

AC_CONFIG_HEADERS([config.h])

Without it, every compiler command invocation is more than 1000 characters long, due to the many -D options; this is not practical for development.

Bruno Haible
  • 1,203
  • 8
  • 8
  • After this string added I get errors in `autoreconf`: `autoheader: warning: missing template: ICONV_CONST` `autoheader: Use AC_DEFINE([ICONV_CONST], [], [Description])` `autoheader: warning: missing template: LIBISOFS_VERBOSE_DEBUG` `autoheader: warning: missing template: _GNU_SOURCE` `autoreconf: /usr/bin/autoheader failed with exit status: 1` – PASAf Jan 23 '18 at 15:27
  • Yes, `AC_DEFINE` wants a third argument nowadays. Fix the AC_DEFINE invocations in your code. – Bruno Haible Jan 23 '18 at 22:16
  • You don't need to define `_GNU_SOURCE` yourself when you use gnulib. The gnulib module `extensions` does it (and it does the equivalent thing for the other platforms as well). – Bruno Haible Jan 23 '18 at 22:17