Build error on mingw/msys

140 views
Skip to first unread message

Max Erickson

unread,
Mar 21, 2012, 10:42:12 AM3/21/12
to Ledger
Hello-

I made enough changes to acprep to get configure to complete in a msys
shell and then things bomb out during make.

The changes are shown in the pastebin, but summarizing, they are
'use / as path seperator', 'don't look for python-config' and some
monkeying around to run aclocal with a python subprocess that doesn't
understand shell scripts.

The console output from an attempted build is here:

http://paste.pocoo.org/show/569048/

I guess something with mingw is missing or set wrong, but I have no
idea what to look for (and zero experience with C++ and minimal
experience with mingw and msys...).

Any suggestions?


Max

Max Erickson

unread,
Mar 22, 2012, 9:30:54 AM3/22/12
to Ledger

On Mar 21, 10:42 am, Max Erickson <maxerick...@gmail.com> wrote:
>
> http://paste.pocoo.org/show/569048/
>
> I guess something with mingw is missing or set wrong, but I have no
> idea what to look for (and zero experience with C++ and minimal
> experience with mingw and msys...).
>
> Any suggestions?
>
> Max

Apparently attempting to send something coherent helped me gain a
little clarity; the problem shown in my paste is probably because one
of the mingw system headers contains

#define VOID void

Would it be a problem to use a different name in the enum?


Max

John Wiegley

unread,
Mar 22, 2012, 4:21:00 PM3/22/12
to ledge...@googlegroups.com
>>>>> Max Erickson <maxerickson-Re5JQ...@public.gmane.org> writes:

> Apparently attempting to send something coherent helped me gain a little
> clarity; the problem shown in my paste is probably because one of the mingw
> system headers contains

> #define VOID void

> Would it be a problem to use a different name in the enum?

How about at the top of value.h you just add this:

#if defined(VOID)
#undef VOID
#endif

Does that work? If so, I can check that in.

John

Max Erickson

unread,
Mar 22, 2012, 9:49:07 PM3/22/12
to Ledger


On Mar 22, 4:21 pm, John Wiegley <jwieg...@gmail.com> wrote:
>
> How about at the top of value.h you just add this:
>
> #if defined(VOID)
> #undef VOID
> #endif
>
> Does that work?  If so, I can check that in.
>
> John

Yeah, that does work. Then mingw doesn't have setenv:

make[2]: Entering directory `/c/qprojects/compile-ledger/ledger'
CXX libledger_report_la-stats.lo
In file included from src/stats.cc:38:0:
src/report.h: In constructor
'ledger::report_t::pager_option_t::pager_option_t()
':
src/report.h:788:3: error: 'setenv' was not declared in this scope
make[2]: *** [libledger_report_la-stats.lo] Error 1

If I patch that to use putenv, things go on until libtool fails to
link libledger_report.la:

CXXLD libledger_report.la
libtool: link: warning: undefined symbols not allowed in i686-pc-
mingw32 shared
libraries
./libtool: line 1111: lib: command not found
make[2]: *** [libledger_report.la] Error 127

I think libtool is emitting MSVC commands there, but that's as far as
I have gotten with it.

More broadly, I wonder if this 'should' work? I guess in the sense, do
you expect that minimal changes should be enough to successfully
compile with mingw32?


Max

John Wiegley

unread,
Mar 22, 2012, 11:38:42 PM3/22/12
to ledge...@googlegroups.com
>>>>> Max Erickson <maxerickson-Re5JQ...@public.gmane.org> writes:

> More broadly, I wonder if this 'should' work? I guess in the sense, do you
> expect that minimal changes should be enough to successfully compile with
> mingw32?

I have no reason off-hand to believe that it shouldn't work.

John

Max Erickson

unread,
Mar 24, 2012, 9:55:27 AM3/24/12
to Ledger
So my attempt to get acprep to run aclocal doesn't work. That explains
libtool emitting the wrong commands. A little fiddling with the
autoconf stuff got it working (I haven't minimized and verified the
commands, but I think just aclocal -I m4 and ./config.status libtool
are enough.).

The last thing missing from mingw is an implementation of strptime. I
looked at a few and the one here is relatively self contained:

http://googlesitemapgenerator.googlecode.com/svn/trunk/src/common/timesupport.cc

I inserted it into the project using sha1.cpp/sha1.h as a model and
the build completes successfully (to be clear, my primary goal is a
working windows build and some documentation about doing that, any
changes to the official sources that simplify those goals are a
bonus).

Next step is to try to get the tests working (the simple commands I
have tried do work and at a glance do output correct values).


Max

Max Erickson

unread,
Apr 7, 2012, 10:52:59 AM4/7/12
to Ledger

>
> Next step is to try to get the tests working (the simple commands I
> have tried do work and at a glance do output correct values).
>

A few changes to RegressTests.py to account for different path
seperators, shell quoting and shell escapes and most of the baseline
and regress tests pass (instead of special casing python's os and
os.path all over the place, I am using a sitecustomize.py to patch
them at runtime). The path/shell fixes aren't complete , so there are
still some failures there, but I guess they aren't very intereseting.
Most of the remaining failing tests have unicode characters.

The output is here, along with the changes to RegressTests.py:

http://paste.pocoo.org/show/577470/

I guess the problem is with file input in the mingw libraries, but I
haven't figured out where to look yet. Any tips there?


Max

Max Erickson

unread,
Apr 15, 2012, 9:56:28 PM4/15/12
to Ledger
On Apr 7, 10:52 am, Max Erickson <maxerick...@gmail.com> wrote:
> Most of the remaining failing tests have unicode characters.
>
> I guess the problem is with file input in the mingw libraries, but I
> haven't figured out where to look yet. Any tips there?
>

The root of the issue is that std::isspace (in read_line in
textual.cc) is eating the last byte of the Utf-8 Euro symbol. I think
the function is implemented in terms of 0 to 255 and is then
interpreting the byte as -84. Locale stuff on mingw seems to have
pretty thin support. An appropriate fix certainly isn't obvious to me.


Max
Reply all
Reply to author
Forward
0 new messages