Compile on NetBSD -- Help!

Comments, questions, bug reports, etc.
Post Reply
WhatAmIDoing
Posts: 4
Joined: Wed Jul 18, 2018 1:59 am

Compile on NetBSD -- Help!

Post 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
synchronicity
Site Admin
Posts: 473
Joined: Sun Aug 02, 2015 10:31 pm

Re: Compile on NetBSD -- Help!

Post by synchronicity »

Can you post the actual error messages? Also what is your compiler version?
WhatAmIDoing
Posts: 4
Joined: Wed Jul 18, 2018 1:59 am

Re: Compile on NetBSD -- Help!

Post 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.
synchronicity
Site Admin
Posts: 473
Joined: Sun Aug 02, 2015 10:31 pm

Re: Compile on NetBSD -- Help!

Post 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
WhatAmIDoing
Posts: 4
Joined: Wed Jul 18, 2018 1:59 am

Re: Compile on NetBSD -- Help!

Post 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!
synchronicity
Site Admin
Posts: 473
Joined: Sun Aug 02, 2015 10:31 pm

Re: Compile on NetBSD -- Help!

Post 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).
WhatAmIDoing
Posts: 4
Joined: Wed Jul 18, 2018 1:59 am

Re: Compile on NetBSD -- Help!

Post 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.
Guerrant
Posts: 1
Joined: Sat Jul 14, 2018 8:59 am

Re: Compile on NetBSD -- Help!

Post 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?
Last edited by Guerrant on Fri Oct 21, 2022 4:07 pm, edited 2 times in total.
synchronicity
Site Admin
Posts: 473
Joined: Sun Aug 02, 2015 10:31 pm

Re: Compile on NetBSD -- Help!

Post 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.
synchronicity
Site Admin
Posts: 473
Joined: Sun Aug 02, 2015 10:31 pm

Re: Compile on NetBSD -- Help!

Post 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.
Post Reply