Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile libmodbus-3.0.8 on haiku64bit (r1b2) #563

Closed
mazbrili opened this issue Oct 22, 2020 · 6 comments
Closed

Cannot compile libmodbus-3.0.8 on haiku64bit (r1b2) #563

mazbrili opened this issue Oct 22, 2020 · 6 comments

Comments

@mazbrili
Copy link

mazbrili commented Oct 22, 2020

libmodbus version

libmodbus 3.0.8

OS and/or distribution

Haiku 64bit ( hrev54154+119)

Environment

X86_64

Description

-Problem cannot build libmodbus 3.0.8 on haiku64bit (r1b2)

Steps to reproduce the behavior (commands or source code)

*to reproduce.
*get the source version 3.0.8
*run autogen.sh
*run ./configure
*run make

Expected behaviour

compile successfully

Actual behaviour

error make

libmodbus make output

make[3]: Entering directory '/HPKG/haikuports/net-libs/libmodbus/work-3.0.8/sources/libmodbus-3.0.8/tests'
CC bandwidth-server-one.o
CCLD bandwidth-server-one
CC bandwidth-server-many-up.o
CCLD bandwidth-server-many-up
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: bandwidth-server-many-up.o: in function main': /HPKG/haikuports/net-libs/libmodbus/work-3.0.8/sources/libmodbus-3.0.8/tests/bandwidth-server-many-up.c:104: undefined reference to accept'
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: /HPKG/haikuports/net-libs/libmodbus/work-3.0.8/sources/libmodbus-3.0.8/tests/bandwidth-server-many-up.c:114: undefined reference to `inet_ntoa'
collect2: error: ld returned 1 exit status
Makefile:429: recipe for target 'bandwidth-server-many-up' failed
make[3]: *** [bandwidth-server-many-up] Error 1
make[3]: Leaving directory '/HPKG/haikuports/net-libs/libmodbus/work-3.0.8/sources/libmodbus-3.0.8/tests'
Makefile:370: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/HPKG/haikuports/net-libs/libmodbus/work-3.0.8/sources/libmodbus-3.0.8/tests'
Makefile:466: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/HPKG/haikuports/net-libs/libmodbus/work-3.0.8/sources/libmodbus-3.0.8'
Makefile:373: recipe for target 'all' failed
make: *** [all] Error 2

@mazbrili
Copy link
Author

we can build successfully with add LIBS=-lnetwork before configure.
we pass tcp test on haiku64

@Begasus
Copy link
Contributor

Begasus commented Oct 31, 2020

Builds fine with the current PR at haikuports for 32 bit Haiku (with gcc2 and gcc8) too

@Begasus
Copy link
Contributor

Begasus commented Nov 4, 2020

Adding next line to configure.ac solves the issue on using LIBS=-lnetwork

# Checks for library functions.
-AC_CHECK_FUNCS([accept4 getaddrinfo gettimeofday inet_ntoa select socket strerror strlcpy])
+AC_SEARCH_LIBS(inet_ntoa, network socket)
+AC_CHECK_FUNCS([accept4 getaddrinfo gettimeofday inet_ntoa select socket strerror strlcpy])

Checked with latest release and seems to be working fine

@stephane
Copy link
Owner

stephane commented Jan 8, 2022

Could we merge this change w/o issue for other platforms?

@Begasus
Copy link
Contributor

Begasus commented Jan 9, 2022

Changed the check a bit for Haiku like (for latest release: 3.1.7):

+# Check for Haiku's libnetwork library
+AC_SEARCH_LIBS(accept, network socket)

Checked a build on 32bit with both our compilers, also checked a build on Ubuntu, works fine.

With gcc2 we get an error on build time (but I guess we can strike that as broken as there is nothing using the gcc2 version).

/sources/libmodbus-3.1.7/tests/unit-test-client.c:32: badly punctuated parameter list in `#define'

For the checks I had to replace killall with kill (we don't have killall in Haiku) in:

killall unit-test-server

On both Haiku and Ubuntu it produces the same output:

make  check-TESTS
PASS: unit-tests.sh
============================================================================
Testsuite summary for libmodbus 3.1.7
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

@Begasus
Copy link
Contributor

Begasus commented Jan 9, 2022

Hold this thought for a while, will get back on this later :)

EDIT seems to be doing OK here, just needed to run a few testruns (after dogschool) before I wanted any change here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants