Index: meson.build
--- meson.build.orig
+++ meson.build
@@ -321,7 +321,7 @@ conf.set('ENABLE_RELOCATABLE_RESOURCES', relocatable_b
 
 
 math              = cc.find_library('m')
-dl                = platform_windows ? no_dep : cc.find_library('dl')
+dl                = platform_linux ? cc.find_library('dl') : no_dep
 rpc               = platform_windows ? cc.find_library('rpcrt4') : no_dep
 dbghelp           = platform_windows ? cc.find_library('dbghelp') : no_dep
 winsock           = platform_windows ? cc.find_library('ws2_32') : no_dep
@@ -1341,6 +1341,7 @@ conf.set('NO_FD_SET',
   not platform_windows
   and not cc.compiles('''
     #include <sys/types.h>
+    #include <sys/select.h>
     int main() { fd_set readMask, writeMask; return 0; }
   ''')
 )
