Ticket #1463: openbsd.diff
File openbsd.diff, 19.4 KB (added by , 12 years ago) |
---|
-
binaries/data/config/default.cfg
5 5 ; * create a text file called "local.cfg" instead, and copy * 6 6 ; * the lines from this file that you want to change. * 7 7 ; * * 8 ; * On Linux / OS X, create: * 9 ; * ~/.config/0ad/config/local.cfg * 8 ; * On Linux, create: * 9 ; * $XDG_CONFIG_HOME/0ad/config/local.cfg * 10 ; * (Note: $XDG_CONFIG_HOME defaults to ~/.config) * 11 ; * * 12 ; * On OS X, create: * 13 ; * ~/Library/Application\ Support/0ad/config/local.cfg * 10 14 ; * * 11 15 ; * On Windows, create: * 12 ; * %appdata% /0ad/config/local.cfg *16 ; * %appdata%\0ad\config\local.cfg * 13 17 ; * * 14 18 ; ************************************************************** 15 19 -
build/premake/extern_libs4.lua
211 211 if os.is("windows") then 212 212 add_default_include_paths("boost") 213 213 end 214 if os.typeis("OpenBSD") then 215 includedirs { "/usr/local/include" } 216 end 214 217 end, 215 218 link_settings = function() 216 219 if os.is("windows") then … … 356 359 if os.is("windows") then 357 360 add_default_include_paths("libpng") 358 361 end 362 if os.typeis("OpenBSD") then 363 includedirs { "/usr/local/include/libpng" } 364 end 359 365 end, 360 366 link_settings = function() 361 367 if os.is("windows") then … … 539 545 if os.is("windows") then 540 546 add_default_lib_paths("vorbis") 541 547 end 548 if os.typeis("OpenBSD") then 549 add_default_links({ 550 unix_names = { "ogg", 551 "vorbis" }, 552 }) 553 end 542 554 add_default_links({ 543 555 win_names = { "vorbisfile" }, 544 556 unix_names = { "vorbisfile" }, -
build/premake/premake4.lua
307 307 if _ACTION == "gmake" then 308 308 linkoptions { "-Wl,-rpath,'$$ORIGIN'" } 309 309 elseif _ACTION == "codeblocks" then 310 linkoptions { "-Wl,-R\\\\$$ORIGIN" } 310 linkoptions { "-Wl,-R\\\\$$ORIGIN" } 311 311 end 312 312 end 313 313 end … … 338 338 elseif os.is("macosx") then 339 339 return "ConsoleApp" 340 340 else 341 return "WindowedApp" 341 return "WindowedApp" 342 342 end 343 343 end 344 344 … … 609 609 "cxxtest", 610 610 } 611 611 612 612 if not _OPTIONS["without-audio"] then 613 613 table.insert(extern_libs, "openal") 614 614 table.insert(extern_libs, "vorbis") 615 615 end … … 765 765 links { "fam" } 766 766 end 767 767 768 if not _OPTIONS["android"] then 768 -- TODO pyrogenesis/test on OpenBSD link vorbis and ogg too (not only vorbisfile) 769 if not _OPTIONS["android"] and not os.typeis("OpenBSD") then 769 770 links { "rt" } 770 771 end 771 772 … … 774 775 linkoptions { "-Wl,--fix-cortex-a8" } 775 776 end 776 777 777 if os.is("linux") then778 if os.is("linux") or os.typeis("GNU/kFreeBSD") then 778 779 links { 779 780 -- Dynamic libraries (needed for linking for gold) 780 781 "dl", 781 782 } 782 783 elseif os.is("bsd") then 783 784 links { 784 -- Needed for backtrace* on FreeBSD785 -- Needed for backtrace* on BSDs 785 786 "execinfo", 786 787 } 787 788 end … … 1014 1015 linkoptions { "-rdynamic" } 1015 1016 1016 1017 elseif os.is("bsd") then 1017 -- define BSD-something? 1018 if os.typeis("OpenBSD") then 1019 links { "c", } 1020 end 1018 1021 1019 1022 buildoptions { "-fno-strict-aliasing" } 1020 1023 … … 1180 1183 links { "fam" } 1181 1184 end 1182 1185 1183 if not _OPTIONS["android"] then1186 if not _OPTIONS["android"] and not os.typeis("OpenBSD") then 1184 1187 links { "rt" } 1185 1188 end 1186 1189 … … 1189 1192 linkoptions { "-Wl,--fix-cortex-a8" } 1190 1193 end 1191 1194 1192 if os.is("linux") then1195 if os.is("linux") or os.typeis("GNU/kFreeBSD") then 1193 1196 links { 1194 1197 -- Dynamic libraries (needed for linking for gold) 1195 1198 "dl", 1196 1199 } 1197 1200 elseif os.is("bsd") then 1198 1201 links { 1199 -- Needed for backtrace* on FreeBSD1202 -- Needed for backtrace* on BSDs 1200 1203 "execinfo", 1201 1204 } 1202 1205 end -
build/premake/premake4/src/base/os.lua
65 65 end 66 66 67 67 68 69 68 -- 70 69 -- Check the current operating system; may be set with the /os command line flag. 71 70 -- … … 73 72 function os.is(id) 74 73 return (os.get():lower() == id:lower()) 75 74 end 76 77 75 76 function os.typeget() 77 return _OS_TYPE 78 end 79 -- 80 -- Check the current operating system type (currently only which BSD variation) 81 -- 82 function os.typeis(t) 83 return (os.typeget():lower() == t:lower()) 84 end 78 85 79 86 -- 80 87 -- The os.matchdirs() and os.matchfiles() functions -
build/premake/premake4/src/host/premake.c
87 87 lua_pushstring(L, PLATFORM_STRING); 88 88 lua_setglobal(L, "_OS"); 89 89 90 /* set the OS platform type */ 91 lua_pushstring(L, PLATFORM_OS_TYPE); 92 lua_setglobal(L, "_OS_TYPE"); 93 90 94 /* Parse the command line arguments */ 91 95 if (z == OKAY) z = process_arguments(L, argc, argv); 92 96 -
build/premake/premake4/src/host/premake.h
18 18 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) 19 19 #define PLATFORM_BSD (1) 20 20 #define PLATFORM_STRING "bsd" 21 # if defined(__FreeBSD_kernel__) && !defined(__FreeBSD__) 22 # define PLATFORM_OS_TYPE "GNU/kFreeBSD" 23 # elif defined(__FreeBSD__) 24 # define PLATFORM_OS_TYPE "FreeBSD" 25 # elif defined(__NetBSD__) 26 # define PLATFORM_OS_TYPE "NetBSD" 27 # elif defined(__OpenBSD__) 28 # define PLATFORM_OS_TYPE "OpenBSD" 29 # endif 21 30 #elif defined(__APPLE__) && defined(__MACH__) 22 31 #define PLATFORM_MACOSX (1) 23 32 #define PLATFORM_STRING "macosx" … … 29 38 #define PLATFORM_STRING "windows" 30 39 #endif 31 40 41 #ifndef PLATFORM_OS_TYPE 42 # define PLATFORM_OS_TYPE "" 43 #endif 44 32 45 33 46 /* Pull in platform-specific headers required by built-in functions */ 34 47 #if PLATFORM_WINDOWS -
build/premake/premake4/src/host/scripts.c
4 4 5 5 const char* builtin_scripts[] = { 6 6 /* base/os.lua */ 7 "function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\npath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nio.input(\"/etc/ld.so.conf\")\nif io.input() then\nfor line in io.lines() do\npath = path .. \":\" .. line\nend\nio.input():close()\nend\nend\ntable.insert(formats, \"%s\")\npath = (path or \"\") .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\n local function domatch(result, mask, wantfiles)\nif mas"7 "function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\npath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nio.input(\"/etc/ld.so.conf\")\nif io.input() then\nfor line in io.lines() do\npath = path .. \":\" .. line\nend\nio.input():close()\nend\nend\ntable.insert(formats, \"%s\")\npath = (path or \"\") .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nfunction os.typeget()\nreturn _OS_TYPE\nend\nfunction os.typeis(t)\nreturn (os.typeget():lower() == t:lower())\nend\nlocal function domatch(result, mask, wantfiles)\nif mas" 8 8 "k:startswith(\"./\") then\nmask = mask:sub(3)\nend\nlocal basedir = mask\nlocal starpos = mask:find(\"%*\")\nif starpos then\nbasedir = basedir:sub(1, starpos - 1)\nend\nbasedir = path.getdirectory(basedir)\nif (basedir == \".\") then basedir = \"\" end\nlocal recurse = mask:find(\"**\", nil, true)\nmask = path.wildcards(mask)\nlocal function matchwalker(basedir)\nlocal wildcard = path.join(basedir, \"*\")\nlocal m = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nlocal isfile = os.matchisfile(m)\nif ((wantfiles and isfile) or (not wantfiles and not isfile)) then\nlocal fname = path.join(basedir, os.matchname(m))\nif fname:match(mask) == fname then\ntable.insert(result, fname)\nend\nend\nend\nos.matchdone(m)\nif recurse then\nm = os.matchstart(wildcard)\nwhile (os.matchnext(m)) do\nif not os.matchisfile(m) then\nlocal dirname = os.matchname(m)\nmatchwalker(path.join(basedir, dirname))\nend\nend\nos.matchdone(m)\nend\nend\nmatchwalker(basedir)\nend\nfunction os.matchdirs(...)\nlocal result = { }\nfor _, ma" 9 9 "sk in ipairs(arg) do\ndomatch(result, mask, false)\nend\nreturn result\nend\nfunction os.matchfiles(...)\nlocal result = { }\nfor _, mask in ipairs(arg) do\ndomatch(result, mask, true)\nend\nreturn result\nend\nlocal builtin_mkdir = os.mkdir\nfunction os.mkdir(p)\nlocal dir = iif(p:startswith(\"/\"), \"/\", \"\")\nfor part in p:gmatch(\"[^/]+\") do\ndir = dir .. part\nif (part ~= \"\" and not path.isabsolute(part) and not os.isdir(dir)) then\nlocal ok, err = builtin_mkdir(dir)\nif (not ok) then\nreturn nil, err\nend\nend\ndir = dir .. \"/\"\nend\nreturn true\nend\nlocal builtin_rmdir = os.rmdir\nfunction os.rmdir(p)\nlocal dirs = os.matchdirs(p .. \"/*\")\nfor _, dname in ipairs(dirs) do\nos.rmdir(dname)\nend\nlocal files = os.matchfiles(p .. \"/*\")\nfor _, fname in ipairs(files) do\nos.remove(fname)\nend\nbuiltin_rmdir(p)\nend\n", 10 10 -
source/lib/config2.h
1 /* Copyright (c) 201 0Wildfire Games1 /* Copyright (c) 2012 Wildfire Games 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 73 73 #ifndef CONFIG2_FILE_ENABLE_AIO 74 74 // work around a bug introduced in Linux 2.6.38 75 75 // (http://www.wildfiregames.com/forum/index.php?showtopic=14561&view=findpost&p=217710) 76 # if OS_LINUX 76 // OpenBSD doesn't provide aio.h so we disable its use 77 # if OS_LINUX || OS_OPENBSD 77 78 # define CONFIG2_FILE_ENABLE_AIO 0 78 79 # else 79 80 # define CONFIG2_FILE_ENABLE_AIO 1 -
source/lib/posix/posix_aio.h
30 30 31 31 #if OS_WIN 32 32 # include "lib/sysdep/os/win/wposix/waio.h" 33 #elif OS_ANDROID 33 #elif OS_ANDROID || OS_OPENBSD 34 34 // Android doesn't provide aio.h. We don't actually use aio on Linuxes (see 35 35 // CONFIG2_FILE_ENABLE_AIO) but we use its symbols and structs, so define 36 36 // them here 37 # if OS_OPENBSD 38 // OpenBSD 5.1 (latest version at time of writing) has no struct sigevent defined, 39 // so we do this here. 40 struct sigevent 41 { 42 int sigev_notify; 43 int sigev_signo; 44 union sigval sigev_value; 45 void (*sigev_notify_function)(union sigval); 46 pthread_attr_t *sigev_notify_attributes; 47 }; 48 # endif 37 49 # define LIO_READ 0 38 50 # define LIO_WRITE 1 39 51 # define LIO_NOP 2 -
source/lib/posix/posix_mman.h
1 /* Copyright (c) 201 0Wildfire Games1 /* Copyright (c) 2012 Wildfire Games 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 20 20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 21 */ 22 22 23 #ifndef INCLUDED_POSIX_MMAN 24 #define INCLUDED_POSIX_MMAN 25 23 26 #if OS_WIN 24 27 # include "lib/sysdep/os/win/wposix/wmman.h" 25 28 #else … … 27 30 #endif 28 31 29 32 #include "lib/posix/posix_errno.h" // for user convenience 33 34 #endif // #ifndef INCLUDED_POSIX_MMAN -
source/lib/secure_crt.cpp
106 106 // self-test and the t* defines (needed for test). 107 107 #if EMULATE_SECURE_CRT 108 108 109 #if !OS_UNIX || OS_MACOSX 109 #if !OS_UNIX || OS_MACOSX || OS_OPENBSD 110 110 // return length [in characters] of a string, not including the trailing 111 111 // null character. to protect against access violations, only the 112 112 // first <max_len> characters are examined; if the null character is -
source/lib/secure_crt.h
47 47 #if EMULATE_SECURE_CRT 48 48 49 49 // (conflicts with glibc definitions) 50 #if !OS_UNIX || OS_MACOSX 50 #if !OS_UNIX || OS_MACOSX || OS_OPENBSD 51 51 // return length [in characters] of a string, not including the trailing 52 52 // null character. to protect against access violations, only the 53 53 // first <max_len> characters are examined; if the null character is 54 54 // not encountered by then, <max_len> is returned. 55 // strnlen is available on OpenBSD 56 #if !OS_OPENBSD 55 57 extern size_t strnlen(const char* str, size_t max_len); 58 #endif 56 59 extern size_t wcsnlen(const wchar_t* str, size_t max_len); 57 60 #endif 58 61 -
source/lib/sysdep/os.h
1 /* Copyright (c) 201 0Wildfire Games1 /* Copyright (c) 2012 Wildfire Games 2 2 * 3 3 * Permission is hereby granted, free of charge, to any person obtaining 4 4 * a copy of this software and associated documentation files (the … … 68 68 // BSD 69 69 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) 70 70 # define OS_BSD 1 71 // OpenBSD has no aio.h so and we need a way to disable it for it only 72 # if defined(__OpenBSD__) 73 # define OS_OPENBSD 1 74 # endif 71 75 #else 72 76 # define OS_BSD 0 73 77 #endif 78 #ifndef OS_OPENBSD 79 # define OS_OPENBSD 0 80 #endif 74 81 // Solaris 75 82 #if defined(sun) || defined(__sun) 76 83 # define OS_SOLARIS 1 -
source/lib/sysdep/os/bsd/bcpu.cpp
28 28 #include "lib/module_init.h" 29 29 30 30 #include "valgrind.h" 31 #include <sys/param.h> 31 32 #include <sys/sysctl.h> 32 33 33 34 size_t os_cpu_NumProcessors() -
source/maths/Brush.cpp
413 413 414 414 faceStartIdx = j + 1; 415 415 } 416 } 417 No newline at end of file 416 } -
source/ps/CStrIntern.h
83 83 CStrInternInternals* m; 84 84 }; 85 85 86 #endif // INCLUDED_CSTRINTERN 87 No newline at end of file 86 #endif // INCLUDED_CSTRINTERN -
source/ps/Font.cpp
81 81 Handle CFont::GetTexture() 82 82 { 83 83 return unifont_get_texture(h); 84 } 85 No newline at end of file 84 } -
source/ps/PreprocessorWrapper.cpp
83 83 free(output); 84 84 85 85 return ret; 86 } 87 No newline at end of file 86 } -
source/ps/PreprocessorWrapper.h
41 41 CPreprocessor m_Preprocessor; 42 42 }; 43 43 44 #endif // INCLUDED_PREPROCESSORWRAPPER 45 No newline at end of file 44 #endif // INCLUDED_PREPROCESSORWRAPPER -
source/ps/Profiler2GPU.cpp
871 871 void CProfiler2GPU::RegionEnter(const char* UNUSED(id)) { } 872 872 void CProfiler2GPU::RegionLeave(const char* UNUSED(id)) { } 873 873 874 #endif 875 No newline at end of file 874 #endif -
source/renderer/OverlayRenderer.cpp
606 606 glDisable(GL_BLEND); 607 607 glDisable(GL_TEXTURE_2D); 608 608 #endif 609 } 610 No newline at end of file 609 } -
source/renderer/TexturedLineRData.h
85 85 CVertexBuffer::VBChunk* m_VBIndices; 86 86 }; 87 87 88 #endif // INCLUDED_TEXTUREDLINERDATA 89 No newline at end of file 88 #endif // INCLUDED_TEXTUREDLINERDATA -
source/simulation2/components/tests/test_ObstructionManager.h
474 474 TS_ASSERT_EQUALS(obSquare3.u, CFixedVector2D(fixed::FromInt(1), fixed::FromInt(0))); 475 475 TS_ASSERT_EQUALS(obSquare3.v, CFixedVector2D(fixed::FromInt(0), fixed::FromInt(1))); 476 476 } 477 }; 478 No newline at end of file 477 }; -
source/simulation2/helpers/Render.cpp
567 567 } 568 568 569 569 points.swap(newPoints); 570 } 571 No newline at end of file 570 }