HaxeFoundation / HaxeFoundation/haxe
Building haxe on FreeBSD broken
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
I believe building from source on FreeBSD is broken. Attempting to build HEAD on FreeBSD using the instructions given at https://haxe.org/documentation/introduction/building-haxe.html
```
$ gmake
...
dune build --workspace dune-workspace.dev src/haxe.exe
ocamlc libs/pcre/pcre_stubs.o (exit 2)
(cd _build/default/libs/pcre && /usr/local/bin/ocamlc.opt -g -ccopt -O2 -ccopt -fno-strict-aliasing -ccopt -fwrapv -ccopt -D_FILE_OFFSET_BITS=64 -ccopt -D_REENTRANT -ccopt -D_THREAD_SAFE -ccopt -fPIC -ccopt -g -o pcre_stubs.o pcre_stubs.c)
pcre_stubs.c:56:10: fatal error: 'pcre.h' file not found
#include "pcre.h"
^~~~~~~~
1 error generated.
```
This appears to be addressed by @andyli's comment here https://github.com/HaxeFoundation/haxe/issues/6146#issuecomment-295161446, however
```
$ gmake "CFLAGS=-I /usr/local/include/"
...
dune build --workspace dune-workspace.dev src/haxe.exe
ocamlc libs/pcre/pcre_stubs.o (exit 2)
(cd _build/default/libs/pcre && /usr/local/bin/ocamlc.opt -g -ccopt -O2 -ccopt -fno-strict-aliasing -ccopt -fwrapv -ccopt -D_FILE_OFFSET_BITS=64 -ccopt -D_REENTRANT -ccopt -D_THREAD_SAFE -ccopt -fPIC -ccopt -g -o pcre_stubs.o pcre_stubs.c)
pcre_stubs.c:56:10: fatal error: 'pcre.h' file not found
#include "pcre.h"
^~~~~~~~
1 error generated.
```
After learning way more about dune than I'd care to know, I have been able to work around the problem by modifying /haxe/dune from
```
(data_only_dirs extra lib std tests)
```
to
```
(env
(release
(ocamlopt_flags (:standard -ccopt -L/usr/local/lib))
(c_flags ("-I/usr/local/include"))
)
)
(data_only_dirs extra lib std tests)
```
```
$ gmake
...
cp -f _build/default/src/haxe.exe ./haxe
(cd /usr/home/voxel/Src/External/haxe/extra/haxelib_src && /usr/home/voxel/Src/External/haxe/haxe client.hxml && nekotools boot run.n)
mv extra/haxelib_src/run haxelib
```
Which now allows gmake to run the build as expected. I'm not sure what a cleaner way to fix this issue would be.
Contributor guide
Assessment
This issue has not been assessed yet.