diff --git a/build/premake/extern_libs5.lua b/build/premake/extern_libs5.lua
index 6807dc7e0..c4002a50b 100644
a
|
b
|
extern_lib_defs = {
|
262 | 262 | compile_settings = function() |
263 | 263 | if os.istarget("windows") then |
264 | 264 | add_default_include_paths("gloox") |
265 | | elseif os.istarget("macosx") then |
266 | | -- Support GLOOX_CONFIG for overriding the default PATH-based gloox-config |
| 265 | elseif not _OPTIONS["android"] then |
| 266 | -- Support GLOOX_CONFIG for overriding the default (pkg-config --cflags gloox) |
| 267 | -- i.e. on OSX where it gets set in update-workspaces.sh |
267 | 268 | gloox_config_path = os.getenv("GLOOX_CONFIG") |
268 | | if not gloox_config_path then |
269 | | gloox_config_path = "gloox-config" |
270 | | end |
271 | | pkgconfig.add_includes(nil, gloox_config_path.." --cflags") |
| 269 | if gloox_config_path then |
| 270 | pkgconfig.add_includes(nil, gloox_config_path.." --cflags") |
| 271 | else |
| 272 | pkgconfig.add_includes("gloox") |
| 273 | end |
272 | 274 | end |
273 | 275 | end, |
274 | 276 | link_settings = function() |
275 | 277 | if os.istarget("windows") then |
276 | 278 | add_default_lib_paths("gloox") |
277 | | end |
278 | | if os.istarget("macosx") then |
279 | | gloox_config_path = os.getenv("GLOOX_CONFIG") |
280 | | if not gloox_config_path then |
281 | | gloox_config_path = "gloox-config" |
282 | | end |
283 | | pkgconfig.add_links(nil, gloox_config_path.." --libs") |
284 | | else |
285 | | -- TODO: consider using pkg-config on non-Windows (for compile_settings too) |
286 | 279 | add_default_links({ |
287 | 280 | win_names = { "gloox-1.0" }, |
288 | | unix_names = { "gloox" }, |
289 | 281 | no_delayload = 1, |
290 | 282 | }) |
| 283 | elseif not _OPTIONS["android"] then |
| 284 | gloox_config_path = os.getenv("GLOOX_CONFIG") |
| 285 | if gloox_config_path then |
| 286 | pkgconfig.add_links(nil, gloox_config_path.." --libs") |
| 287 | else |
| 288 | pkgconfig.add_links("gloox") |
| 289 | end |
291 | 290 | end |
292 | 291 | end, |
293 | 292 | }, |
… |
… |
extern_lib_defs = {
|
540 | 539 | if os.istarget("windows") then |
541 | 540 | includedirs { libraries_dir .. "sdl2/include/SDL" } |
542 | 541 | elseif not _OPTIONS["android"] then |
543 | | -- Support SDL2_CONFIG for overriding the default PATH-based sdl2-config |
| 542 | -- Support SDL2_CONFIG for overriding the default (pkg-config sdl2) |
| 543 | -- i.e. on OSX where it gets set in update-workspaces.sh |
544 | 544 | sdl_config_path = os.getenv("SDL2_CONFIG") |
545 | | if not sdl_config_path then |
546 | | sdl_config_path = "sdl2-config" |
| 545 | if sdl_config_path then |
| 546 | pkgconfig.add_includes(nil, sdl_config_path.." --cflags") |
| 547 | else |
| 548 | pkgconfig.add_includes("sdl2") |
547 | 549 | end |
548 | | |
549 | | pkgconfig.add_includes(nil, sdl_config_path.." --cflags") |
550 | 550 | end |
551 | 551 | end, |
552 | 552 | link_settings = function() |
… |
… |
extern_lib_defs = {
|
554 | 554 | add_default_lib_paths("sdl2") |
555 | 555 | elseif not _OPTIONS["android"] then |
556 | 556 | sdl_config_path = os.getenv("SDL2_CONFIG") |
557 | | if not sdl_config_path then |
558 | | sdl_config_path = "sdl2-config" |
| 557 | if sdl_config_path then |
| 558 | pkgconfig.add_links(nil, sdl_config_path.." --libs") |
| 559 | else |
| 560 | pkgconfig.add_links("sdl2") |
559 | 561 | end |
560 | | pkgconfig.add_links(nil, sdl_config_path.." --libs") |
561 | 562 | end |
562 | 563 | end, |
563 | 564 | }, |
… |
… |
extern_lib_defs = {
|
684 | 685 | end, |
685 | 686 | }, |
686 | 687 | x11 = { |
| 688 | compile_settings = function() |
| 689 | if not os.istarget("windows") and not os.istarget("macosx") then |
| 690 | pkgconfig.add_includes("x11") |
| 691 | end |
| 692 | end, |
687 | 693 | link_settings = function() |
688 | | add_default_links({ |
689 | | win_names = { }, |
690 | | unix_names = { "X11" }, |
691 | | }) |
| 694 | if not os.istarget("windows") and not os.istarget("macosx") then |
| 695 | pkgconfig.add_links("x11") |
| 696 | end |
692 | 697 | end, |
693 | 698 | }, |
694 | 699 | xcursor = { |
diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua
index 36928fb29..de8f858c4 100644
a
|
b
|
function project_set_build_flags()
|
367 | 367 | end |
368 | 368 | end |
369 | 369 | |
370 | | -- add X11 includes paths after all the others so they don't conflict with |
371 | | -- bundled libs |
372 | | function project_add_x11_dirs() |
373 | | if not os.istarget("windows") and not os.istarget("macosx") then |
374 | | -- X11 includes may be installed in one of a gadzillion of five places |
375 | | -- Famous last words: "You can't include too much! ;-)" |
376 | | sysincludedirs { |
377 | | "/usr/X11R6/include/X11", |
378 | | "/usr/X11R6/include", |
379 | | "/usr/local/include/X11", |
380 | | "/usr/local/include", |
381 | | "/usr/include/X11" |
382 | | } |
383 | | libdirs { "/usr/X11R6/lib" } |
384 | | end |
385 | | end |
386 | | |
387 | 370 | -- create a project and set the attributes that are common to all projects. |
388 | 371 | function project_create(project_name, target_type) |
389 | 372 | |
… |
… |
function setup_static_lib_project (project_name, rel_source_dirs, extern_libs, e
|
528 | 511 | project_create(project_name, target_type) |
529 | 512 | project_add_contents(source_root, rel_source_dirs, {}, extra_params) |
530 | 513 | project_add_extern_libs(extern_libs, target_type) |
531 | | project_add_x11_dirs() |
532 | 514 | |
533 | 515 | if not extra_params["no_default_link"] then |
534 | 516 | table.insert(static_lib_names, project_name) |
… |
… |
function setup_shared_lib_project (project_name, rel_source_dirs, extern_libs, e
|
551 | 533 | project_create(project_name, target_type) |
552 | 534 | project_add_contents(source_root, rel_source_dirs, {}, extra_params) |
553 | 535 | project_add_extern_libs(extern_libs, target_type) |
554 | | project_add_x11_dirs() |
555 | 536 | |
556 | 537 | if not extra_params["no_default_link"] then |
557 | 538 | table.insert(static_lib_names, project_name) |
… |
… |
function setup_main_exe ()
|
961 | 942 | } |
962 | 943 | project_add_contents(source_root, {}, {}, extra_params) |
963 | 944 | project_add_extern_libs(used_extern_libs, target_type) |
964 | | project_add_x11_dirs() |
965 | 945 | |
966 | 946 | dependson { "Collada" } |
967 | 947 | |
… |
… |
function setup_atlas_project(project_name, target_type, rel_source_dirs, rel_inc
|
1057 | 1037 | |
1058 | 1038 | project_add_contents(source_root, rel_source_dirs, rel_include_dirs, extra_params) |
1059 | 1039 | project_add_extern_libs(extern_libs, target_type) |
1060 | | project_add_x11_dirs() |
1061 | 1040 | |
1062 | 1041 | -- Platform Specifics |
1063 | 1042 | if os.istarget("windows") then |
… |
… |
function setup_atlas_frontend_project (project_name)
|
1180 | 1159 | |
1181 | 1160 | local target_type = get_main_project_target_type() |
1182 | 1161 | project_create(project_name, target_type) |
1183 | | project_add_x11_dirs() |
1184 | 1162 | |
1185 | 1163 | local source_root = rootdir.."/source/tools/atlas/AtlasFrontends/" |
1186 | 1164 | files { source_root..project_name..".cpp" } |
… |
… |
function setup_collada_project(project_name, target_type, rel_source_dirs, rel_i
|
1220 | 1198 | extra_params["pch_dir"] = source_root |
1221 | 1199 | project_add_contents(source_root, rel_source_dirs, rel_include_dirs, extra_params) |
1222 | 1200 | project_add_extern_libs(extern_libs, target_type) |
1223 | | project_add_x11_dirs() |
1224 | 1201 | |
1225 | 1202 | -- Platform Specifics |
1226 | 1203 | if os.istarget("windows") then |
… |
… |
function setup_tests()
|
1364 | 1341 | |
1365 | 1342 | project_add_contents(source_root, {}, {}, extra_params) |
1366 | 1343 | project_add_extern_libs(used_extern_libs, target_type) |
1367 | | project_add_x11_dirs() |
1368 | 1344 | |
1369 | 1345 | dependson { "Collada" } |
1370 | 1346 | |
diff --git a/source/lib/sysdep/os/unix/x/x.cpp b/source/lib/sysdep/os/unix/x/x.cpp
index e7649cd6e..a3e199f5b 100644
a
|
b
|
|
41 | 41 | |
42 | 42 | #define Cursor X__Cursor |
43 | 43 | |
44 | | #include <Xlib.h> |
| 44 | #include <X11/Xlib.h> |
45 | 45 | #include <stdlib.h> |
46 | | #include <Xatom.h> |
47 | | #include <Xcursor/Xcursor.h> |
| 46 | #include <X11/Xatom.h> |
| 47 | #include <X11/Xcursor/Xcursor.h> |
48 | 48 | |
49 | 49 | #include "SDL.h" |
50 | 50 | #include "SDL_syswm.h" |