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

FreeBSD support for hxcpp #277

Closed
rudrabhoj opened this issue Sep 4, 2015 · 13 comments
Closed

FreeBSD support for hxcpp #277

rudrabhoj opened this issue Sep 4, 2015 · 13 comments

Comments

@rudrabhoj
Copy link

Hello, I am trying to compile hxcpp for FreeBSD, but when I do I get the following error:

[agnis@bhagavati ~/Dev/hxcpp/project]$ neko build.n
Unknown host system: BSD

Neko and Haxe are working fine, I have done many tests with them, all are good. Also using Phaser extern for Haxe, which is working fine too.

@rudrabhoj
Copy link
Author

Where is the source of build.n?

@andyli
Copy link
Member

andyli commented Sep 4, 2015

Let's make good use of the search function in Github ;)
https://github.com/HaxeFoundation/hxcpp/search?utf8=%E2%9C%93&q=%22Unknown+host+system%22&type=Code

@rudrabhoj
Copy link
Author

While I am no regular user of github, that should have been obvious to me. sorry :P :P

@rudrabhoj
Copy link
Author

So now I guess should search 'linux' in the repository and add FreeBSD option where ever necessary...

@rudrabhoj
Copy link
Author

Where HX_WINDOWS, HX_LINUX, etc. are initially defined? I did search this time :P

@rudrabhoj
Copy link
Author

Okay I edited all files wherever I find mention of linux and a need to add freebsd support to. But why do we need hxcpp to build hxcpp?

[agnis@bhagavati ~/Dev/hxcpp/project]$ neko build.n freebsd

Build freebsd, link=lib arch=m64
haxelib run hxcpp Build.xml -Dfreebsd -DHXCPP_M64 -Dstatic_link
Library hxcpp is not installed
#### Error building m64

FreeBSD currently don't have working hxcpp. If I had a working hxcpp then why would I compile from source:

[agnis@bhagavati ~/Dev/hxcpp/project]$ neko build.n freebsd

Build freebsd, link=lib arch=m64
haxelib run hxcpp Build.xml -Dfreebsd -DHXCPP_M64 -Dstatic_link
/usr/local/lib/neko/std.ndll: Undefined symbol "WIFEXITED"
#### Error building m64

This is what happens when I try compiling after install hxcpp through haxelib. How to build hxcpp without having hxcpp installed?

@andyli
Copy link
Member

andyli commented Sep 4, 2015

neko build.n uses haxelib run hxcpp ..., which calls the run.n in hxcpp. That's why it complains if hxcpp is not installed.
To make it works, run haxelib dev hxcpp path/to/hxcpp, which will use the given directory as the hxcpp haxelib, as if it is installed.

@andyli
Copy link
Member

andyli commented Sep 4, 2015

HX_* are defined in the toolchain xml files, e.g. HX_WINDOWS is defined in https://github.com/HaxeFoundation/hxcpp/blob/master/toolchain/msvc-toolchain.xml#L52

@rudrabhoj
Copy link
Author

Hello,
I set the checkout folder as hxcpp.

[agnis@bhagavati ~/Dev/hxcpp/project]$ neko build.n freebsd

Build freebsd, link=lib arch=m64
haxelib run hxcpp Build.xml -Dfreebsd -DHXCPP_M64 -Dstatic_link
This version of hxcpp (/usr/home/agnis/Dev/hxcpp/) appears to be a source/developement version.
Before this can be used, you need to:
 1. Rebuild the main command-line tool, this can be done with:
     cd tools/hxcpp
     haxe compile.hxml
 2. Build the binaries appropriate to your system(s), this can be done with:
     cd project
     neko build.n

I did haxe compile.hxml in tools/hxcpp, it went on smooth.
Then I retired neko build.n and I get this error:

[agnis@bhagavati ~/Dev/hxcpp/project]$ neko build.n freebsd

Build freebsd, link=lib arch=m64
haxelib run hxcpp Build.xml -Dfreebsd -DHXCPP_M64 -Dstatic_link
/usr/local/lib/neko/std.ndll: Undefined symbol "WIFEXITED"
#### Error building m64

"WIFEXITED definitions: POSIX documents this in stdlib.h as optional, and is
defined there on linux, but on FreeBSD it is not, so we need to include
sys/wait.h where POSIX mandates it to be."
-[1]

So given that issue is in std.ndll, I can assume this would be solved adding sys/wait.h in neko compilation?

[1] Source: https://github.com/geaaru/geaaru_overlay/blob/master/net-libs/webkit-gtk/files/webkit-gtk-1.10.2-wifexited.patch

@andyli
Copy link
Member

andyli commented Sep 4, 2015

You may probably want to discuss that in HaxeFoundation/neko#84

@rudrabhoj
Copy link
Author

Yes, that was the case. this wait.h issue as there in hxcpp too at some places, corrected them too. But in project/Build.xml, I am unable to translate this into FreeBSD version

<target id="linuxcompat" output="${LIBPREFIX}linuxcompat${LIBEXTRA}" tool="linker" toolid="${STD_MODULE_LINK}">
  <files id="linuxcompat"/>
  <builddir name="libs/linuxcompat"/>
  <outdir name="${this_dir}/../${DESTDIR}/${BINDIR}"/>
</target>

I just copied it all mindlessly and wrote freebsdcompat, didn't went smooth, here's what i wrote:

<target id="freebsdcompat" output="${LIBPREFIX}freebsdcompat${LIBEXTRA}" tool="linker" toolid="${STD_MODULE_LINK}">
  <files id="freebsdcompat"/>
  <builddir name="libs/freebsdcompat"/>
  <outdir name="${this_dir}/../${DESTDIR}/${BINDIR}"/>
</target>

During compilation it gives following error after compiling std

.........
.........
clang++ -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_FREEBSD -DSTATIC_LINK -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=0 -m64 -DHXCPP_M64 -I/usr/home/agnis/Dev/hxcpp/include -x c++ -frtti -Wno-invalid-offsetof /usr/home/agnis/Dev/hxcpp/project/libs/sqlite/sqlite.cpp -o/usr/home/agnis/Dev/hxcpp/project/libs/std/obj/freebsd64-stat/9133519a_sqlite.o
ar -cr /usr/home/agnis/Dev/hxcpp/lib/FreeBSD64/libsqlite.a @/usr/home/agnis/Dev/hxcpp/project/libs/std/obj/freebsd64-stat/all_objs
ar: warning: can't open file: @/usr/home/agnis/Dev/hxcpp/project/libs/std/obj/freebsd64-stat/all_objs: No such file or directory
ranlib /usr/home/agnis/Dev/hxcpp/lib/FreeBSD64/libsqlite.a
Error: Could not find filegroup freebsdcompat
#### Error building m64

@rudrabhoj
Copy link
Author

What is a filegroup??

@rudrabhoj
Copy link
Author

Okay I'll use Linux instead :P :/

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

2 participants