janet-lang / janet-lang/jaylib

FreeBSD build possible, modifications needed

Open
#28 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
194
Forks
47
PR merge metrics
No merged PRs in 30d

Description

cflags, lflags, and defines need to be FreeBSD specific in this case:

``` diff
diff --git a/project.janet b/project.janet
index 96e9e81..d954222 100644
--- a/project.janet
+++ b/project.janet
@@ -16,6 +16,7 @@
:windows '["user32.lib" "gdi32.lib" "winmm.lib" "shell32.lib"]
:macos '["-lpthread" "-framework" "Cocoa" "-framework" "CoreVideo" "-framework" "IOKit" "-framework" "OpenGL"]
:linux '["-lpthread" "-lX11"]
+ :freebsd '["-L/usr/local/lib" "-lpthread" "-lX11"]
#default
'["-lpthread"]))

@@ -24,7 +25,7 @@

:cflags [;default-cflags ;cflags]

- :defines {"PLATFORM_DESKTOP" true "_POSIX_C_SOURCE" "200809L"}
+ :defines {"PLATFORM_DESKTOP" true } # "_POSIX_C_SOURCE" "200809L"}

:source ["src/main.c"

@@ -47,6 +48,8 @@
"src/shapes.h"
"src/3d.h"]

+ :cflags [;default-cflags ;'["-I/usr/local/include"]]
+
:lflags [;default-lflags ;lflags])

# `jpm run repl` to run a repl with access to jaylib
```

That illustrates the changes necessary, however, is not fit for actual use (would probably break other platforms) so is mostly provided as documentation.

The other ordeal might be that the cflags, lflags, should be defaults under FreeBSD in jpm but am not sure if that is true or not. Depends on what those are under other platforms. The `_POSIX_C_SOURCE` define breaks `soundcard.h` on some platforms supposedly (currently on FreeBSD to our knowledge).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in project.janet and inspect how jpm supplies platform-specific cflags, lflags, and defines for FreeBSD and other platforms. Compare the proposed FreeBSD values, including _POSIX_C_SOURCE and /usr/local paths, against existing platform settings. Done means FreeBSD builds successfully without breaking other supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.