Menu

Compiling xlsLib on FreeBSD

2014-12-29
2014-12-29
  • Waitman Gobble

    Waitman Gobble - 2014-12-29

    A few caveats compiling on FreeBSD-11.0-Current

    1) need to run 'sh ./bootstrap', otherwise 'make' fails b/c automake-1.3 is
    specified in Makefile. rebuilding Makefile updates to automake-1.4

    2) looks like need to add 'const' to iconv calls in globalrec.cpp
    ln 771: resultSize = iconv(cd, (const char )&inbuf, &inbytesleft, (char
    )&outbuf, &outbytesleft);
    ln 842: resultSize = iconv(cd, (const char )&inbuf, &inbytesleft, (char
    )&outbuf, &outbytesleft);

    (or configure --without-iconv)

    Seems to be working great, thanks.

    --
    Waitman Gobble
    Los Altos California USA
    510-830-7975

     
    • David Hoerl

      David Hoerl - 2014-12-29

      Surely you mean '(const char **)'? ["And please stop calling me Shirley" - hopefully you will get the reference :-) ]

      Do you have the C++ prototype for 'iconv'? It might actually be something more weird like '(const char const * const * const)'.

      Let me know and I'll update the source. I'm loath to touch bootstrap et al as it was heavily modified by someone no long active on the project, and I don't want to break anything...

      EDIT: looks like multiple 'const's is a C99 feature, and not valid in C++. So it must be (const char **) that you meant.

      HAH - so I tried that in the latest Xcode, and it won't compile! On the Mac iconv is defined with restricted on that argument, not const. So now not sure what to do...

      EDIT2: Sigh. So linux went and re-defined iconv - its what FreeBSD is using too:

      http://www.freebsd.org/cgi/man.cgi?query=iconv&sektion=3&apropos=0&manpath=FreeBSD+9.0-RELEASE+and+Ports

       

      Last edit: David Hoerl 2014-12-29
      • Waitman Gobble

        Waitman Gobble - 2014-12-29

        On Mon, Dec 29, 2014 at 7:07 AM, David Hoerl dhoerl@users.sf.net wrote:

        Surely you mean '(const char **)'? ["And please stop calling me surely" -
        hopefully you will get the reference :-) ]

        Do you have the C++ prototype for 'iconv'? It might actually be something
        more weird like '(const char const * const * const)'.

        Let me know and I'll update the source. I'm loath to touch bootstrap et al
        as it was heavily modified by someone no long active on the project, and I
        don't want to break anything...

        Sorry - It appears that the email software mangled my post, simply adding
        'const' to those those lines should solve the problem in this case.

        On August 13, 2013 iconv was moved into FreeBSD 'base', before that it had
        to be installed through ports. It's a BSD version of iconv and not GNU
        iconv. I don't remember what was in ports before, it may have been pulling
        GNU iconv.

        ref:

        https://github.com/freebsd/freebsd/blob/master/include/iconv.h

        https://github.com/freebsd/freebsd/blob/master/lib/libc/iconv/iconv.c

        I could submit a FreeBSD port for xlsLib. I'm surprised it hasn't already
        been submitted. (unless it has and I'm just missing it).

        Thank you,

        --
        Waitman Gobble
        Los Altos California USA
        510-830-7975

         
  • David Hoerl

    David Hoerl - 2014-12-29

    I updated my original answer but you probably didn't see it. There is no 'const' in the Mac version, or most other iconv versions - this appears to be an unusual adaption of the command (although a more proper one for sure).

    Thus, I can't really update the source as it will break lots of other systems.

     
    • Waitman Gobble

      Waitman Gobble - 2014-12-29

      On Mon, Dec 29, 2014 at 10:48 AM, David Hoerl dhoerl@users.sf.net wrote:

      I updated my original answer but you probably didn't see it. There is no
      'const' in the Mac version, or most other iconv versions - this appears to
      be an unusual adaption of the command (although a more proper one for sure).

      Thus, I can't really update the source as it will break lots of other
      systems.

      OK no worry. The note is there for others using FreeBSD. If I get a chance
      I'll submit a FreeBSD port for xlsLib.

      Waitman

      --
      Waitman Gobble
      Los Altos California USA
      510-830-7975

       

Log in to post a comment.