Ticket #1463: more_openbsd_compat.diff
File more_openbsd_compat.diff, 14.5 KB (added by , 12 years ago) |
---|
-
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.is("bsd") then 215 -- for OpenBSD 216 includedirs { "/usr/local/include" } 217 end 214 218 end, 215 219 link_settings = function() 216 220 if os.is("windows") then … … 356 360 if os.is("windows") then 357 361 add_default_include_paths("libpng") 358 362 end 363 if os.is("bsd") then 364 -- OpenBSD only 365 includedirs { "/usr/local/include/libpng" } 366 end 359 367 end, 360 368 link_settings = function() 361 369 if os.is("windows") then -
build/premake/premake4/build/gmake.unix/Premake4.make
29 29 CFLAGS += $(CPPFLAGS) -Wall -Os 30 30 CXXFLAGS += $(CFLAGS) 31 31 LDFLAGS += -s -rdynamic 32 LIBS += -lm -ldl32 LIBS += -lm 33 33 RESFLAGS += $(DEFINES) $(INCLUDES) 34 34 LDDEPS += 35 35 LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS) -
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/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/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 -
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 -
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/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/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/maths/Brush.cpp
413 413 414 414 faceStartIdx = j + 1; 415 415 } 416 } 417 No newline at end of file 416 } -
libraries/nvtt/issue176.patch
1 Index: src/src/nvcore/nvcore.h 2 =================================================================== 3 --- src/src/nvcore/nvcore.h (revision 11943) 4 +++ src/src/nvcore/nvcore.h (working copy) 5 @@ -41,6 +41,9 @@ 6 #elif defined POSH_OS_FREEBSD 7 # define NV_OS_FREEBSD 1 8 # define NV_OS_UNIX 1 9 +#elif defined POSH_OS_OPENBSD 10 +# define NV_OS_OPENBSD 1 11 +# define NV_OS_UNIX 1 12 #elif defined POSH_OS_CYGWIN32 13 # define NV_OS_CYGWIN 1 14 #elif defined POSH_OS_MINGW 15 @@ -178,7 +181,7 @@ 16 #elif NV_CC_GNUC 17 # if NV_OS_LINUX 18 # include "DefsGnucLinux.h" 19 -# elif NV_OS_DARWIN || NV_OS_FREEBSD 20 +# elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 21 # include "DefsGnucDarwin.h" 22 # elif NV_OS_MINGW 23 # include "DefsGnucWin32.h" 24 Index: src/src/nvcore/Debug.cpp 25 =================================================================== 26 --- src/src/nvcore/Debug.cpp (revision 11943) 27 +++ src/src/nvcore/Debug.cpp (working copy) 28 @@ -27,7 +27,7 @@ 29 # include <signal.h> 30 #endif 31 32 -#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD 33 +#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 34 # include <unistd.h> // getpid 35 #endif 36 37 @@ -38,10 +38,13 @@ 38 # endif 39 #endif 40 41 -#if NV_OS_DARWIN || NV_OS_FREEBSD 42 +#if NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 43 # include <sys/types.h> 44 +# include <sys/param.h> 45 # include <sys/sysctl.h> // sysctl 46 -# include <sys/ucontext.h> 47 +# if !NV_OS_OPENBSD 48 +# include <sys/ucontext.h> 49 +# endif 50 # undef HAVE_EXECINFO_H 51 # if defined(HAVE_EXECINFO_H) // only after OSX 10.5 52 # include <execinfo.h> // backtrace 53 @@ -210,6 +213,14 @@ 54 ucontext_t * ucp = (ucontext_t *)secret; 55 return (void *)ucp->uc_mcontext.mc_eip; 56 # endif 57 +# elif NV_OS_OPENBSD 58 +# if NV_CPU_X86_64 59 + ucontext_t * ucp = (ucontext_t *)secret; 60 + return (void *)ucp->sc_rip; 61 +# elif NV_CPU_X86 62 + ucontext_t * ucp = (ucontext_t *)secret; 63 + return (void *)ucp->sc_eip; 64 +# endif 65 # else 66 # if NV_CPU_X86_64 67 // #define REG_RIP REG_INDEX(rip) // seems to be 16 68 Index: src/src/nvcore/poshlib/posh.h 69 =================================================================== 70 --- src/src/nvcore/poshlib/posh.h (revision 11943) 71 +++ src/src/nvcore/poshlib/posh.h (working copy) 72 @@ -298,6 +298,11 @@ 73 # define POSH_OS_STRING "FreeBSD" 74 #endif 75 76 +#if defined __OpenBSD__ 77 +# define POSH_OS_OPENBSD 1 78 +# define POSH_OS_STRING "OpenBSD" 79 +#endif 80 + 81 #if defined __CYGWIN32__ 82 # define POSH_OS_CYGWIN32 1 83 # define POSH_OS_STRING "Cygwin" 84 Index: src/src/nvmath/nvmath.h 85 =================================================================== 86 --- src/src/nvmath/nvmath.h (revision 11943) 87 +++ src/src/nvmath/nvmath.h (working copy) 88 @@ -115,7 +115,7 @@ 89 { 90 #if NV_OS_WIN32 91 return _finite(f) != 0; 92 -#elif NV_OS_DARWIN || NV_OS_FREEBSD 93 +#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 94 return isfinite(f); 95 #elif NV_OS_LINUX 96 return finitef(f); 97 @@ -130,7 +130,7 @@ 98 { 99 #if NV_OS_WIN32 100 return _isnan(f) != 0; 101 -#elif NV_OS_DARWIN || NV_OS_FREEBSD 102 +#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 103 return isnan(f); 104 #elif NV_OS_LINUX 105 return isnanf(f); -
libraries/nvtt/src/src/nvcore/nvcore.h
41 41 #elif defined POSH_OS_FREEBSD 42 42 # define NV_OS_FREEBSD 1 43 43 # define NV_OS_UNIX 1 44 #elif defined POSH_OS_OPENBSD 45 # define NV_OS_OPENBSD 1 46 # define NV_OS_UNIX 1 44 47 #elif defined POSH_OS_CYGWIN32 45 48 # define NV_OS_CYGWIN 1 46 49 #elif defined POSH_OS_MINGW … … 178 181 #elif NV_CC_GNUC 179 182 # if NV_OS_LINUX 180 183 # include "DefsGnucLinux.h" 181 # elif NV_OS_DARWIN || NV_OS_FREEBSD 184 # elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 182 185 # include "DefsGnucDarwin.h" 183 186 # elif NV_OS_MINGW 184 187 # include "DefsGnucWin32.h" -
libraries/nvtt/src/src/nvcore/Debug.cpp
27 27 # include <signal.h> 28 28 #endif 29 29 30 #if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD 30 #if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 31 31 # include <unistd.h> // getpid 32 32 #endif 33 33 … … 38 38 # endif 39 39 #endif 40 40 41 #if NV_OS_DARWIN || NV_OS_FREEBSD 41 #if NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 42 42 # include <sys/types.h> 43 # include <sys/param.h> 43 44 # include <sys/sysctl.h> // sysctl 44 # include <sys/ucontext.h> 45 # if !NV_OS_OPENBSD 46 # include <sys/ucontext.h> 47 # endif 45 48 # undef HAVE_EXECINFO_H 46 49 # if defined(HAVE_EXECINFO_H) // only after OSX 10.5 47 50 # include <execinfo.h> // backtrace … … 210 213 ucontext_t * ucp = (ucontext_t *)secret; 211 214 return (void *)ucp->uc_mcontext.mc_eip; 212 215 # endif 216 # elif NV_OS_OPENBSD 217 # if NV_CPU_X86_64 218 ucontext_t * ucp = (ucontext_t *)secret; 219 return (void *)ucp->sc_rip; 220 # elif NV_CPU_X86 221 ucontext_t * ucp = (ucontext_t *)secret; 222 return (void *)ucp->sc_eip; 223 # endif 213 224 # else 214 225 # if NV_CPU_X86_64 215 226 // #define REG_RIP REG_INDEX(rip) // seems to be 16 -
libraries/nvtt/src/src/nvcore/poshlib/posh.h
298 298 # define POSH_OS_STRING "FreeBSD" 299 299 #endif 300 300 301 #if defined __OpenBSD__ 302 # define POSH_OS_OPENBSD 1 303 # define POSH_OS_STRING "OpenBSD" 304 #endif 305 301 306 #if defined __CYGWIN32__ 302 307 # define POSH_OS_CYGWIN32 1 303 308 # define POSH_OS_STRING "Cygwin" -
libraries/nvtt/src/src/nvmath/nvmath.h
115 115 { 116 116 #if NV_OS_WIN32 117 117 return _finite(f) != 0; 118 #elif NV_OS_DARWIN || NV_OS_FREEBSD 118 #elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 119 119 return isfinite(f); 120 120 #elif NV_OS_LINUX 121 121 return finitef(f); … … 130 130 { 131 131 #if NV_OS_WIN32 132 132 return _isnan(f) != 0; 133 #elif NV_OS_DARWIN || NV_OS_FREEBSD 133 #elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD 134 134 return isnan(f); 135 135 #elif NV_OS_LINUX 136 136 return isnanf(f); -
libraries/nvtt/README.txt
6 6 r907.patch and r1025.patch (from NVTT SVN - fixes build on FreeBSD) 7 7 rpath.patch (fixes .so file search paths for bundled copy) 8 8 issue139.patch (fixes http://code.google.com/p/nvidia-texture-tools/issues/detail?id=139) 9 issue176.patch (partially from http:/code.google.com/p/nvidia-texture-tools/issues/detail?id=176 - fixes build on OpenBSD) 9 10 png-api.patch (partially from NVTT SVN r1248 - fixes build with libpng 1.5) 10 11 cmake-freebsd.patch (fixes build on FreeBSD) 11 12 gcc47-unistd.patch (fixes build on GCC 4.7) -
libraries/enet/build.sh
18 18 19 19 mkdir -p lib/ 20 20 21 if [ "`uname -s`" = "Darwin" ] 22 then 23 # Fix libtool's use of an absolute path 24 install_name_tool -id @executable_path/libenet.1.dylib src/.libs/libenet.1.dylib 25 cp src/.libs/libenet.dylib lib/ 26 cp src/.libs/libenet.1.dylib ../../binaries/system/ 27 else 28 cp src/.libs/libenet.so lib/ 29 cp src/.libs/libenet.so.1 ../../binaries/system/ 30 fi 21 case "`uname -s`" in 22 "Darwin" ) 23 # Fix libtool's use of an absolute path 24 install_name_tool -id @executable_path/libenet.1.dylib src/.libs/libenet.1.dylib 25 cp src/.libs/libenet.dylib lib/ 26 cp src/.libs/libenet.1.dylib ../../binaries/system/ 27 ;; 28 "OpenBSD" ) 29 cp src/.libs/libenet.so.1.* lib/ 30 cp src/.libs/libenet.so.1.* ../../binaries/system/libenet.so.1 31 ;; 32 * ) 33 cp src/.libs/libenet.so lib/ 34 cp src/.libs/libenet.so.1 ../../binaries/system/ 35 ;; 36 esac