Skip to content

Commit

Permalink
Compile fixes for NetBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-jonsson committed Jun 20, 2024
1 parent f37c7c6 commit db33b6b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Terminal

on:
push:
Expand Down Expand Up @@ -29,7 +29,7 @@ jobs:
copyback: false
prepare: |
PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)/All" /usr/sbin/pkg_add pkgin
pkgin -y in premake5 gmake SDL2-2.30.1 libpcap-1.10.4
pkgin -y in premake5 gmake libpcap-1.10.4
run: |
git config --global --add safe.directory $(pwd)
premake5 --test gmake
Expand Down
5 changes: 5 additions & 0 deletions front/terminal/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
//
// 3. This notice may not be removed or altered from any source distribution.

/* The Mac OS X libc API selection is broken (tested with Xcode 15.0.1) */
#ifndef __APPLE__
#define _POSIX_C_SOURCE 2 /* select POSIX.2-1992 to expose popen & pclose */
#endif

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
Expand Down
19 changes: 13 additions & 6 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ workspace "virtualxt"

if not _OPTIONS["no-modules"] and not _OPTIONS["dynamic"] then
links(modules)
for _,f in ipairs(modules_link_callback) do
f()
filter {}
end
end

-- Perhaps move this to options?
Expand Down Expand Up @@ -321,7 +325,7 @@ workspace "virtualxt"
for _,f in ipairs(modules_link_callback) do
f()
filter {}
end
end
end
end

Expand Down Expand Up @@ -371,13 +375,16 @@ workspace "virtualxt"
dependson "modules"
else
links(modules)
for _,f in ipairs(modules_link_callback) do
f()
filter {}
end
end
end

defines { "_DEFAULT_SOURCE", "_XOPEN_SOURCE" }
files { "front/terminal/*.h", "front/terminal/*.c" }
includedirs { "lib/vxt/include", "lib/inih", "lib/termbox2", "front/common" }
links { "m", "vxt", "inih" }
files { "front/terminal/*.h", "front/terminal/*.c" }
includedirs { "lib/vxt/include", "lib/inih", "lib/termbox2", "front/common" }
links { "m", "vxt", "inih" }

cleancommands {
"{RMDIR} build/terminal",
Expand All @@ -388,7 +395,7 @@ workspace "virtualxt"
files { "tools/validator/pi8088/pi8088.c", "tools/validator/pi8088/udmask.h" }

filter "toolset:clang or gcc"
buildoptions "-Wno-unused-parameter"
buildoptions { "-Wno-unused-parameter", "-Wno-implicit-function-declaration", "-Wno-incompatible-pointer-types" }
linkoptions "-Wl,-rpath,'$$ORIGIN'/../lib"

filter "toolset:clang"
Expand Down

0 comments on commit db33b6b

Please sign in to comment.