diff --git a/CMakeLists.txt b/CMakeLists.txt index 25ea460..6099d2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ else() option(MW_USE_FREETYPE2 "Use FreeType 2" ON) endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL Linux) +if(${CMAKE_SYSTEM_NAME} STREQUAL Linux OR ${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD) option(MW_USE_WAYLAND "Enable Wayland backend" ON) endif() diff --git a/configure b/configure index d091522..fcc7014 100755 --- a/configure +++ b/configure @@ -84,12 +84,15 @@ sub def_platform { param_set("freetype2", 0); param_set("stb-truetype", 1); } - if($target eq "Linux") { + if($target eq "Linux" || $target eq "FreeBSD") { param_set("x11", 1); if(!param_get("tiny")){ param_set("wayland", 1); } } + if($target eq "NetBSD" || $target eq "OpenBSD") { + param_set("x11", 1); + } } foreach my $l (@ARGV) { diff --git a/pl/ostype/FreeBSD.pl b/pl/ostype/FreeBSD.pl index 5fb0cda..7b4c638 100644 --- a/pl/ostype/FreeBSD.pl +++ b/pl/ostype/FreeBSD.pl @@ -1,7 +1,14 @@ add_incdir2("-I/usr/local/include"); add_libdir( "-L/usr/local/lib -Wl,-R/usr/local/lib"); -use_backend("x11"); + +if (param_get("wayland") && not(param_get("tiny"))) { + push(@enabled_backends, "wayland"); +} +if (param_get("x11")) { + push(@enabled_backends, "x11"); +} + add_libs("-lpthread"); add_cflags("-DUSE_DBUS");