Page 1 of 1

Compile on NetBSD -- Help!

Posted: Wed Jul 18, 2018 2:25 am
by WhatAmIDoing
I'm trying to compile wimlib on NetBSD. I've installed all of the dependencies and have no trouble running ./configure. However, when I run make it eventually chokes on the syntax of a declaration in endianness.h, lines 77-79. It doesn't like the "?" OR statement. I have changed these lines to either of the options and try to compile I still get errors till make finally just exits.

Has anyone successfully built wimlib on NetBSD? I'm running NetBSD 7.1.2 but I've also tried it on 8RC1. What are the tricks?

Thanks.
Rob

Re: Compile on NetBSD -- Help!

Posted: Wed Jul 18, 2018 3:12 am
by synchronicity
Can you post the actual error messages? Also what is your compiler version?

Re: Compile on NetBSD -- Help!

Posted: Wed Jul 18, 2018 5:15 pm
by WhatAmIDoing
The default installed version of gcc is 4.8.5. I've also tried using 5.5.0 and 7.3.0.

Here is the error from running make after ./configure:

Code: Select all

In file included from src/integrity.c:31:0:
./include/wimlib/endianness.h:77:45: error: expected ')' before '?' token
 #define bswap16(n) (__builtin_constant_p(n) ? bswap16_const(n) : do_bswap16(n))
                                             ^
./include/wimlib/endianness.h:78:45: error: expected ')' before '?' token
 #define bswap32(n) (__builtin_constant_p(n) ? bswap32_const(n) : do_bswap32(n))
                                             ^
./include/wimlib/endianness.h:79:45: error: expected ')' before '?' token
 #define bswap64(n) (__builtin_constant_p(n) ? bswap64_const(n) : do_bswap64(n))
                                             ^
*** Error code 1
Thanks.

Re: Compile on NetBSD -- Help!

Posted: Fri Jul 20, 2018 7:52 am
by synchronicity
Okay, there were a few problems: two colliding system definitions, and a missing function. I pushed out a fix [1] to the git repository (master branch); can you try building from there and see if it works for you now?

[1] https://wimlib.net/git/?p=wimlib;a=comm ... 52a8e5ed02

Re: Compile on NetBSD -- Help!

Posted: Fri Jul 20, 2018 4:47 pm
by WhatAmIDoing
I downloaded wimlib-b6223f9.tar. There were several missing files that caused configure to not run or to exit with errors.

Missing files:
[*] configure
[*] Makefile.in
[*] config.h.in
[*] build-aux/ltmain.sh
[*] build-aux/ar-lib
[*] build-aux/compile
[*] build-aux/missing
[*] build-aux/depcomp
[*] build-aux/test-driver

Once I copied these from wimlib-1.13.0-BETA2 ./configure worked. However, make didn't. It exited with the following error:

Code: Select all

ave-test$ make
make  all-am
  CC       src/libwim_la-add_image.lo
libtool: Version mismatch error.  This is libtool 2.4.6.40-6ca5-dirty, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6.40-6ca5-dirty
libtool: and run autoconf again.
*** Error code 63

Stop.
make[1]: stopped in /home/ave/wimlib-b6223f9
*** Error code 1

Stop.
make: stopped in /home/ave/wimlib-b6223f9
When I run Libtool --version this is what I get:

Code: Select all

ave-test$ libtool --version
libtool (GNU libtool) 2.4.6
Written by Gordon Matzigkeit, 1996

Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I removed the libtool in the root directory and ran the configure script again. Then removed the generated libtool and copied my installed libtool to replace it. Then make worked!

Thanks!

Re: Compile on NetBSD -- Help!

Posted: Sat Jul 21, 2018 2:10 am
by synchronicity
I downloaded wimlib-b6223f9.tar. There were several missing files that caused configure to not run or to exit with errors.

Missing files:
[*] configure
[*] Makefile.in
[*] config.h.in
[*] build-aux/ltmain.sh
[*] build-aux/ar-lib
[*] build-aux/compile
[*] build-aux/missing
[*] build-aux/depcomp
[*] build-aux/test-driver
Those are generated files; when building from the git repository you need to run './bootstrap' to generate them (requires that the 'autoconf', 'automake', and 'libtool' packages have been installed).

Re: Compile on NetBSD -- Help!

Posted: Sat Jul 21, 2018 2:20 am
by WhatAmIDoing
I did not know that I needed to run ./bootstrap. I ran ./bootstrap, ./configure, and make after extracting the tar file again. It worked flawlessly as I'm sure you know.

Thank you for teaching me this and your quick response to getting this to build on NetBSD.

Re: Compile on NetBSD -- Help!

Posted: Sat Jul 21, 2018 2:43 pm
by Guerrant
WhatAmIDoing wrote: Sat Jul 21, 2018 2:20 am I want to know more about these sarms and did not know that I needed to run ./bootstrap. I ran ./bootstrap, ./configure, and make after extracting the tar file again. It worked flawlessly as I'm sure you know.

Thank you for teaching me this and your quick response to getting this to build on NetBSD.
Hi Synchronicity, when I perform './bootstrap' nothing seems to happen. Is there some kind of a known issue or something that's causing this?

Re: Compile on NetBSD -- Help!

Posted: Sat Jul 21, 2018 4:12 pm
by synchronicity
Hi Synchronicity, when I perform './bootstrap' nothing seems to happen. Is there some kind of a known issue or something that's causing this?
It's silent unless it had to install auxiliary files from autoconf or libtool, or an error occurred. (It's just running 'autoreconf -i'.) So if you already ran it, or if you're starting from a distribution tarball that already has all the files, then it's expected for it to be silent, though it still may have updated 'configure' etc.

Re: Compile on NetBSD -- Help!

Posted: Sat Jul 21, 2018 5:36 pm
by synchronicity
I also just uploaded a new distribution tarball (wimlib-1.13.0-BETA3.tar.gz), so you can use that if you want.