Skip to content

Build and run on Haiku - #60

Closed
duncanmcqueen wants to merge 3 commits into
ingelabs:masterfrom
duncanmcqueen:haiku-host
Closed

duncanmcqueen wants to merge 3 commits into
ingelabs:masterfrom
duncanmcqueen:haiku-host

Conversation

@duncanmcqueen

Copy link
Copy Markdown
Contributor

Summary

This pull request lets GNU Classpath build and run on Haiku (x86_64). It has three small changes:

  • configure.ac: Haiku has the socket functions and h_errno in libnetwork. Now AC_SEARCH_LIBS for inet_pton also looks in network.
  • VMNetworkInterface: Haiku does not define IFF_RUNNING. The file now defines it if necessary.
  • cpnet: On Haiku, gethostbyname_r() is in libnetwork, but no header declares it. Configure finds the function but not the number of arguments, and cpnet.c stops with #error. Now cpnet.c uses gethostbyname() in this case.

With the config.guess and config.sub from current automake, configure runs on Haiku as x86_64-unknown-haiku.

Tests

On Haiku R1/beta6 x86_64: autoreconf -fi, configure with --enable-jni --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-gjdoc --disable-examples --enable-default-preferences-peer=file --disable-tools, make and make install complete. I used the result with Kaffe 1.1.10. A command line test (including network and processes) passes.

AI assistance

An AI model (Claude Code, by Anthropic) wrote these changes and this text. The repository owner directed the work. Please review the changes as you review other contributions.

The commits do not have a Signed-off-by line. If you need one, the owner will add it.

🤖 Generated with Claude Code

duncanmcqueen and others added 3 commits October 14, 2026 08:46
Haiku has inet_pton(), the other socket functions and h_errno in
libnetwork. Without it, the JNI libraries fail to load (undefined
__h_errno) and configure does not find the socket functions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
Haiku does not define IFF_RUNNING.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
On Haiku, gethostbyname_r() is in libnetwork but no header declares
it, so configure finds the function but not the number of arguments,
and cpnet.c stops with #error. Use gethostbyname() in that case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
@guillerodriguez

Copy link
Copy Markdown
Contributor

Hi @duncanmcqueen, thanks for these too!

As with #59, could you split this into separate PRs, one per fix? Steps to reproduce or a small test case for each would be very helpful as well.

One general note: we’re a bit cautious with platform-specific changes, and prefer fixes that improve portability in general rather than ones that target a single OS. So when you open the new PRs, it would help if each one mentioned whether the issue is specific to Haiku or could possibly impact other systems.

Thanks!

@duncanmcqueen

Copy link
Copy Markdown
Contributor Author

Thank you for the review. I split this pull request into one pull request for each fix:

Each pull request tells if the problem is specific to Haiku:

I reproduced each problem on Haiku with the master branch, and each pull request has the results before and after the change. The three changes depend on each other on Haiku: master does not build there without #75, and #73 shows the cpnet.c error that #74 fixes. Thus #74 must be merged before #73 or together with it.

While I wrote the test for #75, I found an error in this pull request: it defined IFF_RUNNING as 0x40, which is IFF_NOARP on Haiku. #75 uses Haiku's IFF_LINK instead.

I close this pull request, because the three new pull requests replace it.

🤖 Generated with Claude Code

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

Successfully merging this pull request may close these issues.

2 participants